@plitzi/plitzi-sdk 0.38.14 → 0.38.16

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.
@@ -17,11 +17,11 @@ import*as e from"react";import t,{Children as n,Component as r,Fragment as i,Pro
17
17
  /* @__PURE__ */I("path",{fill:"currentColor",d:"M67.12,83.23c-0.251,4.695-10.719,13.862-14.292,16.887l-4.008-4.008 c2.94-3.723,11.57-14.256,16.276-14.751C66.352,81.226,67.185,82.018,67.12,83.23z"})]})]}),B=(e,t)=>({type:e,bindings:{},initialState:{visibility:!0},...t,styleSelectors:{base:"",...t.styleSelectors}}),U=()=>e=>{let{definition:t,builder:n,market:r,defaultStyle:i,settings:o}=e.content;return{...e,content:{...e.content,definition:B(e.type,t),builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canSnippet:!0,itemsAllowed:[],itemsNotAllowed:[],...n},market:{owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",...r},defaultStyle:{name:t.label,displayMode:"desktop",...i},settings:o??{}}}},H=U()({type:"plitziSdk",content:{attributes:{spaceKey:"",environment:"main"},definition:{label:"Plitzi Sdk",description:"Another space drawn inside this one, as a widget — its home page, no router of its own: by its key, or from its documents (`offlineData`), bound to UI generated on the fly."},market:{category:"advanced",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{style:{base:{default:{}}}}}});function W(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=W(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function V(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=W(e))&&(r&&(r+=" "),r+=t);return r}var G=Symbol.for("plitzi.sharedContexts.v1"),K=(e,t)=>{let n=(e=>(e[G]??=/* @__PURE__ */new Map,e[G]))(globalThis),r=n.get(e);if(r)return r;let i=l(t);return i.displayName=e,n.set(e,i),i},Y=K("ElementContext",void 0),J=K("ElementParentContext",void 0),X=e=>"object"==typeof e&&!!e&&!Array.isArray(e),Z=(e,t)=>{if("string"!=typeof t)return t;if("number"==typeof e){let e=Number(t.trim());return""!==t.trim()&&Number.isFinite(e)?e:t}return"boolean"!=typeof e||"true"!==t&&"false"!==t?t:"true"===t},Q=(e,t)=>{if("function"!=typeof e||!("content"in e)||!X(e.content))return t;let n=e.content.attributes;if(!X(n))return t;let r=!1,i={...t};for(let[o,a]of Object.entries(t)){let e=Z(n[o],a);e!==a&&(i[o]=e,r=!0)}return r?i:t},ee=e=>!1!==e&&"false"!==e,te=(e,t)=>{let n=new Set(t),r={};for(let i in e)!n.has(i)&&Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},ne={previewMode:!0,debugMode:!1,renderMode:"raw",environment:"main",isHydrating:!1,hydrated:!1,overQuota:!1,testAttributes:!0,ownsHead:!0,enclosed:!1},re=()=>{let[[e,t,n,r,i,o,a,s,l,c]]=Dt(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota","render.testAttributes","render.ownsHead","render.enclosed"]);return k(()=>({previewMode:e??ne.previewMode,debugMode:t??ne.debugMode,renderMode:n??ne.renderMode,environment:r??ne.environment,isHydrating:i??ne.isHydrating,hydrated:o??ne.hydrated,overQuota:a??ne.overQuota,testAttributes:s??ne.testAttributes,ownsHead:l??ne.ownsHead,enclosed:c??ne.enclosed}),[e,t,n,r,i,o,a,s,l,c])},ie=()=>{},oe=class{items=[];notifying=0;dead=0;get length(){return this.items.length-this.dead}add(e){return this.items.push(e),()=>this.remove(e)}remove(e){let t=this.items.indexOf(e);if(-1===t)return;if(this.notifying>0)return this.items[t]=ie,void this.dead++;let n=this.items.pop();t<this.items.length&&(this.items[t]=n)}begin(){this.notifying++}end(){0===--this.notifying&&this.dead>0&&this.compact()}forEach(e,t){this.begin();try{let n,{items:r}=this,i=r.length,o=0,a=!1;for(;o<i;)try{for(;o<i;o++)e(r[o])}catch(e){a||(a=!0,n=e),o++}if(a){if(!t)throw n;t(n)}}finally{this.end()}}clear(){if(this.notifying>0){let{items:e}=this;for(let t=0,n=e.length;t<n;t++)e[t]=ie;return void(this.dead=e.length)}this.items.length=0,this.dead=0}compact(){let{items:e}=this,t=0;for(let n=0;n<e.length;n++)e[n]!==ie&&(e[t++]=e[n]);e.length=t,this.dead=0}},ae=(e,t)=>"function"==typeof e?!e(t):!1===e,se=e=>"object"==typeof e&&!!e&&!Array.isArray(e),le=(e,t)=>{if(!se(e)||!se(t))return t;let n={...e};for(let r of Object.keys(t))"__proto__"!==r&&(n[r]=r in e?le(e[r],t[r]):t[r]);return n},ce=/* @__PURE__ */new Map,ue=e=>{let t=ce.get(e);return void 0===t&&(t=e.split("."),ce.size<4096&&ce.set(e,t)),t},de=/* @__PURE__ */new Map;function pe(e,t){let n=Array.isArray(t);if("string"!=typeof t&&!n||n&&!t.length||"string"==typeof t&&!t)return e;if("string"==typeof t&&-1===t.indexOf("."))return"object"==typeof e&&e&&t in e?e[t]:void 0;if("string"==typeof t)return(e=>{let t=de.get(e);return t||(t=(e=>{if(1===e.length){let t=e[0];return e=>"object"==typeof e&&e&&t in e?e[t]:void 0}return t=>{let n=t;for(let r=0;r<e.length;r++){if("object"!=typeof n||!n)return;n=n[e[r]]}return n}})(ue(e)),de.size<4096&&de.set(e,t)),t})(t)(e);let r=e;for(let i of t){if("object"!=typeof r||!r||!(i in r))return;r=r[i]}return r}var he=(e,t)=>"string"!=typeof e||e===t||e.length>t.length&&e.startsWith(t)&&"."===e[t.length]||t.length>e.length&&t.startsWith(e)&&"."===t[e.length],fe=(e,t,n=12)=>{if(!Object.is(e,t)){if(n<=0||!se(e)||!se(t))return{path:"",value:t};for(let r of/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])){if(Object.is(e[r],t[r]))continue;let i=fe(e[r],t[r],n-1);if(i)return{path:i.path?`${r}.${i.path}`:r,value:i.value}}}},me=/* @__PURE__ */new WeakMap;function ge(e){return me.get(e)}var ye,be=e=>{let t=e?.enabled;return n=>{if(ae(t,n.getState()))return;let{handle:r,record:i}=function(e,t={}){let n=t.limit??100,r=t.path,i=t.shouldRecord,o=[{state:e.getState(),timestamp:Date.now()}],a=0,s=!1,l=()=>({entries:o,index:a,canUndo:a>0,canRedo:a<o.length-1}),c=l(),u=/* @__PURE__ */new Set,d=()=>{c=l(),u.forEach(e=>e())},p=t=>{if(t<0||t>=o.length||t===a)return;let n=o[t].state;if(s=!0,r){let t=pe(n,r);e.setState(r,()=>t)}else e.setState(void 0,()=>n);s=!1,a=t,d()};return{handle:{getSnapshot:()=>c,subscribe:e=>(u.add(e),()=>u.delete(e)),undo:()=>p(a-1),redo:()=>p(a+1),travelTo:p,clear:()=>{o=[{state:e.getState(),timestamp:Date.now()}],a=0,d()}},record:({path:t})=>{if(s||i&&!i(t)||r&&void 0!==t&&!he(t,r))return;let l,c=a<o.length-1?o.slice(0,a+1):o,u=c[c.length-1].state,p=e.getState(),h=t??r,f=t??r;if(f)try{let e=fe(pe(u,f),pe(p,f));e&&(h=e.path?`${f}.${e.path}`:f,l=e.value)}catch{}let m=[...c,{path:h,value:l,state:p,timestamp:Date.now()}];o=m.length>n?m.slice(m.length-n):m,a=o.length-1,d()}}}(n,e);return me.set(n,r),{onChange:i}}},ve=e=>{},we=e=>{console.error("[store]",`${e.phase} error at`,e.path??"(root)",e.error)},ke=(e={})=>{let{filter:t,sink:n=ve,errorSink:r=we,enabled:i}="function"==typeof e?{sink:e}:e;return e=>{if(!ae(i,e.getState()))return{onChange:e=>{(!t||t(e))&&n(e)},onError:r}}},xe=(e="local")=>{if("string"!=typeof e)return e;try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}},Se=Symbol("unchanged"),Te=e=>/^\d+$/.test(e),Ce=e=>Array.isArray(e)?e.slice():{...e},Ee=(e,t,n,r,i)=>{let o=t[n],a="object"==typeof e&&e?e:{};if(n===t.length-1){let e=a[o],t=i?r(e):r;if(e===t)return Se;let n=Ce(a);return n[o]=t,n}let s=Ee(a[o],t,n+1,r,i);if(s===Se)return Se;let l=Ce(a);return l[o]=s,l},Ae=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,Ie=e=>Ae.test(e)?`.${e}`:`[${JSON.stringify(e)}]`,Oe=e=>Ae.test(e)?e:JSON.stringify(e),_e=e=>{let t=e.length,n="";for(let o=0;o<t-1;o++){let t=0===o?"o":"_"+(o-1);n+=`var _${o}=${t}==null?void 0:${t}${Ie(e[o])};\n`}let r=t>1?"_"+(t-2):"o";n+=`var _p=${r}==null?void 0:${r}${Ie(e[t-1])};\n`,n+="var _v=f?v(_p):v;\nif(_p===_v)return null;\n";let i="_v";for(let o=t-1;o>=0;o--)i=`{...${0===o?"o":`(_${o-1}||{})`},${Oe(e[o])}:${i}}`;return n+=`return ${i};`,Function("o","v","f",n)},Ne=/* @__PURE__ */new Map,Me=(e,t,n)=>{if("object"!=typeof e||!e)return Se;let r=e,i=t[n];if(!Object.hasOwn(r,i))return Se;if(n===t.length-1){let e=Ce(r);return Array.isArray(e)?e.splice(Number(i),1):delete e[i],e}let o=Me(r[i],t,n+1);if(o===Se)return Se;let a=Ce(r);return a[i]=o,a},Pe=(e,t,n,r,i)=>{let o=((e,t)=>{if(!(()=>{if(typeof window>"u")return!1;if(void 0===ye)try{_e(["x","y"])({x:{}},1,!1),ye=!0}catch{ye=!1}return ye})())return;let n=Ne.get(e);if(n)return n;if(t.some(Te))return;let r=_e(t);return Ne.size>=256&&Ne.delete(Ne.keys().next().value),Ne.set(e,r),r})(t,n);if(o){let t=o(e,r,i);return null===t?Se:t}return Ee(e,n,0,r,i)},Le=Symbol("@plitzi/nexus/cancel"),Re=(()=>{try{return"production"}catch{}return"production"})(),je="production"===Re,ze=!je,De="test"===Re;var $e=e=>"number"==typeof e||""===e||isNaN(Number(e))?e:Number(e),Fe=e=>Array.isArray(e)?e.slice():{...e},qe=(e,t,n,r)=>{let i=$e(t[n]),o=Fe(e);return o[i]=n===t.length-1?r:qe(e[i]??{},t,n+1,r),o},Be=Symbol("no-error"),Ue=(e,t,n)=>{let r=0,i=Be;for(;r<n;)try{for(;r<n;r++)e[r](t)}catch(e){i===Be&&(i=e),r++}return i},He="__proto__";var We=(e,t)=>e===t||e.startsWith(`${t}.`),Ve=class{reportError;records=/* @__PURE__ */new Map;listeners=/* @__PURE__ */new Set;announced=/* @__PURE__ */new Set;timer;snapshot;constructor(e){this.reportError=e}get size(){return this.records.size}getRecords(){return this.snapshot??=Object.fromEntries(this.records),this.snapshot}subscribe(e){return this.listeners.add(e),this.schedule(),()=>{this.listeners.delete(e),this.schedule()}}record(e,t,n,r){this.drop(e,r,!1);let i=Math.max(0,t),o={updatedAt:n,expiresAt:n+i,ttl:i};this.records.set(e,o),this.announced.delete(e),this.changed(),r||this.emit({path:e,type:"recorded",freshness:o})}drop(e,t,n=!0){if(0!==this.records.size)for(let r of[...this.records.keys()])(r===e?n:r.startsWith(`${e}.`))&&this.forget(r,t)}dropChanged(e,t,n){for(let r of[...this.records.keys()])pe(e,r)!==pe(t,r)&&this.forget(r,n)}get(e){if(0===this.records.size)return;let t=e;for(;;){let e=this.records.get(t);if(e)return e;let n=t.lastIndexOf(".");if(-1===n)return;t=t.slice(0,n)}}expire(e,t){let n=[];if(this.records.forEach((r,i)=>{(void 0===e||We(i,e)||We(e,i))&&(r.expiresAt>t&&this.records.set(i,{...r,expiresAt:t}),this.announced.add(i),n.push(i))}),n.length>0){this.changed();for(let e of n)this.emit({path:e,type:"expired",freshness:this.records.get(e)})}return n}forget(e,t){let n=this.records.get(e);this.records.delete(e),this.announced.delete(e),this.changed(),t||this.emit({path:e,type:"dropped",freshness:n})}changed(){this.snapshot=void 0,this.schedule()}emit(e){for(let t of[...this.listeners])try{t(e)}catch(Wr){this.reportError(Wr,e.path)}}schedule(){if(clearTimeout(this.timer),this.timer=void 0,0===this.listeners.size)return;let e=1/0;this.records.forEach((t,n)=>{!this.announced.has(n)&&t.expiresAt<e&&(e=t.expiresAt)}),e!==1/0&&(this.timer=setTimeout(()=>this.elapse(),Math.min(2147483647,Math.max(0,e-Date.now()))))}elapse(){let e=Date.now(),t=[];this.records.forEach((n,r)=>{!this.announced.has(r)&&n.expiresAt<=e&&(this.announced.add(r),t.push(r))});for(let n of t)this.emit({path:n,type:"elapsed",freshness:this.records.get(n)});this.schedule()}},Ge=class{subscribers=null;children=null},Ke=class{direct=/* @__PURE__ */new Map;descendants=/* @__PURE__ */new Map;root=new Ge;size=0;add(e,t){let n=ue(e),r=this.direct.get(e);if(!r){r=new oe,this.direct.set(e,r);let t=this.root;for(let e of n){t.children||(t.children=/* @__PURE__ */new Map);let n=t.children.get(e);n||(n=new Ge,t.children.set(e,n)),t=n}t.subscribers=r,this.size++;let i="";for(let r=0;r<n.length-1;r++){i=i?`${i}.${n[r]}`:n[r];let t=this.descendants.get(i);t||(t=/* @__PURE__ */new Set,this.descendants.set(i,t)),t.add(e)}}return r.add(t),()=>this.remove(e,r,t,n)}remove(e,t,n,r){if(this.direct.get(e)!==t||(t.remove(n),t.length>0))return;this.direct.delete(e),this.size--;let i=this.root;for(let a of r){if(!i.children)return;let e=i.children.get(a);if(!e)return;i=e}i.subscribers===t&&(i.subscribers=null);let o="";for(let a=0;a<r.length-1;a++){o=o?`${o}.${r[a]}`:r[a];let t=this.descendants.get(o);t&&(t.delete(e),0===t.size&&this.descendants.delete(o))}}walkAncestors(e,t){let n=this.root;for(let r of e){if(!n.children)return;let e=n.children.get(r);if(!e)return;n=e,n.subscribers&&t(n.subscribers)}}getDescendants(e){return this.descendants.get(e)}forEachAffected(e,t,n){let r=e=>{e&&e.forEach(t,n)};if("string"!=typeof e)return void this.direct.forEach(r);let i=ue(e);this.walkAncestors(i,r),this.descendants.get(e)?.forEach(e=>r(this.direct.get(e)))}clear(){this.direct.clear(),this.descendants.clear(),this.root.children=null,this.root.subscribers=null,this.size=0}},Ye=e=>`@plitzi/nexus: scope collision — two sibling scopes under the same parent both delegate a write to "${e}", clobbering each other through the shared parent. Write to a path each scope owns, or move the shared value into the parent and update it there.`,Je=0;function Xe(e,t){let n,r,i,o={},a=new oe,s=new oe,l=new Ke,c=new oe,u=()=>{0!==c.length&&c.forEach(e=>e())},d=[],p=[],h=[],f=t?.parent,m=++Je,g=(e,t,n)=>{if(0===p.length)throw e;let r={error:e,phase:t,path:n};for(let i=0,o=p.length;i<o;i++)p[i](r)},y=new Ve((e,t)=>g(e,"notify",t)),b=()=>o,v=()=>n??={...o},{getState:w,getPath:k,invalidate:x,resetCache:S,getMergeCount:T}=function(e,t,n,r){if(!n)return{getState:t,getPath:t=>pe(e(),t),invalidate:()=>{},resetCache:()=>{},getMergeCount:()=>0};let i,o=n,a=r&&r.length>0?new Set(r):void 0,s=!0,l=!1,c=0,u=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;return{getState:()=>((s||void 0===i)&&(i=(()=>{c++;let e=t(),n=le(o.getState(),e);if(a)for(let t of a)void 0!==e[t]&&(n[t]=e[t]);return n})(),s=!1),i),getPath:t=>{if(l)u.clear(),l=!1;else if(u.has(t))return u.get(t);let n=(t=>{if(a){let n=t.indexOf("."),r=-1===n?t:t.slice(0,n);if(a.has(r)&&void 0!==e()[r])return pe(e(),t)}let n=pe(e(),t);if(void 0===n)return o.getPath(t);let r=o.getPath(t);if(void 0===r||!se(n)||!se(r))return n;let i=d.get(t);if(i&&i.own===n&&i.parent===r)return i.value;c++;let s=le(r,n);return d.set(t,{own:n,parent:r,value:s}),s})(t);return u.set(t,n),n},invalidate:()=>{s=!0,l=!0},resetCache:()=>{u.clear(),d.clear(),i=void 0,s=!0,l=!1},getMergeCount:()=>c}}(b,v,f,t?.exclusive),C=()=>{x(),u()},E=!1;f&&(S(),i=f.subscribeInvalidate?.(C));let{setState:A,batch:I}=function(e){let{getOwnState:t,getOwnSnapshot:n,setOwnState:r,mutateOwnKey:i,deleteOwnKey:o,parent:a,listeners:s,pathListeners:l,changeListeners:c,interceptors:u,readOnly:d,freshness:p,reportError:h,invalidateDescendants:f,onDelegateToParent:m}=e,g=e=>{if(0===d.length||!(e=>{for(let t=0,n=d.length;t<n;t++){let n=d[t];if(e===n||e.startsWith(`${n}.`)||n.startsWith(`${e}.`))return!0}return!1})(e))return!1;if(ze)throw Error(`@plitzi/nexus: refused to write to read-only path "${e}"`);return!0},y=(e,t,n)=>{let r=t;for(let i=0,o=u.length;i<o;i++){let o;try{o=u[i]({path:e,value:r,prev:n})}catch(t){return h(t,"beforeChange",e),Le}if(o===Le)return Le;void 0!==o&&(r=o)}return r},b=(e,t,n)=>{void 0===t?p.size>0&&p.drop(e,n):p.record(e,t,Date.now(),n)},v=0,w=/* @__PURE__ */new Set,k=(e,t)=>{let{items:n}=e;if(v>0)for(let r=0,i=n.length;r<i;r++)w.add(n[r]);else if(0!==n.length){e.begin();try{let e=Ue(n,t,n.length);e!==Be&&h(e,"notify",t)}finally{e.end()}}},x=(e,t,n)=>{let r={path:e,prev:t,next:n,prevValue:void 0===e?t:pe(t,e),nextValue:void 0===e?n:pe(n,e)},{items:i}=c;c.begin();try{let t=Ue(i,r,i.length);t!==Be&&h(t,"onChange",e)}finally{c.end()}},S=(e,t,n,r)=>{let i=l.getDescendants(e);if(i)for(let o of i){let i=l.direct.get(o);if(!i)continue;let a=ue(o).slice(r);pe(t,a)!==pe(n,a)&&k(i,e)}},T=(e,t,n,i,o)=>{let a=e?pe(n,e):void 0,h=e?o?t(a):t:void 0;if(e&&u.length>0){let t=y(e,h,a);if(t===Le)return;h=t}if(e&&a===h)return;let m=e?((e,t,n)=>{if("string"==typeof t){if(!t)return n;let r=ue(t);if(1===r.length){let t=Fe(e);return t[$e(r[0])]=n,t}return qe(e,r,0,n)}return Array.isArray(t)&&t.length?qe(e,t,0,n):n})(n,e,h):o?t(n):{...n,...t};if(!e&&u.length>0){let e=y(void 0,m,n);if(e===Le)return;m=e}if(m!==n){if(d.length>0)for(let e=0,t=d.length;e<t;e++){let t=d[e];if(pe(n,t)!==pe(m,t)){if(ze)throw Error(`@plitzi/nexus: refused to write to read-only path "${d[e]}"`);return}}p.size>0&&p.dropChanged(n,m,!i),r(m),c.length>0&&x(e,n,m),f(),i&&(k(s,e),l.size>0&&l.direct.forEach((t,r)=>{pe(n,r)!==pe(m,r)&&k(t,e)}))}};return{setState:(e,d,h={})=>{let{canPropagate:v=!0,unmount:w=!1,raw:C=!1,ttl:E}=h,A=t(),I=!C&&"function"==typeof d;if("string"==typeof e&&-1!==e.indexOf(He)&&-1!==ue(e).indexOf(He))throw Error(`@plitzi/nexus: refused to write to unsafe path "${e}" (\`__proto__\` segment)`);if("string"==typeof e&&g(e))return;if(a&&"string"==typeof e&&!(-1===e.indexOf(".")?Object.hasOwn(A,e):((e,t)=>{let n=e;for(let r=0,i=t.length;r<i;r++){if("object"!=typeof n||!n||!Object.hasOwn(n,t[r]))return!1;n=n[t[r]]}return!0})(A,ue(e))))return m?.(e),void a.setState(e,d,{canPropagate:v,unmount:w,raw:C,ttl:E});if("string"!=typeof e)return void T(e,d,A,v,I);if(-1===e.indexOf(".")){if(w){if(!Object.hasOwn(A,e))return;let t=A[e];if(u.length>0&&y(e,void 0,t)===Le)return;p.drop(e,!v);let r=c.length>0?n():void 0;if(o(e),void 0!==r&&x(e,r,n()),v&&(k(s,e),l.size>0)){let n=l.direct.get(e);n&&k(n,e),S(e,t,void 0,1)}return void f()}let t=A[e],r=I?d(t):d,a=r;if(u.length>0){let n=y(e,r,t);if(n===Le)return;a=n}if(b(e,E,!v),t===a)return;let h=c.length>0?n():void 0;if(i(e,a),void 0!==h&&x(e,h,n()),v&&(k(s,e),l.size>0)){let n=l.direct.get(e);n&&k(n,e),S(e,t,a,1)}return void f()}let O,_=ue(e);if(w){if(u.length>0&&y(e,void 0,pe(A,e))===Le)return;p.drop(e,!v),O=((e,t)=>Me(e,t,0))(A,_)}else if(u.length>0){let t=pe(A,e),n=I?d(t):d,r=y(e,n,t);if(r===Le)return;O=Pe(A,e,_,r,!1)}else O=Pe(A,e,_,d,I);if(w||b(e,E,!v),O===Se)return;let N=O;r(N),c.length>0&&x(e,A,N),v&&(k(s,e),l.size>0&&(((e,t)=>{l.walkAncestors(t,t=>k(t,e))})(e,_),S(e,A,N,0))),f()},batch:e=>{v++;try{return e()}finally{if(v--,0===v&&w.size>0){let e=[...w];w.clear();let t=Ue(e,void 0,e.length);t!==Be&&h(t,"notify",void 0)}}}}}({getOwnState:b,getOwnSnapshot:v,setOwnState:e=>{o=e,n=void 0,x()},mutateOwnKey:(e,t)=>{o[e]=t,x(),n=void 0},deleteOwnKey:e=>{delete o[e],x(),n=void 0},parent:f,listeners:a,pathListeners:l,changeListeners:s,interceptors:d,readOnly:t?.readOnly??[],freshness:y,reportError:g,invalidateDescendants:u,onDelegateToParent:ze&&f?e=>f.scopeClaims?.claimDelegatedWrite(e,m):void 0}),O=()=>{r&&(r.unsubscribe(),r=void 0,S())},_=()=>{f&&(!E&&(a.length>0||l.size>0||s.length>0)?!r&&f&&(x(),S(),r=function(e,t,n,r,i,o,a){let s;return{unsubscribe:e.subscribe(e=>{a();let l=e;if(t.forEach(t=>t(e),e=>o(e,"notify",l)),n.size>0&&n.forEachAffected(e,t=>t(e),e=>o(e,"notify",l)),r.length>0){let e=i(),t=s??e,n={path:l,prev:t,next:e,prevValue:void 0===l?t:pe(t,l),nextValue:void 0===l?e:pe(e,l)};s=e,r.forEach(e=>e(n),e=>o(e,"onChange",l))}}),seedBaseline:()=>{s??=i()}}}(f,a,l,s,w,g,x),s.length>0&&r.seedBaseline()):O())},N=e=>(_(),()=>{e(),_()}),M=e=>N(a.add(e)),P=(e,t)=>N(l.add(e,t)),L=e=>{let t=N(s.add(e));return r?.seedBaseline(),t};o="function"==typeof e?e(A,w):e;let R=e=>y.get(e)??f?.getFreshness(e),j={id:t?.id,scopePath:t?.scopePath,getState:w,getOwnState:v,getPath:k,setState:A,get:e=>void 0===e?w():k(e),set:A,watch:(e,t)=>"function"==typeof e?M(e):P(e,t),withBase:e=>{let t=(t,n,r)=>A(void 0===t?e:`${e}.${t}`,n,r);return{getState:t=>{let n=k(e);return void 0===n&&void 0!==t?t:n},getPath:(t,n)=>{let r=k(`${e}.${t}`);return void 0===r&&void 0!==n?n:r},setState:t,subscribe:t=>P(e,t),subscribePath:(t,n)=>P(`${e}.${t}`,n),get:t=>k(void 0===t?e:`${e}.${t}`),set:t,watch:(t,n)=>"function"==typeof t?P(e,t):P(`${e}.${t}`,n)}},batch:I,subscribe:M,subscribePath:P,subscribeChange:L,getFreshness:R,isStale:e=>{let t=R(e);return!t||Date.now()>=t.expiresAt},expire:e=>{let t=y.expire(e,Date.now()),n=f?f.expire(e):[];return 0===n.length?t:[...t,...n]},watchFreshness:(e,t)=>{let n="function"==typeof e?void 0:e,r="function"==typeof e?e:t,i=void 0===n?r:e=>{let t=e.path;(t===n||t.startsWith(`${n}.`)||n.startsWith(`${t}.`))&&r(e)},o=y.subscribe(i),a=f?.watchFreshness(i);return()=>{o(),a?.()}},getFreshnessRecords:()=>y.getRecords(),destroy:()=>{E=!0,O(),a.clear(),l.clear(),s.clear(),c.clear(),i?.(),ze&&f&&f.scopeClaims?.releaseScope(m)},reconnect:()=>{E=!1,f&&(i?.(),i=f.subscribeInvalidate?.(C)),_()},subscribeInvalidate:e=>c.add(e),hydrate:()=>{for(let e of h)e()}};if(t?.middlewares)for(let z of t.middlewares){let e=z(j);e?.beforeChange&&d.push(e.beforeChange),e?.onChange&&L(e.onChange),e?.onError&&p.push(e.onError);let n=e?.hydrate;n&&(t.deferHydrate?h.push(()=>n(j)):n(j))}return ze&&(j.scopeClaims=(()=>{let e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map;return{claimDelegatedWrite(n,r){let i=e.get(n);if(void 0!==i){if(i===r)return;if(De)throw Error(Ye(n));return void console.warn(Ye(n))}e.set(n,r);let o=t.get(r);o?o.add(n):t.set(r,/* @__PURE__ */new Set([n]))},releaseScope(n){let r=t.get(n);if(r){for(let t of r)e.delete(t);t.delete(n)}}}})()),De&&(j.listeners=a,j.pathListeners=l,j.changeListeners=s,j.interceptors=d,j.errorHandlers=p,j.invalidateListeners=c,j.getMergeCount=T),j}var Ze=Symbol("@plitzi/nexus/ssr-snapshot");function Qe(e){return"object"==typeof e&&!!e&&Ze in e}var et,tt=/* @__PURE__ */new Map,nt=/* @__PURE__ */new Set,rt=0,it=()=>{et=void 0;for(let e of nt)e()},ot=(e,t,n)=>{let r=e;return tt.set(r,{uid:"dev-store-"+ ++rt,store:r,scopeId:t,name:n}),it(),()=>{tt.delete(r),it()}},at=e=>(nt.add(e),()=>{nt.delete(e)}),st=()=>(et??=[...tt.values()],et),lt=Xe({runs:[]},{id:"action-runs"}),ct=0,ut=e=>lt.setState("runs",e),dt=/* @__PURE__ */new Map,pt=e=>{dt.get(e)?.()},ht=e=>({id:`render-${e.runId}`,actionId:e.actionId,mode:"render",runId:e.runId,status:e.status,steps:e.steps,progress:[],startedAt:e.startedAt,endedAt:e.endedAt,...void 0===e.error?{}:{error:e.error},...void 0===e.elementId?{}:{elementId:e.elementId}}),ft=e=>{let{runs:t}=lt.getState(),n=new Set(t.map(e=>e.runId)),r=e.filter(e=>!n.has(e.runId)).map(ht);0!==r.length&&ut([...r.reverse(),...t].slice(0,100))},mt=(e,t)=>{let{runs:n}=lt.getState();n.some(t=>t.id===e)&&ut(n.map(n=>n.id===e?{...n,...t}:n))},gt=()=>{let e=new Set(lt.getState().runs.filter(e=>e.cancellable).map(e=>e.id));[...dt.keys()].forEach(t=>{e.has(t)||dt.delete(t)}),ut([])},yt=()=>({...T(lt.subscribe,lt.getState,lt.getState),clear:gt}),bt=Symbol.for("@plitzi/nexus.contexts.v1"),vt=(e,t)=>{let n=(e=>(e[bt]??=/* @__PURE__ */new Map,e[bt]))(globalThis),r=n.get(e);if(r)return r;let i=l(t);return i.displayName=e,n.set(e,i),i},wt=vt("DevStoreScopeContext",void 0),kt=vt("StoreContext",void 0),xt=vt("StoreRegistryContext",void 0),St=(e,t)=>{for(let n=e;n;n=n.parent)if(n.id===t)return n.store},Tt=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0};function Ct(e,t,n){let r=m(kt),i=m(xt);if(e)return e;if(void 0!==n){let e=St(i,n);if(!e)throw Error(`${t}: no store registered with id "${n}" in any ancestor StoreProvider`);return e}if(!r)throw Error(`${t} must be used inside a StoreProvider`);return r}var Et=typeof window<"u"?w:g,At=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!Object.is(e[i],t[i]))return!1;return!0};function It(e,t,n={}){let r=n,i=Ct(r.store,"useStoreSync",r.storeId);Array.isArray(e)?function(e,t,n,r){let{mode:i="sync",enabled:o=!0,syncStrategy:a="afterRender",raw:s=!1,ttl:l}=r,c=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),u=x(!1),d=!u.current;u.current=!0;let p=x(void 0),h=o&&(d||"sync"===i&&n.some((e,t)=>!Object.is(p.current?.[t],e))),f=(r=!0)=>{p.current=n,e.batch(()=>{t.forEach((t,i)=>{let o="function"==typeof t?t(e.getState()):t;e.setState(o,n[i],{canPropagate:r,raw:s,ttl:l})})})};"render"===a?h&&f():(h&&d&&f(!1),Et(()=>{h&&!d&&f()},[h,n,c]))}(i,e,t,n):function(e,t,n,r){let i=void 0===t,o="function"==typeof t,a=i?At:Object.is,{mode:s="sync",enabled:l=!0,equalityFn:c=a,syncStrategy:u="afterRender",raw:d=!1,ttl:p}=r,h=x(void 0),f=x(!1),m=!f.current;f.current=!0;let g=h.current,y=l&&(m||"sync"===s&&(void 0===g||!c(g,n))),b=(r=!0)=>{if(h.current=n,i)e.setState(void 0,e=>({...e,...n}),{canPropagate:r});else if(o){let i=t(e.getState());e.setState(i,n,{canPropagate:r,raw:d,ttl:p})}else e.setState(t,n,{canPropagate:r,raw:d,ttl:p})};"render"===u?y&&b():(y&&m&&b(!1),Et(()=>{y&&!m&&b()},[y,n,t]))}(i,e,t,n)}var Ot=Xe,_t=vt("StoreMiddlewareContext",void 0),Nt=e=>!0===e.cascade,Mt=({store:e,id:t,segment:n,isolate:r,path:i,value:o,inherit:a,autoSync:s=!0,middlewares:l,name:c,children:u})=>{let d=m(kt),p=m(_t),h=m(xt),f=m(wt),y=d?.scopePath??"",b=k(()=>void 0===n?y:y?`${y}/${n}`:n,[y,n]),v=x(void 0),w="live"===a,S=k(()=>{let e="snapshot"===a&&d?d.getState():{},t="function"==typeof o?o(e):{...e,...o};return Qe(t)?function(e){return Qe(e)?{...e}:e}(t):t},[a,d,o]),T=l??[],C=p?[...p,...T]:T,E=k(()=>{let e=T.filter(Nt);return 0===e.length?p:[...p??[],...e]},[p,l]);v.current||=e??Ot(()=>S,{id:t,scopePath:b,exclusive:w?r:void 0,parent:w?d:void 0,middlewares:C.length>0?C:void 0,deferHydrate:!0});let A=k(()=>t?{id:t,store:v.current,parent:h}:h,[t,h]),O=x(!1);g(()=>{ze&&t&&!O.current&&St(h,t)&&(O.current=!0,console.warn(`@plitzi/nexus: duplicate StoreProvider id "${t}" — it shadows an ancestor provider with the same id, so a descendant's { storeId: "${t}" } or useStoreById("${t}") resolves to this (nearer) store. Use a distinct id, or remove one of the providers.`))},[t,h]),g(()=>(w&&!e&&v.current?.reconnect?.(),()=>{w&&!e&&v.current?.destroy?.()}),[w,e]),g(()=>{if(ze||void 0!==f)return ot(v.current,f,c)},[f,c]);let _=x(!1);g(()=>{!_.current&&v.current?.hydrate&&(v.current.hydrate(),_.current=!0)},[]),It(i,i?o:S,{enabled:!!o&&s,store:v.current});let N=/* @__PURE__ */I(kt,{value:v.current,children:u});return A!==h&&(N=/* @__PURE__ */I(xt,{value:A,children:N})),E!==p&&(N=/* @__PURE__ */I(_t,{value:E,children:N})),N};var Pt=Symbol("unset"),Lt=e=>Array.isArray(e),Rt=(e,t,n,r)=>{void 0===t?e.setState(void 0,n,r):"function"==typeof t?e.setState(t(e.getState()),n,r):e.setState(t,n,r)};var jt=()=>({useStore:function(e,t){return function(e,t={}){let n=Ct(t.store,"useStore",t.storeId),r=Lt(e),i=t.mode??"sync",o=t.enabled??!0,a=t.equalityFn??(r?Tt:void 0===e?At:Object.is),s=x(t.transformer);s.current=t.transformer;let l=x(e);l.current=e;let c=x(Pt),u=x(r);u.current!==r&&(u.current=r,c.current=Pt);let d=(e=>Lt(e)?`[${e.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|")}]`:e)(e),p=k(()=>()=>{let e=l.current;if(!o&&c.current!==Pt)return c.current;let t=Lt(e)?((e,t)=>{let n=t.some(e=>"function"==typeof e)?e.getState():void 0;return t.map(t=>"function"==typeof t?pe(n,t(n)):e.getPath(t))})(n,e):((e,t)=>{if("string"==typeof t)return e.getPath(t);if("function"==typeof t){let n=e.getState();return pe(n,t(n))}return e.getState()})(n,e);return c.current!==Pt&&("mount"!==i||Lt(e))&&a(c.current,t)?c.current:(c.current=t,t)},[n,d,o,i,a]),h=k(()=>e=>{let t=l.current;if(!o||"mount"===i)return()=>{};if("string"==typeof t)return n.subscribePath(t,e);if(!Lt(t)||t.some(e=>"function"==typeof e))return n.subscribe(e);let r=t.map(t=>n.subscribePath(t,e));return()=>r.forEach(e=>e())},[n,d,o,i]),f=T(h,p,p);return[k(()=>s.current?s.current(f):f,[f]),...k(()=>{let e=l.current;return Lt(e)?e.map((e,t)=>(e,r)=>{let i=l.current;Rt(n,i[t],e,r)}):[(e,t)=>Rt(n,l.current,e,t)]},[n,d])]}(e,t)},useStoreSync:function(e,t,n){It(e,t,n)},useStoreGetter:function(e,t){return function(e,t){let n="string"==typeof e?e:void 0,r=Array.isArray(e)?e:void 0,i="object"!=typeof e||Array.isArray(e)?t:e,o=Ct(i?.store,"useStoreGetter",i?.storeId),a=x(r);a.current=r;let s=r?.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|");return k(()=>{if(r)return r.map((e,t)=>(e,n)=>{let i=(a.current??r)[t],s="function"==typeof i?i(o.getState()):pe(o.getState(),i);if(void 0!==e){let t=pe(s,e);return void 0===t&&void 0!==n?n:t}return void 0===s&&void 0!==n?n:s});if(void 0!==n){let e=o.withBase(n);return(t,n)=>void 0===t?void 0===n?e.getState():e.getState(n):void 0===n?e.getPath(t):e.getPath(t,n)}return(e,t)=>{let n=o.getState();if(void 0!==e){let r=pe(n,e);return void 0===r&&void 0!==t?t:r}return n}},[o,n,s])}(e,t)},useStoreSetter:function(e,t){return function(e,t){let n="string"==typeof e?e:void 0,r="object"==typeof e?e:t,i=Ct(r?.store,"useStoreSetter",r?.storeId);return k(()=>void 0===n?i.setState:i.withBase(n).setState,[i,n])}(e,t)},useFreshness:function(e,t){return function(e,t={}){let{enabled:n=!0}=t,r=Ct(t.store,"useFreshness",t.storeId),i=x(void 0),o=f(t=>n?r.watchFreshness(e,t):()=>{},[r,e,n]),a=f(()=>{let t=(e=>({isStale:!e||Date.now()>=e.expiresAt,updatedAt:e?.updatedAt,expiresAt:e?.expiresAt}))(r.getFreshness(e));return i.current&&((e,t)=>e.isStale===t.isStale&&e.updatedAt===t.updatedAt&&e.expiresAt===t.expiresAt)(i.current,t)?i.current:(i.current=t,t)},[r,e]);return T(o,a,a)}(e,t)},useOnStale:function(e,t,n){!function(e,t,n={}){let{enabled:r=!0}=n,i=Ct(n.store,"useOnStale",n.storeId),o=x(t);g(()=>{o.current=t},[t]),g(()=>{if(r)return i.watchFreshness(e,e=>{("expired"===e.type||"elapsed"===e.type)&&o.current(e)})},[i,e,r])}(e,t,n)}});function zt(e){return Ct(void 0,"useStoreById",e)}var{useStore:Dt,useStoreSync:$t,useStoreGetter:Ft,useStoreSetter:qt}=jt(),{useStore:Bt,useStoreSync:Ut,useStoreGetter:Ht,useStoreSetter:Wt}=jt(),{useStore:Vt,useStoreSync:Gt,useStoreGetter:Kt,useStoreSetter:Yt}=jt(),Jt=Symbol("twigArrowParams"),Xt=(e,t)=>e===t?0:null==e?-1:null==t?1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t)),Zt=e=>void 0===e||"function"==typeof e||"symbol"==typeof e?"null":"bigint"==typeof e?e.toString():JSON.stringify(e),Qt=e=>null==e?"":String(e),en=e=>"object"==typeof e&&!!e&&"__PLITZI_RAW__"===e.__marker,tn=e=>en(e)?e.__raw:e,nn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],rn=/* @__PURE__ */new Map,on=e=>{if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}},an=(e,t,n)=>{for(let r of[null==t?"en":Qt(t),"en"])try{return new Intl.NumberFormat(r,n).format(e)}catch{continue}return String(e)},sn={raw:e=>(e=>({__raw:e,__marker:"__PLITZI_RAW__"}))(e),to_json:e=>Zt(e),json_encode:e=>Zt(e),object_as_json:e=>"object"==typeof e&&e?JSON.stringify(e):e,default:(e,t)=>(e=>null==e||""===e)(e)?t[0]:e,upper:e=>"string"==typeof e?e.toUpperCase():e,lower:e=>"string"==typeof e?e.toLowerCase():e,trim:e=>"string"==typeof e?e.trim():e,capitalize:e=>"string"==typeof e&&e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():e,title:e=>"string"==typeof e?e.replace(/\b\w/g,e=>e.toUpperCase()):e,camelize:e=>"string"==typeof e?e.replace(/[-_]+(.)?/g,(e,t)=>t?t.toUpperCase():""):e,kebab:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e,snake:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():e,ltrim:e=>"string"==typeof e?e.trimStart():e,rtrim:e=>"string"==typeof e?e.trimEnd():e,pad:(e,t)=>{if("string"!=typeof e)return e;let n=Number(t[0])||0,r=t.length>1?Qt(t[1]):" ";if(""===r)return e;let i=n-e.length;if(i<=0)return e;let o=Math.ceil(i/r.length);return r.repeat(o).slice(0,i)+e},padRight:(e,t)=>{if("string"!=typeof e)return e;let n=Number(t[0])||0,r=t.length>1?Qt(t[1]):" ";if(""===r)return e;let i=n-e.length;if(i<=0)return e;let o=Math.ceil(i/r.length);return e+r.repeat(o).slice(0,i)},number:(e,t)=>{if("number"==typeof e){let n=Number(t[0])||0;return e.toFixed(n)}if("string"!=typeof e)return e;let n=e.match(/-?\d+(?:\.\d+)?/);return n?Number(n[0]):0},replace:(e,t)=>"string"!=typeof e||0===t.length?e:e.split(Qt(t[0])).join(Qt(t[1])),slice:(e,t)=>{if(0===t.length)return e;let n=Number(t[0])||0,r=t.length>1&&Number.isFinite(Number(t[1]))?n+Number(t[1]):void 0;return"string"==typeof e||Array.isArray(e)?e.slice(n,r):e},split:(e,t)=>"string"==typeof e&&t.length>0?e.split(Qt(t[0])):e,join:(e,t)=>Array.isArray(e)?e.join(0===t.length?"":Qt(t[0])):e,reverse:e=>"string"==typeof e?e.split("").reverse().join(""):Array.isArray(e)?[...e].reverse():e,length:e=>"string"==typeof e||Array.isArray(e)?e.length:"number"==typeof e?Qt(e).length:"object"==typeof e&&e?Object.keys(e).length:0,first:e=>"string"==typeof e?e.length>0?e[0]:"":Array.isArray(e)?e.length>0?e[0]:void 0:e,last:e=>"string"==typeof e?e.length>0?e[e.length-1]:"":Array.isArray(e)?e.length>0?e[e.length-1]:void 0:e,contains:(e,t)=>{if(0===t.length)return!1;let n=t[0];return"string"==typeof e?e.includes(Qt(n)):!!Array.isArray(e)&&e.includes(n)},startswith:(e,t)=>"string"==typeof e&&t.length>0&&e.startsWith(Qt(t[0])),endswith:(e,t)=>"string"==typeof e&&t.length>0&&e.endsWith(Qt(t[0])),number_format:(e,t)=>{if("number"!=typeof e)return e;let n=Number(t[0])||0,r=null==t[1]?".":Qt(t[1]),i=null==t[2]?"":Qt(t[2]),o=e.toFixed(n);if(""===i)return o.replace(".",r);let a=o.split(".");return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,i),a.join(r)},currency:(e,t)=>{let n=on(e);if(void 0===n||0===t.length)return e;let r=t[2],i="object"==typeof r&&!!r&&"trimZeros"in r&&!0===r.trimZeros&&Number.isInteger(n);return an(n,t[1],{style:"currency",currency:Qt(t[0]),...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},percent:(e,t)=>{let n=on(e);if(void 0===n)return e;let r=Number(t[0])||0;return an(n,t[1],{style:"percent",minimumFractionDigits:0,maximumFractionDigits:r})},sort:(e,t)=>{if(!Array.isArray(e))return e;let n=[...e],r=t[0];if("function"==typeof r){let e=r;return(e[Jt]??1)>=2?n.sort((t,n)=>Number(e(t,n))):n.sort((t,n)=>Xt(e(t),e(n)))}return n.sort(Xt)},batch:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Number(t[0]);if(n<=0)return e;let r=[];for(let i=0;i<e.length;i+=n)r.push(e.slice(i,i+n));return r},map:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=t[0];return"function"==typeof n?e.map((e,t)=>n(e,t)):e},reduce:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=t[0];if("function"!=typeof n)return e;let r=t[1],i=+(void 0===r),o=void 0===r?e[0]:r;for(let a=i;a<e.length;a++)o=n(o,e[a],a);return o},merge:(e,t)=>{if(0===t.length)return e;let n=t[0];return Array.isArray(e)&&Array.isArray(n)?[...e,...n]:"object"==typeof e&&e&&"object"==typeof n&&n&&!Array.isArray(n)?{...e,...n}:e},keys:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.keys(e):e,values:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.values(e):e,filter:(e,t)=>{if(!Array.isArray(e))return e;if(0===t.length)return e.filter(Boolean);let n=t[0];if("function"==typeof n)return e.filter((e,t)=>n(e,t));let r=Qt(n);return e.filter(e=>{if("object"==typeof e&&e){let t=e[r];return null!=t&&!1!==t&&""!==t}return!!e})},column:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Qt(t[0]);return e.map(e=>"object"==typeof e&&e?e[n]:void 0)},url_encode:e=>"string"==typeof e?encodeURIComponent(e):"object"==typeof e&&e&&!Array.isArray(e)?new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Qt(t)]))).toString():e,nl2br:e=>"string"==typeof e?e.replace(/\n/g,"<br>"):e,striptags:(e,t)=>{if("string"!=typeof e)return e;let n=t.length>0?Qt(t[0]).trim():"";if(n){let t=n.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map(e=>e.replace(/[/>]/g,"").trim());if(t.length>0){let n=RegExp(`<(?!/?(?:${t.join("|")})\\b)[^>]+>`,"gi");return e.replace(n,"").replace(/\s+/g," ").trim()}}return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()},abs:e=>"number"==typeof e?Math.abs(e):e,round:(e,t)=>{if("number"!=typeof e)return e;let n=Number(t[0])||0,r=null==t[1]?"common":Qt(t[1]),i=10**n;return"ceil"===r?Math.ceil(e*i)/i:"floor"===r?Math.floor(e*i)/i:Math.round(e*i)/i},format:(e,t)=>{if("string"!=typeof e)return e;let n=0;return e.replace(/%((?:[-+ 0]|'.)*)(\d*)(?:\.(\d+))?([sdf%])/g,(e,r,i,o,a)=>{if("%"===a)return"%";let s=t[n];if(n++,void 0===s)return e;let l,c=r.includes("+");if("d"===a){let e=Math.trunc(Number(s));l=`${c&&e>=0?"+":""}${e}`}else if("f"===a){let e=Number(s);l=`${c&&e>=0?"+":""}${void 0===o?String(e):e.toFixed(Number(o))}`}else l=Qt(s),l=void 0===o?l:l.slice(0,Number(o));let u=Number(i||0);if(l.length>=u)return l;let d=/'(.)/.exec(r),p=d?d[1]:r.includes("0")?"0":" ";return r.includes("-")?l.padEnd(u,"0"===p?" ":p):"0"===p&&"s"!==a&&/^[+-]/.test(l)?l[0]+l.slice(1).padStart(u-1,"0"):l.padStart(u,p)})},spaceless:e=>"string"==typeof e?e.replace(/>\s+</g,"><").trim():e,random:e=>Array.isArray(e)?e.length>0?e[Math.floor(Math.random()*e.length)]:void 0:"string"==typeof e?e.length>0?e[Math.floor(Math.random()*e.length)]:"":"number"==typeof e?Math.floor(Math.random()*e):e,date:(e,t)=>{if(0===t.length)return e;let n=Qt(t[0]),r=(e=>{if(e instanceof Date)return e;if("number"==typeof e)return new Date(e);let t=String(e).trim();return/^-?\d+$/.test(t)?new Date(Number(t)):new Date(t)})(e);if(Number.isNaN(r.getTime()))return"";let i=((e,t)=>{if(!t)return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),weekday:e.getDay()};let n=(e=>{if(!rn.has(e))try{rn.set(e,new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}))}catch{rn.set(e,null)}return rn.get(e)??null})(t);if(!n)return;let r=n.formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return{year:Number(i("year")),month:Number(i("month")),day:Number(i("day")),hours:Number(i("hour")),minutes:Number(i("minute")),seconds:Number(i("second")),weekday:nn.indexOf(i("weekday"))}})(r,t.length>1?Qt(t[1]):"");if(!i)return"";let o=e=>String(e).padStart(2,"0"),a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s={Y:String(i.year),y:o(i.year%100),m:o(i.month),n:String(i.month),d:o(i.day),j:String(i.day),H:o(i.hours),G:String(i.hours),h:o(i.hours%12||12),g:String(i.hours%12||12),A:i.hours<12?"AM":"PM",a:i.hours<12?"am":"pm",i:o(i.minutes),s:o(i.seconds),w:String(i.weekday),N:String(0===i.weekday?7:i.weekday),U:String(Math.floor(r.getTime()/1e3)),l:a[i.weekday],D:a[i.weekday].slice(0,3),F:["January","February","March","April","May","June","July","August","September","October","November","December"][i.month-1],M:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i.month-1]},l="",c=!1;for(let u of n)c?(l+=u,c=!1):"\\"===u?c=!0:l+=Object.prototype.hasOwnProperty.call(s,u)?s[u]:u;return l},base64_encode:e=>"string"==typeof e?(e=>{let t=(new TextEncoder).encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)})(e):e,base64_decode:e=>"string"==typeof e?(e=>{let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return(new TextDecoder).decode(n)})(e):e,md5:e=>"string"==typeof e?(e=>{let t=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],n=/* @__PURE__ */new Uint32Array(64);for(let f=0;f<64;f++)n[f]=Math.floor(4294967296*Math.abs(Math.sin(f+1)));let r=(new TextEncoder).encode(e),i=8*r.length,o=1+(r.length+8>>6)<<6,a=new Uint8Array(o);a.set(r),a[r.length]=128;let s=new DataView(a.buffer);s.setUint32(o-8,i>>>0,!0),s.setUint32(o-4,Math.floor(i/4294967296)>>>0,!0);let l=1732584193,c=4023233417,u=2562383102,d=271733878,p=(e,t)=>e<<t|e>>>32-t;for(let f=0;f<o;f+=64){let e=/* @__PURE__ */new Uint32Array(16);for(let t=0;t<16;t++)e[t]=s.getUint32(f+4*t,!0);let r=l,i=c,o=u,a=d;for(let s=0;s<64;s++){let l,c;s<16?(l=i&o|~i&a,c=s):s<32?(l=a&i|~a&o,c=(5*s+1)%16):s<48?(l=i^o^a,c=(3*s+5)%16):(l=o^(i|~a),c=7*s%16),l=l+r+n[s]+e[c]|0,r=a,a=o,o=i,i=i+p(l,t[s])|0}l=l+r|0,c=c+i|0,u=u+o|0,d=d+a|0}let h=e=>{let t="";for(let n=0;n<4;n++)t+=(e>>>8*n&255).toString(16).padStart(2,"0");return t};return h(l)+h(c)+h(u)+h(d)})(e):e,without:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let n=t.map(Qt),r={};for(let[i,o]of Object.entries(e))n.includes(i)||(r[i]=o);return r},only:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let n=t.map(Qt),r={};for(let[i,o]of Object.entries(e))n.includes(i)&&(r[i]=o);return r},find:(e,t)=>{if(!Array.isArray(e)||0===t.length)return;let n=t[0];if("function"==typeof n)return e.find((e,t)=>n(e,t));if(t.length<2)return;let r=Qt(n),i=t[1];return e.find(e=>"object"==typeof e&&e?e[r]===i:e===i)},pluck:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Qt(t[0]);return e.map(e=>"object"==typeof e&&e?e[n]:void 0)},unique:e=>Array.isArray(e)?[...new Set(e)]:e,flatten:e=>Array.isArray(e)?e.flat():e,sum:e=>Array.isArray(e)?e.reduce((e,t)=>e+("number"==typeof t?t:0),0):e,chunk:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Number(t[0]);if(n<=0)return e;let r=[];for(let i=0;i<e.length;i+=n)r.push(e.slice(i,i+n));return r},index_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Qt(t[0]),r={};for(let i of e)"object"==typeof i&&i&&(r[String(i[n]??"")]=i);return r},group_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Qt(t[0]),r={};for(let i of e)if("object"==typeof i&&i){let e=String(i[n]??"");r[e]=r[e]??[],r[e].push(i)}return r}},ln=(e,t)=>e[t],cn=(e,t)=>{let n=t.indexOf(".");if(-1===n)return e[t];let r=e[t.slice(0,n)],i=n+1,o=t.length;for(;i<o;){if(null==r)return;let e=t.indexOf(".",i);if(-1===e)return r[t.slice(i)];r=r[t.slice(i,e)],i=e+1}return r},un=e=>null==e?"":"object"==typeof e?JSON.stringify(e):String(e),dn=e=>{try{let t=JSON.parse(e);return"number"==typeof t&&String(t)!==e.trim()?e:t||e}catch{return e}},pn=e=>{let t={},n=e.variables;for(let r in n)t[r]=n[r];for(let r in e)t[r]=e[r];return t},hn=e=>!(null==e||!1===e||""===e||0===e||Array.isArray(e)&&0===e.length),fn=(e,t)=>"string"==typeof t?t.includes(String(e)):Array.isArray(t)?t.includes(e):!("object"!=typeof t||!t)&&String(e)in t,mn={defined:e=>void 0!==e,null:e=>null==e,none:e=>null==e,empty:e=>null==e||""===e||!1===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length,iterable:e=>Array.isArray(e)||"object"==typeof e&&!!e,even:e=>"number"==typeof e&&e%2==0,odd:e=>"number"==typeof e&&1===Math.abs(e%2)},gn=e=>"path"===e.type||"filter"===e.type&&gn(e.subject),yn=e=>"path"===e.type?e.segments[0]:"filter"===e.type?yn(e.subject):void 0,bn=[],vn=(e,t,n=!1,r=!1)=>{let i=new kn(t,n,r);return{output:i.evalNodes(e),variables:i.variables,hasSet:i.hasSet}},wn=(e,t)=>new kn(t).evalExpression(e),kn=class e{variables;keepEmptyTokens;jsonStrings;inString=!1;escaping=!1;breakFlag=!1;continueFlag=!1;hasSet=!1;constructor(e,t=!1,n=!1){this.variables={...e},this.keepEmptyTokens=t,this.jsonStrings=n}keeps(e){if("boolean"==typeof this.keepEmptyTokens)return this.keepEmptyTokens;let t=yn(e);return void 0===t||!this.keepEmptyTokens.settled.has(t)}evalNodes(e){let t=e.length;if(0===t)return"";if(1===t)return this.evalNode(e[0]);let n="";for(let r=0;r<t&&(n+=this.evalNode(e[r]),!this.breakFlag&&!this.continueFlag);r++);return n}evalNode(e){switch(e.type){case"text":return this.jsonStrings&&this.followQuotes(e.value),e.value;case"variable":return this.jsonStrings&&this.inString?JSON.stringify(this.evalVariable(e)).slice(1,-1):this.evalVariable(e);case"if":return this.evalIf(e);case"for":return this.evalFor(e);case"set":return this.evalSet(e);case"apply":return this.evalApply(e);case"break":return this.breakFlag=!0,"";case"continue":return this.continueFlag=!0,""}}evalVariable(e){let t=this.evalExpression(e.expression);return this.keeps(e.expression)&&((e,t)=>null==t||""===t&&gn(e))(e.expression,t)?e.source:en(t)?String(tn(t)):"function"==typeof t?"":null!=t&&"object"!=typeof t?String(t):e.raw?null==t?"":String(t):"object"==typeof t&&t?JSON.stringify(t):""}followQuotes(e){for(let t=0;t<e.length;t++){let n=e[t];this.escaping?this.escaping=!1:this.inString&&"\\"===n?this.escaping=!0:'"'===n&&(this.inString=!this.inString)}}evalIf(e){if(hn(this.evalExpression(e.condition)))return this.evalNodes(e.body);for(let t of e.elseifClauses)if(hn(this.evalExpression(t.condition)))return this.evalNodes(t.body);return e.elseBody?this.evalNodes(e.elseBody):""}evalFor(e){let t=this.evalExpression(e.collection);if(void 0!==e.source&&void 0===t&&this.keeps(e.collection))return e.source;let n,r=null;if(null!==e.keyVar){let i=(e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.entries(e):null)(t);if(!i||0===i.length)return e.elseBody?this.evalNodes(e.elseBody):"";let o=i.length;r=Array(o),n=Array(o);for(let e=0;e<o;e++)r[e]=i[e][0],n[e]=i[e][1]}else{let r=(e=>Array.isArray(e)?e:"object"==typeof e&&e?Object.values(e):null)(t);if(!r||0===r.length)return e.elseBody?this.evalNodes(e.elseBody):"";n=r}return this.runLoop(e,n,r)}runLoop(e,t,n){let{valueVar:r,keyVar:i,body:o}=e,a=t.length,s=this.variables.loop,l={index:0,index0:0,first:!1,last:!1,length:a,revindex:0};this.variables.loop=l;let c="";for(let u=0;u<a;u++){if(l.index=u+1,l.index0=u,l.first=0===u,l.last=u===a-1,l.revindex=a-u,null!==n&&null!==i&&(this.variables[i]=n[u]),this.variables[r]=t[u],c+=this.evalNodes(o),this.breakFlag){this.breakFlag=!1;break}this.continueFlag&&=!1}return void 0===s?delete this.variables.loop:this.variables.loop=s,c}evalSet(e){return this.hasSet=!0,this.variables[e.name]=Array.isArray(e.value)?this.evalNodes(e.value):this.evalExpression(e.value),""}evalApply(e){let t=this.applyFilters(this.evalNodes(e.body),e.filters);return en(t)?String(tn(t)):"object"==typeof t&&t?JSON.stringify(t):null==t?"":String(t)}applyFilters(e,t){let n=e;for(let r of t){let e=sn[r.name];void 0!==e&&(n=e(n,0===r.args.length?bn:this.evalArgs(r.args)))}return n}evalArgs(e){let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=this.evalExpression(e[r]);return n}evalExpression(e){switch(e.type){case"literal":return e.value;case"array":{let t=e.elements,n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=this.evalExpression(t[e]);return n}case"object":{let t={};for(let n of e.entries){let e=this.evalExpression(n.key);t["string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):""]=this.evalExpression(n.value)}return t}case"range":return this.evalRange(e.start,e.end);case"path":return this.resolvePath(e.segments);case"index":return this.resolveIndex(e.object,e.index);case"function":return this.evalFunction(e.name,e.args);case"filter":return this.applyFilters(this.evalExpression(e.subject),e.filters);case"concat":{let t=e.parts,n=t.length,r="";for(let e=0;e<n;e++){let n=this.evalExpression(t[e]);r+=null==n?"":String(n)}return r}case"unary":return"-"===e.operator?-Number(this.evalExpression(e.operand)):!hn(this.evalExpression(e.operand));case"binary":return this.evalBinary(e.operator,e.left,e.right);case"default":return this.evalExpression(e.value)??this.evalExpression(e.defaultExpr);case"ternary":{let t=this.evalExpression(e.condition);return hn(t)?e.trueExpr?this.evalExpression(e.trueExpr):t:this.evalExpression(e.falseExpr)}case"arrow":return this.createArrowFunction(e.params,e.body)}}createArrowFunction(t,n){let r={...this.variables},i=this.keepEmptyTokens,o=(...o)=>{let a=new e(r,i);for(let e=0;e<t.length;e++)a.variables[t[e]]=o[e];return a.evalExpression(n)};return o[Jt]=t.length,o}resolvePath(e){let t=e.length;if(0===t)return;let n=this.variables[e[0]];for(let r=1;r<t;r++){if(null==n)return;n=n[e[r]]}return n}resolveIndex(e,t){let n=this.evalExpression(e);if(null==n)return;let r=this.evalExpression(t);return null!=r?n[String(r)]:void 0}evalRange(e,t){let n=Number(this.evalExpression(e)),r=Number(this.evalExpression(t)),i=n<=r,o=1+(i?r-n:n-r),a=Array(o);for(let s=0;s<o;s++)a[s]=i?n+s:n-s;return a}evalFunction(e,t){let n=this.evalArgs(t);switch(e){case"cycle":{let e=n[0],t=n[1];return Array.isArray(e)&&"number"==typeof t?e[t%e.length]:""}case"max":return this.minMax(n,Math.max);case"min":return this.minMax(n,Math.min);case"range":return this.rangeFunction(n);default:return""}}minMax(e,t){return 0===e.length?void 0:t(...1===e.length&&Array.isArray(e[0])?e[0]:e)}rangeFunction(e){if(0===e.length)return[];if(1===e.length){let t=Number(e[0]),n=Array(t+1);for(let e=0;e<=t;e++)n[e]=e;return n}let t=Number(e[0]),n=Number(e[1]),r=e.length>2?Number(e[2]):t<=n?1:-1;if(0===r)return[];let i=Math.floor((r>0?n-t:t-n)/Math.abs(r))+1;if(i<=0)return[];let o=Array(i);for(let a=0;a<i;a++)o[a]=t+a*r;return o}evalBinary(e,t,n){let r=(e=>"path"===e.type&&1===e.segments.length?e.segments[0]:"literal"===e.type&&null===e.value?"null":void 0)(n);if(("is"===e||"is not"===e)&&void 0!==r){let n=mn[r];if(n){let r=n(this.evalExpression(t));return"is"===e?r:!r}}if("or"===e)return hn(this.evalExpression(t))||hn(this.evalExpression(n));if("and"===e)return hn(this.evalExpression(t))&&hn(this.evalExpression(n));let i=this.evalExpression(t),o=this.evalExpression(n),a="number"==typeof i&&"number"==typeof o;switch(e){case"+":return a?i+o:Number(i)+Number(o);case"-":return a?i-o:Number(i)-Number(o);case"*":return a?i*o:Number(i)*Number(o);case"/":return a?i/o:Number(i)/Number(o);case"//":return Math.floor(Number(i)/Number(o));case"**":return Number(i)**Number(o);case"starts with":return"string"==typeof i&&i.startsWith(un(o));case"ends with":return"string"==typeof i&&i.endsWith(un(o));case"%":return a?i%o:Number(i)%Number(o);case"==":return i===o||String(i)===String(o);case"!=":return i!==o&&String(i)!==String(o);case">":return a?i>o:Number(i)>Number(o);case"<":return a?i<o:Number(i)<Number(o);case">=":return a?i>=o:Number(i)>=Number(o);case"<=":return a?i<=o:Number(i)<=Number(o);case"in":return fn(i,o);case"not in":return!fn(i,o);case"same as":case"is":return i===o;case"divisible by":{let e=Number(o);return 0!==e&&Number.isFinite(e)&&Number(i)%e===0}case"is not":return i!==o;default:return!1}}},xn=41,Sn=42,Tn=45,Cn=e=>e>=97&&e<=122||e>=65&&e<=90||95===e,En=e=>Cn(e)||e>=48&&e<=57,An=e=>En(e)||e===Tn,In=e=>e>=48&&e<=57,On=e=>32===e||9===e||10===e||13===e,_n=e=>{let t=e.length;if(0===t||!Cn(e.charCodeAt(0)))return!1;for(let n=1;n<t;n++)if(!En(e.charCodeAt(n)))return!1;return!0},Nn=e=>{let t=e.length;if(0===t||!Cn(e.charCodeAt(0)))return!1;let n=!1,r=!1;for(let i=1;i<t;i++){let t=e.charCodeAt(i);if(46!==t){if(n){if(r=In(t),!r&&!Cn(t))return!1;n=!1}else if(r?!In(t):!En(t))return!1}else{if(n)return!1;n=!0,r=!1}}return!n},Mn=e=>_n(e),Pn=(e,t)=>t?`{{{${e}}}}`:`{{${e}}}`,Ln=e=>{switch(e.type){case"text":return e.value;case"variable":return Pn(e.content,e.raw);case"tag":return`{%${e.content}%}`}},Rn=class{src;pos=0;constructor(e){this.src=e}eof(){return this.pos>=this.src.length}peek(){return this.pos<this.src.length?this.src.charCodeAt(this.pos):-1}at(e){let t=this.pos+e;return t<this.src.length?this.src.charCodeAt(t):-1}skipWs(){for(;this.pos<this.src.length&&On(this.src.charCodeAt(this.pos));)this.pos++}scanName(){let e=this.pos;if(!this.eof()&&Cn(this.src.charCodeAt(this.pos)))for(this.pos++;!this.eof()&&An(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanIndex(){let e=this.pos;for(;!this.eof()&&In(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanStringLiteral(){let e=this.src.charCodeAt(this.pos);this.pos++;let t="";for(;this.pos<this.src.length&&this.src.charCodeAt(this.pos)!==e;)if(92===this.src.charCodeAt(this.pos)&&this.pos+1<this.src.length){this.pos++;let n=this.src.charCodeAt(this.pos);t+=110===n?"\n":116===n?"\t":114===n?"\r":92===n?"\\":n===e?String.fromCharCode(n):String.fromCharCode(92)+String.fromCharCode(n),this.pos++}else t+=this.src[this.pos],this.pos++;return this.pos<this.src.length&&this.pos++,t}scanNumber(){let e=this.pos;for(this.src.charCodeAt(this.pos)===Tn&&this.pos++;this.pos<this.src.length&&In(this.src.charCodeAt(this.pos));)this.pos++;if(46===this.src.charCodeAt(this.pos))for(this.pos++;this.pos<this.src.length&&In(this.src.charCodeAt(this.pos));)this.pos++;return Number(this.src.slice(e,this.pos))}matchKeyword(e){let t=this.pos+e.length;if(t>this.src.length)return!1;for(let n=0;n<e.length;n++)if(this.src.charCodeAt(this.pos+n)!==e.charCodeAt(n))return!1;return!(t<this.src.length&&En(this.src.charCodeAt(t))||(this.pos=t,this.skipWs(),0))}matchBinaryOp(){this.skipWs();let e=this.peek();if(61===this.at(1)){if(61===e)return this.pos+=2,"==";if(33===e)return this.pos+=2,"!=";if(62===e)return this.pos+=2,">=";if(60===e)return this.pos+=2,"<="}return 62===e?(this.pos++,">"):60===e?(this.pos++,"<"):null}},jn=(e,t)=>{let n=new Dn(e,t),r=n.parseTernary();return n.expectEnd(),r},zn=["same as","divisible by"],Dn=class extends Rn{issues;constructor(e,t){super(e),this.issues=t}report(e){this.issues?.push(e)}expectEnd(){this.skipWs(),this.eof()||this.report(`Unexpected "${this.src.slice(this.pos).trim()}" in "${this.src.trim()}"`)}expectChar(e,t){this.skipWs(),this.peek()!==e?this.report(`Missing ${t} in "${this.src.trim()}"`):this.pos++}parseTernary(){let e=this.parseOr();if(this.skipWs(),63!==this.peek())return e;if(this.pos++,this.skipWs(),58===this.peek())return this.pos++,this.skipWs(),{type:"ternary",condition:e,trueExpr:null,falseExpr:this.parseTernary()};let t=this.parseOr();return this.skipWs(),58===this.peek()?(this.pos++,this.skipWs(),{type:"ternary",condition:e,trueExpr:t,falseExpr:this.parseTernary()}):{type:"ternary",condition:e,trueExpr:t,falseExpr:{type:"literal",value:""}}}parseOr(){let e=this.parseAnd();for(this.skipWs();this.matchKeyword("or");)e={type:"binary",operator:"or",left:e,right:this.parseAnd()},this.skipWs();return e}parseAnd(){let e=this.parseNot();for(this.skipWs();this.matchKeyword("and");)e={type:"binary",operator:"and",left:e,right:this.parseNot()},this.skipWs();return e}parseNot(){return this.skipWs(),this.matchKeyword("not")?{type:"unary",operator:"not",operand:this.parseComparison()}:this.parseComparison()}parseComparison(){let e=this.parseConcat();for(this.skipWs();!this.eof();){if(this.matchKeyword("is")){this.skipWs();let t=this.matchKeyword("not");this.skipWs();let n=this.matchWordedTest();if(n){let r={type:"binary",operator:n,left:e,right:this.parseConcat()};e=t?{type:"unary",operator:"not",operand:r}:r,this.skipWs();continue}e={type:"binary",operator:t?"is not":"is",left:e,right:this.parseConcat()},this.skipWs();continue}if(this.matchKeyword("not")){if(this.skipWs(),this.matchKeyword("in")){e={type:"binary",operator:"not in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.src.slice(this.pos-4);return this.pos=this.src.length,{type:"unary",operator:"not",operand:jn(t,this.issues)}}if(this.matchKeyword("in")){e={type:"binary",operator:"in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.matchAffixTest();if(t){e={type:"binary",operator:t,left:e,right:this.parseConcat()},this.skipWs();continue}if(this.matchKeyword("matches")){this.report("`matches` is not supported: templates evaluate no regular expressions. Use `starts with`, `ends with` or `in`."),e={type:"binary",operator:"matches",left:e,right:this.parseConcat()},this.skipWs();continue}let n=this.matchBinaryOp();if(!n)break;e={type:"binary",operator:n,left:e,right:this.parseConcat()},this.skipWs()}return e}matchWordedTest(){let e=this.pos;for(let t of zn){let[n,r]=t.split(" ");if(this.matchKeyword(n)){if(this.skipWs(),this.matchKeyword(r))return t;this.pos=e}}return null}matchAffixTest(){let e=this.pos;for(let t of["starts","ends"])if(this.matchKeyword(t)){if(this.matchKeyword("with"))return"starts"===t?"starts with":"ends with";this.pos=e}return null}parseConcat(){let e=this.parseAdditive();for(this.skipWs();126===this.peek();){this.pos++;let t=this.parseAdditive();e="concat"===e.type?{type:"concat",parts:[...e.parts,t]}:{type:"concat",parts:[e,t]},this.skipWs()}return e}parseAdditive(){let e=this.parseMultiplicative();this.skipWs();for(let t=this.peek();43===t||t===Tn;t=this.peek())this.pos++,e={type:"binary",operator:43===t?"+":"-",left:e,right:this.parseMultiplicative()},this.skipWs();return e}parseMultiplicative(){let e=this.parsePower();this.skipWs();for(let t=this.peek();!(t!==Sn&&47!==t&&37!==t||t===Sn&&this.at(1)===Sn);t=this.peek()){let n=47===t&&47===this.at(1);this.pos+=n?2:1,e={type:"binary",operator:n?"//":t===Sn?"*":47===t?"/":"%",left:e,right:this.parsePower()},this.skipWs()}return e}parsePower(){let e=this.parseDefault();return this.skipWs(),this.peek()!==Sn||this.at(1)!==Sn?e:(this.pos+=2,{type:"binary",operator:"**",left:e,right:this.parsePower()})}parseSignedAtom(){return this.peek()===Tn&&In(this.at(1))?this.maybeTrailingFilters({type:"literal",value:this.scanNumber()}):this.peek()===Tn?(this.pos++,this.skipWs(),{type:"unary",operator:"-",operand:this.parseSignedAtom()}):this.parseAtom()}parseDefault(){if(this.skipWs(),this.peek()===Tn&&In(this.at(1)))return this.maybeTrailingFilters({type:"literal",value:this.scanNumber()});if(this.peek()===Tn)return this.pos++,{type:"unary",operator:"-",operand:this.parseDefault()};let e=this.parseAtom();for(this.skipWs();63===this.peek()&&63===this.at(1);)this.pos+=2,this.skipWs(),e={type:"default",value:e,defaultExpr:this.parseSignedAtom()},this.skipWs();return e}parseAtom(){this.skipWs();let e=this.peek();if(40===e){this.pos++,this.skipWs();let e=this.pos,t=this.tryParseArrowParams();if(null!==t)return this.maybeTrailingFilters({type:"arrow",params:t,body:this.parseTernary()});this.pos=e;let n=this.parseTernary();return this.expectChar(xn,'a closing ")"'),this.maybeTrailingFilters(this.parseAccessChain(n,null))}if(39===e||34===e)return this.maybeTrailingFilters({type:"literal",value:this.scanStringLiteral()});if(In(e))return this.maybeTrailingFilters({type:"literal",value:this.scanNumber()});if(91===e){this.pos++;let e={type:"array",elements:this.parseArgList(93)};return this.maybeTrailingFilters(this.parseAccessChain(e,null))}return 123===e?(this.pos++,this.maybeTrailingFilters(this.parseAccessChain(this.parseObjectLiteral(),null))):this.parsePathOrFunctionOrArrow()}tryParseArrowParams(){let e=this.pos,t=[];for(this.skipWs();this.peek()!==xn;){let n=this.scanName();if(!n)return this.pos=e,null;if(t.push(n),this.skipWs(),44!==this.peek())break;this.pos++,this.skipWs()}return this.skipWs(),this.peek()===xn&&(this.pos++,this.skipWs(),61===this.peek()&&62===this.at(1))?(this.pos+=2,t):(this.pos=e,null)}parsePathOrFunctionOrArrow(){let e=this.scanName();if(!e)return this.report(this.eof()?`Missing a value at the end of "${this.src.trim()}"`:`Unexpected "${this.src.slice(this.pos).trim()}" in "${this.src.trim()}"`),this.pos++,{type:"literal",value:""};if("true"===e||"false"===e)return this.maybeTrailingFilters({type:"literal",value:"true"===e});if("null"===e||"none"===e)return this.maybeTrailingFilters({type:"literal",value:null});if(this.skipWs(),61===this.peek()&&62===this.at(1))return this.pos+=2,this.maybeTrailingFilters({type:"arrow",params:[e],body:this.parseTernary()});if(40===this.peek()){this.pos++;let t=this.parseArgList(xn);return this.maybeTrailingFilters(this.parseAccessChain({type:"function",name:e,args:t},null))}let t=[e];return this.maybeTrailingFilters(this.parseAccessChain({type:"path",segments:t},t))}parseAccessChain(e,t){let n=e,r=t;for(;;){let e=this.peek();if(46===e){let e=this.pos;this.pos++;let t=this.scanName()||this.scanIndex();if(!t){this.pos=e;break}r?r.push(t):n={type:"index",object:n,index:{type:"literal",value:t}};continue}if(91!==e)break;this.pos++;let t=this.parseTernary();this.expectChar(93,'a closing "]"'),!r||"literal"!==t.type||"string"!=typeof t.value&&"number"!=typeof t.value?(r&&=(n={type:"path",segments:r},null),n={type:"index",object:n,index:t}):r.push(String(t.value))}return r?{type:"path",segments:r}:n}maybeTrailingFilters(e){return this.skipWs(),124===this.peek()?{type:"filter",subject:e,filters:this.parseTrailingFilters()}:e}parseObjectLiteral(){let e=[];for(this.skipWs();!this.eof()&&125!==this.peek();){let t=this.parseObjectKey();this.skipWs(),58===this.peek()&&this.pos++,this.skipWs(),e.push({key:t,value:this.parseTernary()}),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs())}return this.expectChar(125,'a closing "}"'),{type:"object",entries:e}}parseObjectKey(){let e=this.peek();if(39===e||34===e)return{type:"literal",value:this.scanStringLiteral()};if(In(e))return{type:"literal",value:this.scanNumber()};if(40===e){this.pos++,this.skipWs();let e=this.parseTernary();return this.skipWs(),this.peek()===xn&&this.pos++,e}return{type:"literal",value:this.scanName()}}parseArgList(e){let t=[];for(this.skipWs();!this.eof()&&this.peek()!==e;)t.push(this.parseTernary()),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs());return this.expectChar(e,e===xn?'a closing ")"':'a closing "]"'),t}parseTrailingFilters(){let e=[];for(;124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}parseApplyChain(){this.skipWs();let e=[this.readFilter()];for(this.skipWs();124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}readFilter(){let e=this.scanName();return e||this.report(`A "|" with no filter name after it in "${this.src.trim()}"`),this.skipWs(),40===this.peek()?(this.pos++,{name:e,args:this.parseArgList(xn)}):{name:e,args:[]}}},$n=e=>{let t=0;for(;t<e.length&&!On(e.charCodeAt(t));)t++;return e.slice(0,t)},Fn=(e,t=!1,n)=>{let r=new Bn(e,t,n),i=r.parseBody();if(!r.error){let e=r.peek();if(e&&"tag"===e.type){let t=$n(e.content.trim());qn.has(t)&&(r.error=`Orphan closing tag: {% ${t} %} without matching opening tag`)}}return{nodes:i,error:r.error}},qn=/* @__PURE__ */new Set(["endif","endfor","endset","endapply","else","elseif"]),Bn=class{tokens;keepEmptyTokens;issues;pos=0;error=null;constructor(e,t=!1,n){this.tokens=e,this.keepEmptyTokens=t,this.issues=n}peek(){return this.tokens[this.pos]}advance(){let e=this.tokens[this.pos];return e&&this.pos++,e}isTag(e){let t=this.peek();if(!t||"tag"!==t.type)return!1;let n=t.content.trim();return n===e||n.startsWith(e+" ")||n.startsWith(e+"\t")}parseBody(){let e=[];for(;this.pos<this.tokens.length;){let t=this.peek();if(!t||"tag"===t.type&&qn.has($n(t.content.trim())))break;let n=this.parseNode();n&&e.push(n)}return e}parseNode(){let e=this.peek();return e?"text"===e.type?(this.advance(),{type:"text",value:e.value}):"variable"===e.type?this.parseVariable():this.parseTag():null}parseVariable(){let e=this.advance();if(!e||"variable"!==e.type)return{type:"variable",raw:!1,expression:{type:"literal",value:""},source:""};let t=e.content.trim(),n=this.keepEmptyTokens?Pn(e.content,e.raw):"";if(_n(t))return{type:"variable",raw:e.raw,expression:{type:"path",segments:[t]},source:n};let r=jn(t,this.issues);return{type:"variable",raw:e.raw,expression:r,source:n}}parseTag(){let e=this.peek();if(!e||"tag"!==e.type)return null;let t=e.content.trim(),n=$n(t);switch(n){case"if":return this.parseIf();case"for":return this.parseFor();case"set":return this.parseSet();case"apply":return this.parseApply();case"break":return this.advance(),{type:"break"};case"continue":return this.advance(),{type:"continue"};default:return this.issues?.push(`Unknown tag {% ${n} %}: the tags are if, for, set, apply, break and continue`),this.advance(),null}}parseIf(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return this.error="Malformed {% if %} tag",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let t=e.content.trim(),n=-1===t.indexOf(" ")?"":t.slice(t.indexOf(" ")+1).trim();if(!n)return this.error="Malformed {% if %} tag: missing condition",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let r=jn(n,this.issues),i=this.parseBody(),o=[],a=null,s=!1;for(;this.peek();){let e=this.peek();if(!e||"tag"!==e.type)break;let t=$n(e.content.trim());if("elseif"===t){this.advance();let t=e.content.trim(),n=t.slice(t.indexOf(" ")+1).trim(),r=jn(n,this.issues),i=this.parseBody();o.push({condition:r,body:i})}else{if("else"!==t){if("endif"===t){this.advance(),s=!0;break}break}this.advance(),a=this.parseBody()}}return s||(this.error="Malformed {% if %} block: missing {% endif %}"),{type:"if",condition:r,body:i,elseifClauses:o,elseBody:a}}parseFor(){let e=this.pos;this.advance();let t=this.tokens[this.pos-1];if("tag"!==t.type)return{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let n=t.content.trim(),r=n.slice(n.indexOf(" ")+1).trim(),i=/\sin\s/.exec(r);if(!i)return this.error="Invalid {% for %} syntax: missing the `in` keyword",{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let o=r.slice(0,i.index).trim(),a=r.slice(i.index+i[0].length).trim(),s=(e=>{let t=0;for(let n=0;n+1<e.length;n++){let r=e.charCodeAt(n);if(0!==t)r===t&&(t=0);else if(39===r||34===r)t=r;else if(46===r&&46===e.charCodeAt(n+1))return[e.slice(0,n).trim(),e.slice(n+2).trim()]}return null})(a),l=s?{type:"range",start:jn(s[0],this.issues),end:jn(s[1],this.issues)}:jn(a,this.issues),c=o.indexOf(","),u=-1===c?null:o.slice(0,c).trim(),d=-1===c?o:o.slice(c+1).trim();if(!Mn(d))return this.error=`Invalid {% for %} variable name: "${d}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};if(null!==u&&!Mn(u))return this.error=`Invalid {% for %} key variable name: "${u}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let p=this.parseBody(),h=null;if(this.peek()){let e=this.peek();e&&"tag"===e.type&&"else"===$n(e.content.trim())&&(this.advance(),h=this.parseBody())}let f=this.peek();return f&&"tag"===f.type&&"endfor"===$n(f.content.trim())?this.advance():this.error="Malformed {% for %} block: missing {% endfor %}",{type:"for",valueVar:d,keyVar:u,collection:l,body:p,elseBody:h,source:this.keepEmptyTokens?this.reconstructRange(e,this.pos):void 0}}reconstructRange(e,t){let n="";for(let r=e;r<t;r++)n+=Ln(this.tokens[r]);return n}parseSet(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"set",name:"_unknown",value:{type:"literal",value:""}};let t=e.content.trim(),n=t.slice(t.indexOf(" ")+1).trim(),r=n.indexOf("=");if(-1===r){let e=n.trim(),t=this.parseBody(),r=this.peek();return r&&"tag"===r.type&&this.advance(),{type:"set",name:e,value:t}}let i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return{type:"set",name:i,value:jn(o,this.issues)}}parseApply(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"apply",filters:[],body:[]};let t=e.content.trim(),n=((e,t)=>{let n=new Dn(e,t),r=n.parseApplyChain();return n.expectEnd(),r})(t.slice(t.indexOf(" ")+1).trim(),this.issues),r=this.parseBody(),i=this.peek();return i&&"tag"===i.type&&this.advance(),{type:"apply",filters:n,body:r}}},Un=/* @__PURE__ */new Map,Hn={hits:0,misses:0},Wn=e=>{let t=Un.get(e);if(t)return Hn.hits++,t;Hn.misses++;let n=(e=>{let t=(e=>{let t=[],n=0;for(;n<e.length;){let r,i,o=e.indexOf("{{",n),a=e.indexOf("{%",n);if(-1===o&&-1===a)break;if(-1===o?(r=a,i=!0):-1===a||o<a?(r=o,i=!1):(r=a,i=!0),r>n&&t.push({type:"text",value:e.slice(n,r)}),i||123!==e.charCodeAt(r+2))if(i){let i=e.indexOf("%}",r+2);if(-1===i)return{tokens:t,error:"Unclosed tag"};t.push({type:"tag",content:e.slice(r+2,i)}),n=i+2}else{let i=e.indexOf("}}",r+2);if(-1===i)return{tokens:t,error:"Unclosed double-brace token"};t.push({type:"variable",content:e.slice(r+2,i),raw:!1}),n=i+2}else{let i=e.indexOf("}}}",r+3);if(-1===i)return{tokens:t,error:"Unclosed triple-brace token"};t.push({type:"variable",content:e.slice(r+3,i),raw:!0}),n=i+3}}return n<e.length&&t.push({type:"text",value:e.slice(n)}),{tokens:t,error:null}})(e);if(t.error)return null;let n=t.tokens,{hasTags:r,allSimpleOrDotted:i}=(e=>{let t=!1,n=!0;for(let r=0;r<e.length;r++){let i=e[r];if("tag"===i.type){t=!0;break}if("variable"===i.type&&!Nn(i.content.trim())){n=!1;break}}return{hasTags:t,allSimpleOrDotted:n}})(n),o=null,a=null;if(r||!i){let e=Fn(n,!1);if(e.error)return null;o=e.nodes;let t=Fn(n,!0);t.error||(a=t.nodes)}else{let e=Fn(n,!0);e.error||(a=e.nodes)}return{tokens:n,hasTags:r,allSimpleOrDotted:i,nodes:o,nodesWithSource:a}})(e);return n?((()=>{if(Un.size>=1024){let e=Un.keys().next().value;void 0!==e&&Un.delete(e)}})(),Un.set(e,n),n):null},Vn=(e,t={},n=!1,r=!1)=>{if("string"!=typeof e)return e;try{if(-1===e.indexOf("{%")&&-1===e.indexOf("{{"))return e;let i="variables"in t?pn(t):t,o=Wn(e);if(!o)return e;if(!1===n&&!o.hasTags&&o.allSimpleOrDotted){let e=((e,t)=>{let n="";for(let r of e.tokens)if("text"===r.type)n+=r.value;else if("variable"===r.type){let e=r.content.trim(),i=-1===r.content.indexOf(".")?ln(t,e):cn(t,e);n+=r.raw?null==i?"":String(i):un(i)}return n})(o,i);return r?dn(e):e}let a=((e,t)=>t?e.nodesWithSource:e.nodes)(o,!1!==n);if(!a)return e;let{output:s,variables:l,hasSet:c}=vn(a,i,n);return c&&Object.assign(t,l),!1!==n&&s===e?e:r?dn(s):s}catch{return e}},Gn=e=>{let t=e?.filter(e=>"text"!==e.type||""!==e.value.trim())??[],n=t.at(-1),r=t.slice(0,-1);if("variable"===n?.type&&r.every(e=>"set"===e.type))return{statements:r,expression:n.expression}},Kn=({statements:e,expression:t},n)=>{let r="variables"in n?pn(n):n;if(0===e.length)return wn(t,r);let{variables:i}=vn(e,r);return Object.assign(n,i),wn(t,i)},Yn=(e,t={})=>{if("string"!=typeof e)return e;let n=Wn(e),r=Gn(n?n.nodes??n.nodesWithSource:null);if(!r)return Vn(e,t);try{return Kn(r,t)}catch{return e}},Jn=/* @__PURE__ */new Set(["json_encode","to_json","object_as_json"]),Xn=(e,t={})=>{if("string"!=typeof e)return e;let n=Wn(e),r=Gn(n?n.nodes??n.nodesWithSource:null);if(!r){let n=e.includes('"')?((e,t)=>{let n=Wn(e),r=n?n.nodes??n.nodesWithSource:null;if(r)try{let e="variables"in t?pn(t):t,{output:n,variables:i,hasSet:o}=vn(r,e,!1,!0);if(!(e=>{let t=e.trimStart();return t.startsWith("{")||t.startsWith("[")})(n))return;let a=JSON.parse(n);return o&&Object.assign(t,i),a}catch{return}})(e,t):void 0;if(void 0!==n)return n;let r=Vn(e,t);return"string"==typeof r?(e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}})(r):r}let{expression:i}=r;try{let e=Kn(r,t);if(void 0===e)return"";if("string"==typeof e&&(e=>"filter"===e.type&&Jn.has(e.filters[e.filters.length-1]?.name??""))(i))try{return JSON.parse(e)}catch{return e}return e}catch{return e}},Zn="[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*",Qn=`(?:${Zn}|\\d+)`,er=`\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${Zn}(?:\\.${Qn})*)\\s*\\]`,tr=`${Zn}(?:${er})*(?:\\??\\.${Qn}(?:${er})*)*(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`,nr=`(?:\\{\\{\\{\\s*${tr}\\s*\\}\\}\\}|\\{\\{\\s*${tr}\\s*\\}\\})`,rr=new RegExp(nr,"g"),ir=RegExp(`^${nr}$`),or=(e,t=!1)=>{if("string"!=typeof e)return!1;let n=t?ir:rr;return n.lastIndex=0,n.test(e.trim())},ar=(e,t)=>{if(Array.isArray(e))for(let n of e)ar(n,t);else if("object"==typeof e&&e){if("type"in e&&"path"===e.type&&"segments"in e&&Array.isArray(e.segments)){let n=e.segments.filter(e=>"string"==typeof e);return void(n.length>0&&t.add(n.join(".")))}for(let n of Object.values(e))ar(n,t)}},sr=e=>{let t=Wn(e);if(!t)return[];let n=/* @__PURE__ */new Set;return ar(t.nodes??t.nodesWithSource,n),[...n]},lr=({source:e,transformers:t,when:n})=>{let r=e?[e]:[];for(let{action:i,params:o}of t??[])"twigTemplate"===i&&"string"==typeof o.template&&o.template&&r.push(...sr(o.template).filter(e=>"source"!==e&&!e.startsWith("source.")));return n&&r.push(...cr(n)),r},cr=e=>e.rules.flatMap(e=>"rules"in e?cr(e):[e.field,...e.isBinding&&"string"==typeof e.value?[e.value]:[]]);function ur(e){if("string"==typeof e||"number"==typeof e){let t=String(e);return""===t?null:/^[a-zA-Z0-9_-]+$/.test(t)||/^\d+$/.test(t)?t:null}return null}function dr(e,t=!0){return e?"string"==typeof e?function(e,t){if(!e||e.startsWith(".")||e.endsWith(".")||/[^a-zA-Z0-9_.[\]-]/.test(e)||t&&(/\.\.|(\[\])/g.test(e)||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||/\][^.[]/.test(e)))return[];let n,r=[],i=/([^.[\]]+)|\[(\d+)\]/g;for(;n=i.exec(e);)if(n[1]){if(!t&&""===n[1])continue;let e=ur(n[1]);if(null!==e)r.push(e);else if(t)return[]}else if(n[2]){let e=ur(n[2]);if(null!==e)r.push(e);else if(t)return[]}return r.length?r:[]}(e,t):Array.isArray(e)?function(e,t){if(!Array.isArray(e))return[];let n=[];for(let r of e){let e=ur(r);if(null!==e)n.push(e);else if(t)return[]}return n}(e,t):[]:[]}function pr(e,t,n){if(null==e||!t)return n;let r=dr(t);if(!r.length)return n;let i=e;for(let o of r){if("object"!=typeof i||!i)return n;i=Array.isArray(i)?i[Number(o)]:i[o]}return void 0===i?n:i}function hr(e,t,n){let r=dr(t);if(!r.length)return e;let i=e;for(let a=0;a<r.length-1;a++){let t=r[a],n=r[a+1];if("object"!=typeof i||!i)return e;let o=i;(null==o[t]||"object"!=typeof o[t])&&(o[t]=/^\d+$/.test(n)?[]:{}),i=o[t]}let o=r[r.length-1];return"object"==typeof i&&i&&(i[o]=n),e}function fr(e,t){let n={},r=Array.isArray(t)?t:[t];for(let i of r){let t=pr(e,i);void 0!==t&&hr(n,i,t)}return n}function mr(e,t=/* @__PURE__ */new WeakMap){if("object"!=typeof e||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let n=/* @__PURE__ */new Map;return t.set(e,n),e.forEach((e,r)=>n.set(r,mr(e,t))),n}if(e instanceof Set){let n=/* @__PURE__ */new Set;return t.set(e,n),e.forEach(e=>n.add(mr(e,t))),n}if(ArrayBuffer.isView(e)){if(e instanceof DataView){let n=new DataView(mr(e.buffer,t),e.byteOffset,e.byteLength);return t.set(e,n),n}let n=new(0,e.constructor)(e.buffer.slice(0),e.byteOffset,e.length);return t.set(e,n),n}if(e instanceof ArrayBuffer){let n=e.slice(0);return t.set(e,n),n}if(Array.isArray(e)){let n=[];return t.set(e,n),e.forEach((e,r)=>n[r]=mr(e,t)),n}let n=Object.getPrototypeOf(e),r=Object.create(n);t.set(e,r);for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=mr(e[i],t));return r}var gr=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),e);function yr(e,t){let n=dr(t),r=Array.isArray(e)?[...e]:gr(e);if(!n.length)return r;let i=e,o=r;for(let a=0;a<n.length;a++){let e=n[a],t=i?.[e];if(!t||"object"!=typeof t){o[e]=t;break}let r=Array.isArray(t)?[...t]:gr(t);o[e]=r,i=t,o=r}return r}function br(e,t){if(null===e)return!1;let n=dr(t),r=e;for(let i of n){if(null==r||!(i in r))return!1;r=r[i]}return!0}function vr(e,t){let n=Array.isArray(t)?t:t?[t]:[];if(0===n.length)return{...e};let r=[],i=[];for(let a of n){let e=dr(a);0!==e.length&&(1===e.length?r.push(e[0]):i.push(a))}let o=e;if(r.length){let e;for(let t of r)Object.prototype.hasOwnProperty.call(o,t)&&(e??=gr(o),delete e[t]);e&&(o=e)}for(let a of i){let e=dr(a);if(!br(o,a))continue;let t=yr(o,a),n=t;for(let r=0;r<e.length-1&&n&&"object"==typeof n;r++)n=n[e[r]];if(n&&"object"==typeof n){let t=e[e.length-1];Object.prototype.hasOwnProperty.call(n,t)&&delete n[t]}o=t}return o}function wr(e,t=0,n={}){let r,i,o,a,s,l=0,c=n.leading??!1,u=n.trailing??!0,d=n.maxWait,p=()=>Date.now();function h(t){if(!r)return o;l=t;let n=r,a=i;return r=void 0,i=void 0,o=e.apply(a,n),o}function f(e){a=setTimeout(g,e)}function m(e){if(void 0===s)return!0;let n=e-s;return n>=t||n<0||void 0!==d&&e-l>=d}function g(){let e=p();if(m(e))return b(e);f(function(e){let n=e-l,r=t-(e-(s??0));return void 0===d?r:Math.min(r,d-n)}(e))}function y(e){return l=e,f(t),c?h(e):o}function b(e){return a=void 0,u&&r?h(e):(r=i=void 0,o)}function v(...e){let n=p(),l=m(n);if(r=e,i=this,s=n,l){if(!a)return y(n);if(void 0!==d)return clearTimeout(a),f(t),h(n)}return a||f(t),o}return v.cancel=()=>{void 0!==a&&clearTimeout(a),l=0,r=s=i=a=void 0},v.flush=()=>void 0===a?o:b(p()),v.pending=()=>void 0!==a,v}function kr(e,t=0,n={}){return wr(e,t,{leading:n.leading??!0,trailing:n.trailing??!0,maxWait:t})}var xr=/* @__PURE__ */$({cva:()=>Cr,cx:()=>Tr}),Sr=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Tr=V,Cr=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return Tr(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(e=>{const t=null==n?void 0:n[e],r=null==o?void 0:o[e];if(null===t)return null;const a=Sr(t)||Sr(r);return i[e][a]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...s}[t]):{...o,...s}[t]===n})?[...e,n,r]:e},[]);return Tr(e,a,l,null==n?void 0:n.class,null==n?void 0:n.className)},{cva:Er}=xr,Ar=(Math.pow(10,8),6048e5),Ir=36e5,Or=Symbol.for("constructDateFrom");function _r(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&Or in e?e[Or](t):e instanceof Date?new e.constructor(t):new Date(t)}function Nr(e,t){return _r(t||e,e)}function Mr(e,t){const n=()=>_r(t?.in,NaN),r=t?.additionalDigits??2,i=function(e){const t={},n=e.split(Pr.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Pr.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Pr.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const e=Pr.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let o;if(i.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:null===o?i:100*o,restDateString:e.slice((r[1]||r[2]).length)}}(i.date,r);o=function(e,t){if(null===t)/* @__PURE__ */return new Date(NaN);const n=e.match(Lr);if(!n)/* @__PURE__ */return new Date(NaN);const r=!!n[4],i=zr(n[1]),o=zr(n[2])-1,a=zr(n[3]),s=zr(n[4]),l=zr(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){const r=/* @__PURE__ */new Date(0);r.setUTCFullYear(e,0,4);const i=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}(t,s,l):/* @__PURE__ */new Date(NaN);{const e=/* @__PURE__ */new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=($r[t]||(Fr(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(Fr(e)?366:365)}(t,i)?(e.setUTCFullYear(t,o,Math.max(i,a)),e):/* @__PURE__ */new Date(NaN)}}(e.restDateString,e.year)}if(!o||isNaN(+o))return n();const a=+o;let s,l=0;if(i.time&&(l=function(e){const t=e.match(Rr);if(!t)return NaN;const n=Dr(t[1]),r=Dr(t[2]),i=Dr(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,i)?n*Ir+6e4*r+1e3*i:NaN}(i.time),isNaN(l)))return n();if(!i.timezone){const e=new Date(a+l),n=Nr(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return s=function(e){if("Z"===e)return 0;const t=e.match(jr);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,i)?n*(r*Ir+6e4*i):NaN}(i.timezone),isNaN(s)?n():Nr(a+l+s,t?.in)}var Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Rr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,jr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function zr(e){return e?parseInt(e):1}function Dr(e){return e&&parseFloat(e.replace(",","."))||0}var $r=[31,null,31,30,31,30,31,31,30,31,30,31];function Fr(e){return e%400==0||e%4==0&&e%100!=0}var qr=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?Mr(e):e,Math.floor((n=t,+Nr(n)/1e3)).toString();var n},Br=e=>{if("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let[t,n,r]=e.split("-").map(Number),i=/* @__PURE__ */new Date(0);return i.setFullYear(t,n-1,r),i.getFullYear()===t&&i.getMonth()===n-1&&i.getDate()===r},Ur={},Hr=/* @__PURE__ */new Map,Wr=K("ComponentContext",{}),Vr={};Object.freeze(Vr);var Gr=(e,t="",n=".",r=!1)=>e&&"object"==typeof e?Object.keys(e).reduce((i,o)=>{o=o.replaceAll(n,"").replaceAll(".","");let a=`${t}${t?n:""}${o}`;return"object"!=typeof e[o]||Array.isArray(e[o])&&(r||e[o].length>5)?[...i,a]:[...i,a,...Gr(e[o],a,n,r)]},[]):[],Kr=({url:e="",type:t,internalProps:n,autoRegister:r=!0,plitziJsxSkipHOC:i=!1,plitziJsxProps:o=Vr})=>{let{register:s}=h(Wr),[l,c]=S(!1);g(()=>c(!0),[]);let u=k(()=>d(((e,t,n=!0,r=!1,i)=>async()=>{if(!Hr.get(e)){let t=(async e=>{try{let t=await fetch(e),n=new Blob([await t.text()],{type:"text/javascript"});return await(import(
18
18
  /* @vite-ignore */
19
19
  /* webpackIgnore: true */
20
- URL.createObjectURL(n)))}catch(e){return void console.error(e)}})(e).finally(()=>{Hr.delete(e)});Hr.set(e,{promise:t,timestamp:Date.now()})}let o=await(Hr.get(e)?.promise),[{default:a},{default:s},{nestedInject:l}]=await Promise.all([Promise.resolve().then(()=>Gu),Promise.resolve().then(()=>sE),Promise.resolve().then(()=>PN)]);if(!o)return{default:s};let{type:c,pluginSettings:u}=pr(o,"default",{}),{version:d,initialItems:p,plugins:h}=o;if(!c)return{default:s};let f=o.default;return r||(f=a(o.default)),f.version=d,f.origin="remote",f.type=c,f.initialItems=p,f.pluginSettings=u,f.plugins=l(h,"remote"),n&&t(f),i&&i!==c?{default:(r?h?.[i]:f.plugins[i])??s}:{default:f}})(e,s,r,i,t)),[e,t]);return l?/* @__PURE__ */I(a,i?{children:/* @__PURE__ */I(u,{internalProps:n,plitziJsxSkipHOC:i,...o})}:{children:/* @__PURE__ */I(u,{internalProps:n})}):null},Yr=({type:e,plugins:t})=>{let n=(e?t[e]:void 0)??((e,t)=>Object.values(e).find(e=>e.subPlugins.find(e=>e===t)))(t,e);if(!n)return;let r=pr(n,"assets",[]).filter(e=>"script"===e.type);return{url:r.find(e=>e.isMain)?.params.src??pr(r,"0.params.src","")}},Jr=({key:e,plitziElementLayout:t,type:n,internalProps:r,components:i,plugins:o})=>{let a={...r,plitziElementLayout:t},s=i.notFound?/* @__PURE__ */I(i.notFound,{internalProps:a},e):void 0;if(!n)return s;let l=i[n];if(l)/* @__PURE__ */return I(l,{internalProps:a,extraProps:l.extraProps},e);let c=Yr({type:n,plugins:o});return c?/* @__PURE__ */I(Kr,{url:c.url,type:n,internalProps:a},e):s},Xr=K("LayoutBodyContext",void 0),Zr=()=>{},Qr=({bodies:e,children:t})=>{let[n]=S(()=>({current:e,listeners:/* @__PURE__ */new Set}));return w(()=>{n.current!==e&&(n.current=e,n.listeners.forEach(e=>e()))},[e,n]),/* @__PURE__ */I(Xr,{value:n,children:t})},ei=e=>{let t={};for(let n of e.split(";")){let e=n.indexOf(":");if(-1===e)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();if(r&&i){let e=r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());t[e]=i}}return t},ti=({id:e,frozen:t,children:n})=>{let[r]=S(()=>{if(!t||typeof document>"u")return null;let n=document.querySelector(`[data-rsc-id="${e}"]`);if(!n)return null;let r={};for(let e=0;e<n.attributes.length;e++){let{name:t,value:i}=n.attributes[e];"class"!==t&&"style"!==t&&"data-rsc-id"!==t&&(r[t]=i)}let i=n.getAttribute("style");return{tag:n.tagName.toLowerCase(),className:n.className,style:i?ei(i):void 0,attrs:r,html:n.innerHTML}});return r&&t?c(r.tag,{"data-rsc-id":e,className:r.className||void 0,style:r.style,...r.attrs,dangerouslySetInnerHTML:{__html:r.html}}):n},ni="[A-Za-z_][A-Za-z0-9_]*",ri=RegExp(`^${ni}$`),ii=(/* @__PURE__ */RegExp(`^!?${ni}$`),new Set(["__proto__","constructor","prototype"])),oi=e=>ri.test(e)&&!ii.has(e),ai=(e,t)=>{if(e)for(let n of e.split(";")){let e=n.indexOf("=");if(e>-1&&n.slice(0,e).trim()===t)try{return decodeURIComponent(n.slice(e+1).trim())}catch{return}}},si=()=>{try{return typeof document>"u"?void 0:document.cookie}catch{return}},li=e=>{let t=e?.split(":")[1];return t?`plitzi_flags_${t}`:"plitzi_flags"},ci=(e,t,n)=>{let{[t]:r,...i}=e;return void 0===n?i:{...i,[t]:n}},ui=(e,t)=>{let n=li(e),r=(e=>Object.entries(e).filter(([e])=>oi(e)).map(([e,t])=>`${e}:${t?"1":"0"}`).join(","))(t);try{document.cookie=r?`${n}=${encodeURIComponent(r)};path=/;SameSite=Lax`:`${n}=;path=/;max-age=0;SameSite=Lax`}catch{}},di=e=>"number"==typeof e||"string"==typeof e&&!e.includes(",")&&!Number.isNaN(parseFloat(e)),pi=e=>{if(!e||"object"!=typeof e)return;let{combinator:t,enabled:n}=e,{rules:r}=e;return Array.isArray(r)?(r=r.map(e=>{if((e=>"rules"in e)(e))return pi(e);let{field:t,value:n,operator:r,enabled:i,isBinding:o}=e;return{field:t,value:n,operator:r,enabled:i,isBinding:o}}).filter(Boolean),{rules:r,combinator:t,enabled:n}):void 0},hi=(e,t="json")=>pi(e),fi=(e,t)=>"boolean"==typeof e&&"string"==typeof t?e===(t="true"===(t=t.toLowerCase())||"1"===t):"string"==typeof e&&"boolean"==typeof t?(e="true"===(e=e.toLowerCase())||"1"===e)===t:("number"==typeof e&&(e=`${e}`),"number"==typeof t&&(t=`${t}`),e===t),mi=(e,t)=>null!=e&&null!=t&&(Br(e)&&Br(t)?(e=qr(e),t=qr(t),parseFloat(t)>parseFloat(e)):di(e)?(e=parseFloat(e),t=parseFloat(t),di(t)&&t>e):t>e),gi=(e,t)=>mi(e,t)||fi(e,t),yi=(e,t)=>null!=e&&null!=t&&(Br(e)&&Br(t)?(e=qr(e),t=qr(t),parseFloat(t)<parseFloat(e)):di(e)?(e=parseFloat(e),t=parseFloat(t),di(t)&&t<e):t<e),bi=(e,t)=>yi(e,t)||fi(e,t),vi=(e,t)=>Array.isArray(t)?t.some(t=>fi(e,t)):"string"==typeof e&&"string"==typeof t&&t.toLowerCase().includes(e.toLowerCase()),wi=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().startsWith(e.toLowerCase()),ki=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().endsWith(e.toLowerCase()),xi=e=>{switch(typeof e){case"boolean":case"number":case"function":return!1;case"object":case"undefined":return null==e||0===Object.keys(e).length;default:return!e}},Si=(e,t)=>("string"==typeof e&&e.includes(",")?e=e.split(",").map(e=>e.trim()):("string"==typeof e||"number"==typeof e)&&(e=[e]),!!Array.isArray(e)&&("string"==typeof t&&t.includes(",")&&(t=t.split(",").map(e=>e.trim())),Array.isArray(t)?t.some(t=>di(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t)):di(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t))),Ti=(e,t)=>{let n=[];return"string"==typeof e&&(n=e.split(",").map(e=>e.trim())),!(n.length<2)&&gi(n[0],t)&&bi(n[1],t)},Ci=(e,t={},n=!1,r=!1)=>{if(!e)return r;let{combinator:i,rules:o,enabled:a}=e;if(!Array.isArray(o))return r;if(!1===a)return!0;let s=o.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ci(e,t,n):((e,t)=>{let{field:n,operator:r,isBinding:i}=e,{value:o}=e,a=pr(t,n);switch(i&&(o=pr(t,e.value)),r){case"=":return fi(o,a);case"!=":return!fi(o,a);case"<":return yi(o,a);case">":return mi(o,a);case"<=":return bi(o,a);case">=":return gi(o,a);case"contains":return vi(o,a);case"doesNotContain":return!vi(o,a);case"beginsWith":return wi(o,a);case"doesNotBeginWith":return!wi(o,a);case"endsWith":return ki(o,a);case"doesNotEndWith":return!ki(o,a);case"empty":return xi(a);case"notEmpty":return!xi(a);case"in":return Si(o,a);case"notIn":return!Si(o,a);case"between":return Ti(o,a);case"notBetween":return!Ti(o,a);default:return!1}})(e,t));return n?s:"and"===i?!s.includes(!1):s.includes(!0)},Ei=(e,t={},n=!1,r=!1)=>Ci(hi(e),t,n,r),Ai=(e,t,n,r=!1)=>{let{rules:i,enabled:o}=e;if(!Array.isArray(i)||!1===o)return{};let a=i.filter(e=>!1!==e.enabled).flatMap(e=>"rules"in e?Ai(e,t,n,!0):e);return r?a:a.reduce((e,r)=>{let{field:i,isBinding:o,value:a}=r;return o&&hr(e,a,pr(t,a,n)),hr(e,i,pr(t,i,n)),e},{})},Ii=(e,t={},n=void 0)=>Ai(hi(e),t,n),Oi=["server","sdk","qa"],_i=(e,t)=>{let n=((e,t)=>Array.isArray(e.rules)?e.rules.findIndex(e=>(e=>"object"==typeof e&&!!e&&"rules"in e&&Array.isArray(e.rules)&&e.rules.some(e=>!("object"!=typeof e||!e||"enabled"in e&&!1===e.enabled)))(e.when)&&((e,t)=>!!Ei(e,t))(e.when,t)):-1)(e,t);return-1===n?{value:e.value,layer:"space"}:{value:e.rules[n].value,layer:"space",rule:n}},Ni=(e,t={},n={})=>Object.fromEntries(Object.entries(e??{}).map(([e,r])=>[e,Oi.reduce((t,r)=>{let i=n[r]?.[e];return"boolean"==typeof i?{value:i,layer:r}:t},_i(r,t))])),Mi=e=>Object.fromEntries(Object.entries(e).map(([e,{value:t}])=>[e,t])),Pi=(e,t)=>!e||(t[e.name]??!1)===e.is,Li=K("PluginsContext",{assets:{}}),Ri=typeof window>"u",ji={},zi=()=>()=>{},Di=()=>!0,$i=()=>!1,Fi=({id:e,definition:t,plitziElementLayout:n,children:r,previewMode:o,visible:a=!0})=>{let[[s,l]]=Dt(["schema.flat","rsc.enabled"],{mode:"mount"}),[c=ji]=Dt("runtime.sources.flags"),{components:d,componentDefinitions:p}=h(Wr),{plugins:m}=h(Li),{items:g}=t,y=p.current[t.type],b=t.loadStrategy??y?.definition.loadStrategy??"eager",v=n||r||g?.length,w=x(!1);a&&(w.current=!0);let S=!o||"eager"===b||a||"lazy"===b&&w.current,C=n?`${n.type}:${n.rootId}:${n.slots.join(",")}`:"",E=T(zi,Di,$i),A=n?.slots.includes(e)??!1,O=(e=>{let t=h(Xr),n=f(n=>void 0!==e&&t?(t.listeners.add(n),()=>{t.listeners.delete(n)}):Zr,[e,t]),r=f(()=>void 0!==e&&t?t.current[e]:void 0,[e,t]);return T(n,r,r)})(A?e:void 0);return k(()=>{if(!v||!S)return;let e=(g??[]).filter(e=>{let t=s[e];if(!t||!Pi(t.definition.flag,c))return!1;if(!o||!l)return!0;let n=t.definition.runtime??"shared";return!(!E&&"client"===n)}).map(e=>{let{rootId:t,type:r,runtime:i}=pr(s,`${e}.definition`,{}),a=pr(n,"rootId",t),c=r in d.current||!!Yr({type:r,plugins:m}),u=Jr({key:!o&&n?`${e}_${C}`:e,plitziElementLayout:n,type:r,internalProps:{id:e,rootId:a},components:d.current,plugins:m});return l&&"server"===i&&!Ri&&o?/* @__PURE__ */I(ti,{id:e,frozen:!(E&&c),children:u},e):u});return A&&e.push(/* @__PURE__ */I(i,{children:O},"#layout-body")),Array.isArray(r)?e.push(...r.filter(u)):u(r)&&e.push(/* @__PURE__ */I(i,{children:r},"#children")),g?1===e.length?e[0]:e:void 0},[v,S,g,c,n,r,s,o,l,E,C,d,m,A,O])},qi=U()({type:"blockHtml",content:{attributes:{content:""},definition:{label:"HTML Block",description:"Renders an arbitrary raw HTML string as a block. Escape hatch when no structured element fits."},market:{category:"advanced",icon:"fa-brands fa-html5"},defaultStyle:{style:{base:{default:{}}}}}}),Bi=U()({type:"blockJsx",content:{attributes:{content:'import { useCallback } from "react";\nimport { JsxManager } from "@plitzi/plitzi-sdk";\n\nconst BlockJsx = ({ internalProps, content, content2 }) => {\n const handleClick = useCallback(() => {\n alert("Hello World");\n }, []);\n\n return (\n <div style={{ display: "flex", gap: "4px" }}>\n <JsxManager\n as="Heading"\n internalProps={internalProps}\n content={`${content} ${content2}`}\n />\n <button onClick={handleClick} style={{ border: "1px gray solid", cursor: "pointer" }}>\n Click Me\n </button>\n </div>\n );\n};\n\nexport default BlockJsx;',props:'{"content": "Hello", "content2": "World"}',contentCache:"aW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnOwppbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gInJlYWN0IjsKaW1wb3J0IHsgSnN4TWFuYWdlciB9IGZyb20gIkBwbGl0emkvcGxpdHppLXNkayI7CnZhciBCbG9ja0pzeCA9IGZ1bmN0aW9uIEJsb2NrSnN4KF9yZWYpIHsKICB2YXIgaW50ZXJuYWxQcm9wcyA9IF9yZWYuaW50ZXJuYWxQcm9wcywKICAgIGNvbnRlbnQgPSBfcmVmLmNvbnRlbnQsCiAgICBjb250ZW50MiA9IF9yZWYuY29udGVudDI7CiAgdmFyIGhhbmRsZUNsaWNrID0gdXNlQ2FsbGJhY2soZnVuY3Rpb24gKCkgewogICAgYWxlcnQoIkhlbGxvIFdvcmxkIik7CiAgfSwgW10pOwogIHJldHVybiAvKiNfX1BVUkVfXyovUmVhY3QuY3JlYXRlRWxlbWVudCgiZGl2IiwgewogICAgc3R5bGU6IHsKICAgICAgZGlzcGxheTogImZsZXgiLAogICAgICBnYXA6ICI0cHgiCiAgICB9CiAgfSwgLyojX19QVVJFX18qL1JlYWN0LmNyZWF0ZUVsZW1lbnQoSnN4TWFuYWdlciwgewogICAgYXM6ICJIZWFkaW5nIiwKICAgIGludGVybmFsUHJvcHM6IGludGVybmFsUHJvcHMsCiAgICBjb250ZW50OiAiIi5jb25jYXQoY29udGVudCwgIiAiKS5jb25jYXQoY29udGVudDIpCiAgfSksIC8qI19fUFVSRV9fKi9SZWFjdC5jcmVhdGVFbGVtZW50KCJidXR0b24iLCB7CiAgICBvbkNsaWNrOiBoYW5kbGVDbGljaywKICAgIHN0eWxlOiB7CiAgICAgIGJvcmRlcjogIjFweCBncmF5IHNvbGlkIiwKICAgICAgY3Vyc29yOiAncG9pbnRlcicKICAgIH0KICB9LCAiQ2xpY2sgTWUiKSk7Cn07CmV4cG9ydCBkZWZhdWx0IEJsb2NrSnN4Ow==",allowEmptyRender:!1},definition:{label:"Block JSX",description:"A compiled JSX block for advanced authoring."},market:{category:"advanced",icon:"fa-solid fa-code"},defaultStyle:{style:{base:{default:{}}}}}}),Ui=U()({type:"custom",content:{attributes:{renderType:"",settings:"{}",isPlugin:!1,assets:"",scriptUrl:""},definition:{label:"Custom",description:"A custom element slot whose behaviour is supplied by a host/plugin component."},market:{category:"advanced",icon:"fa-solid fa-paintbrush"},defaultStyle:{name:"Custom Element",style:{base:{default:{display:"flex","justify-content":"center","align-items":"center"}}}}}}),Hi=U()({type:"nodeHtml",content:{attributes:{subType:"div"},definition:{label:"Html Node",description:"A single raw HTML tag with custom attributes.",items:[]},market:{category:"advanced",icon:"fa-brands fa-html5"},defaultStyle:{style:{base:{default:{}}},subTypes:{hr:{name:"HR Node",displayMode:"desktop",style:{base:{default:{"border-top-width":"1px"}}}}}}}}),Wi=U()({type:"reference",content:{attributes:{referenceType:"element",referenceId:""},definition:{label:"Reference",description:"Places one of the components of the space, or renders another of its elements by id, in place.",items:[]},market:{category:"advanced",icon:"fa-solid fa-asterisk"},defaultStyle:{name:"Reference Element",style:{base:{default:{}}}}}}),Vi={"padding-top":"6px","padding-left":"12px","padding-right":"12px","padding-bottom":"6px",cursor:"pointer","font-size":"16px","line-height":"1.5","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px"},Gi=U()({type:"button",attributeValues:{subType:["button","submit","reset"],contentPlacement:["before","after"],iconPlacement:["before","after"]},content:{attributes:{contentPlacement:"after",content:"Button",icon:"",iconPlacement:"before",subType:"button",disabled:!1},definition:{label:"Button",description:"A clickable button. On its own it only renders; wire an interaction flow (trigger onClick → callbacks) to make it DO something. Its words are its `content` and an icon beside them its `icon` (Font Awesome classes) — no text or fontAwesome element inside it for them.",items:[],styleSelectors:{icon:""}},market:{category:"basic",icon:"fa-solid fa-hand-pointer"},defaultStyle:{style:{base:{default:Vi}},subTypes:{button:{name:"Default Button",displayMode:"desktop",style:{base:{default:Vi}}},reset:{name:"Reset Button",displayMode:"desktop",style:{base:{default:Vi}}},submit:{name:"Submit Button",displayMode:"desktop",style:{base:{default:Vi}}}}}}}),Ki=U()({type:"dropdown",attributeValues:{popupPlacement:["left","right","top","bottom"]},content:{attributes:{popupPlacement:"bottom",openPopup:!1,backgroundDisabled:!1,closeOnClickBackground:!0,closeOnClickPopup:!0,containerTopOffset:5,containerLeftOffset:5,disabled:!1},definition:{label:"Dropdown",description:"A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.",items:[],styleSelectors:{backgroundContainer:""}},market:{category:"basic",icon:"fa-solid fa-angle-down"},defaultStyle:{style:{base:{default:{cursor:"pointer","user-select":"none"}},backgroundContainer:{default:{top:0,bottom:0,left:0,right:0,position:"fixed",cursor:"default","z-index":50}}}}},initialItems:["dropdownPopup"]}),Yi=U()({type:"dropdownPopup",ancestorType:"dropdown",content:{attributes:{},definition:{label:"Dropdown Popup",description:"The floating panel revealed by a dropdown.",items:[],initialState:{}},builder:{canDelete:!1,canDragDrop:!1,canMove:!1,canSnippet:!1},market:{category:"basic",icon:"fa-regular fa-window-restore"},defaultStyle:{style:{base:{default:{"background-color":"light-dark(white, oklch(0.21 0.006 285.885))","min-height":"24px","min-width":"24px","padding-right":"4px","padding-bottom":"4px","padding-left":"4px","padding-top":"4px",position:"fixed",display:"flex","flex-direction":"column","border-top-right-radius":"4px","border-bottom-right-radius":"4px","border-bottom-left-radius":"4px","border-top-left-radius":"4px","box-shadow":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 4px 11px","z-index":100}}},subTypes:{}}},initialItems:[]}),Ji=U()({type:"heading",attributeValues:{subType:["h1","h2","h3","h4","h5","h6"]},content:{attributes:{content:"Heading",subType:"h1"},definition:{label:"Heading",description:"A section heading (<h1>–<h6>) for titles and document hierarchy."},market:{category:"basic",icon:"fa-solid fa-heading"},defaultStyle:{style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-weight":700}}},subTypes:{h1:{name:"H1 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"38px","font-weight":700,"line-height":"1.158"}}}},h2:{name:"H2 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"32px","font-weight":700,"line-height":"1.125"}}}},h3:{name:"H3 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"24px","font-weight":700,"line-height":"1.25"}}}},h4:{name:"H4 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"18px","font-weight":700,"line-height":"1.333"}}}},h5:{name:"H5 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"14px","font-weight":700,"line-height":"1.429"}}}},h6:{name:"H6 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"12px","font-weight":700,"line-height":"1.5"}}}}}}}}),Xi=U()({type:"link",attributeValues:{mode:["page","internal","external"],target:["self","blank","parent","top"],contentPlacement:["before","after"],iconPlacement:["before","after"],current:["page","section"]},content:{attributes:{href:"#",target:"self",mode:"page",hash:"",label:"",content:"",contentPlacement:"after",icon:"",iconPlacement:"before",current:"page"},definition:{label:"Link",description:"Navigation. Moves the user between pages of the site or to an external URL (its `mode`/`href` decide which). Use this to go page-to-page rather than a button + interaction. Its words are its own `content` and an icon beside them its `icon` (Font Awesome classes) — no text or fontAwesome element inside it for them. It marks itself current on the page it leads to (`aria-current`, the `current` style state); its `current` set to `section` keeps it current on every page under its path too — a menu entry for a section and its pages.",items:[],styleSelectors:{icon:""}},builder:{itemsNotAllowed:["link"]},market:{category:"basic",icon:"fa-solid fa-link"},defaultStyle:{style:{base:{default:{display:"inline-block",color:"inherit","text-decoration":"none",cursor:"pointer"}}}}}}),Zi=U()({type:"markdown",content:{attributes:{content:"Markdown",headingLinks:!0},definition:{label:"Markdown",description:"Renders a Markdown source string (GitHub-flavoured) as HTML, inside a `div.markdown`. Each part of it takes a class through the slot named for it: `heading` (every `h1`–`h6`) and `heading1`…`heading6` (that level only, beside it — a property goes on one of the two, never both), `paragraph`, `link`, `strong`, `emphasis` (`em`), `list` (`ul`/`ol`), `listItem`, `quote` (`blockquote`), `divider` (`hr`), `code` (inline), `image`, `table`, `tableHead` (`thead`), `tableRow`, `tableHeaderCell` (`th`) and `tableCell` (`td`). A fenced block is `codeBlock` (its `pre`) in `codeBlockFrame`, under `codeBlockHeader`, which holds `codeBlockLanguage` and the `codeBlockCopy` button. Every heading carries an id made of its words, which `/page#its-words` lands on, and starts with an empty link to itself — `a.anchor > span.octicon-link`, the `anchor` slot; `headingLinks: false` leaves the link out and keeps the id. Unstyled, it reads as a document — headings, lists, code, tables — from the base layer of the SDK, which a class on the slot of a part replaces property by property.",styleSelectors:{heading:"",heading1:"",heading2:"",heading3:"",heading4:"",heading5:"",heading6:"",paragraph:"",link:"",strong:"",emphasis:"",list:"",listItem:"",quote:"",divider:"",code:"",codeBlock:"",codeBlockFrame:"",codeBlockHeader:"",codeBlockLanguage:"",codeBlockCopy:"",image:"",table:"",tableHead:"",tableRow:"",tableHeaderCell:"",tableCell:"",anchor:""}},market:{category:"basic",icon:"fa-brands fa-markdown"},defaultStyle:{style:{base:{default:{}}}}}}),Qi=U()({type:"paragraph",content:{attributes:{content:"Paragraph"},definition:{label:"Paragraph",description:"A block of body text (a <p>). Use for longer prose passages."},market:{category:"basic",icon:"fa-solid fa-paragraph"},defaultStyle:{style:{base:{default:{"margin-top":"14px","margin-bottom":"14px"}}}}}}),eo=U()({type:"richText",attributeValues:{format:["html","markdown","text"]},content:{attributes:{content:"",format:"html",mediaBaseUrl:""},definition:{label:"Rich Text",description:"Renders a body field coming from a CMS — HTML, markdown or plain text. Scripts and event handlers are stripped before rendering, so third-party content cannot execute. The parts of an HTML or markdown body take a class through the slots a `markdown` has, by the same names: `heading` and `heading1`…`heading6` (a property on one of the two, never both), `paragraph`, `link`, `strong` (`strong`/`b`), `emphasis` (`em`/`i`), `list`, `listItem`, `quote`, `divider`, `code` (inline), `codeBlock` (`pre`), `image`, `table`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`; the fenced block of a markdown body also sits in `codeBlockFrame`, under `codeBlockHeader` with `codeBlockLanguage` and `codeBlockCopy`. Unstyled, a body reads as a document from the base layer of the SDK, which a class on the slot of a part replaces property by property.",items:[],styleSelectors:{heading:"",heading1:"",heading2:"",heading3:"",heading4:"",heading5:"",heading6:"",paragraph:"",link:"",strong:"",emphasis:"",list:"",listItem:"",quote:"",divider:"",code:"",codeBlock:"",codeBlockFrame:"",codeBlockHeader:"",codeBlockLanguage:"",codeBlockCopy:"",image:"",table:"",tableHead:"",tableRow:"",tableHeaderCell:"",tableCell:""}},market:{category:"basic",icon:"fa-solid fa-file-lines"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),to=U()({type:"text",content:{attributes:{content:"Text"},definition:{label:"Text",description:"Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text."},market:{category:"basic",icon:"fa-solid fa-align-left"},defaultStyle:{style:{base:{default:{display:"inline"}}}}}}),no={"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",display:"inline-flex","align-items":"center","background-color":"transparent",color:"inherit","font-family":"inherit","font-size":"inherit","font-style":"inherit","font-weight":"inherit","line-height":"inherit","letter-spacing":"inherit",cursor:"pointer"},ro=U()({type:"themeToggle",attributeValues:{subType:["switch","segmented"]},triggers:{onThemeChange:{action:"onThemeChange",title:"On Theme Change",type:"trigger",params:{},preview:{theme:"dark"}}},content:{attributes:{subType:"switch",lightLabel:"Light",darkLabel:"Dark",systemLabel:"System",showSystem:!1},definition:{label:"Theme Toggle",description:"Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: its buttons carry no browser look and take the colour and type around them — style them with the space own classes. A `segmented` one marks the chosen option with `aria-pressed`, which is the `current` state of its `option` slot. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that. A `switch` marks the icon of the scheme in use — the one chosen, or the machine one while none is — with `aria-current`, the `current` state of its `icon` slot.",items:[],styleSelectors:{icon:"",option:""}},market:{category:"basic",icon:"fa-solid fa-circle-half-stroke"},defaultStyle:{style:{base:{default:no},icon:{default:{}},option:{default:{...no,"row-gap":"4px","column-gap":"4px"}}},subTypes:{}}}}),io=U()({type:"form",attributeValues:{method:["get","post"]},sourceType:"apiContainer",triggers:{onSubmit:{action:"onSubmit",title:"On Form Submit",type:"trigger",params:{},preview:{values:{},actionUrl:"",method:""}}},callbacks:{performReset:{action:"performReset",title:"Reset Form",type:"callback",params:{}},setFieldValue:{action:"setFieldValue",title:"Set Field Value",type:"callback",preview:{},params:{name:{label:"Field Name",defaultValue:void 0,type:"select",options:[]},value:{type:"text",defaultValue:""}}},setFieldError:{action:"setFieldError",title:"Set Field Error",type:"callback",preview:{},params:{name:{label:"Field Name",defaultValue:void 0,type:"select",options:[]},error:{type:"text",defaultValue:""}}}},content:{attributes:{method:"get",actionUrl:"",managedByInteractions:!1,noValidate:!1,errors:{},values:{}},definition:{label:"Form",description:"A <form> that groups form controls and handles submission; wire its submit through an interaction flow.",items:[]},market:{category:"form",icon:"fa-solid fa-rectangle-list"},defaultStyle:{style:{base:{default:{}}}}}}),oo={width:"100%",display:"flex","align-items":"center","border-right-color":"#6f7780","border-right-style":"solid","border-right-width":"1px","border-top-right-radius":"4px","border-bottom-color":"#6f7780","border-bottom-style":"solid","border-bottom-width":"1px","border-bottom-right-radius":"4px","border-bottom-left-radius":"4px","border-top-left-radius":"4px","border-left-color":"#6f7780","border-left-style":"solid","border-left-width":"1px","border-top-color":"#6f7780","border-top-style":"solid","border-top-width":"1px","user-select":"none","font-size":"14px","padding-left":"16px","padding-right":"16px","padding-top":"8px","padding-bottom":"8px",outline:"none",position:"relative"},ao={...oo,"line-height":"20px"},so={display:"flex",cursor:"pointer","font-weight":"600","font-size":"14px","line-height":"18px",color:"#6b7280","user-select":"none"},lo={...so,"margin-bottom":"4px"},co={display:"block",color:"red","margin-top":"4px"},uo={color:"red","margin-left":"4px"},po={"border-top-style":"none","border-right-style":"none","border-bottom-style":"none","border-left-style":"none"},ho={height:"100%",width:"100%","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",display:"block",...po,"background-color":"transparent",color:"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit","box-shadow":"none"},fo={height:"100%",width:"100%","padding-right":"calc(1.15em + 8px)",display:"block",...po,"background-color":"transparent",color:"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit",appearance:"none",cursor:"inherit","box-shadow":"none"},mo={height:"100%","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","padding-right":"4px","padding-left":"4px",display:"flex","justify-content":"center","align-items":"center",...po,"background-color":"transparent",color:"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit","font-weight":"inherit",cursor:"pointer"},go={...oo,cursor:"pointer"},yo=(e,t,{field:n,icon:r}={})=>({name:e,displayMode:"desktop",style:{base:{default:{}},input:{default:t},...n?{field:{default:n}}:{},...r?{icon:{default:r}}:{},label:{default:lo},requiredMark:{default:uo},error:{default:co}}}),bo={field:ho},vo=U()({type:"formControl",attributeValues:{subType:["text","number","email","password","search","url","tel","date","time","checkbox","switch","select","textarea","hidden","color"]},triggers:{onChange:{action:"onChange",title:"On Change",type:"trigger",params:{},preview:{value:"",name:""}}},content:{attributes:{subType:"text",name:"",label:"Label",hideLabel:!1,placeholder:"",defaultValue:"",autoComplete:!0,autoFocus:!1,disabled:!1,options:[],required:!1,requiredMessage:"",minLength:0,minLengthMessage:"",maxLength:0,maxLengthMessage:"",formatMessage:"",pattern:"",patternMessage:"",matches:"",matchesMessage:"",readOnly:!1},definition:{label:"Form Control",description:'A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input. Optional unless `required: true`, as an HTML field is: a `requiredMessage` alone requires nothing. A select offers its `options`: `[{ label, value }, …]` — the text shown, and what the field takes. A `switch` is a checkbox announced and drawn as an on/off switch (`role="switch"`), for a setting that applies at once; both hold `true`/`false`, and a `defaultValue` of `"true"` starts them on. Its slots: `label`, `requiredMark` (the `*` that ends the label of a required field), `input` (the box a typed field or a select is drawn in — a textarea, checkbox or switch is its own box), `field` (the `<input>` or `<select>` inside that box), `icon` (the show/hide button of a password) and `error`. The box is ringed (`2px solid currentColor`) while the field inside has keyboard focus: restyle it with a `focus-within` state on the `input` slot — the box never takes `focus` itself. The thumb of a switch is no element a class reaches: the class on its `input` slot sets `--plitzi-switch-thumb` (off), `--plitzi-switch-thumb-checked` (on, white by default) and `--plitzi-switch-thumb-shadow`.',styleSelectors:{label:"",requiredMark:"",input:"",field:"",icon:"",error:""}},builder:{canSnippet:!1},market:{category:"form",icon:"fa-solid fa-i-cursor"},defaultStyle:{style:{base:{default:{}}},subTypes:{hidden:yo("Form Control Hidden",{}),text:yo("Form Control Text",ao,bo),number:yo("Form Control Number",ao,bo),email:yo("Form Control Email",ao,bo),password:yo("Form Control Password",ao,{...bo,icon:mo}),search:yo("Form Control Search",ao,bo),url:yo("Form Control URL",ao,bo),tel:yo("Form Control Phone",ao,bo),date:yo("Form Control Date",ao,bo),time:yo("Form Control Time",ao,bo),color:yo("Form Control Color",ao,bo),textarea:yo("Form Control Textarea",{...ao,color:"inherit",resize:"vertical"}),select:yo("Form Control Select",go,{field:fo}),checkbox:{name:"Form Control Checkbox",displayMode:"desktop",style:{base:{default:{}},input:{default:{"margin-top":"0px","margin-bottom":"0px","margin-left":"0px","margin-right":"4px"}},label:{default:so},requiredMark:{default:uo},error:{default:co}}},switch:{name:"Form Control Switch",displayMode:"desktop",style:{base:{default:{}},input:{default:{height:"20px",width:"36px","margin-top":"0px","margin-bottom":"0px","margin-left":"0px","margin-right":"8px",position:"relative","flex-shrink":"0","border-top-color":"currentColor","border-top-style":"solid","border-top-width":"1px","border-right-color":"currentColor","border-right-style":"solid","border-right-width":"1px","border-bottom-color":"currentColor","border-bottom-style":"solid","border-bottom-width":"1px","border-left-color":"currentColor","border-left-style":"solid","border-left-width":"1px","border-top-left-radius":"10px","border-top-right-radius":"10px","border-bottom-left-radius":"10px","border-bottom-right-radius":"10px","background-color":"transparent",transition:"background-color 150ms ease",appearance:"none",cursor:"pointer"}},label:{default:{...so,"align-items":"center"}},requiredMark:{default:uo},error:{default:co}}}}}}}),wo=U()({type:"layoutContainer",attributeValues:{subType:["div","header","footer","nav","main","section","article","aside","address","figure"]},content:{attributes:{subType:"div"},definition:{label:"Layout Container",description:"A reusable layout shell (header/footer chrome) shared across pages.",items:[]},builder:{canDragDrop:!1},market:{category:"internal",icon:"fa-solid fa-border-all"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),ko=U()({type:"loading",content:{attributes:{},definition:{label:"Loading",description:"A loading placeholder shown while data or a suspense boundary resolves."},builder:{canDragDrop:!1},market:{category:"internal",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{style:{base:{default:{}}}}}}),xo=U()({type:"notFound",content:{attributes:{},definition:{label:"Not Found",description:"The 404 screen shown when no route matches."},builder:{canDragDrop:!1},market:{category:"internal",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{style:{base:{default:{display:"flex","justify-content":"center","align-items":"center"}}}}}}),So=U()({type:"page",serverTemplates:["seoPageTitle","seoPageDescription","notFound"],attributeValues:{documentScroll:["locked","noBounce"]},triggers:{onPageLoad:{action:"onPageLoad",title:"On Page Load",type:"trigger",params:{},preview:{pageId:"",routeParams:"",queryParams:""}}},content:{attributes:{enabled:!0,name:"Page",slug:"",folder:"",layout:"",layoutContainer:"",seoEnabled:!1,seoPageTitle:"Title",seoPageDescription:"Description"},definition:{label:"Page",description:"The root of a routable screen. Managed through the page ops (upsertPage/deletePage), not added as a child element.",items:[]},builder:{canDelete:!1,canDragDrop:!1,canMove:!1},market:{category:"internal",icon:"fas fa-file"},defaultStyle:{style:{base:{default:{display:"flex","flex-direction":"column","min-height":"100%","min-width":"100%","font-family":"Arial",color:"light-dark(#333, oklch(0.92 0.004 286.32))","font-size":"14px","font-weight":400,"line-height":"16px","text-align":"left"}}}}}}),To=U()({type:"embed",content:{attributes:{src:"",title:"",loading:"lazy"},definition:{label:"Embed",description:"Another page inside this one — a map, a video player, a form — in a frame."},market:{category:"media",icon:"fa-solid fa-window-maximize"},defaultStyle:{style:{base:{default:{display:"block",width:"100%","aspect-ratio":"16 / 9","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px"}}}}}}),Co=U()({type:"fontAwesome",content:{attributes:{icon:"fas fa-flag",size:"fa-1x",iconAnimation:""},definition:{label:"Font Awesome",description:"Renders a Font Awesome icon by its icon name."},market:{category:"media",icon:"fa-solid fa-font-awesome"},defaultStyle:{style:{base:{default:{display:"inline-block","font-size":"16px"}}}}}}),Eo=U()({type:"image",attributeValues:{fetchPriority:["high","low","auto"],loadMode:["auto","eager","lazy"]},content:{attributes:{src:"",alt:"",decorative:!1,fetchPriority:"auto",loadMode:"auto"},definition:{label:"Image",description:"Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both."},market:{category:"media",icon:"fa-solid fa-image"},defaultStyle:{style:{base:{default:{display:"block",width:"140px",height:"auto","max-width":"100%"}}}}}}),Ao=U()({type:"svg",content:{attributes:{content:"",label:""},definition:{label:"SVG",description:"A drawing written as SVG markup, coloured by its class."},market:{category:"media",icon:"fa-solid fa-bezier-curve"},defaultStyle:{name:"Svg",style:{base:{default:{display:"inline-flex",width:"24px",height:"24px"}}}}}}),Io=U()({type:"video",content:{attributes:{src:"",autoPlay:!1,playsInline:!1,loop:!1,muted:!0},definition:{label:"Video",description:"Embeds a video from a URL."},market:{category:"media",icon:"fa-solid fa-video"},defaultStyle:{style:{base:{default:{display:"block",width:"400px",height:"250px"}}}}}}),Oo=U()({type:"apiContainer",attributeValues:{subType:["","div","header","footer","nav","main","section","article","aside","address","figure"],method:["get","post","put","delete","patch"],credentials:["include","omit","same-origin"],pagination:["none","url","append"]},sourceType:"apiContainer",serverTemplates:["notFound"],triggers:{onApiError:{action:"onApiError",title:"On Api Error",type:"trigger",params:{},preview:{url:"",method:"",status:"",data:""}},onApiSuccess:{action:"onApiSuccess",title:"On Api Success",type:"trigger",params:{},preview:{url:"",method:"",status:"",data:""}}},callbacks:{performQuery:{action:"performQuery",title:"Perform Query",type:"callback",preview:{},params:{input:{label:"Input (server providers)",type:"codemirror-json",defaultValue:"{}",description:"Values handed to a server-driven provider with its request, beside the page’s own route and query params — a search, a filter. Kept for the pages it loads after (`loadMore`, `goToPage`) until the next query."}}},cancelQuery:{action:"cancelQuery",title:"Cancel Query",type:"callback",preview:{},params:{}},loadMore:{action:"loadMore",title:"Load More",type:"callback",preview:{},params:{}},goToPage:{action:"goToPage",title:"Go To Page",type:"callback",preview:{},params:{page:{label:"Page",defaultValue:"1",type:"text"}}},writeRecord:{action:"writeRecord",title:"Write Record",type:"callback",preview:{action:"create"},params:{action:{label:"Endpoint",defaultValue:"create",type:"text"},recordId:{label:"Record Id",defaultValue:"",type:"text"}}}},content:{attributes:{query:"",method:"get",accessToken:"",mockData:"{}",subType:"",credentials:"same-origin",connector:"",resource:"",limit:"10",singleRecord:!1,filters:[],pagination:"none",pageParam:"page",renderWhileLoading:!1,cache:!1,staleTime:30,gcTime:300},definition:{label:"Api Container",description:'Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step, and `refreshSeconds` makes it ask again on its own every N seconds (either runtime; paused while the tab is hidden) — the way to keep a queue, feed or status board current without a plugin. A server provider (`runtime: "server"`) whose answer means the address shows nothing — a record not found — says so in `notFound`, a template against its answer (`{{ source.found == false }}`): the page is sent with status 404, rendered as written. Its `subType` (container tag) is empty by default, and then it renders NO element of its own: its children lay out directly in its parent, and any class, variant or style binding on it applies to nothing. To style the provider itself give it a tag (`subType: "div"`, `section`, …); otherwise style its parent or a child.',items:[]},market:{category:"provider",icon:"fa-solid fa-server"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),_o=U()({type:"channel",attributeValues:{subType:["","div","section","aside","main"]},sourceType:"channel",triggers:{onMessage:{action:"onMessage",title:"On Message",type:"trigger",params:{},preview:{type:"",data:"",from:"",user:"",at:"",echo:!1}},onJoin:{action:"onJoin",title:"On Join",type:"trigger",params:{},preview:{from:"",user:"",state:{}}},onLeave:{action:"onLeave",title:"On Leave",type:"trigger",params:{},preview:{from:"",user:"",state:{}}}},callbacks:{publish:{action:"publish",title:"Publish",type:"callback",preview:{},params:{type:{label:"Type",defaultValue:"",type:"text"},data:{label:"Data (JSON or a template)",defaultValue:"",type:"text"},echo:{label:"Heard on this page too",defaultValue:!1,type:"boolean"}}},setPresence:{action:"setPresence",title:"Set Presence",type:"callback",preview:{},params:{data:{label:"State (JSON or a template)",defaultValue:"",type:"text"}}}},content:{attributes:{topic:"",grant:"",keep:20,subType:""},definition:{label:"Channel",description:"A realtime channel: every OTHER page on the same `topic` hears what one publishes, within milliseconds — the page that sent it too with `echo` (its `from` is then the `me` of the channel). The topic must match a channel the space declares in its settings (`channels`), e.g. `board:{{ id }}` under `board:{id}`. A topic of a private channel (`grant: true`) opens only with `grant`, bound to the grant the action that let this visitor in returned (its `realtime.grant` step). ITS DESCENDANTS bind to its source `channel_<id>`: `connected`, `members` (with the state each announced), `messages` (the last `keep`) and `last`. It fires `onMessage`; `onJoin` when somebody who came after this page has announced who they are, and `onLeave` when somebody goes — each with `from`, `user` and the `state` they announced; and answers `publish({ type, data, echo })` and `setPresence({ data })`; `presence` is the state this page announces (a name, a colour). Closed in the builder and anywhere without a server.",items:[]},market:{category:"provider",icon:"fa-solid fa-tower-broadcast"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),No=U()({type:"carouselTrack",ancestorType:"carousel",content:{attributes:{},definition:{label:"Carousel Track",description:"Where a carousel shows its slides: what is inside is one slide, rendered once per item.",items:[]},builder:{canSnippet:!1},market:{category:"structure",icon:"fa-solid fa-film"},defaultStyle:{style:{base:{default:{position:"relative",overflow:"hidden"}}}}}}),Mo=U()({type:"carousel",sourceType:"carousel",triggers:{onChange:{action:"onChange",title:"On Slide Change",type:"trigger",params:{},preview:{index:"0",item:{}}}},callbacks:{next:{action:"next",title:"Next Slide",type:"callback",params:{},preview:{}},previous:{action:"previous",title:"Previous Slide",type:"callback",params:{},preview:{}},goTo:{action:"goTo",title:"Go To Slide",type:"callback",params:{index:{type:"text",label:"Index (from 0)",defaultValue:"0",canBind:!0}},preview:{}},play:{action:"play",title:"Play",type:"callback",params:{},preview:{}},pause:{action:"pause",title:"Pause",type:"callback",params:{},preview:{}}},content:{attributes:{items:[],mode:"slide",autoplay:0,pauseOnHover:!0,loop:!0,transition:"slide",speed:30,label:""},definition:{label:"Carousel",description:"Items shown one at a time, scrolled past as a marquee, or swiped as a row — with controls of its own inside.",items:[]},market:{category:"structure",icon:"fa-solid fa-images"},defaultStyle:{style:{base:{default:{position:"relative"}}}}},initialItems:["carouselTrack"]}),Po=["div","header","footer","nav","main","section","article","aside","figure"],Lo=U()({type:"container",attributeValues:{subType:["div","header","footer","nav","main","section","article","aside","address","figure","dl","dt","dd","li","h1","h2","h3","h4","h5","h6","p","span"],live:["","polite","assertive"]},content:{attributes:{subType:"div"},definition:{label:"Container",description:"Generic layout box (a div). The primary building block for structure: groups and positions child elements with flex/grid. Reach for it whenever you need to wrap or arrange other elements.",items:[]},market:{category:"structure",icon:"fa-solid fa-crop-simple"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),Ro={"min-height":"30px","min-width":"30px","padding-top":"6px","padding-bottom":"6px","padding-left":"12px","padding-right":"12px","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","background-color":"#4422ee",color:"white","line-height":"24px","font-size":"16px",outline:"none",cursor:"pointer"},jo=U()({type:"dialogContainer",sourceType:"dialogContainer",triggers:{onDialogAccept:{action:"onDialogAccept",title:"On Dialog Accept",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogReject:{action:"onDialogReject",title:"On Dialog Reject",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogOpen:{action:"onDialogOpen",title:"On Dialog Open",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogClose:{action:"onDialogClose",title:"On Dialog Close",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}}},callbacks:{openDialog:{action:"openDialog",title:"Open Dialog",type:"callback",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},closeDialog:{action:"closeDialog",title:"Close Dialog",type:"callback",preview:{},params:{}}},content:{attributes:{headerLabel:"Dialog Header",acceptButtonLabel:"Accept",rejectButtonLabel:"Cancel",autoHideAfterClick:!0},definition:{label:"Dialog Container",description:"A native <dialog> container shown or hidden through interactions (e.g. an onClick open/close).",items:[],loadStrategy:"lazy",styleSelectors:{backgroundContainer:"",rootContainer:"",headerContainer:"",headerTitle:"",headerCloseButton:"",bodyContainer:"",footerContainer:"",acceptButton:"",cancelButton:""}},market:{category:"structure",icon:"fa-regular fa-message"},defaultStyle:{style:{base:{default:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0","z-index":"200"}},backgroundContainer:{default:{height:"100%",width:"100%",left:"0",top:"0",position:"absolute","z-index":"210","background-color":"rgb(0 0 0 / 50%)"}},rootContainer:{default:{display:"flex","flex-direction":"column",position:"absolute",top:"50%",left:"50%","z-index":"250",width:"500px","max-width":"calc(100vw - 32px)","max-height":"calc(100dvh - 32px)",overflow:"auto","background-color":"light-dark(white, oklch(0.21 0.006 285.885))",transform:"translate3d(-50%, -50%, 0px)","padding-top":"20px","padding-bottom":"20px","padding-left":"20px","padding-right":"20px","border-top-left-radius":"8px","border-top-right-radius":"8px","border-bottom-left-radius":"8px","border-bottom-right-radius":"8px"}},headerContainer:{default:{display:"flex","align-items":"center","justify-content":"space-between"}},headerTitle:{default:{"font-size":"20px","font-weight":"500","line-height":"1.2"}},headerCloseButton:{default:{height:"28px",width:"28px","padding-top":"4px","padding-bottom":"4px","padding-left":"4px","padding-right":"4px",display:"flex","justify-content":"center","align-items":"center","flex-shrink":"0","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","background-color":"transparent",color:"inherit","font-style":"inherit","font-weight":"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit",cursor:"pointer"}},bodyContainer:{default:{display:"flex","flex-direction":"column","flex-grow":"1","flex-basis":"auto"}},footerContainer:{default:{display:"flex","justify-content":"flex-end","margin-top":"8px"}},acceptButton:{default:Ro},cancelButton:{default:{...Ro,"margin-left":"12px"}}},subTypes:{}}},initialItems:["container"]}),zo=U()({type:"list",attributeValues:{subType:["ul","ol"],source:["none","controlled"]},sourceType:"list",content:{attributes:{items:[],source:"none",subType:"ul"},definition:{label:"List",description:'Repeats a template (its row: a listItem, or a container with subType "li") once per entry of a data array — the way to render a dynamic collection, as a <ul> (subType "ol" for a numbered one). Bind its items to a data source (e.g. an apiContainer response).',items:[]},market:{category:"structure",icon:"fa-solid fa-list"},defaultStyle:{style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}},subTypes:{ul:{name:"List UL",displayMode:"desktop",style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}}},ol:{name:"List OL",displayMode:"desktop",style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}}}}}},initialItems:["listItem","listItem","listItem"]}),Do=U()({type:"listItem",content:{attributes:{},definition:{label:"List Item",description:"The List Item element lets you add more items to existing List elements. You can then add any content you would like to them, including links, images, etc.",items:[]},builder:{itemsNotAllowed:["listItem"]},market:{category:"structure",icon:"fa-solid fa-grip-lines"},defaultStyle:{style:{base:{default:{}}}}}}),$o=U()({type:"modalContainer",sourceType:"modalContainer",triggers:{onModalOpen:{action:"onModalOpen",title:"On Modal Open",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onModalClose:{action:"onModalClose",title:"On Modal Close",type:"trigger",preview:{},params:{}}},callbacks:{openModal:{action:"openModal",title:"Open Modal",type:"callback",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},closeModal:{action:"closeModal",title:"Close Modal",type:"callback",params:{},preview:{}}},content:{attributes:{title:"Modal Header",autoHideAfterClick:!0},definition:{label:"Modal Container",description:"A modal overlay container opened and closed through interactions; use for dialogs over the page. The element itself is fixed over the whole viewport, and holds two layers side by side — neither inside the other: `backgroundContainer`, the dim layer, `rgb(0 0 0 / 50%)` (its `background-color` is the whole dim), and `rootContainer`, the dialog, centred by `top: 50%`, `left: 50%` and `transform: translate3d(-50%, -50%, 0)` — to sit it near the top, set `top` and `transform: translateX(-50%)`; flex alignment on the dim layer moves nothing. Inside the dialog, top to bottom: `headerContainer` (with `headerTitle` and `headerCloseButton`) and `bodyContainer`.",items:[],loadStrategy:"lazy",styleSelectors:{backgroundContainer:"",rootContainer:"",headerContainer:"",headerTitle:"",headerCloseButton:"",bodyContainer:""}},market:{category:"structure",icon:"fa-regular fa-clone"},defaultStyle:{style:{base:{default:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0","z-index":"200"}},backgroundContainer:{default:{height:"100%",width:"100%",left:"0",top:"0",position:"absolute","z-index":"210","background-color":"rgb(0 0 0 / 50%)"}},rootContainer:{default:{display:"flex","flex-direction":"column",position:"absolute",top:"50%",left:"50%","z-index":"250",width:"500px","max-width":"calc(100vw - 32px)","max-height":"calc(100dvh - 32px)",overflow:"auto","background-color":"light-dark(white, oklch(0.21 0.006 285.885))",transform:"translate3d(-50%, -50%, 0px)","border-top-left-radius":"8px","border-top-right-radius":"8px","border-bottom-left-radius":"8px","border-bottom-right-radius":"8px"}},headerContainer:{default:{display:"flex","align-items":"center","justify-content":"space-between","border-bottom-width":"1px","border-bottom-color":"light-dark(#d1d5db, oklch(0.37 0.013 285.805))","border-bottom-style":"solid","padding-left":"20px","padding-right":"20px","padding-top":"10px","padding-bottom":"10px"}},headerTitle:{default:{"font-size":"20px","font-weight":"500","line-height":"1.2"}},headerCloseButton:{default:{height:"28px",width:"28px","padding-top":"4px","padding-bottom":"4px","padding-left":"4px","padding-right":"4px",display:"flex","justify-content":"center","align-items":"center","flex-shrink":"0","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","background-color":"transparent",color:"inherit","font-style":"inherit","font-weight":"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit",cursor:"pointer"}},bodyContainer:{default:{display:"flex","flex-direction":"column","flex-grow":"1","flex-basis":"auto","padding-top":"20px","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}},subTypes:{}}},initialItems:["container"]}),Fo=U()({type:"pagination",attributeValues:{mode:["pages","loadMore"],target:["url","interaction"]},triggers:{onPageChange:{action:"onPageChange",title:"On Page Change",type:"trigger",params:{},preview:{page:"1"}}},content:{attributes:{pageInfo:{},mode:"pages",target:"url",pageParam:"page",windowSize:5,previousLabel:"Previous",nextLabel:"Next",loadMoreLabel:"Load more"},definition:{label:"Pagination",description:'Pages through a list. Bind it to a provider page info: in URL mode it writes the page into the address bar so the result stays shareable and indexable, and in load-more mode it announces the next page for the provider to append. Its buttons take a class through their slots: `previous`, `page` (each numbered one — the page shown carries `aria-current="page"`, so the class\'s `current` state dresses it), `next` and `loadMore`; one with nowhere to go is disabled, the `disabled` state.',items:[],styleSelectors:{previous:"",page:"",next:"",loadMore:""}},market:{category:"structure",icon:"fa-solid fa-ellipsis"},defaultStyle:{style:{base:{default:{display:"flex","align-items":"center","row-gap":"8px","column-gap":"8px"}}},subTypes:{}}}}),qo=U()({type:"tabContainer",content:{attributes:{},definition:{label:"Tab Container",description:"A tabbed container that switches between panels; composed of header/body/item parts.",items:[]},builder:{itemsAllowed:["tabContainerHeader","tabContainerBody"]},market:{category:"structure",icon:"fa-solid fa-table-columns"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}},initialItems:["tabContainerHeader","tabContainerBody"]}),Bo=U()({type:"tabContainerBody",ancestorType:"tabContainer",content:{attributes:{},definition:{label:"Tab Container Body",description:"The panel area inside a tabContainer that shows the active tab item.",items:[]},builder:{canDelete:!1,canDragDrop:!1,canMove:!1,canSnippet:!1,itemsAllowed:["tabContainerItem"]},market:{category:"structure",icon:"fa-solid fa-table-columns"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}},initialItems:["tabContainerItem","tabContainerItem","tabContainerItem"]}),Uo=U()({type:"tabContainerHeader",ancestorType:"tabContainer",content:{attributes:{},definition:{label:"Tab Container Header",description:"The row of tab triggers inside a tabContainer.",items:[]},builder:{canDelete:!1,canDragDrop:!1,canMove:!1,canSnippet:!1,itemsAllowed:["tabContainerItem"]},market:{category:"structure",icon:"fa-solid fa-table-columns"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}},initialItems:["tabContainerItem","tabContainerItem","tabContainerItem"]}),Ho=U()({type:"tabContainerItem",content:{attributes:{},definition:{label:"Tab Container Item",description:"One selectable tab (trigger + panel) inside a tabContainer.",items:[]},builder:{itemsNotAllowed:["tabContainerItem","tabContainerHeader","tabContainerBody"]},market:{category:"structure",icon:"fa-regular fa-folder"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),Wo={ApiContainer:Oo,BlockHtml:qi,BlockJsx:Bi,Button:Gi,Carousel:Mo,CarouselTrack:No,Channel:_o,Container:Lo,Custom:Ui,DialogContainer:jo,Dropdown:Ki,DropdownPopup:Yi,Embed:To,FontAwesome:Co,Form:io,FormControl:vo,Heading:Ji,Image:Eo,LayoutContainer:wo,Link:Xi,List:zo,ListItem:Do,Loading:ko,Markdown:Zi,ModalContainer:$o,NodeHtml:Hi,NotFound:xo,Page:So,Pagination:Fo,Paragraph:Qi,PlitziSdk:H,Reference:Wi,RichText:eo,Svg:Ao,TabContainer:qo,TabContainerBody:Bo,TabContainerHeader:Uo,TabContainerItem:Ho,Text:to,ThemeToggle:ro,Video:Io},Vo=Object.fromEntries(Object.values(Wo).flatMap(e=>"serverTemplates"in e?[[e.type,e.serverTemplates]]:[])),Go=/* @__PURE__ */new Map,Ko=/* @__PURE__ */new Set(["false","0",""]),Yo=e=>"string"==typeof e?!Ko.has(e.trim().toLowerCase()):Array.isArray(e)?e.length>0:!!e,Jo={action:"arrayMap",title:"Array Map",type:"utility",params:{keys:{defaultValue:'[{"from": "", "to": ""}]',type:"textarea"}},preview:{sourceParsed:""},callback:(e,t)=>{let{keys:n}=t;if(!Array.isArray(e))return e;try{"string"==typeof n&&(n=JSON.parse(n))}catch{return e}return e.map(e=>{let t={};return n.forEach(n=>{"object"==typeof n&&n.from&&n.to&&hr(t,n.to,pr(e,n.from,""))}),t})}};function Xo(e,t){return+Nr(e)-+Nr(t)}var Zo={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Qo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ea={date:Qo({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Qo({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Qo({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ta={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function na(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):t;r=e.formattingValues[i]||e.formattingValues[t]}else{const t=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var ra={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:na({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:na({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:na({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:na({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:na({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function ia(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(s,e=>e.test(a)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(s,e=>e.test(a));let c;return c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:t.slice(a.length)}}}function oa(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];return a=n.valueCallback?n.valueCallback(a):a,{value:a,rest:t.slice(i.length)}}}var aa={ordinalNumber:oa({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ia({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},sa={code:"en-US",formatDistance:(e,t,n)=>{let r;const i=Zo[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:ea,formatRelative:(e,t,n,r)=>ta[e],localize:ra,match:aa,options:{weekStartsOn:0,firstWeekContainsDate:1}},la={};function ca(){return la}function ua(e){const t=Nr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function da(e,...t){const n=_r.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function pa(e,t){const n=Nr(e,t?.in);return n.setHours(0,0,0,0),n}function ha(e,t){const n=ca(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Nr(e,t?.in),o=i.getDay(),a=(o<r?7:0)+o-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function fa(e,t){return ha(e,{...t,weekStartsOn:1})}function ma(e,t){const n=Nr(e,t?.in),r=n.getFullYear(),i=_r(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=fa(i),a=_r(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=fa(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ga(e,t){const n=Nr(e,t?.in),r=n.getFullYear(),i=ca(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=_r(t?.in||e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const s=ha(a,t),l=_r(t?.in||e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=ha(l,t);return+n>=+s?r+1:+n>=+c?r:r-1}function ya(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var ba={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ya("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):ya(n+1,2)},d:(e,t)=>ya(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>ya(e.getHours()%12||12,t.length),H:(e,t)=>ya(e.getHours(),t.length),m:(e,t)=>ya(e.getMinutes(),t.length),s:(e,t)=>ya(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return ya(Math.trunc(r*Math.pow(10,n-3)),t.length)}},va={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return ba.y(e,t)},Y:function(e,t,n,r){const i=ga(e,r),o=i>0?i:1-i;return"YY"===t?ya(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):ya(o,t.length)},R:function(e,t){return ya(ma(e),t.length)},u:function(e,t){return ya(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ya(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ya(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ba.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ya(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=function(e,t){const n=Nr(e,t?.in),r=+ha(n,t)-+function(e,t){const n=ca(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=ga(e,t),o=_r(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ha(o,t)}(n,t);return Math.round(r/Ar)+1}(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):ya(i,t.length)},I:function(e,t,n){const r=function(e,t){const n=Nr(e,t?.in),r=+fa(n)-+function(e){const t=ma(e,void 0),n=_r(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),fa(n)}(n);return Math.round(r/Ar)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):ya(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):ba.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=Nr(e,t?.in);return function(e,t){const[n,r]=da(void 0,e,t),i=pa(n),o=pa(r),a=+i-ua(i),s=+o-ua(o);return Math.round((a-s)/864e5)}(n,function(e){const t=Nr(e,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):ya(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ya(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ya(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return ya(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(i=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(i=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return ba.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):ba.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):ya(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):ya(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ba.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ba.s(e,t)},S:function(e,t){return ba.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return ka(r);case"XXXX":case"XX":return xa(r);default:return xa(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ka(r);case"xxxx":case"xx":return xa(r);default:return xa(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wa(r,":");default:return"GMT"+xa(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wa(r,":");default:return"GMT"+xa(r,":")}},t:function(e,t,n){return ya(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return ya(+e,t.length)}};function wa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+t+ya(o,2)}function ka(e,t){return e%60==0?(e>0?"-":"+")+ya(Math.abs(e)/60,2):xa(e,t)}function xa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+ya(Math.trunc(r/60),2)+t+ya(r%60,2)}var Sa=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Ta=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Ca={p:Ta,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Sa(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",Sa(r,t)).replace("{{time}}",Ta(i,t))}},Ea=/^D+$/,Aa=/^Y+$/,Ia=["D","DD","YY","YYYY"];var Oa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Na=/^'([^]*?)'?$/,Ma=/''/g,Pa=/[a-zA-Z]/;function La(e,t,n){const r=ca(),i=n?.locale??r.locale??sa,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Nr(e,n?.in);if(!function(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+Nr(e)));var t}(s))throw new RangeError("Invalid time value");let l=t.match(_a).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,Ca[t])(e,i.formatLong):e}).join("").match(Oa).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Ra(e)};if(va[t])return{isToken:!0,value:e};if(t.match(Pa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(l=i.localize.preprocessor(s,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return l.map(r=>{if(!r.isToken)return r.value;const o=r.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return Aa.test(e)}(o)||!n?.useAdditionalDayOfYearTokens&&function(e){return Ea.test(e)}(o))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),Ia.includes(e))throw new RangeError(r)}(o,t,String(e)),(0,va[o[0]])(s,o,i.localize,c)}).join("")}function Ra(e){const t=e.match(Na);return t?t[1].replace(Ma,"'"):e}function ja(e,t){const n=+Nr(e)-+Nr(t);return n<0?-1:n>0?1:n}function za(e,t,n){const[r,i,o]=da(n?.in,e,e,t),a=ja(i,o),s=Math.abs(function(e,t){const[n,r]=da(void 0,e,t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(i,o));if(s<1)return 0;1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*s);let l=ja(i,o)===-a;(function(e,t){const n=Nr(e,t?.in);return+function(e,t){const n=Nr(e,t?.in);return n.setHours(23,59,59,999),n}(n,t)===+function(e,t){const n=Nr(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}(n,t)})(r)&&1===s&&1===ja(r,o)&&(l=!1);const c=a*(s-+l);return 0===c?0:c}function Da(e,t){return function(e,t,n){const r=ca(),i=n?.locale??r.locale??sa,o=ja(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[s,l]=da(n?.in,...o>0?[t,e]:[e,t]),c=function(e,t,n){const r=Xo(e,t)/1e3;return(i=n?.roundingMethod,e=>{const t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})(r);var i}(l,s),u=(ua(l)-ua(s))/1e3,d=Math.round((c-u)/60);let p;if(d<2)return n?.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,a):c<10?i.formatDistance("lessThanXSeconds",10,a):c<20?i.formatDistance("lessThanXSeconds",20,a):c<40?i.formatDistance("halfAMinute",0,a):c<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):0===d?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",d,a);if(d<45)return i.formatDistance("xMinutes",d,a);if(d<90)return i.formatDistance("aboutXHours",1,a);if(d<1440){const e=Math.round(d/60);return i.formatDistance("aboutXHours",e,a)}if(d<2520)return i.formatDistance("xDays",1,a);if(d<43200){const e=Math.round(d/1440);return i.formatDistance("xDays",e,a)}if(d<86400)return p=Math.round(d/43200),i.formatDistance("aboutXMonths",p,a);if(p=za(l,s),p<12){const e=Math.round(d/43200);return i.formatDistance("xMonths",e,a)}{const e=p%12,t=Math.trunc(p/12);return e<3?i.formatDistance("aboutXYears",t,a):e<9?i.formatDistance("overXYears",t,a):i.formatDistance("almostXYears",t+1,a)}}(e,function(e){return _r(e,Date.now())}(e),t)}var $a={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Fa={date:Qo({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:Qo({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:Qo({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},qa={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Ba={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Ua={ordinalNumber:(e,t)=>Number(e)+"º",era:na({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:na({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:na({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:na({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:na({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},Ha={ordinalNumber:oa({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:ia({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:ia({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},Wa={code:"es",formatDistance:(e,t,n)=>{let r;const i=$a[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},formatLong:Fa,formatRelative:(e,t,n,r)=>1!==t.getHours()?Ba[e]:qa[e],localize:Ua,match:Ha,options:{weekStartsOn:1,firstWeekContainsDate:1}},Va={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},Ga={date:Qo({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},defaultWidth:"full"}),time:Qo({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:Qo({formats:{full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ka={lastWeek:e=>{const t=e.getDay();return"'"+(0===t||6===t?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Ya={ordinalNumber:(e,t)=>Number(e)+"º",era:na({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},defaultWidth:"wide"}),quarter:na({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:na({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},defaultWidth:"wide"}),day:na({values:{narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},defaultWidth:"wide"}),dayPeriod:na({values:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},defaultFormattingWidth:"wide"})},Ja={ordinalNumber:oa({matchPattern:/^(\d+)(º|ª)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},defaultParseWidth:"any"}),quarter:ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ia({matchPatterns:{narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:{narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},defaultParseWidth:"any"})},Xa={code:"pt",formatDistance:(e,t,n)=>{let r;const i=Va[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"daqui a "+r:"há "+r:r},formatLong:Ga,formatRelative:(e,t,n,r)=>{const i=Ka[e];return"function"==typeof i?i(t):i},localize:Ya,match:Ja,options:{weekStartsOn:0,firstWeekContainsDate:4}},Za={en:sa,es:Wa,pt:Xa},Qa=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?Mr(e):e,t};function es(e,t="dd MMMM, yyyy",n="en"){return e?La(Qa(e),t,{locale:Za[n]}):""}function ts(e,t){let n=Qa(e);return Xo(Qa(t),n)}var ns={action:"dateConverter",title:"Date Converter",type:"utility",params:{format:{defaultValue:"dd/MM/yyyy",type:"text"},asAge:{defaultValue:!1,type:"checkbox"},isUnix:{defaultValue:!0,type:"checkbox"},isUtc:{defaultValue:!1,type:"checkbox"},locale:{defaultValue:"en",type:"select",options:[{label:"en",value:"en"},{label:"es",value:"es"},{label:"pt",value:"pt"}]}},preview:{format:"",asAge:"",isUnix:"",isUtc:"",locale:""},callback:(e,{format:t="dd/MM/yyyy",asAge:n=!1,isUnix:r=!0,isUtc:i=!1,locale:o="en"})=>{if("string"!=typeof e&&"number"!=typeof e)return e;try{let a=Qa(r?Number(e):e);return isNaN(a.getTime())?e:n?function(e,t="en",n){if(!e)return"";let r=Qa(e);return isNaN(r.getTime())?"":Da(r,{...n,locale:Za[t]})}(a,o,{addSuffix:!0}):i?function(e,t="dd MMMM, yyyy",n="en"){return e?La((e=>{let t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return t.setFullYear(e.getUTCFullYear()),t})(Qa(e)),t,{locale:Za[n]}):""}(a,t,o):es(a,t,o)}catch{return e}}},rs={action:"not",title:"Not",type:"utility",params:{},preview:{content:""},callback:e=>!Yo(e)},is={action:"styleSelector",title:"Style Selector",type:"utility",params:{originalSelector:{label:"Original Selector",description:"This will append the original selector (require append option enabled)",defaultValue:!1,disabled:({append:e})=>!e,type:"checkbox"},append:{label:"Append Selector",defaultValue:!1,type:"checkbox"},selector:{label:"Selector",defaultValue:"",type:"select",options:(e,t,n)=>{let r=n?.stylePlatform;return r?Object.keys(r).map(e=>({label:e,options:Object.values(r[e]).filter(e=>"class"===e.type).map(e=>({label:e.name,value:e.name}))})):[]}}},preview:{append:"",originalSelector:"",selector:""},callback:(e,t,n,r={})=>{let{originalSelector:i,append:o,selector:a}=t,s=[];if(o&&!i&&r.sourceTo)s.push(r.sourceTo,a);else if(i&&o){let e=pr(n,"definition.styleSelectors.base","");e?s.push(e,a):s.push(a)}return s.length?1===s.length?s[0]:s.join(" "):""}},os={action:"styleVariant",title:"Style Variant",type:"utility",params:{key:{label:"Selector Key",defaultValue:"",type:"select",options:(e,t)=>{let n=t?.definition?.styleSelectors;if(!t||!t.definition||!n)return[];let r=t.definition.type;return(e=>{let t=e.reduce((e,{groupLabel:t,option:n})=>(t in e||(e[t]=[]),e[t].push(n),e),{});return Object.entries(t).map(([e,t])=>({label:e,options:t}))})(Object.entries(n).flatMap(([e,t])=>(t?[r,...t.split(" ")]:[r]).map(t=>({groupLabel:e,option:{value:`${t}.${e}`,label:`${t} (${e})`}}))))}},variant:{label:"Variant",defaultValue:"",type:"select",options:(e,t,n)=>{let r=t?.definition?.styleSelectors,i=e.key||"";if(!(t&&t.definition&&r&&n?.stylePlatform&&i.includes(".")))return[];let o=t.definition.type,a=i.split(".").pop()||"",s=r[a];if(!s)return[];let l=[],c=[o,...s.split(" ").filter(Boolean)];return Object.entries(n.stylePlatform).forEach(([e,t])=>{c.forEach(n=>{let r=t[n];if(!r)return;let i=r.attributes[a];Object.keys(i.variants||{}).forEach(t=>{l.push({value:t,label:`${e}: ${t}`})})})}),l}},append:{label:"Append to Variant",description:"Merge with existing variant values instead of replacing",defaultValue:!1,type:"checkbox"}},preview:{key:"",variant:"",append:""},callback:(e,t,n,r={})=>{let{key:i,variant:o,append:a}=t;if(!i)return r.sourceTo??{};let s=i||"base",l=o||e;return"object"!=typeof l||Array.isArray(l)?hr(a?{...r.sourceTo}:{},s,l):l}},as={action:"twigTemplate",title:"Twig Template",type:"utility",params:{template:{label:"Template",defaultValue:"Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",type:"codemirror-text"},returnMode:{label:"Returns",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Value (a single {{ expression }})",value:"value"}]}},preview:{template:""},callback:(e,t,n,r={})=>{let{template:i,returnMode:o="text"}=t,a={source:e,...r};try{return"value"===o?Yn(i,a):Vn(i,a)}catch{return e}}},ss={twigTemplate:as,dateConverter:ns,staticValue:{action:"staticValue",title:"Static Value",type:"utility",params:{valueType:{label:"Value Type",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Long Text",value:"textarea"},{label:"Boolean",value:"select"}]},value:{defaultValue:"",type:({valueType:e})=>e,options:[{label:"True",value:"true"},{label:"False",value:"false"}]}},preview:{valueType:"",value:""},callback:(e,t)=>{let{valueType:n,value:r}=t;return"select"===n?"true"===r:r}},capitalize:{action:"capitalize",title:"Capitalize",type:"utility",params:{},preview:{content:""},callback:e=>"string"==typeof e?function(e){return null!=e&&"string"==typeof e&&e.trim()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}(e):e},arrayMap:Jo,stringToArray:{action:"stringToArray",title:"Text to List",type:"utility",params:{separator:{label:"Separator",defaultValue:",",type:"text"}},preview:{valueType:"",value:""},callback:(e,t)=>{let{separator:n}=t;return"string"==typeof e?e.split(n).map(e=>e.trim()):e}},not:rs,styleSelector:is,styleVariant:os},ls=(Object.values(ss).map(({title:e,action:t})=>({label:e,value:t})),(e,t)=>{if(e&&typeof localStorage<"u")try{let t=localStorage.getItem(e);if("dark"===t||"light"===t)return t}catch{}return"system"===t?(()=>{if(typeof window>"u")return"light";try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}})():t}),cs=l({theme:{components:{}},colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{}});cs.displayName="ThemeContext";var us=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.enumerable,ds=(e,t,n="soft",r={})=>{let{skip:i=[],skipFunctions:o=!1}=r;if(e===t&&"soft"===n)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let o,a,s=[];if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(a=o;0!==a--;)if(!ds(e[a],t[a],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.values())if(!t.has(a))return!1;for(a of e.entries())if(!ds(a[1],t.get(a[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(o=e.length,o!=t.length)return!1;for(a=o;0!==a--;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.unicode===t.unicode&&e.lastIndex===t.lastIndex&&e.sticky===t.sticky;if((e.valueOf!==Object.prototype.valueOf||t.valueOf!==Object.prototype.valueOf)&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if((e.toString!==Object.prototype.toString||t.toString!==Object.prototype.toString)&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if(s="soft"===n?Object.keys(e):Object.getOwnPropertyNames(e),o=s.length,o!==("soft"===n?Object.keys(t).length:Object.getOwnPropertyNames(t).length))return!1;for(a=o;0!==a--;)if(!Object.prototype.hasOwnProperty.call(t,s[a]))return!1;for(a=o;0!==a--;){let o=s[a];if("_owner"===o&&e.$$typeof)continue;let l="soft"===n||us(e,o)||!i.includes(o);if(!ds(e[o],t[o],n,r)&&l)return!1}return!0}return!!("hard"===n&&e===t||o&&"function"==typeof e&&"function"==typeof t)||e!=e&&t!=t},ps=ds,hs=(e,t="soft",n={})=>{let r=x(e);return ps(r.current,e,t,n)?r.current:(r.current=e,e)},fs=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ms="-",gs=[],ys=e=>{const t=ws(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return vs(e);const n=e.split(ms),r=""===n[0]&&n.length>1?1:0;return bs(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||gs}return n[e]||gs}}},bs=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=bs(e,t+1,i);if(n)return n}const o=n.validators;if(null===o)return;const a=0===t?e.join(ms):e.slice(t).join(ms),s=o.length;for(let l=0;l<s;l++){const e=o[l];if(e.validator(a))return e.classGroupId}},vs=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),ws=e=>{const{theme:t,classGroups:n}=e;return ks(n,t)},ks=(e,t)=>{const n=fs();for(const r in e){const i=e[r];xs(i,n,r,t)}return n},xs=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const i=e[o];Ss(i,t,n,r)}},Ss=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?Es(e,t,n,r):Cs(e,t,n,r):Ts(e,t,n)},Ts=(e,t,n)=>{(""===e?t:As(t,e)).classGroupId=n},Cs=(e,t,n,r)=>{Is(e)?xs(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},Es=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let a=0;a<o;a++){const[e,o]=i[a];xs(o,As(t,e),n,r)}},As=(e,t)=>{let n=e;const r=t.split(ms),i=r.length;for(let o=0;o<i;o++){const e=r[o];let t=n.nextPart.get(e);t||(t=fs(),n.nextPart.set(e,t)),n=t}return n},Is=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Os=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,o)=>{n[i]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},_s=[],Ns=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ms=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,o=0;const a=e.length;for(let u=0;u<a;u++){const a=e[u];if(0===r&&0===i){if(":"===a){t.push(e.slice(o,u)),o=u+1;continue}if("/"===a){n=u;continue}}"["===a?r++:"]"===a?r--:"("===a?i++:")"===a&&i--}const s=0===t.length?e:e.slice(o);let l=s,c=!1;return s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0),Ns(t,c,l,n&&n>o?n-o:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ns(_s,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Ps=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const o=e[i],a="["===o[0],s=t.has(o);a||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ls=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Rs=/\s+/,js=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=js(e[r]))&&(n&&(n+=" "),n+=t);return n},zs=(e,...t)=>{let n,r,i,o;const a=e=>{const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o,postfixLookupClassGroupIds:a}=t,s=[],l=e.trim().split(Rs);let c="";for(let u=l.length-1;u>=0;u-=1){const e=l[u],{isExternal:t,modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){c=e+(c.length>0?" "+c:c);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&a[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){c=e+(c.length>0?" "+c:c);continue}if(m=r(h),!m){c=e+(c.length>0?" "+c:c);continue}g=!1}const y=0===d.length?"":1===d.length?d[0]:o(d).join(":"),b=p?y+"!":y,v=b+m;if(s.indexOf(v)>-1)continue;s.push(v);const w=i(m,g);for(let n=0;n<w.length;++n){const e=w[n];s.push(b+e)}c=e+(c.length>0?" "+c:c)}return c})(e,n);return i(e,o),o};return o=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Os(e.cacheSize),parseClassName:Ms(e),sortModifiers:Ps(e),postfixLookupClassGroupIds:Ls(e),...ys(e)}))(l),r=n.cache.get,i=n.cache.set,o=a,a(s)},(...e)=>o(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=js(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Ds=[],$s=e=>{const t=t=>t[e]||Ds;return t.isThemeGetter=!0,t.themeKey=e,t},Fs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bs=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Us=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ws=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Vs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ks=e=>Bs.test(e),Ys=e=>!!e&&!Number.isNaN(Number(e)),Js=e=>!!e&&Number.isInteger(Number(e)),Xs=e=>e.endsWith("%")&&Ys(e.slice(0,-1)),Zs=e=>Us.test(e),Qs=()=>!0,el=e=>Hs.test(e)&&!Ws.test(e),tl=()=>!1,nl=e=>Vs.test(e),rl=e=>Gs.test(e),il=e=>!sl(e)&&!ml(e),ol=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),al=e=>Sl(e,Al,tl),sl=e=>Fs.test(e),ll=e=>Sl(e,Il,el),cl=e=>Sl(e,Ol,Ys),ul=e=>Sl(e,Nl,Qs),dl=e=>Sl(e,_l,tl),pl=e=>Sl(e,Cl,tl),hl=e=>Sl(e,El,rl),fl=e=>Sl(e,Ml,nl),ml=e=>qs.test(e),gl=e=>Tl(e,Il),yl=e=>Tl(e,_l),bl=e=>Tl(e,Cl),vl=e=>Tl(e,Al),wl=e=>Tl(e,El),kl=e=>Tl(e,Ml,!0),xl=e=>Tl(e,Nl,!0),Sl=(e,t,n)=>{const r=Fs.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},Tl=(e,t,n=!1)=>{const r=qs.exec(e);return!!r&&(r[1]?t(r[1]):n)},Cl=e=>"position"===e||"percentage"===e,El=e=>"image"===e||"url"===e,Al=e=>"length"===e||"size"===e||"bg-size"===e,Il=e=>"length"===e,Ol=e=>"number"===e,_l=e=>"family-name"===e,Nl=e=>"number"===e||"weight"===e,Ml=e=>"shadow"===e,Pl=/*#__PURE__*/zs(()=>{const e=$s("color"),t=$s("font"),n=$s("text"),r=$s("font-weight"),i=$s("tracking"),o=$s("leading"),a=$s("breakpoint"),s=$s("container"),l=$s("spacing"),c=$s("radius"),u=$s("shadow"),d=$s("inset-shadow"),p=$s("text-shadow"),h=$s("drop-shadow"),f=$s("blur"),m=$s("perspective"),g=$s("aspect"),y=$s("ease"),b=$s("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ml,sl],w=()=>[ml,sl,l],k=()=>[Ks,"full","auto",...w()],x=()=>[Js,"none","subgrid",ml,sl],S=()=>["auto",{span:["full",Js,ml,sl]},Js,ml,sl],T=()=>[Js,"auto",ml,sl],C=()=>["auto","min","max","fr",ml,sl],E=()=>["auto",...w()],A=()=>[Ks,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],I=()=>[s,Ks,"screen","full","dvw","lvw","svw","min","max","fit",...w()],O=()=>[Ks,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],_=()=>[e,ml,sl],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",bl,pl,{position:[ml,sl]}],M=()=>["auto","cover","contain",vl,al,{size:[ml,sl]}],P=()=>[Xs,gl,ll],L=()=>["","none","full",c,ml,sl],R=()=>["",Ys,gl,ll],j=()=>[Ys,Xs,bl,pl],z=()=>["","none",f,ml,sl],D=()=>["none",Ys,ml,sl],$=()=>["none",Ys,ml,sl],F=()=>[Ys,ml,sl],q=()=>[Ks,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[Qs],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[il],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",Ys],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ks,sl,ml,g]}],container:["container"],"container-type":[{"@container":["","normal","size",ml,sl]}],"container-named":[ol],columns:[{columns:[Ys,"auto",sl,ml,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Js,"auto",ml,sl]}],basis:[{basis:[Ks,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ys,Ks,"auto","initial","none",sl]}],grow:[{grow:["",Ys,ml,sl]}],shrink:[{shrink:["",Ys,ml,sl]}],order:[{order:[Js,"first","last","none",ml,sl]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],w:[{w:[s,"screen",...A()]}],"min-w":[{"min-w":[s,"screen","none",...A()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh","none",...A()]}],"font-size":[{text:["base",n,gl,ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xl,ul]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xs,sl]}],"font-family":[{font:[yl,dl,t]}],"font-features":[{"font-features":[sl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ml,sl]}],"line-clamp":[{"line-clamp":[Ys,"none",ml,cl]}],leading:[{leading:["none",o,...w()]}],"list-image":[{"list-image":["none",ml,sl]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ml,sl]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ys,"from-font","auto",ml,ll]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Ys,"auto",ml,sl]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Js,ml,sl]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ml,sl]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ml,sl]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Js,ml,sl],radial:["",ml,sl],conic:["",Js,ml,sl]},wl,hl]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":R()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ys,ml,sl]}],"outline-w":[{outline:["",Ys,gl,ll]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","inner","none",u,kl,fl]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,kl,fl]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Ys,ll]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,kl,fl]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Ys,ml,sl]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ys]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ml,sl]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ys]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ml,sl]}],filter:[{filter:["","none",ml,sl]}],blur:[{blur:z()}],brightness:[{brightness:[Ys,ml,sl]}],contrast:[{contrast:[Ys,ml,sl]}],"drop-shadow":[{"drop-shadow":["","none",h,kl,fl]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Ys,ml,sl]}],"hue-rotate":[{"hue-rotate":[Ys,ml,sl]}],invert:[{invert:["",Ys,ml,sl]}],saturate:[{saturate:[Ys,ml,sl]}],sepia:[{sepia:["",Ys,ml,sl]}],"backdrop-filter":[{"backdrop-filter":["","none",ml,sl]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[Ys,ml,sl]}],"backdrop-contrast":[{"backdrop-contrast":[Ys,ml,sl]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ys,ml,sl]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ys,ml,sl]}],"backdrop-invert":[{"backdrop-invert":["",Ys,ml,sl]}],"backdrop-opacity":[{"backdrop-opacity":[Ys,ml,sl]}],"backdrop-saturate":[{"backdrop-saturate":[Ys,ml,sl]}],"backdrop-sepia":[{"backdrop-sepia":["",Ys,ml,sl]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ml,sl]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ys,"initial",ml,sl]}],ease:[{ease:["linear","initial",y,ml,sl]}],delay:[{delay:[Ys,ml,sl]}],animate:[{animate:["none",b,ml,sl]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ml,sl]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:D()}],"rotate-x":[{"rotate-x":D()}],"rotate-y":[{"rotate-y":D()}],"rotate-z":[{"rotate-z":D()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[ml,sl,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:q()}],"translate-x":[{"translate-x":q()}],"translate-y":[{"translate-y":q()}],"translate-z":[{"translate-z":q()}],"translate-none":["translate-none"],zoom:[{zoom:[Js,ml,sl]}],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ml,sl]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":_()}],"scrollbar-track-color":[{"scrollbar-track":_()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ml,sl]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Ys,gl,ll,cl]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Ll=function(e,{componentKey:t,className:n,variants:r}){let{theme:i}=h(cs);e=hs(e);let o=hs(n),a=f((t,n={},r="")=>(n={...n,className:r},"string"==typeof e?pr(i.components[e],t,void 0)?.(n)??r:e.map(e=>pr(i.components[e],t,void 0)?.(n)).filter(Boolean).join(" ")||r),[i.components,e]);return t=k(()=>void 0!==t?t:e&&"string"==typeof e?Object.keys(i.components[e]):Array.isArray(e)&&e.length>0?e.map(e=>Object.keys(i.components[e])).flat():void 0,[e,i.components]),k(()=>{if(t&&"string"==typeof t)return Pl(a(t,r,o&&"object"==typeof o?pr(o,t,""):o));if(t&&Array.isArray(t)){let e={};return t.forEach((t,n)=>{let i;"object"==typeof o?i=pr(o,t):"string"==typeof o&&0===n&&(i=o);let s=Pl(a(t,r,i));t.split(".").length>1?hr(e,t.split(".").slice(1).join("."),s):hr(e,t,s)}),e}return""},[t,o,a,r])},Rl=({ref:e,className:t,children:n,testId:r,direction:i,wrap:o,items:a,gap:s,justify:l,grow:c,basis:u,alignItems:d,shrink:p,...h})=>(t=Ll("Flex",{className:t,componentKey:"root",variants:{direction:i,wrap:o,items:a,gap:s,justify:l,grow:c,basis:u,shrink:p,alignItems:d}}),/* @__PURE__ */I("div",{...h,"data-testid":r,className:t,ref:e,children:n})),jl=(e,t,n="primary")=>e?"disabled":t&&"primary"===n?"primaryActive":t&&"secondary"===n?"secondaryActive":t&&"tertiary"===n?"tertiaryActive":n,zl=({className:e,children:t,icon:r,active:i=!1,disabled:o=!1,testId:a,intent:l,size:c,cursor:d,title:p,...h})=>{let f=Ll("Icon",{className:e,componentKey:"root",variants:{intent:jl(o,i,l),size:c,cursor:o?"disabled":d}}),{iconChildren:m}=k(()=>{let e={iconChildren:void 0};return n.forEach(t,t=>{u(t)&&(e.iconChildren=s(t,{...h,className:V({"h-[1em] w-[1em]":"custom"!==c},f,t.props.className),title:p}))}),e},[t,f,h,c,p]);return m||/* @__PURE__ */I("i",{...h,title:p,"data-testid":a,className:V(r,f)})},Dl=({ref:e,children:t,testId:r,className:i="",iconPlacement:o="none",loading:a=!1,disabled:l=!1,type:c="button",size:d,intent:p,border:h,justify:f,items:m,aspect:g,...y})=>{let b=Ll("Button",{className:i,componentKey:["root","icon"],variants:{intent:p,size:d,border:h,justify:f,items:m,disabled:l,aspect:g}}),{iconChildren:v,contentChildren:w}=k(()=>{let e={iconChildren:void 0,contentChildren:void 0};return n.forEach(t,t=>{if("string"!=typeof t){if(u(t))if(t.type===zl){let n=t.props;e.iconChildren=s(t,{className:V(b.icon,n.className),size:d,testId:r?`${r}-icon`:void 0,...n,intent:n.intent??"custom"})}else if("i"===t.type){let n=t.props;e.iconChildren=s(t,{className:V(b.icon,n.className),size:d,"data-testid":r?`${r}-icon`:void 0,...n,intent:n.intent??"custom"})}else e.contentChildren=t}else e.contentChildren=t}),e},[t,b.icon,d,r]);/* @__PURE__ */
20
+ URL.createObjectURL(n)))}catch(e){return void console.error(e)}})(e).finally(()=>{Hr.delete(e)});Hr.set(e,{promise:t,timestamp:Date.now()})}let o=await(Hr.get(e)?.promise),[{default:a},{default:s},{nestedInject:l}]=await Promise.all([Promise.resolve().then(()=>Gu),Promise.resolve().then(()=>sE),Promise.resolve().then(()=>BN)]);if(!o)return{default:s};let{type:c,pluginSettings:u}=pr(o,"default",{}),{version:d,initialItems:p,plugins:h}=o;if(!c)return{default:s};let f=o.default;return r||(f=a(o.default)),f.version=d,f.origin="remote",f.type=c,f.initialItems=p,f.pluginSettings=u,f.plugins=l(h,"remote"),n&&t(f),i&&i!==c?{default:(r?h?.[i]:f.plugins[i])??s}:{default:f}})(e,s,r,i,t)),[e,t]);return l?/* @__PURE__ */I(a,i?{children:/* @__PURE__ */I(u,{internalProps:n,plitziJsxSkipHOC:i,...o})}:{children:/* @__PURE__ */I(u,{internalProps:n})}):null},Yr=({type:e,plugins:t})=>{let n=(e?t[e]:void 0)??((e,t)=>Object.values(e).find(e=>e.subPlugins.find(e=>e===t)))(t,e);if(!n)return;let r=pr(n,"assets",[]).filter(e=>"script"===e.type);return{url:r.find(e=>e.isMain)?.params.src??pr(r,"0.params.src","")}},Jr=({key:e,plitziElementLayout:t,type:n,internalProps:r,components:i,plugins:o})=>{let a={...r,plitziElementLayout:t},s=i.notFound?/* @__PURE__ */I(i.notFound,{internalProps:a},e):void 0;if(!n)return s;let l=i[n];if(l)/* @__PURE__ */return I(l,{internalProps:a,extraProps:l.extraProps},e);let c=Yr({type:n,plugins:o});return c?/* @__PURE__ */I(Kr,{url:c.url,type:n,internalProps:a},e):s},Xr=K("LayoutBodyContext",void 0),Zr=()=>{},Qr=({bodies:e,children:t})=>{let[n]=S(()=>({current:e,listeners:/* @__PURE__ */new Set}));return w(()=>{n.current!==e&&(n.current=e,n.listeners.forEach(e=>e()))},[e,n]),/* @__PURE__ */I(Xr,{value:n,children:t})},ei=e=>{let t={};for(let n of e.split(";")){let e=n.indexOf(":");if(-1===e)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();if(r&&i){let e=r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());t[e]=i}}return t},ti=({id:e,frozen:t,children:n})=>{let[r]=S(()=>{if(!t||typeof document>"u")return null;let n=document.querySelector(`[data-rsc-id="${e}"]`);if(!n)return null;let r={};for(let e=0;e<n.attributes.length;e++){let{name:t,value:i}=n.attributes[e];"class"!==t&&"style"!==t&&"data-rsc-id"!==t&&(r[t]=i)}let i=n.getAttribute("style");return{tag:n.tagName.toLowerCase(),className:n.className,style:i?ei(i):void 0,attrs:r,html:n.innerHTML}});return r&&t?c(r.tag,{"data-rsc-id":e,className:r.className||void 0,style:r.style,...r.attrs,dangerouslySetInnerHTML:{__html:r.html}}):n},ni="[A-Za-z_][A-Za-z0-9_]*",ri=RegExp(`^${ni}$`),ii=(/* @__PURE__ */RegExp(`^!?${ni}$`),new Set(["__proto__","constructor","prototype"])),oi=e=>ri.test(e)&&!ii.has(e),ai=(e,t)=>{if(e)for(let n of e.split(";")){let e=n.indexOf("=");if(e>-1&&n.slice(0,e).trim()===t)try{return decodeURIComponent(n.slice(e+1).trim())}catch{return}}},si=()=>{try{return typeof document>"u"?void 0:document.cookie}catch{return}},li=e=>{let t=e?.split(":")[1];return t?`plitzi_flags_${t}`:"plitzi_flags"},ci=(e,t,n)=>{let{[t]:r,...i}=e;return void 0===n?i:{...i,[t]:n}},ui=(e,t)=>{let n=li(e),r=(e=>Object.entries(e).filter(([e])=>oi(e)).map(([e,t])=>`${e}:${t?"1":"0"}`).join(","))(t);try{document.cookie=r?`${n}=${encodeURIComponent(r)};path=/;SameSite=Lax`:`${n}=;path=/;max-age=0;SameSite=Lax`}catch{}},di=e=>"number"==typeof e||"string"==typeof e&&!e.includes(",")&&!Number.isNaN(parseFloat(e)),pi=e=>{if(!e||"object"!=typeof e)return;let{combinator:t,enabled:n}=e,{rules:r}=e;return Array.isArray(r)?(r=r.map(e=>{if((e=>"rules"in e)(e))return pi(e);let{field:t,value:n,operator:r,enabled:i,isBinding:o}=e;return{field:t,value:n,operator:r,enabled:i,isBinding:o}}).filter(Boolean),{rules:r,combinator:t,enabled:n}):void 0},hi=(e,t="json")=>pi(e),fi=(e,t)=>"boolean"==typeof e&&"string"==typeof t?e===(t="true"===(t=t.toLowerCase())||"1"===t):"string"==typeof e&&"boolean"==typeof t?(e="true"===(e=e.toLowerCase())||"1"===e)===t:("number"==typeof e&&(e=`${e}`),"number"==typeof t&&(t=`${t}`),e===t),mi=(e,t)=>null!=e&&null!=t&&(Br(e)&&Br(t)?(e=qr(e),t=qr(t),parseFloat(t)>parseFloat(e)):di(e)?(e=parseFloat(e),t=parseFloat(t),di(t)&&t>e):t>e),gi=(e,t)=>mi(e,t)||fi(e,t),yi=(e,t)=>null!=e&&null!=t&&(Br(e)&&Br(t)?(e=qr(e),t=qr(t),parseFloat(t)<parseFloat(e)):di(e)?(e=parseFloat(e),t=parseFloat(t),di(t)&&t<e):t<e),bi=(e,t)=>yi(e,t)||fi(e,t),vi=(e,t)=>Array.isArray(t)?t.some(t=>fi(e,t)):"string"==typeof e&&"string"==typeof t&&t.toLowerCase().includes(e.toLowerCase()),wi=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().startsWith(e.toLowerCase()),ki=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().endsWith(e.toLowerCase()),xi=e=>{switch(typeof e){case"boolean":case"number":case"function":return!1;case"object":case"undefined":return null==e||0===Object.keys(e).length;default:return!e}},Si=(e,t)=>("string"==typeof e&&e.includes(",")?e=e.split(",").map(e=>e.trim()):("string"==typeof e||"number"==typeof e)&&(e=[e]),!!Array.isArray(e)&&("string"==typeof t&&t.includes(",")&&(t=t.split(",").map(e=>e.trim())),Array.isArray(t)?t.some(t=>di(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t)):di(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t))),Ti=(e,t)=>{let n=[];return"string"==typeof e&&(n=e.split(",").map(e=>e.trim())),!(n.length<2)&&gi(n[0],t)&&bi(n[1],t)},Ci=(e,t={},n=!1,r=!1)=>{if(!e)return r;let{combinator:i,rules:o,enabled:a}=e;if(!Array.isArray(o))return r;if(!1===a)return!0;let s=o.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ci(e,t,n):((e,t)=>{let{field:n,operator:r,isBinding:i}=e,{value:o}=e,a=pr(t,n);switch(i&&(o=pr(t,e.value)),r){case"=":return fi(o,a);case"!=":return!fi(o,a);case"<":return yi(o,a);case">":return mi(o,a);case"<=":return bi(o,a);case">=":return gi(o,a);case"contains":return vi(o,a);case"doesNotContain":return!vi(o,a);case"beginsWith":return wi(o,a);case"doesNotBeginWith":return!wi(o,a);case"endsWith":return ki(o,a);case"doesNotEndWith":return!ki(o,a);case"empty":return xi(a);case"notEmpty":return!xi(a);case"in":return Si(o,a);case"notIn":return!Si(o,a);case"between":return Ti(o,a);case"notBetween":return!Ti(o,a);default:return!1}})(e,t));return n?s:"and"===i?!s.includes(!1):s.includes(!0)},Ei=(e,t={},n=!1,r=!1)=>Ci(hi(e),t,n,r),Ai=(e,t,n,r=!1)=>{let{rules:i,enabled:o}=e;if(!Array.isArray(i)||!1===o)return{};let a=i.filter(e=>!1!==e.enabled).flatMap(e=>"rules"in e?Ai(e,t,n,!0):e);return r?a:a.reduce((e,r)=>{let{field:i,isBinding:o,value:a}=r;return o&&hr(e,a,pr(t,a,n)),hr(e,i,pr(t,i,n)),e},{})},Ii=(e,t={},n=void 0)=>Ai(hi(e),t,n),Oi=["server","sdk","qa"],_i=(e,t)=>{let n=((e,t)=>Array.isArray(e.rules)?e.rules.findIndex(e=>(e=>"object"==typeof e&&!!e&&"rules"in e&&Array.isArray(e.rules)&&e.rules.some(e=>!("object"!=typeof e||!e||"enabled"in e&&!1===e.enabled)))(e.when)&&((e,t)=>!!Ei(e,t))(e.when,t)):-1)(e,t);return-1===n?{value:e.value,layer:"space"}:{value:e.rules[n].value,layer:"space",rule:n}},Ni=(e,t={},n={})=>Object.fromEntries(Object.entries(e??{}).map(([e,r])=>[e,Oi.reduce((t,r)=>{let i=n[r]?.[e];return"boolean"==typeof i?{value:i,layer:r}:t},_i(r,t))])),Mi=e=>Object.fromEntries(Object.entries(e).map(([e,{value:t}])=>[e,t])),Pi=(e,t)=>!e||(t[e.name]??!1)===e.is,Li=K("PluginsContext",{assets:{}}),Ri=typeof window>"u",ji={},zi=()=>()=>{},Di=()=>!0,$i=()=>!1,Fi=({id:e,definition:t,plitziElementLayout:n,children:r,previewMode:o,visible:a=!0})=>{let[[s,l]]=Dt(["schema.flat","rsc.enabled"],{mode:"mount"}),[c=ji]=Dt("runtime.sources.flags"),{components:d,componentDefinitions:p}=h(Wr),{plugins:m}=h(Li),{items:g}=t,y=p.current[t.type],b=t.loadStrategy??y?.definition.loadStrategy??"eager",v=n||r||g?.length,w=x(!1);a&&(w.current=!0);let S=!o||"eager"===b||a||"lazy"===b&&w.current,C=n?`${n.type}:${n.rootId}:${n.slots.join(",")}`:"",E=T(zi,Di,$i),A=n?.slots.includes(e)??!1,O=(e=>{let t=h(Xr),n=f(n=>void 0!==e&&t?(t.listeners.add(n),()=>{t.listeners.delete(n)}):Zr,[e,t]),r=f(()=>void 0!==e&&t?t.current[e]:void 0,[e,t]);return T(n,r,r)})(A?e:void 0);return k(()=>{if(!v||!S)return;let e=(g??[]).filter(e=>{let t=s[e];if(!t||!Pi(t.definition.flag,c))return!1;if(!o||!l)return!0;let n=t.definition.runtime??"shared";return!(!E&&"client"===n)}).map(e=>{let{rootId:t,type:r,runtime:i}=pr(s,`${e}.definition`,{}),a=pr(n,"rootId",t),c=r in d.current||!!Yr({type:r,plugins:m}),u=Jr({key:!o&&n?`${e}_${C}`:e,plitziElementLayout:n,type:r,internalProps:{id:e,rootId:a},components:d.current,plugins:m});return l&&"server"===i&&!Ri&&o?/* @__PURE__ */I(ti,{id:e,frozen:!(E&&c),children:u},e):u});return A&&e.push(/* @__PURE__ */I(i,{children:O},"#layout-body")),Array.isArray(r)?e.push(...r.filter(u)):u(r)&&e.push(/* @__PURE__ */I(i,{children:r},"#children")),g?1===e.length?e[0]:e:void 0},[v,S,g,c,n,r,s,o,l,E,C,d,m,A,O])},qi=U()({type:"blockHtml",content:{attributes:{content:""},definition:{label:"HTML Block",description:"Renders an arbitrary raw HTML string as a block. Escape hatch when no structured element fits."},market:{category:"advanced",icon:"fa-brands fa-html5"},defaultStyle:{style:{base:{default:{}}}}}}),Bi=U()({type:"blockJsx",content:{attributes:{content:'import { useCallback } from "react";\nimport { JsxManager } from "@plitzi/plitzi-sdk";\n\nconst BlockJsx = ({ internalProps, content, content2 }) => {\n const handleClick = useCallback(() => {\n alert("Hello World");\n }, []);\n\n return (\n <div style={{ display: "flex", gap: "4px" }}>\n <JsxManager\n as="Heading"\n internalProps={internalProps}\n content={`${content} ${content2}`}\n />\n <button onClick={handleClick} style={{ border: "1px gray solid", cursor: "pointer" }}>\n Click Me\n </button>\n </div>\n );\n};\n\nexport default BlockJsx;',props:'{"content": "Hello", "content2": "World"}',contentCache:"aW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnOwppbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gInJlYWN0IjsKaW1wb3J0IHsgSnN4TWFuYWdlciB9IGZyb20gIkBwbGl0emkvcGxpdHppLXNkayI7CnZhciBCbG9ja0pzeCA9IGZ1bmN0aW9uIEJsb2NrSnN4KF9yZWYpIHsKICB2YXIgaW50ZXJuYWxQcm9wcyA9IF9yZWYuaW50ZXJuYWxQcm9wcywKICAgIGNvbnRlbnQgPSBfcmVmLmNvbnRlbnQsCiAgICBjb250ZW50MiA9IF9yZWYuY29udGVudDI7CiAgdmFyIGhhbmRsZUNsaWNrID0gdXNlQ2FsbGJhY2soZnVuY3Rpb24gKCkgewogICAgYWxlcnQoIkhlbGxvIFdvcmxkIik7CiAgfSwgW10pOwogIHJldHVybiAvKiNfX1BVUkVfXyovUmVhY3QuY3JlYXRlRWxlbWVudCgiZGl2IiwgewogICAgc3R5bGU6IHsKICAgICAgZGlzcGxheTogImZsZXgiLAogICAgICBnYXA6ICI0cHgiCiAgICB9CiAgfSwgLyojX19QVVJFX18qL1JlYWN0LmNyZWF0ZUVsZW1lbnQoSnN4TWFuYWdlciwgewogICAgYXM6ICJIZWFkaW5nIiwKICAgIGludGVybmFsUHJvcHM6IGludGVybmFsUHJvcHMsCiAgICBjb250ZW50OiAiIi5jb25jYXQoY29udGVudCwgIiAiKS5jb25jYXQoY29udGVudDIpCiAgfSksIC8qI19fUFVSRV9fKi9SZWFjdC5jcmVhdGVFbGVtZW50KCJidXR0b24iLCB7CiAgICBvbkNsaWNrOiBoYW5kbGVDbGljaywKICAgIHN0eWxlOiB7CiAgICAgIGJvcmRlcjogIjFweCBncmF5IHNvbGlkIiwKICAgICAgY3Vyc29yOiAncG9pbnRlcicKICAgIH0KICB9LCAiQ2xpY2sgTWUiKSk7Cn07CmV4cG9ydCBkZWZhdWx0IEJsb2NrSnN4Ow==",allowEmptyRender:!1},definition:{label:"Block JSX",description:"A compiled JSX block for advanced authoring."},market:{category:"advanced",icon:"fa-solid fa-code"},defaultStyle:{style:{base:{default:{}}}}}}),Ui=U()({type:"custom",content:{attributes:{renderType:"",settings:"{}",isPlugin:!1,assets:"",scriptUrl:""},definition:{label:"Custom",description:"A custom element slot whose behaviour is supplied by a host/plugin component."},market:{category:"advanced",icon:"fa-solid fa-paintbrush"},defaultStyle:{name:"Custom Element",style:{base:{default:{display:"flex","justify-content":"center","align-items":"center"}}}}}}),Hi=U()({type:"nodeHtml",content:{attributes:{subType:"div"},definition:{label:"Html Node",description:"A single raw HTML tag with custom attributes.",items:[]},market:{category:"advanced",icon:"fa-brands fa-html5"},defaultStyle:{style:{base:{default:{}}},subTypes:{hr:{name:"HR Node",displayMode:"desktop",style:{base:{default:{"border-top-width":"1px"}}}}}}}}),Wi=U()({type:"reference",content:{attributes:{referenceType:"element",referenceId:""},definition:{label:"Reference",description:"Places one of the components of the space, or renders another of its elements by id, in place.",items:[]},market:{category:"advanced",icon:"fa-solid fa-asterisk"},defaultStyle:{name:"Reference Element",style:{base:{default:{}}}}}}),Vi={"padding-top":"6px","padding-left":"12px","padding-right":"12px","padding-bottom":"6px",cursor:"pointer","font-size":"16px","line-height":"1.5","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px"},Gi=U()({type:"button",attributeValues:{subType:["button","submit","reset"],contentPlacement:["before","after"],iconPlacement:["before","after"]},content:{attributes:{contentPlacement:"after",content:"Button",icon:"",iconPlacement:"before",subType:"button",disabled:!1},definition:{label:"Button",description:"A clickable button. On its own it only renders; wire an interaction flow (trigger onClick → callbacks) to make it DO something. Its words are its `content` and an icon beside them its `icon` (Font Awesome classes) — no text or fontAwesome element inside it for them.",items:[],styleSelectors:{icon:""}},market:{category:"basic",icon:"fa-solid fa-hand-pointer"},defaultStyle:{style:{base:{default:Vi}},subTypes:{button:{name:"Default Button",displayMode:"desktop",style:{base:{default:Vi}}},reset:{name:"Reset Button",displayMode:"desktop",style:{base:{default:Vi}}},submit:{name:"Submit Button",displayMode:"desktop",style:{base:{default:Vi}}}}}}}),Ki=U()({type:"dropdown",attributeValues:{popupPlacement:["left","right","top","bottom"]},content:{attributes:{popupPlacement:"bottom",openPopup:!1,backgroundDisabled:!1,closeOnClickBackground:!0,closeOnClickPopup:!0,containerTopOffset:5,containerLeftOffset:5,disabled:!1},definition:{label:"Dropdown",description:"A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.",items:[],styleSelectors:{backgroundContainer:""}},market:{category:"basic",icon:"fa-solid fa-angle-down"},defaultStyle:{style:{base:{default:{cursor:"pointer","user-select":"none"}},backgroundContainer:{default:{top:0,bottom:0,left:0,right:0,position:"fixed",cursor:"default","z-index":50}}}}},initialItems:["dropdownPopup"]}),Yi=U()({type:"dropdownPopup",ancestorType:"dropdown",content:{attributes:{},definition:{label:"Dropdown Popup",description:"The floating panel revealed by a dropdown.",items:[],initialState:{}},builder:{canDelete:!1,canDragDrop:!1,canMove:!1,canSnippet:!1},market:{category:"basic",icon:"fa-regular fa-window-restore"},defaultStyle:{style:{base:{default:{"background-color":"light-dark(white, oklch(0.21 0.006 285.885))","min-height":"24px","min-width":"24px","padding-right":"4px","padding-bottom":"4px","padding-left":"4px","padding-top":"4px",position:"fixed",display:"flex","flex-direction":"column","border-top-right-radius":"4px","border-bottom-right-radius":"4px","border-bottom-left-radius":"4px","border-top-left-radius":"4px","box-shadow":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 4px 11px","z-index":100}}},subTypes:{}}},initialItems:[]}),Ji=U()({type:"heading",attributeValues:{subType:["h1","h2","h3","h4","h5","h6"]},content:{attributes:{content:"Heading",subType:"h1"},definition:{label:"Heading",description:"A section heading (<h1>–<h6>) for titles and document hierarchy."},market:{category:"basic",icon:"fa-solid fa-heading"},defaultStyle:{style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-weight":700}}},subTypes:{h1:{name:"H1 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"38px","font-weight":700,"line-height":"1.158"}}}},h2:{name:"H2 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"32px","font-weight":700,"line-height":"1.125"}}}},h3:{name:"H3 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"24px","font-weight":700,"line-height":"1.25"}}}},h4:{name:"H4 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"18px","font-weight":700,"line-height":"1.333"}}}},h5:{name:"H5 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"14px","font-weight":700,"line-height":"1.429"}}}},h6:{name:"H6 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"12px","font-weight":700,"line-height":"1.5"}}}}}}}}),Xi=U()({type:"link",attributeValues:{mode:["page","internal","external"],target:["self","blank","parent","top"],contentPlacement:["before","after"],iconPlacement:["before","after"],current:["page","section"]},content:{attributes:{href:"#",target:"self",mode:"page",hash:"",label:"",content:"",contentPlacement:"after",icon:"",iconPlacement:"before",current:"page"},definition:{label:"Link",description:"Navigation. Moves the user between pages of the site or to an external URL (its `mode`/`href` decide which). Use this to go page-to-page rather than a button + interaction. Its words are its own `content` and an icon beside them its `icon` (Font Awesome classes) — no text or fontAwesome element inside it for them. It marks itself current on the page it leads to (`aria-current`, the `current` style state); its `current` set to `section` keeps it current on every page under its path too — a menu entry for a section and its pages.",items:[],styleSelectors:{icon:""}},builder:{itemsNotAllowed:["link"]},market:{category:"basic",icon:"fa-solid fa-link"},defaultStyle:{style:{base:{default:{display:"inline-block",color:"inherit","text-decoration":"none",cursor:"pointer"}}}}}}),Zi=U()({type:"markdown",content:{attributes:{content:"Markdown",headingLinks:!0},definition:{label:"Markdown",description:"Renders a Markdown source string (GitHub-flavoured) as HTML, inside a `div.markdown`. Each part of it takes a class through the slot named for it: `heading` (every `h1`–`h6`) and `heading1`…`heading6` (that level only, beside it — a property goes on one of the two, never both), `paragraph`, `link`, `strong`, `emphasis` (`em`), `list` (`ul`/`ol`), `listItem`, `quote` (`blockquote`), `divider` (`hr`), `code` (inline), `image`, `table`, `tableHead` (`thead`), `tableRow`, `tableHeaderCell` (`th`) and `tableCell` (`td`). A fenced block is `codeBlock` (its `pre`) in `codeBlockFrame`, under `codeBlockHeader`, which holds `codeBlockLanguage` and the `codeBlockCopy` button. Every heading carries an id made of its words, which `/page#its-words` lands on, and starts with an empty link to itself — `a.anchor > span.octicon-link`, the `anchor` slot; `headingLinks: false` leaves the link out and keeps the id. Unstyled, it reads as a document — headings, lists, code, tables — from the base layer of the SDK, which a class on the slot of a part replaces property by property.",styleSelectors:{heading:"",heading1:"",heading2:"",heading3:"",heading4:"",heading5:"",heading6:"",paragraph:"",link:"",strong:"",emphasis:"",list:"",listItem:"",quote:"",divider:"",code:"",codeBlock:"",codeBlockFrame:"",codeBlockHeader:"",codeBlockLanguage:"",codeBlockCopy:"",image:"",table:"",tableHead:"",tableRow:"",tableHeaderCell:"",tableCell:"",anchor:""}},market:{category:"basic",icon:"fa-brands fa-markdown"},defaultStyle:{style:{base:{default:{}}}}}}),Qi=U()({type:"paragraph",content:{attributes:{content:"Paragraph"},definition:{label:"Paragraph",description:"A block of body text (a <p>). Use for longer prose passages."},market:{category:"basic",icon:"fa-solid fa-paragraph"},defaultStyle:{style:{base:{default:{"margin-top":"14px","margin-bottom":"14px"}}}}}}),eo=U()({type:"richText",attributeValues:{format:["html","markdown","text"]},content:{attributes:{content:"",format:"html",mediaBaseUrl:""},definition:{label:"Rich Text",description:"Renders a body field coming from a CMS — HTML, markdown or plain text. Scripts and event handlers are stripped before rendering, so third-party content cannot execute. The parts of an HTML or markdown body take a class through the slots a `markdown` has, by the same names: `heading` and `heading1`…`heading6` (a property on one of the two, never both), `paragraph`, `link`, `strong` (`strong`/`b`), `emphasis` (`em`/`i`), `list`, `listItem`, `quote`, `divider`, `code` (inline), `codeBlock` (`pre`), `image`, `table`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`; the fenced block of a markdown body also sits in `codeBlockFrame`, under `codeBlockHeader` with `codeBlockLanguage` and `codeBlockCopy`. Unstyled, a body reads as a document from the base layer of the SDK, which a class on the slot of a part replaces property by property.",items:[],styleSelectors:{heading:"",heading1:"",heading2:"",heading3:"",heading4:"",heading5:"",heading6:"",paragraph:"",link:"",strong:"",emphasis:"",list:"",listItem:"",quote:"",divider:"",code:"",codeBlock:"",codeBlockFrame:"",codeBlockHeader:"",codeBlockLanguage:"",codeBlockCopy:"",image:"",table:"",tableHead:"",tableRow:"",tableHeaderCell:"",tableCell:""}},market:{category:"basic",icon:"fa-solid fa-file-lines"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),to=U()({type:"text",content:{attributes:{content:"Text"},definition:{label:"Text",description:"Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text."},market:{category:"basic",icon:"fa-solid fa-align-left"},defaultStyle:{style:{base:{default:{display:"inline"}}}}}}),no={"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",display:"inline-flex","align-items":"center","background-color":"transparent",color:"inherit","font-family":"inherit","font-size":"inherit","font-style":"inherit","font-weight":"inherit","line-height":"inherit","letter-spacing":"inherit",cursor:"pointer"},ro=U()({type:"themeToggle",attributeValues:{subType:["switch","segmented"]},triggers:{onThemeChange:{action:"onThemeChange",title:"On Theme Change",type:"trigger",params:{},preview:{theme:"dark"}}},content:{attributes:{subType:"switch",lightLabel:"Light",darkLabel:"Dark",systemLabel:"System",showSystem:!1},definition:{label:"Theme Toggle",description:"Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: its buttons carry no browser look and take the colour and type around them — style them with the space own classes. A `segmented` one marks the chosen option with `aria-pressed`, which is the `current` state of its `option` slot. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that. A `switch` marks the icon of the scheme in use — the one chosen, or the machine one while none is — with `aria-current`, the `current` state of its `icon` slot.",items:[],styleSelectors:{icon:"",option:""}},market:{category:"basic",icon:"fa-solid fa-circle-half-stroke"},defaultStyle:{style:{base:{default:no},icon:{default:{}},option:{default:{...no,"row-gap":"4px","column-gap":"4px"}}},subTypes:{}}}}),io=U()({type:"form",attributeValues:{method:["get","post"]},sourceType:"apiContainer",triggers:{onSubmit:{action:"onSubmit",title:"On Form Submit",type:"trigger",params:{},preview:{values:{},actionUrl:"",method:""}}},callbacks:{performReset:{action:"performReset",title:"Reset Form",type:"callback",params:{}},setFieldValue:{action:"setFieldValue",title:"Set Field Value",type:"callback",preview:{},params:{name:{label:"Field Name",defaultValue:void 0,type:"select",options:[]},value:{type:"text",defaultValue:""}}},setFieldError:{action:"setFieldError",title:"Set Field Error",type:"callback",preview:{},params:{name:{label:"Field Name",defaultValue:void 0,type:"select",options:[]},error:{type:"text",defaultValue:""}}}},content:{attributes:{method:"get",actionUrl:"",managedByInteractions:!1,noValidate:!1,errors:{},values:{}},definition:{label:"Form",description:"A <form> that groups form controls and handles submission; wire its submit through an interaction flow.",items:[]},market:{category:"form",icon:"fa-solid fa-rectangle-list"},defaultStyle:{style:{base:{default:{}}}}}}),oo={width:"100%",display:"flex","align-items":"center","border-right-color":"#6f7780","border-right-style":"solid","border-right-width":"1px","border-top-right-radius":"4px","border-bottom-color":"#6f7780","border-bottom-style":"solid","border-bottom-width":"1px","border-bottom-right-radius":"4px","border-bottom-left-radius":"4px","border-top-left-radius":"4px","border-left-color":"#6f7780","border-left-style":"solid","border-left-width":"1px","border-top-color":"#6f7780","border-top-style":"solid","border-top-width":"1px","user-select":"none","font-size":"14px","padding-left":"16px","padding-right":"16px","padding-top":"8px","padding-bottom":"8px",outline:"none",position:"relative"},ao={...oo,"line-height":"20px"},so={display:"flex",cursor:"pointer","font-weight":"600","font-size":"14px","line-height":"18px",color:"#6b7280","user-select":"none"},lo={...so,"margin-bottom":"4px"},co={display:"block",color:"red","margin-top":"4px"},uo={color:"red","margin-left":"4px"},po={"border-top-style":"none","border-right-style":"none","border-bottom-style":"none","border-left-style":"none"},ho={height:"100%",width:"100%","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",display:"block",...po,"background-color":"transparent",color:"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit","box-shadow":"none"},fo={height:"100%",width:"100%","padding-right":"calc(1.15em + 8px)",display:"block",...po,"background-color":"transparent",color:"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit",appearance:"none",cursor:"inherit","box-shadow":"none"},mo={height:"100%","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","padding-right":"4px","padding-left":"4px",display:"flex","justify-content":"center","align-items":"center",...po,"background-color":"transparent",color:"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit","font-weight":"inherit",cursor:"pointer"},go={...oo,cursor:"pointer"},yo=(e,t,{field:n,icon:r}={})=>({name:e,displayMode:"desktop",style:{base:{default:{}},input:{default:t},...n?{field:{default:n}}:{},...r?{icon:{default:r}}:{},label:{default:lo},requiredMark:{default:uo},error:{default:co}}}),bo={field:ho},vo=U()({type:"formControl",attributeValues:{subType:["text","number","email","password","search","url","tel","date","time","checkbox","switch","select","textarea","hidden","color"]},triggers:{onChange:{action:"onChange",title:"On Change",type:"trigger",params:{},preview:{value:"",name:""}}},content:{attributes:{subType:"text",name:"",label:"Label",hideLabel:!1,placeholder:"",defaultValue:"",autoComplete:!0,autoFocus:!1,disabled:!1,options:[],required:!1,requiredMessage:"",minLength:0,minLengthMessage:"",maxLength:0,maxLengthMessage:"",formatMessage:"",pattern:"",patternMessage:"",matches:"",matchesMessage:"",readOnly:!1},definition:{label:"Form Control",description:'A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input. Optional unless `required: true`, as an HTML field is: a `requiredMessage` alone requires nothing. A select offers its `options`: `[{ label, value }, …]` — the text shown, and what the field takes. A `switch` is a checkbox announced and drawn as an on/off switch (`role="switch"`), for a setting that applies at once; both hold `true`/`false`, and a `defaultValue` of `"true"` starts them on. Its slots: `label`, `requiredMark` (the `*` that ends the label of a required field), `input` (the box a typed field or a select is drawn in — a textarea, checkbox or switch is its own box), `field` (the `<input>` or `<select>` inside that box), `icon` (the show/hide button of a password) and `error`. The box is ringed (`2px solid currentColor`) while the field inside has keyboard focus: restyle it with a `focus-within` state on the `input` slot — the box never takes `focus` itself. The thumb of a switch is no element a class reaches: the class on its `input` slot sets `--plitzi-switch-thumb` (off), `--plitzi-switch-thumb-checked` (on, white by default) and `--plitzi-switch-thumb-shadow`.',styleSelectors:{label:"",requiredMark:"",input:"",field:"",icon:"",error:""}},builder:{canSnippet:!1},market:{category:"form",icon:"fa-solid fa-i-cursor"},defaultStyle:{style:{base:{default:{}}},subTypes:{hidden:yo("Form Control Hidden",{}),text:yo("Form Control Text",ao,bo),number:yo("Form Control Number",ao,bo),email:yo("Form Control Email",ao,bo),password:yo("Form Control Password",ao,{...bo,icon:mo}),search:yo("Form Control Search",ao,bo),url:yo("Form Control URL",ao,bo),tel:yo("Form Control Phone",ao,bo),date:yo("Form Control Date",ao,bo),time:yo("Form Control Time",ao,bo),color:yo("Form Control Color",ao,bo),textarea:yo("Form Control Textarea",{...ao,color:"inherit",resize:"vertical"}),select:yo("Form Control Select",go,{field:fo}),checkbox:{name:"Form Control Checkbox",displayMode:"desktop",style:{base:{default:{}},input:{default:{"margin-top":"0px","margin-bottom":"0px","margin-left":"0px","margin-right":"4px"}},label:{default:so},requiredMark:{default:uo},error:{default:co}}},switch:{name:"Form Control Switch",displayMode:"desktop",style:{base:{default:{}},input:{default:{height:"20px",width:"36px","margin-top":"0px","margin-bottom":"0px","margin-left":"0px","margin-right":"8px",position:"relative","flex-shrink":"0","border-top-color":"currentColor","border-top-style":"solid","border-top-width":"1px","border-right-color":"currentColor","border-right-style":"solid","border-right-width":"1px","border-bottom-color":"currentColor","border-bottom-style":"solid","border-bottom-width":"1px","border-left-color":"currentColor","border-left-style":"solid","border-left-width":"1px","border-top-left-radius":"10px","border-top-right-radius":"10px","border-bottom-left-radius":"10px","border-bottom-right-radius":"10px","background-color":"transparent",transition:"background-color 150ms ease",appearance:"none",cursor:"pointer"}},label:{default:{...so,"align-items":"center"}},requiredMark:{default:uo},error:{default:co}}}}}}}),wo=U()({type:"layoutContainer",attributeValues:{subType:["div","header","footer","nav","main","section","article","aside","address","figure"]},content:{attributes:{subType:"div"},definition:{label:"Layout Container",description:"A reusable layout shell (header/footer chrome) shared across pages.",items:[]},builder:{canDragDrop:!1},market:{category:"internal",icon:"fa-solid fa-border-all"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),ko=U()({type:"loading",content:{attributes:{},definition:{label:"Loading",description:"A loading placeholder shown while data or a suspense boundary resolves."},builder:{canDragDrop:!1},market:{category:"internal",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{style:{base:{default:{}}}}}}),xo=U()({type:"notFound",content:{attributes:{},definition:{label:"Not Found",description:"The 404 screen shown when no route matches."},builder:{canDragDrop:!1},market:{category:"internal",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{style:{base:{default:{display:"flex","justify-content":"center","align-items":"center"}}}}}}),So=U()({type:"page",serverTemplates:["seoPageTitle","seoPageDescription","notFound"],attributeValues:{documentScroll:["locked","noBounce"]},triggers:{onPageLoad:{action:"onPageLoad",title:"On Page Load",type:"trigger",params:{},preview:{pageId:"",routeParams:"",queryParams:""}}},content:{attributes:{enabled:!0,name:"Page",slug:"",folder:"",layout:"",layoutContainer:"",seoEnabled:!1,seoPageTitle:"Title",seoPageDescription:"Description"},definition:{label:"Page",description:"The root of a routable screen. Managed through the page ops (upsertPage/deletePage), not added as a child element.",items:[]},builder:{canDelete:!1,canDragDrop:!1,canMove:!1},market:{category:"internal",icon:"fas fa-file"},defaultStyle:{style:{base:{default:{display:"flex","flex-direction":"column","min-height":"100%","min-width":"100%","font-family":"Arial",color:"light-dark(#333, oklch(0.92 0.004 286.32))","font-size":"14px","font-weight":400,"line-height":"16px","text-align":"left"}}}}}}),To=U()({type:"embed",content:{attributes:{src:"",title:"",loading:"lazy"},definition:{label:"Embed",description:"Another page inside this one — a map, a video player, a form — in a frame."},market:{category:"media",icon:"fa-solid fa-window-maximize"},defaultStyle:{style:{base:{default:{display:"block",width:"100%","aspect-ratio":"16 / 9","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px"}}}}}}),Co=U()({type:"fontAwesome",content:{attributes:{icon:"fas fa-flag",size:"fa-1x",iconAnimation:""},definition:{label:"Font Awesome",description:"Renders a Font Awesome icon by its icon name."},market:{category:"media",icon:"fa-solid fa-font-awesome"},defaultStyle:{style:{base:{default:{display:"inline-block","font-size":"16px"}}}}}}),Eo=U()({type:"image",attributeValues:{fetchPriority:["high","low","auto"],loadMode:["auto","eager","lazy"]},content:{attributes:{src:"",alt:"",decorative:!1,fetchPriority:"auto",loadMode:"auto"},definition:{label:"Image",description:"Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both."},market:{category:"media",icon:"fa-solid fa-image"},defaultStyle:{style:{base:{default:{display:"block",width:"140px",height:"auto","max-width":"100%"}}}}}}),Ao=U()({type:"svg",content:{attributes:{content:"",label:""},definition:{label:"SVG",description:"A drawing written as SVG markup, coloured by its class."},market:{category:"media",icon:"fa-solid fa-bezier-curve"},defaultStyle:{name:"Svg",style:{base:{default:{display:"inline-flex",width:"24px",height:"24px"}}}}}}),Io=U()({type:"video",content:{attributes:{src:"",autoPlay:!1,playsInline:!1,loop:!1,muted:!0},definition:{label:"Video",description:"Embeds a video from a URL."},market:{category:"media",icon:"fa-solid fa-video"},defaultStyle:{style:{base:{default:{display:"block",width:"400px",height:"250px"}}}}}}),Oo=U()({type:"apiContainer",attributeValues:{subType:["","div","header","footer","nav","main","section","article","aside","address","figure"],method:["get","post","put","delete","patch"],credentials:["include","omit","same-origin"],pagination:["none","url","append"]},sourceType:"apiContainer",serverTemplates:["notFound"],triggers:{onApiError:{action:"onApiError",title:"On Api Error",type:"trigger",params:{},preview:{url:"",method:"",status:"",data:""}},onApiSuccess:{action:"onApiSuccess",title:"On Api Success",type:"trigger",params:{},preview:{url:"",method:"",status:"",data:""}}},callbacks:{performQuery:{action:"performQuery",title:"Perform Query",type:"callback",preview:{},params:{input:{label:"Input (server providers)",type:"codemirror-json",defaultValue:"{}",description:"Values handed to a server-driven provider with its request, beside the page’s own route and query params — a search, a filter. Kept for the pages it loads after (`loadMore`, `goToPage`) until the next query."}}},cancelQuery:{action:"cancelQuery",title:"Cancel Query",type:"callback",preview:{},params:{}},loadMore:{action:"loadMore",title:"Load More",type:"callback",preview:{},params:{}},goToPage:{action:"goToPage",title:"Go To Page",type:"callback",preview:{},params:{page:{label:"Page",defaultValue:"1",type:"text"}}},writeRecord:{action:"writeRecord",title:"Write Record",type:"callback",preview:{action:"create"},params:{action:{label:"Endpoint",defaultValue:"create",type:"text"},recordId:{label:"Record Id",defaultValue:"",type:"text"}}}},content:{attributes:{query:"",method:"get",accessToken:"",mockData:"{}",subType:"",credentials:"same-origin",connector:"",resource:"",limit:"10",singleRecord:!1,filters:[],pagination:"none",pageParam:"page",renderWhileLoading:!1,cache:!1,staleTime:30,gcTime:300},definition:{label:"Api Container",description:'Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step, and `refreshSeconds` makes it ask again on its own every N seconds (either runtime; paused while the tab is hidden) — the way to keep a queue, feed or status board current without a plugin. A server provider (`runtime: "server"`) whose answer means the address shows nothing — a record not found — says so in `notFound`, a template against its answer (`{{ source.found == false }}`): the page is sent with status 404, rendered as written. Its `subType` (container tag) is empty by default, and then it renders NO element of its own: its children lay out directly in its parent, and any class, variant or style binding on it applies to nothing. To style the provider itself give it a tag (`subType: "div"`, `section`, …); otherwise style its parent or a child.',items:[]},market:{category:"provider",icon:"fa-solid fa-server"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),_o=U()({type:"channel",attributeValues:{subType:["","div","section","aside","main"]},sourceType:"channel",triggers:{onMessage:{action:"onMessage",title:"On Message",type:"trigger",params:{},preview:{type:"",data:"",from:"",user:"",at:"",echo:!1}},onJoin:{action:"onJoin",title:"On Join",type:"trigger",params:{},preview:{from:"",user:"",state:{}}},onLeave:{action:"onLeave",title:"On Leave",type:"trigger",params:{},preview:{from:"",user:"",state:{}}}},callbacks:{publish:{action:"publish",title:"Publish",type:"callback",preview:{},params:{type:{label:"Type",defaultValue:"",type:"text"},data:{label:"Data (JSON or a template)",defaultValue:"",type:"text"},echo:{label:"Heard on this page too",defaultValue:!1,type:"boolean"}}},setPresence:{action:"setPresence",title:"Set Presence",type:"callback",preview:{},params:{data:{label:"State (JSON or a template)",defaultValue:"",type:"text"}}}},content:{attributes:{topic:"",grant:"",keep:20,subType:""},definition:{label:"Channel",description:"A realtime channel: every OTHER page on the same `topic` hears what one publishes, within milliseconds — the page that sent it too with `echo` (its `from` is then the `me` of the channel). The topic must match a channel the space declares in its settings (`channels`), e.g. `board:{{ id }}` under `board:{id}`. A topic of a private channel (`grant: true`) opens only with `grant`, bound to the grant the action that let this visitor in returned (its `realtime.grant` step). ITS DESCENDANTS bind to its source `channel_<id>`: `connected`, `members` (with the state each announced), `messages` (the last `keep`), `last` and — on a `retain: true` channel — `retained`, the latest data the server said of each type, there as the page joins (`retained.lists`). It fires `onMessage`; `onJoin` when somebody who came after this page has announced who they are, and `onLeave` when somebody goes — each with `from`, `user` and the `state` they announced; and answers `publish({ type, data, echo })` and `setPresence({ data })`; `presence` is the state this page announces (a name, a colour). Closed in the builder and anywhere without a server.",items:[]},market:{category:"provider",icon:"fa-solid fa-tower-broadcast"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),No=U()({type:"carouselTrack",ancestorType:"carousel",content:{attributes:{},definition:{label:"Carousel Track",description:"Where a carousel shows its slides: what is inside is one slide, rendered once per item.",items:[]},builder:{canSnippet:!1},market:{category:"structure",icon:"fa-solid fa-film"},defaultStyle:{style:{base:{default:{position:"relative",overflow:"hidden"}}}}}}),Mo=U()({type:"carousel",sourceType:"carousel",triggers:{onChange:{action:"onChange",title:"On Slide Change",type:"trigger",params:{},preview:{index:"0",item:{}}}},callbacks:{next:{action:"next",title:"Next Slide",type:"callback",params:{},preview:{}},previous:{action:"previous",title:"Previous Slide",type:"callback",params:{},preview:{}},goTo:{action:"goTo",title:"Go To Slide",type:"callback",params:{index:{type:"text",label:"Index (from 0)",defaultValue:"0",canBind:!0}},preview:{}},play:{action:"play",title:"Play",type:"callback",params:{},preview:{}},pause:{action:"pause",title:"Pause",type:"callback",params:{},preview:{}}},content:{attributes:{items:[],mode:"slide",autoplay:0,pauseOnHover:!0,loop:!0,transition:"slide",speed:30,label:""},definition:{label:"Carousel",description:"Items shown one at a time, scrolled past as a marquee, or swiped as a row — with controls of its own inside.",items:[]},market:{category:"structure",icon:"fa-solid fa-images"},defaultStyle:{style:{base:{default:{position:"relative"}}}}},initialItems:["carouselTrack"]}),Po=["div","header","footer","nav","main","section","article","aside","figure"],Lo=U()({type:"container",attributeValues:{subType:["div","header","footer","nav","main","section","article","aside","address","figure","dl","dt","dd","li","h1","h2","h3","h4","h5","h6","p","span"],live:["","polite","assertive"]},content:{attributes:{subType:"div"},definition:{label:"Container",description:"Generic layout box (a div). The primary building block for structure: groups and positions child elements with flex/grid. Reach for it whenever you need to wrap or arrange other elements.",items:[]},market:{category:"structure",icon:"fa-solid fa-crop-simple"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),Ro={"min-height":"30px","min-width":"30px","padding-top":"6px","padding-bottom":"6px","padding-left":"12px","padding-right":"12px","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","background-color":"#4422ee",color:"white","line-height":"24px","font-size":"16px",outline:"none",cursor:"pointer"},jo=U()({type:"dialogContainer",sourceType:"dialogContainer",triggers:{onDialogAccept:{action:"onDialogAccept",title:"On Dialog Accept",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogReject:{action:"onDialogReject",title:"On Dialog Reject",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogOpen:{action:"onDialogOpen",title:"On Dialog Open",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogClose:{action:"onDialogClose",title:"On Dialog Close",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}}},callbacks:{openDialog:{action:"openDialog",title:"Open Dialog",type:"callback",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},closeDialog:{action:"closeDialog",title:"Close Dialog",type:"callback",preview:{},params:{}}},content:{attributes:{headerLabel:"Dialog Header",acceptButtonLabel:"Accept",rejectButtonLabel:"Cancel",autoHideAfterClick:!0},definition:{label:"Dialog Container",description:"A native <dialog> container shown or hidden through interactions (e.g. an onClick open/close).",items:[],loadStrategy:"lazy",styleSelectors:{backgroundContainer:"",rootContainer:"",headerContainer:"",headerTitle:"",headerCloseButton:"",bodyContainer:"",footerContainer:"",acceptButton:"",cancelButton:""}},market:{category:"structure",icon:"fa-regular fa-message"},defaultStyle:{style:{base:{default:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0","z-index":"200"}},backgroundContainer:{default:{height:"100%",width:"100%",left:"0",top:"0",position:"absolute","z-index":"210","background-color":"rgb(0 0 0 / 50%)"}},rootContainer:{default:{display:"flex","flex-direction":"column",position:"absolute",top:"50%",left:"50%","z-index":"250",width:"500px","max-width":"calc(100vw - 32px)","max-height":"calc(100dvh - 32px)",overflow:"auto","background-color":"light-dark(white, oklch(0.21 0.006 285.885))",transform:"translate3d(-50%, -50%, 0px)","padding-top":"20px","padding-bottom":"20px","padding-left":"20px","padding-right":"20px","border-top-left-radius":"8px","border-top-right-radius":"8px","border-bottom-left-radius":"8px","border-bottom-right-radius":"8px"}},headerContainer:{default:{display:"flex","align-items":"center","justify-content":"space-between"}},headerTitle:{default:{"font-size":"20px","font-weight":"500","line-height":"1.2"}},headerCloseButton:{default:{height:"28px",width:"28px","padding-top":"4px","padding-bottom":"4px","padding-left":"4px","padding-right":"4px",display:"flex","justify-content":"center","align-items":"center","flex-shrink":"0","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","background-color":"transparent",color:"inherit","font-style":"inherit","font-weight":"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit",cursor:"pointer"}},bodyContainer:{default:{display:"flex","flex-direction":"column","flex-grow":"1","flex-basis":"auto"}},footerContainer:{default:{display:"flex","justify-content":"flex-end","margin-top":"8px"}},acceptButton:{default:Ro},cancelButton:{default:{...Ro,"margin-left":"12px"}}},subTypes:{}}},initialItems:["container"]}),zo=U()({type:"list",attributeValues:{subType:["ul","ol"],source:["none","controlled"]},sourceType:"list",content:{attributes:{items:[],source:"none",subType:"ul"},definition:{label:"List",description:'Repeats a template (its row: a listItem, or a container with subType "li") once per entry of a data array — the way to render a dynamic collection, as a <ul> (subType "ol" for a numbered one). Bind its items to a data source (e.g. an apiContainer response).',items:[]},market:{category:"structure",icon:"fa-solid fa-list"},defaultStyle:{style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}},subTypes:{ul:{name:"List UL",displayMode:"desktop",style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}}},ol:{name:"List OL",displayMode:"desktop",style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}}}}}},initialItems:["listItem","listItem","listItem"]}),Do=U()({type:"listItem",content:{attributes:{},definition:{label:"List Item",description:"The List Item element lets you add more items to existing List elements. You can then add any content you would like to them, including links, images, etc.",items:[]},builder:{itemsNotAllowed:["listItem"]},market:{category:"structure",icon:"fa-solid fa-grip-lines"},defaultStyle:{style:{base:{default:{}}}}}}),$o=U()({type:"modalContainer",sourceType:"modalContainer",triggers:{onModalOpen:{action:"onModalOpen",title:"On Modal Open",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onModalClose:{action:"onModalClose",title:"On Modal Close",type:"trigger",preview:{},params:{}}},callbacks:{openModal:{action:"openModal",title:"Open Modal",type:"callback",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},closeModal:{action:"closeModal",title:"Close Modal",type:"callback",params:{},preview:{}}},content:{attributes:{title:"Modal Header",autoHideAfterClick:!0},definition:{label:"Modal Container",description:"A modal overlay container opened and closed through interactions; use for dialogs over the page. The element itself is fixed over the whole viewport, and holds two layers side by side — neither inside the other: `backgroundContainer`, the dim layer, `rgb(0 0 0 / 50%)` (its `background-color` is the whole dim), and `rootContainer`, the dialog, centred by `top: 50%`, `left: 50%` and `transform: translate3d(-50%, -50%, 0)` — to sit it near the top, set `top` and `transform: translateX(-50%)`; flex alignment on the dim layer moves nothing. Inside the dialog, top to bottom: `headerContainer` (with `headerTitle` and `headerCloseButton`) and `bodyContainer`.",items:[],loadStrategy:"lazy",styleSelectors:{backgroundContainer:"",rootContainer:"",headerContainer:"",headerTitle:"",headerCloseButton:"",bodyContainer:""}},market:{category:"structure",icon:"fa-regular fa-clone"},defaultStyle:{style:{base:{default:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0","z-index":"200"}},backgroundContainer:{default:{height:"100%",width:"100%",left:"0",top:"0",position:"absolute","z-index":"210","background-color":"rgb(0 0 0 / 50%)"}},rootContainer:{default:{display:"flex","flex-direction":"column",position:"absolute",top:"50%",left:"50%","z-index":"250",width:"500px","max-width":"calc(100vw - 32px)","max-height":"calc(100dvh - 32px)",overflow:"auto","background-color":"light-dark(white, oklch(0.21 0.006 285.885))",transform:"translate3d(-50%, -50%, 0px)","border-top-left-radius":"8px","border-top-right-radius":"8px","border-bottom-left-radius":"8px","border-bottom-right-radius":"8px"}},headerContainer:{default:{display:"flex","align-items":"center","justify-content":"space-between","border-bottom-width":"1px","border-bottom-color":"light-dark(#d1d5db, oklch(0.37 0.013 285.805))","border-bottom-style":"solid","padding-left":"20px","padding-right":"20px","padding-top":"10px","padding-bottom":"10px"}},headerTitle:{default:{"font-size":"20px","font-weight":"500","line-height":"1.2"}},headerCloseButton:{default:{height:"28px",width:"28px","padding-top":"4px","padding-bottom":"4px","padding-left":"4px","padding-right":"4px",display:"flex","justify-content":"center","align-items":"center","flex-shrink":"0","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","background-color":"transparent",color:"inherit","font-style":"inherit","font-weight":"inherit","line-height":"inherit","font-family":"inherit","font-size":"inherit",cursor:"pointer"}},bodyContainer:{default:{display:"flex","flex-direction":"column","flex-grow":"1","flex-basis":"auto","padding-top":"20px","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}},subTypes:{}}},initialItems:["container"]}),Fo=U()({type:"pagination",attributeValues:{mode:["pages","loadMore"],target:["url","interaction"]},triggers:{onPageChange:{action:"onPageChange",title:"On Page Change",type:"trigger",params:{},preview:{page:"1"}}},content:{attributes:{pageInfo:{},mode:"pages",target:"url",pageParam:"page",windowSize:5,previousLabel:"Previous",nextLabel:"Next",loadMoreLabel:"Load more"},definition:{label:"Pagination",description:'Pages through a list. Bind it to a provider page info: in URL mode it writes the page into the address bar so the result stays shareable and indexable, and in load-more mode it announces the next page for the provider to append. Its buttons take a class through their slots: `previous`, `page` (each numbered one — the page shown carries `aria-current="page"`, so the class\'s `current` state dresses it), `next` and `loadMore`; one with nowhere to go is disabled, the `disabled` state.',items:[],styleSelectors:{previous:"",page:"",next:"",loadMore:""}},market:{category:"structure",icon:"fa-solid fa-ellipsis"},defaultStyle:{style:{base:{default:{display:"flex","align-items":"center","row-gap":"8px","column-gap":"8px"}}},subTypes:{}}}}),qo=U()({type:"tabContainer",content:{attributes:{},definition:{label:"Tab Container",description:"A tabbed container that switches between panels; composed of header/body/item parts.",items:[]},builder:{itemsAllowed:["tabContainerHeader","tabContainerBody"]},market:{category:"structure",icon:"fa-solid fa-table-columns"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}},initialItems:["tabContainerHeader","tabContainerBody"]}),Bo=U()({type:"tabContainerBody",ancestorType:"tabContainer",content:{attributes:{},definition:{label:"Tab Container Body",description:"The panel area inside a tabContainer that shows the active tab item.",items:[]},builder:{canDelete:!1,canDragDrop:!1,canMove:!1,canSnippet:!1,itemsAllowed:["tabContainerItem"]},market:{category:"structure",icon:"fa-solid fa-table-columns"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}},initialItems:["tabContainerItem","tabContainerItem","tabContainerItem"]}),Uo=U()({type:"tabContainerHeader",ancestorType:"tabContainer",content:{attributes:{},definition:{label:"Tab Container Header",description:"The row of tab triggers inside a tabContainer.",items:[]},builder:{canDelete:!1,canDragDrop:!1,canMove:!1,canSnippet:!1,itemsAllowed:["tabContainerItem"]},market:{category:"structure",icon:"fa-solid fa-table-columns"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}},initialItems:["tabContainerItem","tabContainerItem","tabContainerItem"]}),Ho=U()({type:"tabContainerItem",content:{attributes:{},definition:{label:"Tab Container Item",description:"One selectable tab (trigger + panel) inside a tabContainer.",items:[]},builder:{itemsNotAllowed:["tabContainerItem","tabContainerHeader","tabContainerBody"]},market:{category:"structure",icon:"fa-regular fa-folder"},defaultStyle:{style:{base:{default:{}}},subTypes:{}}}}),Wo={ApiContainer:Oo,BlockHtml:qi,BlockJsx:Bi,Button:Gi,Carousel:Mo,CarouselTrack:No,Channel:_o,Container:Lo,Custom:Ui,DialogContainer:jo,Dropdown:Ki,DropdownPopup:Yi,Embed:To,FontAwesome:Co,Form:io,FormControl:vo,Heading:Ji,Image:Eo,LayoutContainer:wo,Link:Xi,List:zo,ListItem:Do,Loading:ko,Markdown:Zi,ModalContainer:$o,NodeHtml:Hi,NotFound:xo,Page:So,Pagination:Fo,Paragraph:Qi,PlitziSdk:H,Reference:Wi,RichText:eo,Svg:Ao,TabContainer:qo,TabContainerBody:Bo,TabContainerHeader:Uo,TabContainerItem:Ho,Text:to,ThemeToggle:ro,Video:Io},Vo=Object.fromEntries(Object.values(Wo).flatMap(e=>"serverTemplates"in e?[[e.type,e.serverTemplates]]:[])),Go=/* @__PURE__ */new Map,Ko=/* @__PURE__ */new Set(["false","0",""]),Yo=e=>"string"==typeof e?!Ko.has(e.trim().toLowerCase()):Array.isArray(e)?e.length>0:!!e,Jo={action:"arrayMap",title:"Array Map",type:"utility",params:{keys:{defaultValue:'[{"from": "", "to": ""}]',type:"textarea"}},preview:{sourceParsed:""},callback:(e,t)=>{let{keys:n}=t;if(!Array.isArray(e))return e;try{"string"==typeof n&&(n=JSON.parse(n))}catch{return e}return e.map(e=>{let t={};return n.forEach(n=>{"object"==typeof n&&n.from&&n.to&&hr(t,n.to,pr(e,n.from,""))}),t})}};function Xo(e,t){return+Nr(e)-+Nr(t)}var Zo={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Qo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ea={date:Qo({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Qo({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Qo({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ta={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function na(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):t;r=e.formattingValues[i]||e.formattingValues[t]}else{const t=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var ra={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:na({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:na({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:na({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:na({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:na({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function ia(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(s,e=>e.test(a)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(s,e=>e.test(a));let c;return c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:t.slice(a.length)}}}function oa(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];return a=n.valueCallback?n.valueCallback(a):a,{value:a,rest:t.slice(i.length)}}}var aa={ordinalNumber:oa({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ia({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},sa={code:"en-US",formatDistance:(e,t,n)=>{let r;const i=Zo[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:ea,formatRelative:(e,t,n,r)=>ta[e],localize:ra,match:aa,options:{weekStartsOn:0,firstWeekContainsDate:1}},la={};function ca(){return la}function ua(e){const t=Nr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function da(e,...t){const n=_r.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function pa(e,t){const n=Nr(e,t?.in);return n.setHours(0,0,0,0),n}function ha(e,t){const n=ca(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Nr(e,t?.in),o=i.getDay(),a=(o<r?7:0)+o-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function fa(e,t){return ha(e,{...t,weekStartsOn:1})}function ma(e,t){const n=Nr(e,t?.in),r=n.getFullYear(),i=_r(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=fa(i),a=_r(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=fa(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ga(e,t){const n=Nr(e,t?.in),r=n.getFullYear(),i=ca(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=_r(t?.in||e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const s=ha(a,t),l=_r(t?.in||e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=ha(l,t);return+n>=+s?r+1:+n>=+c?r:r-1}function ya(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var ba={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ya("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):ya(n+1,2)},d:(e,t)=>ya(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>ya(e.getHours()%12||12,t.length),H:(e,t)=>ya(e.getHours(),t.length),m:(e,t)=>ya(e.getMinutes(),t.length),s:(e,t)=>ya(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return ya(Math.trunc(r*Math.pow(10,n-3)),t.length)}},va={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return ba.y(e,t)},Y:function(e,t,n,r){const i=ga(e,r),o=i>0?i:1-i;return"YY"===t?ya(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):ya(o,t.length)},R:function(e,t){return ya(ma(e),t.length)},u:function(e,t){return ya(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ya(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ya(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ba.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ya(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=function(e,t){const n=Nr(e,t?.in),r=+ha(n,t)-+function(e,t){const n=ca(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=ga(e,t),o=_r(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ha(o,t)}(n,t);return Math.round(r/Ar)+1}(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):ya(i,t.length)},I:function(e,t,n){const r=function(e,t){const n=Nr(e,t?.in),r=+fa(n)-+function(e){const t=ma(e,void 0),n=_r(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),fa(n)}(n);return Math.round(r/Ar)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):ya(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):ba.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=Nr(e,t?.in);return function(e,t){const[n,r]=da(void 0,e,t),i=pa(n),o=pa(r),a=+i-ua(i),s=+o-ua(o);return Math.round((a-s)/864e5)}(n,function(e){const t=Nr(e,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):ya(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ya(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ya(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return ya(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(i=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(i=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return ba.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):ba.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):ya(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):ya(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ba.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ba.s(e,t)},S:function(e,t){return ba.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return ka(r);case"XXXX":case"XX":return xa(r);default:return xa(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ka(r);case"xxxx":case"xx":return xa(r);default:return xa(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wa(r,":");default:return"GMT"+xa(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wa(r,":");default:return"GMT"+xa(r,":")}},t:function(e,t,n){return ya(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return ya(+e,t.length)}};function wa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+t+ya(o,2)}function ka(e,t){return e%60==0?(e>0?"-":"+")+ya(Math.abs(e)/60,2):xa(e,t)}function xa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+ya(Math.trunc(r/60),2)+t+ya(r%60,2)}var Sa=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Ta=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Ca={p:Ta,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Sa(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",Sa(r,t)).replace("{{time}}",Ta(i,t))}},Ea=/^D+$/,Aa=/^Y+$/,Ia=["D","DD","YY","YYYY"];var Oa=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Na=/^'([^]*?)'?$/,Ma=/''/g,Pa=/[a-zA-Z]/;function La(e,t,n){const r=ca(),i=n?.locale??r.locale??sa,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Nr(e,n?.in);if(!function(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+Nr(e)));var t}(s))throw new RangeError("Invalid time value");let l=t.match(_a).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,Ca[t])(e,i.formatLong):e}).join("").match(Oa).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Ra(e)};if(va[t])return{isToken:!0,value:e};if(t.match(Pa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(l=i.localize.preprocessor(s,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return l.map(r=>{if(!r.isToken)return r.value;const o=r.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return Aa.test(e)}(o)||!n?.useAdditionalDayOfYearTokens&&function(e){return Ea.test(e)}(o))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),Ia.includes(e))throw new RangeError(r)}(o,t,String(e)),(0,va[o[0]])(s,o,i.localize,c)}).join("")}function Ra(e){const t=e.match(Na);return t?t[1].replace(Ma,"'"):e}function ja(e,t){const n=+Nr(e)-+Nr(t);return n<0?-1:n>0?1:n}function za(e,t,n){const[r,i,o]=da(n?.in,e,e,t),a=ja(i,o),s=Math.abs(function(e,t){const[n,r]=da(void 0,e,t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(i,o));if(s<1)return 0;1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*s);let l=ja(i,o)===-a;(function(e,t){const n=Nr(e,t?.in);return+function(e,t){const n=Nr(e,t?.in);return n.setHours(23,59,59,999),n}(n,t)===+function(e,t){const n=Nr(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}(n,t)})(r)&&1===s&&1===ja(r,o)&&(l=!1);const c=a*(s-+l);return 0===c?0:c}function Da(e,t){return function(e,t,n){const r=ca(),i=n?.locale??r.locale??sa,o=ja(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[s,l]=da(n?.in,...o>0?[t,e]:[e,t]),c=function(e,t,n){const r=Xo(e,t)/1e3;return(i=n?.roundingMethod,e=>{const t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})(r);var i}(l,s),u=(ua(l)-ua(s))/1e3,d=Math.round((c-u)/60);let p;if(d<2)return n?.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,a):c<10?i.formatDistance("lessThanXSeconds",10,a):c<20?i.formatDistance("lessThanXSeconds",20,a):c<40?i.formatDistance("halfAMinute",0,a):c<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):0===d?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",d,a);if(d<45)return i.formatDistance("xMinutes",d,a);if(d<90)return i.formatDistance("aboutXHours",1,a);if(d<1440){const e=Math.round(d/60);return i.formatDistance("aboutXHours",e,a)}if(d<2520)return i.formatDistance("xDays",1,a);if(d<43200){const e=Math.round(d/1440);return i.formatDistance("xDays",e,a)}if(d<86400)return p=Math.round(d/43200),i.formatDistance("aboutXMonths",p,a);if(p=za(l,s),p<12){const e=Math.round(d/43200);return i.formatDistance("xMonths",e,a)}{const e=p%12,t=Math.trunc(p/12);return e<3?i.formatDistance("aboutXYears",t,a):e<9?i.formatDistance("overXYears",t,a):i.formatDistance("almostXYears",t+1,a)}}(e,function(e){return _r(e,Date.now())}(e),t)}var $a={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Fa={date:Qo({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:Qo({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:Qo({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},qa={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Ba={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Ua={ordinalNumber:(e,t)=>Number(e)+"º",era:na({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:na({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:na({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:na({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:na({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},Ha={ordinalNumber:oa({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:ia({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:ia({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},Wa={code:"es",formatDistance:(e,t,n)=>{let r;const i=$a[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},formatLong:Fa,formatRelative:(e,t,n,r)=>1!==t.getHours()?Ba[e]:qa[e],localize:Ua,match:Ha,options:{weekStartsOn:1,firstWeekContainsDate:1}},Va={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},Ga={date:Qo({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},defaultWidth:"full"}),time:Qo({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:Qo({formats:{full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ka={lastWeek:e=>{const t=e.getDay();return"'"+(0===t||6===t?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Ya={ordinalNumber:(e,t)=>Number(e)+"º",era:na({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},defaultWidth:"wide"}),quarter:na({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:na({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},defaultWidth:"wide"}),day:na({values:{narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},defaultWidth:"wide"}),dayPeriod:na({values:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},defaultFormattingWidth:"wide"})},Ja={ordinalNumber:oa({matchPattern:/^(\d+)(º|ª)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},defaultParseWidth:"any"}),quarter:ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ia({matchPatterns:{narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:{narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},defaultParseWidth:"any"})},Xa={code:"pt",formatDistance:(e,t,n)=>{let r;const i=Va[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"daqui a "+r:"há "+r:r},formatLong:Ga,formatRelative:(e,t,n,r)=>{const i=Ka[e];return"function"==typeof i?i(t):i},localize:Ya,match:Ja,options:{weekStartsOn:0,firstWeekContainsDate:4}},Za={en:sa,es:Wa,pt:Xa},Qa=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?Mr(e):e,t};function es(e,t="dd MMMM, yyyy",n="en"){return e?La(Qa(e),t,{locale:Za[n]}):""}function ts(e,t){let n=Qa(e);return Xo(Qa(t),n)}var ns={action:"dateConverter",title:"Date Converter",type:"utility",params:{format:{defaultValue:"dd/MM/yyyy",type:"text"},asAge:{defaultValue:!1,type:"checkbox"},isUnix:{defaultValue:!0,type:"checkbox"},isUtc:{defaultValue:!1,type:"checkbox"},locale:{defaultValue:"en",type:"select",options:[{label:"en",value:"en"},{label:"es",value:"es"},{label:"pt",value:"pt"}]}},preview:{format:"",asAge:"",isUnix:"",isUtc:"",locale:""},callback:(e,{format:t="dd/MM/yyyy",asAge:n=!1,isUnix:r=!0,isUtc:i=!1,locale:o="en"})=>{if("string"!=typeof e&&"number"!=typeof e)return e;try{let a=Qa(r?Number(e):e);return isNaN(a.getTime())?e:n?function(e,t="en",n){if(!e)return"";let r=Qa(e);return isNaN(r.getTime())?"":Da(r,{...n,locale:Za[t]})}(a,o,{addSuffix:!0}):i?function(e,t="dd MMMM, yyyy",n="en"){return e?La((e=>{let t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return t.setFullYear(e.getUTCFullYear()),t})(Qa(e)),t,{locale:Za[n]}):""}(a,t,o):es(a,t,o)}catch{return e}}},rs={action:"not",title:"Not",type:"utility",params:{},preview:{content:""},callback:e=>!Yo(e)},is={action:"styleSelector",title:"Style Selector",type:"utility",params:{originalSelector:{label:"Original Selector",description:"This will append the original selector (require append option enabled)",defaultValue:!1,disabled:({append:e})=>!e,type:"checkbox"},append:{label:"Append Selector",defaultValue:!1,type:"checkbox"},selector:{label:"Selector",defaultValue:"",type:"select",options:(e,t,n)=>{let r=n?.stylePlatform;return r?Object.keys(r).map(e=>({label:e,options:Object.values(r[e]).filter(e=>"class"===e.type).map(e=>({label:e.name,value:e.name}))})):[]}}},preview:{append:"",originalSelector:"",selector:""},callback:(e,t,n,r={})=>{let{originalSelector:i,append:o,selector:a}=t,s=[];if(o&&!i&&r.sourceTo)s.push(r.sourceTo,a);else if(i&&o){let e=pr(n,"definition.styleSelectors.base","");e?s.push(e,a):s.push(a)}return s.length?1===s.length?s[0]:s.join(" "):""}},os={action:"styleVariant",title:"Style Variant",type:"utility",params:{key:{label:"Selector Key",defaultValue:"",type:"select",options:(e,t)=>{let n=t?.definition?.styleSelectors;if(!t||!t.definition||!n)return[];let r=t.definition.type;return(e=>{let t=e.reduce((e,{groupLabel:t,option:n})=>(t in e||(e[t]=[]),e[t].push(n),e),{});return Object.entries(t).map(([e,t])=>({label:e,options:t}))})(Object.entries(n).flatMap(([e,t])=>(t?[r,...t.split(" ")]:[r]).map(t=>({groupLabel:e,option:{value:`${t}.${e}`,label:`${t} (${e})`}}))))}},variant:{label:"Variant",defaultValue:"",type:"select",options:(e,t,n)=>{let r=t?.definition?.styleSelectors,i=e.key||"";if(!(t&&t.definition&&r&&n?.stylePlatform&&i.includes(".")))return[];let o=t.definition.type,a=i.split(".").pop()||"",s=r[a];if(!s)return[];let l=[],c=[o,...s.split(" ").filter(Boolean)];return Object.entries(n.stylePlatform).forEach(([e,t])=>{c.forEach(n=>{let r=t[n];if(!r)return;let i=r.attributes[a];Object.keys(i.variants||{}).forEach(t=>{l.push({value:t,label:`${e}: ${t}`})})})}),l}},append:{label:"Append to Variant",description:"Merge with existing variant values instead of replacing",defaultValue:!1,type:"checkbox"}},preview:{key:"",variant:"",append:""},callback:(e,t,n,r={})=>{let{key:i,variant:o,append:a}=t;if(!i)return r.sourceTo??{};let s=i||"base",l=o||e;return"object"!=typeof l||Array.isArray(l)?hr(a?{...r.sourceTo}:{},s,l):l}},as={action:"twigTemplate",title:"Twig Template",type:"utility",params:{template:{label:"Template",defaultValue:"Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",type:"codemirror-text"},returnMode:{label:"Returns",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Value (a single {{ expression }})",value:"value"}]}},preview:{template:""},callback:(e,t,n,r={})=>{let{template:i,returnMode:o="text"}=t,a={source:e,...r};try{return"value"===o?Yn(i,a):Vn(i,a)}catch{return e}}},ss={twigTemplate:as,dateConverter:ns,staticValue:{action:"staticValue",title:"Static Value",type:"utility",params:{valueType:{label:"Value Type",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Long Text",value:"textarea"},{label:"Boolean",value:"select"}]},value:{defaultValue:"",type:({valueType:e})=>e,options:[{label:"True",value:"true"},{label:"False",value:"false"}]}},preview:{valueType:"",value:""},callback:(e,t)=>{let{valueType:n,value:r}=t;return"select"===n?"true"===r:r}},capitalize:{action:"capitalize",title:"Capitalize",type:"utility",params:{},preview:{content:""},callback:e=>"string"==typeof e?function(e){return null!=e&&"string"==typeof e&&e.trim()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}(e):e},arrayMap:Jo,stringToArray:{action:"stringToArray",title:"Text to List",type:"utility",params:{separator:{label:"Separator",defaultValue:",",type:"text"}},preview:{valueType:"",value:""},callback:(e,t)=>{let{separator:n}=t;return"string"==typeof e?e.split(n).map(e=>e.trim()):e}},not:rs,styleSelector:is,styleVariant:os},ls=(Object.values(ss).map(({title:e,action:t})=>({label:e,value:t})),(e,t)=>{if(e&&typeof localStorage<"u")try{let t=localStorage.getItem(e);if("dark"===t||"light"===t)return t}catch{}return"system"===t?(()=>{if(typeof window>"u")return"light";try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}})():t}),cs=l({theme:{components:{}},colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{}});cs.displayName="ThemeContext";var us=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.enumerable,ds=(e,t,n="soft",r={})=>{let{skip:i=[],skipFunctions:o=!1}=r;if(e===t&&"soft"===n)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let o,a,s=[];if(Array.isArray(e)){if(o=e.length,o!=t.length)return!1;for(a=o;0!==a--;)if(!ds(e[a],t[a],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.values())if(!t.has(a))return!1;for(a of e.entries())if(!ds(a[1],t.get(a[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(o=e.length,o!=t.length)return!1;for(a=o;0!==a--;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.unicode===t.unicode&&e.lastIndex===t.lastIndex&&e.sticky===t.sticky;if((e.valueOf!==Object.prototype.valueOf||t.valueOf!==Object.prototype.valueOf)&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if((e.toString!==Object.prototype.toString||t.toString!==Object.prototype.toString)&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if(s="soft"===n?Object.keys(e):Object.getOwnPropertyNames(e),o=s.length,o!==("soft"===n?Object.keys(t).length:Object.getOwnPropertyNames(t).length))return!1;for(a=o;0!==a--;)if(!Object.prototype.hasOwnProperty.call(t,s[a]))return!1;for(a=o;0!==a--;){let o=s[a];if("_owner"===o&&e.$$typeof)continue;let l="soft"===n||us(e,o)||!i.includes(o);if(!ds(e[o],t[o],n,r)&&l)return!1}return!0}return!!("hard"===n&&e===t||o&&"function"==typeof e&&"function"==typeof t)||e!=e&&t!=t},ps=ds,hs=(e,t="soft",n={})=>{let r=x(e);return ps(r.current,e,t,n)?r.current:(r.current=e,e)},fs=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ms="-",gs=[],ys=e=>{const t=ws(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return vs(e);const n=e.split(ms),r=""===n[0]&&n.length>1?1:0;return bs(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||gs}return n[e]||gs}}},bs=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=bs(e,t+1,i);if(n)return n}const o=n.validators;if(null===o)return;const a=0===t?e.join(ms):e.slice(t).join(ms),s=o.length;for(let l=0;l<s;l++){const e=o[l];if(e.validator(a))return e.classGroupId}},vs=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),ws=e=>{const{theme:t,classGroups:n}=e;return ks(n,t)},ks=(e,t)=>{const n=fs();for(const r in e){const i=e[r];xs(i,n,r,t)}return n},xs=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const i=e[o];Ss(i,t,n,r)}},Ss=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?Es(e,t,n,r):Cs(e,t,n,r):Ts(e,t,n)},Ts=(e,t,n)=>{(""===e?t:As(t,e)).classGroupId=n},Cs=(e,t,n,r)=>{Is(e)?xs(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},Es=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let a=0;a<o;a++){const[e,o]=i[a];xs(o,As(t,e),n,r)}},As=(e,t)=>{let n=e;const r=t.split(ms),i=r.length;for(let o=0;o<i;o++){const e=r[o];let t=n.nextPart.get(e);t||(t=fs(),n.nextPart.set(e,t)),n=t}return n},Is=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Os=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,o)=>{n[i]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},_s=[],Ns=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ms=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,o=0;const a=e.length;for(let u=0;u<a;u++){const a=e[u];if(0===r&&0===i){if(":"===a){t.push(e.slice(o,u)),o=u+1;continue}if("/"===a){n=u;continue}}"["===a?r++:"]"===a?r--:"("===a?i++:")"===a&&i--}const s=0===t.length?e:e.slice(o);let l=s,c=!1;return s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0),Ns(t,c,l,n&&n>o?n-o:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ns(_s,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Ps=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const o=e[i],a="["===o[0],s=t.has(o);a||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ls=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Rs=/\s+/,js=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=js(e[r]))&&(n&&(n+=" "),n+=t);return n},zs=(e,...t)=>{let n,r,i,o;const a=e=>{const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o,postfixLookupClassGroupIds:a}=t,s=[],l=e.trim().split(Rs);let c="";for(let u=l.length-1;u>=0;u-=1){const e=l[u],{isExternal:t,modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){c=e+(c.length>0?" "+c:c);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&a[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){c=e+(c.length>0?" "+c:c);continue}if(m=r(h),!m){c=e+(c.length>0?" "+c:c);continue}g=!1}const y=0===d.length?"":1===d.length?d[0]:o(d).join(":"),b=p?y+"!":y,v=b+m;if(s.indexOf(v)>-1)continue;s.push(v);const w=i(m,g);for(let n=0;n<w.length;++n){const e=w[n];s.push(b+e)}c=e+(c.length>0?" "+c:c)}return c})(e,n);return i(e,o),o};return o=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Os(e.cacheSize),parseClassName:Ms(e),sortModifiers:Ps(e),postfixLookupClassGroupIds:Ls(e),...ys(e)}))(l),r=n.cache.get,i=n.cache.set,o=a,a(s)},(...e)=>o(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=js(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Ds=[],$s=e=>{const t=t=>t[e]||Ds;return t.isThemeGetter=!0,t.themeKey=e,t},Fs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bs=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Us=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ws=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Vs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ks=e=>Bs.test(e),Ys=e=>!!e&&!Number.isNaN(Number(e)),Js=e=>!!e&&Number.isInteger(Number(e)),Xs=e=>e.endsWith("%")&&Ys(e.slice(0,-1)),Zs=e=>Us.test(e),Qs=()=>!0,el=e=>Hs.test(e)&&!Ws.test(e),tl=()=>!1,nl=e=>Vs.test(e),rl=e=>Gs.test(e),il=e=>!sl(e)&&!ml(e),ol=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),al=e=>Sl(e,Al,tl),sl=e=>Fs.test(e),ll=e=>Sl(e,Il,el),cl=e=>Sl(e,Ol,Ys),ul=e=>Sl(e,Nl,Qs),dl=e=>Sl(e,_l,tl),pl=e=>Sl(e,Cl,tl),hl=e=>Sl(e,El,rl),fl=e=>Sl(e,Ml,nl),ml=e=>qs.test(e),gl=e=>Tl(e,Il),yl=e=>Tl(e,_l),bl=e=>Tl(e,Cl),vl=e=>Tl(e,Al),wl=e=>Tl(e,El),kl=e=>Tl(e,Ml,!0),xl=e=>Tl(e,Nl,!0),Sl=(e,t,n)=>{const r=Fs.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},Tl=(e,t,n=!1)=>{const r=qs.exec(e);return!!r&&(r[1]?t(r[1]):n)},Cl=e=>"position"===e||"percentage"===e,El=e=>"image"===e||"url"===e,Al=e=>"length"===e||"size"===e||"bg-size"===e,Il=e=>"length"===e,Ol=e=>"number"===e,_l=e=>"family-name"===e,Nl=e=>"number"===e||"weight"===e,Ml=e=>"shadow"===e,Pl=/*#__PURE__*/zs(()=>{const e=$s("color"),t=$s("font"),n=$s("text"),r=$s("font-weight"),i=$s("tracking"),o=$s("leading"),a=$s("breakpoint"),s=$s("container"),l=$s("spacing"),c=$s("radius"),u=$s("shadow"),d=$s("inset-shadow"),p=$s("text-shadow"),h=$s("drop-shadow"),f=$s("blur"),m=$s("perspective"),g=$s("aspect"),y=$s("ease"),b=$s("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ml,sl],w=()=>[ml,sl,l],k=()=>[Ks,"full","auto",...w()],x=()=>[Js,"none","subgrid",ml,sl],S=()=>["auto",{span:["full",Js,ml,sl]},Js,ml,sl],T=()=>[Js,"auto",ml,sl],C=()=>["auto","min","max","fr",ml,sl],E=()=>["auto",...w()],A=()=>[Ks,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],I=()=>[s,Ks,"screen","full","dvw","lvw","svw","min","max","fit",...w()],O=()=>[Ks,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],_=()=>[e,ml,sl],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",bl,pl,{position:[ml,sl]}],M=()=>["auto","cover","contain",vl,al,{size:[ml,sl]}],P=()=>[Xs,gl,ll],L=()=>["","none","full",c,ml,sl],R=()=>["",Ys,gl,ll],j=()=>[Ys,Xs,bl,pl],z=()=>["","none",f,ml,sl],D=()=>["none",Ys,ml,sl],$=()=>["none",Ys,ml,sl],F=()=>[Ys,ml,sl],q=()=>[Ks,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[Qs],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[il],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",Ys],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ks,sl,ml,g]}],container:["container"],"container-type":[{"@container":["","normal","size",ml,sl]}],"container-named":[ol],columns:[{columns:[Ys,"auto",sl,ml,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Js,"auto",ml,sl]}],basis:[{basis:[Ks,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ys,Ks,"auto","initial","none",sl]}],grow:[{grow:["",Ys,ml,sl]}],shrink:[{shrink:["",Ys,ml,sl]}],order:[{order:[Js,"first","last","none",ml,sl]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],w:[{w:[s,"screen",...A()]}],"min-w":[{"min-w":[s,"screen","none",...A()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh","none",...A()]}],"font-size":[{text:["base",n,gl,ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xl,ul]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xs,sl]}],"font-family":[{font:[yl,dl,t]}],"font-features":[{"font-features":[sl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ml,sl]}],"line-clamp":[{"line-clamp":[Ys,"none",ml,cl]}],leading:[{leading:["none",o,...w()]}],"list-image":[{"list-image":["none",ml,sl]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ml,sl]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ys,"from-font","auto",ml,ll]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Ys,"auto",ml,sl]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Js,ml,sl]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ml,sl]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ml,sl]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Js,ml,sl],radial:["",ml,sl],conic:["",Js,ml,sl]},wl,hl]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":R()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ys,ml,sl]}],"outline-w":[{outline:["",Ys,gl,ll]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","inner","none",u,kl,fl]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,kl,fl]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Ys,ll]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,kl,fl]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Ys,ml,sl]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ys]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ml,sl]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ys]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ml,sl]}],filter:[{filter:["","none",ml,sl]}],blur:[{blur:z()}],brightness:[{brightness:[Ys,ml,sl]}],contrast:[{contrast:[Ys,ml,sl]}],"drop-shadow":[{"drop-shadow":["","none",h,kl,fl]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Ys,ml,sl]}],"hue-rotate":[{"hue-rotate":[Ys,ml,sl]}],invert:[{invert:["",Ys,ml,sl]}],saturate:[{saturate:[Ys,ml,sl]}],sepia:[{sepia:["",Ys,ml,sl]}],"backdrop-filter":[{"backdrop-filter":["","none",ml,sl]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[Ys,ml,sl]}],"backdrop-contrast":[{"backdrop-contrast":[Ys,ml,sl]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ys,ml,sl]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ys,ml,sl]}],"backdrop-invert":[{"backdrop-invert":["",Ys,ml,sl]}],"backdrop-opacity":[{"backdrop-opacity":[Ys,ml,sl]}],"backdrop-saturate":[{"backdrop-saturate":[Ys,ml,sl]}],"backdrop-sepia":[{"backdrop-sepia":["",Ys,ml,sl]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ml,sl]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ys,"initial",ml,sl]}],ease:[{ease:["linear","initial",y,ml,sl]}],delay:[{delay:[Ys,ml,sl]}],animate:[{animate:["none",b,ml,sl]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ml,sl]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:D()}],"rotate-x":[{"rotate-x":D()}],"rotate-y":[{"rotate-y":D()}],"rotate-z":[{"rotate-z":D()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[ml,sl,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:q()}],"translate-x":[{"translate-x":q()}],"translate-y":[{"translate-y":q()}],"translate-z":[{"translate-z":q()}],"translate-none":["translate-none"],zoom:[{zoom:[Js,ml,sl]}],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ml,sl]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":_()}],"scrollbar-track-color":[{"scrollbar-track":_()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ml,sl]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Ys,gl,ll,cl]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Ll=function(e,{componentKey:t,className:n,variants:r}){let{theme:i}=h(cs);e=hs(e);let o=hs(n),a=f((t,n={},r="")=>(n={...n,className:r},"string"==typeof e?pr(i.components[e],t,void 0)?.(n)??r:e.map(e=>pr(i.components[e],t,void 0)?.(n)).filter(Boolean).join(" ")||r),[i.components,e]);return t=k(()=>void 0!==t?t:e&&"string"==typeof e?Object.keys(i.components[e]):Array.isArray(e)&&e.length>0?e.map(e=>Object.keys(i.components[e])).flat():void 0,[e,i.components]),k(()=>{if(t&&"string"==typeof t)return Pl(a(t,r,o&&"object"==typeof o?pr(o,t,""):o));if(t&&Array.isArray(t)){let e={};return t.forEach((t,n)=>{let i;"object"==typeof o?i=pr(o,t):"string"==typeof o&&0===n&&(i=o);let s=Pl(a(t,r,i));t.split(".").length>1?hr(e,t.split(".").slice(1).join("."),s):hr(e,t,s)}),e}return""},[t,o,a,r])},Rl=({ref:e,className:t,children:n,testId:r,direction:i,wrap:o,items:a,gap:s,justify:l,grow:c,basis:u,alignItems:d,shrink:p,...h})=>(t=Ll("Flex",{className:t,componentKey:"root",variants:{direction:i,wrap:o,items:a,gap:s,justify:l,grow:c,basis:u,shrink:p,alignItems:d}}),/* @__PURE__ */I("div",{...h,"data-testid":r,className:t,ref:e,children:n})),jl=(e,t,n="primary")=>e?"disabled":t&&"primary"===n?"primaryActive":t&&"secondary"===n?"secondaryActive":t&&"tertiary"===n?"tertiaryActive":n,zl=({className:e,children:t,icon:r,active:i=!1,disabled:o=!1,testId:a,intent:l,size:c,cursor:d,title:p,...h})=>{let f=Ll("Icon",{className:e,componentKey:"root",variants:{intent:jl(o,i,l),size:c,cursor:o?"disabled":d}}),{iconChildren:m}=k(()=>{let e={iconChildren:void 0};return n.forEach(t,t=>{u(t)&&(e.iconChildren=s(t,{...h,className:V({"h-[1em] w-[1em]":"custom"!==c},f,t.props.className),title:p}))}),e},[t,f,h,c,p]);return m||/* @__PURE__ */I("i",{...h,title:p,"data-testid":a,className:V(r,f)})},Dl=({ref:e,children:t,testId:r,className:i="",iconPlacement:o="none",loading:a=!1,disabled:l=!1,type:c="button",size:d,intent:p,border:h,justify:f,items:m,aspect:g,...y})=>{let b=Ll("Button",{className:i,componentKey:["root","icon"],variants:{intent:p,size:d,border:h,justify:f,items:m,disabled:l,aspect:g}}),{iconChildren:v,contentChildren:w}=k(()=>{let e={iconChildren:void 0,contentChildren:void 0};return n.forEach(t,t=>{if("string"!=typeof t){if(u(t))if(t.type===zl){let n=t.props;e.iconChildren=s(t,{className:V(b.icon,n.className),size:d,testId:r?`${r}-icon`:void 0,...n,intent:n.intent??"custom"})}else if("i"===t.type){let n=t.props;e.iconChildren=s(t,{className:V(b.icon,n.className),size:d,"data-testid":r?`${r}-icon`:void 0,...n,intent:n.intent??"custom"})}else e.contentChildren=t}else e.contentChildren=t}),e},[t,b.icon,d,r]);/* @__PURE__ */
21
21
  return O("button",{ref:e,type:c,"data-testid":r,className:b.root,disabled:l,...y,children:[!a&&w&&/* @__PURE__ */O(A,{children:[("before"===o||"both"===o)&&w&&v,w,("after"===o||"both"===o)&&w&&v]}),!a&&!w&&v,a&&/* @__PURE__ */I("i",{className:"fa-solid fa-sync fa-spin text-base"})]})};Dl.Icon=zl;var $l={root:Er("flex outline-none select-none border transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:["border-transparent bg-primary-500 text-white","hover:bg-primary-600","focus-visible:ring-primary-500","dark:bg-primary-400 dark:hover:bg-primary-500 dark:focus-visible:ring-primary-300"],secondary:["border-gray-300 text-zinc-700 hover:border-gray-400 hover:bg-gray-50 hover:text-zinc-900","focus-visible:ring-gray-400","dark:border-zinc-700 dark:text-zinc-300 dark:hover:border-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-white dark:focus-visible:ring-zinc-500"],danger:["border-transparent bg-red-500 text-white hover:bg-red-600","focus-visible:ring-red-500","dark:bg-red-600 dark:hover:bg-red-700"],custom:""},disabled:{true:["disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none"],false:"cursor-pointer"},aspect:{square:"aspect-square",custom:""},size:{md:"py-2 px-4 gap-2 text-sm rounded-lg",sm:"py-1.5 px-3 gap-1.5 text-sm rounded-md",xs:"py-1 px-2 gap-1 text-xs rounded-sm min-w-6",custom:""},border:{solid:"border-solid",none:"border-none",custom:""},items:{start:"",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},justify:{normal:"justify-normal",start:"",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"}},compoundVariants:[],defaultVariants:{items:"center",justify:"center",intent:"primary",border:"solid",size:"md",disabled:!1,aspect:"custom"}}),icon:Er("shrink-0",{variants:{intent:{default:""},size:{md:"text-sm",sm:"text-xs",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"default",size:"md"}})},Fl=Dl,ql=e=>({labelId:`${e}-label`,errorId:`${e}-error`}),Bl=({className:e,id:t,message:n,disabled:r=!1,error:i=!1,intent:o,size:a})=>(e=Ll("ErrorMessage",{className:e,componentKey:"root",variants:{intent:o,size:a,error:i,disabled:r}}),/* @__PURE__ */I("p",{id:t,className:e,children:n})),Ul=({className:e,children:t,disabled:n=!1,error:r=!1,intent:i,size:o,...a})=>(e=Ll("Label",{className:e,componentKey:"root",variants:{intent:i,size:o,error:r,disabled:n}}),/* @__PURE__ */I("label",{className:e,...a,children:t})),Hl=({ref:e,className:t,id:r,labelledByControl:i=!1,label:o,error:a,disabled:l,intent:c,size:d,prefix:p,children:h,loading:m,clearable:g,inline:y,value:b,onClear:v,...w})=>{let x=Ll("Input",{className:t,componentKey:["root","label","inputContainer","iconFloatingContainer","icon","iconError","iconClear"],variants:{intent:c,size:d,disabled:l||m,error:!!a,inline:y}}),S=f(e=>v?.(e),[v]),{labelId:T,errorId:C}=r?ql(r):{labelId:void 0,errorId:void 0},E=i?void 0:r,{iconChildren:A,inputChildren:_}=k(()=>{let e={iconChildren:void 0,inputChildren:[]};return n.forEach(h,t=>{if(u(t))if(t.type===zl){let n=t.props;e.iconChildren=s(t,{className:V(x.icon,n.className),size:d,...n,intent:n.intent??"custom"})}else e.inputChildren.push(t)}),e},[h,x.icon,d]);/* @__PURE__ */
22
22
  return O("div",{className:x.root,ref:e,...w,children:[o&&!y&&/* @__PURE__ */I(Ul,{error:!!a,disabled:l,intent:c,size:d,id:T,htmlFor:E,className:x.label,children:o}),
23
23
  /* @__PURE__ */O("div",{className:x.inputContainer,children:[A,!!p&&p,!y&&_,y&&/* @__PURE__ */O(Ul,{error:!!a,disabled:l,intent:c,size:d,id:T,htmlFor:E,className:x.label,children:[_,o]}),!l&&(!!a||m||g&&!!b)&&/* @__PURE__ */O("div",{className:x.iconFloatingContainer,children:[a&&!m&&/* @__PURE__ */I(zl,{intent:"custom",icon:"fa-solid fa-circle-exclamation",className:x.iconError}),m&&/* @__PURE__ */I(zl,{icon:"fa-solid fa-sync fa-spin",className:x.iconLoading}),!m&&g&&!!b&&/* @__PURE__ */I(zl,{className:x.iconClear,icon:"fa-solid fa-xmark",onClick:S})]})]}),a&&/* @__PURE__ */I(Bl,{id:C,message:"boolean"==typeof a?"":a,intent:c,size:d,error:!!a})]})},Wl=(e,t,n=!1)=>{let r=x(n),i=x(t);g(()=>{if(r.current){let n=i.current;return i.current=t,e(n)}r.current=!0,i.current=t},t)},Vl=Object.assign(p(({ref:e,children:t,className:n="",id:r,label:i="",placeholder:o="",loading:a=!1,disabled:s=!1,clearable:l=!1,inline:c=!1,prefix:u="",type:d="text",size:p,intent:h="primary",value:m="",error:g=!1,containerProps:y,onChange:v,...w})=>{let k=Ll("Input",{className:n&&"object"==typeof n?n.input:"",componentKey:"input",variants:{intent:h,size:p,disabled:s||a,error:!!g,inline:c}}),x=(({id:e,error:t})=>{let n=b(),r=e??n,{labelId:i,errorId:o}=ql(r),a=(e=>"string"==typeof e&&""!==e)(t)?o:void 0;return{id:r,labelId:i,describedBy:a,controlProps:{id:r,"aria-describedby":a,"aria-invalid":!!t||void 0}}})({id:r,error:g}),S=f(e=>v?.(e.target.value),[v]),T=f(()=>v?.(""),[v]);/* @__PURE__ */
24
- return O(Hl,{className:n,id:x.id,label:i,loading:a,clearable:l,value:m,prefix:u,disabled:s,error:g,intent:h,size:p,onClear:T,...y,children:[t,/* @__PURE__ */I("input",{ref:e,...x.controlProps,type:d,placeholder:o,className:k,disabled:s||a,value:m,onChange:S,...w})]})}),{Icon:zl}),Gl={root:Er("flex flex-col",{variants:{intent:{primary:"",custom:""},disabled:{true:"opacity-60 pointer-events-none",false:""},size:{md:"gap-1.5",sm:"gap-1 text-sm",xs:"gap-1 text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),inputContainer:Er("flex items-center border relative transition-colors duration-150 focus-within:ring-2 focus-within:ring-offset-0",{variants:{intent:{primary:"bg-white text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",custom:""},error:{true:"border-red-500 focus-within:ring-red-500/30",false:"border-gray-300 dark:border-zinc-700 focus-within:ring-primary-500/30 dark:focus-within:ring-primary-400/30 hover:border-gray-400 dark:hover:border-zinc-500"},disabled:{true:"cursor-not-allowed opacity-60 pointer-events-none",false:""},size:{md:"py-2 px-3 gap-2 rounded-lg",sm:"py-1.5 px-2.5 gap-1.5 rounded-md",xs:"py-1 px-2 gap-1 rounded-sm",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",error:!1,disabled:!1,size:"md"}}),input:Er("p-0 border-0 outline-none focus:ring-0 w-full bg-transparent",{variants:{intent:{primary:"text-zinc-900 placeholder:text-zinc-400 dark:text-zinc-200 dark:placeholder:text-zinc-500"},error:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:""},size:{md:"text-sm",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md",disabled:!1,error:!1}}),label:Er("text-sm font-medium text-zinc-700 dark:text-zinc-300",{variants:{inline:{true:"flex select-none items-center",false:""},disabled:{true:"",false:""},size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[{inline:!0,disabled:!0,className:"cursor-not-allowed"},{inline:!0,disabled:!1,className:"cursor-pointer"},{inline:!0,size:"md",className:"gap-2"},{inline:!0,size:"sm",className:"gap-1.5"},{inline:!0,size:"xs",className:"gap-1"}],defaultVariants:{inline:!1,disabled:!1,size:"md"}}),iconFloatingContainer:Er("flex items-center justify-center",{variants:{intent:{primary:""},size:{md:"gap-2",sm:"gap-1.5",xs:"gap-1",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),icon:Er("border-r border-gray-300 dark:border-zinc-700 text-zinc-400 dark:text-zinc-500 shrink-0",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""},size:{md:"pr-2.5 mr-0.5",sm:"pr-2 mr-0.5",xs:"pr-1.5 mr-0.5",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),iconError:Er("",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""}},compoundVariants:[],defaultVariants:{intent:"primary"}}),iconClear:Er("cursor-pointer text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors duration-150"),iconLoading:Er("text-zinc-400 dark:text-zinc-500")},Kl=Vl,Yl=Symbol.for("immer-nothing"),Jl=Symbol.for("immer-draftable"),Xl=Symbol.for("immer-state");function Zl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ql=Object,ec=Ql.getPrototypeOf,tc="constructor",nc="prototype",rc="configurable",ic="enumerable",oc="writable",ac="value",sc=e=>!!e&&!!e[Xl];function lc(e){return!!e&&(dc(e)||yc(e)||!!e[Jl]||!!e[tc]?.[Jl]||bc(e)||vc(e))}var cc=Ql[nc][tc].toString(),uc=/* @__PURE__ */new WeakMap;function dc(e){if(!e||!wc(e))return!1;const t=ec(e);if(null===t||t===Ql[nc])return!0;const n=Ql.hasOwnProperty.call(t,tc)&&t[tc];if(n===Object)return!0;if(!kc(n))return!1;let r=uc.get(n);return void 0===r&&(r=Function.toString.call(n),uc.set(n,r)),r===cc}function pc(e,t,n=!0){0===hc(e)?(n?Reflect.ownKeys(e):Ql.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function hc(e){const t=e[Xl];return t?t.type_:yc(e)?1:bc(e)?2:vc(e)?3:0}var fc=(e,t,n=hc(e))=>2===n?e.has(t):Ql[nc].hasOwnProperty.call(e,t),mc=(e,t,n=hc(e))=>2===n?e.get(t):e[t],gc=(e,t,n,r=hc(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},yc=Array.isArray,bc=e=>e instanceof Map,vc=e=>e instanceof Set,wc=e=>"object"==typeof e,kc=e=>"function"==typeof e,xc=e=>"boolean"==typeof e,Sc=e=>e.copy_||e.base_,Tc=e=>e.modified_?e.copy_:e.base_;function Cc(e,t){if(bc(e))return new Map(e);if(vc(e))return new Set(e);if(yc(e))return Array[nc].slice.call(e);const n=dc(e);if(!0===t||"class_only"===t&&!n){const t=Ql.getOwnPropertyDescriptors(e);delete t[Xl];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o[oc]&&(o[oc]=!0,o[rc]=!0),(o.get||o.set)&&(t[i]={[rc]:!0,[oc]:!0,[ic]:o[ic],[ac]:e[i]})}return Ql.create(ec(e),t)}{const t=ec(e);if(null!==t&&n)return{...e};const r=Ql.create(t);return Ql.assign(r,e)}}function Ec(e,t=!1){return Ic(e)||sc(e)||!lc(e)||(hc(e)>1&&Ql.defineProperties(e,{set:Ac,add:Ac,clear:Ac,delete:Ac}),Ql.freeze(e),t&&pc(e,(e,t)=>{Ec(t,!0)},!1)),e}var Ac={[ac]:function(){Zl(2)}};function Ic(e){return null===e||!wc(e)||Ql.isFrozen(e)}var Oc="MapSet",_c="Patches",Nc="ArrayMethods",Mc={};function Pc(e){const t=Mc[e];return t||Zl(0),t}var Lc,Rc=e=>!!Mc[e],jc=()=>Lc;function zc(e,t){t&&(e.patchPlugin_=Pc(_c),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dc(e){$c(e),e.drafts_.forEach(qc),e.drafts_=null}function $c(e){e===Lc&&(Lc=e.parent_)}var Fc=e=>Lc={drafts_:[],parent_:Lc,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:/* @__PURE__ */new Set,processedForPatches_:/* @__PURE__ */new Set,mapSetPlugin_:Rc(Oc)?Pc(Oc):void 0,arrayMethodsPlugin_:Rc(Nc)?Pc(Nc):void 0};function qc(e){const t=e[Xl];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Bc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[Xl].modified_&&(Dc(t),Zl(4)),lc(e)&&(e=Uc(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Xl].base_,e,t)}else e=Uc(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ec(t,n)}(t,e,!0),Dc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yl?e:void 0}function Uc(e,t){if(Ic(t))return t;const n=t[Xl];if(!n)return Yc(t,e.handledSet_,e);if(!Wc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Kc(n,e)}return n.copy_}function Hc(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wc=(e,t)=>e.scope_===t,Vc=[];function Gc(e,t,n,r){const i=Sc(e),o=e.type_;if(void 0!==r&&mc(i,r,o)===t)return void gc(i,r,n,o);if(!e.draftLocations_){const t=e.draftLocations_=/* @__PURE__ */new Map;pc(i,(e,n)=>{if(sc(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??Vc;for(const s of a)gc(i,s,n,o)}function Kc(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Hc(e)}}function Yc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||sc(e)||t.has(e)||!lc(e)||Ic(e)||(t.add(e),pc(e,(r,i)=>{if(sc(i)){const t=i[Xl];Wc(t,n)&&(gc(e,r,Tc(t),e.type_),Hc(t))}else lc(i)&&Yc(i,t,n)})),e}var Jc={get(e,t){if(t===Xl)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Sc(e);if(!fc(i,t,e.type_))return function(e,t,n){const r=Qc(t,n);return r?ac in r?r[ac]:r.get?.call(e.draft_):void 0}(e,i,t);const o=i[t];if(e.finalized_||!lc(o))return o;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return o;if(o===Zc(e.base_,t)||function(e,t,n){return!(1!==e.type_||!e.allIndicesReassigned_||e.assigned_?.get(t)||!lc(n)||n[Xl])&&e.baseRefs_.has(n)}(e,t,o)){tu(e);const n=1===e.type_?+t:t,r=nu(e.scope_,o,e,n);return e.copy_[n]=r}return o},has:(e,t)=>t in Sc(e),ownKeys:e=>Reflect.ownKeys(Sc(e)),set(e,t,n){const r=Qc(Sc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Zc(Sc(e),t),i=r?.[Xl];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||fc(e.base_,t,e.type_)))return!0;tu(e),eu(e)}return e.copy_[t]===n&&(void 0!==n||fc(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(sc(n)){const i=n[Xl];Wc(i,r)&&i.callbacks_.push(function(){tu(e),Gc(e,n,Tc(i),t)})}else lc(n)&&e.callbacks_.push(function(){const i=Sc(e);3===e.type_?i.has(n)&&Yc(n,r.handledSet_,r):mc(i,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&Yc(mc(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(tu(e),void 0!==Zc(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),eu(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Sc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[oc]:!0,[rc]:1!==e.type_||"length"!==t,[ic]:r[ic],[ac]:n[t]}:r},defineProperty(){Zl(11)},getPrototypeOf:e=>ec(e.base_),setPrototypeOf(){Zl(12)}},Xc={};for(let PM in Jc){let e=Jc[PM];Xc[PM]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}function Zc(e,t){const n=e[Xl];return(n?Sc(n):e)[t]}function Qc(e,t){if(!(t in e))return;let n=ec(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ec(n)}}function eu(e){e.modified_||(e.modified_=!0,e.parent_&&eu(e.parent_))}function tu(e){e.copy_||(e.assigned_=/* @__PURE__ */new Map,e.copy_=Cc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function nu(e,t,n,r){const[i,o]=bc(t)?Pc(Oc).proxyMap_(t,n):vc(t)?Pc(Oc).proxySet_(t,n):function(e,t){const n=yc(e),r={type_:n?1:0,scope_:t?t.scope_:jc(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=Jc;n&&(i=[r],o=Xc);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,[s,r]}(t,n);return(n?.scope_??jc()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const i=t;if(!i||!Wc(i,r))return;r.mapSetPlugin_?.fixSetContents(i);const o=Tc(i);Gc(e,i.draft_??i,o,n),Kc(i,r)})}(n,o,r):o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)}),i}function ru(e){if(!lc(e)||Ic(e))return e;const t=e[Xl];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Cc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Cc(e,!0);return pc(n,(e,t)=>{gc(n,e,ru(t))},r),t&&(t.finalized_=!1),n}Xc.deleteProperty=function(e,t){return Xc.set.call(this,e,t,void 0)},Xc.set=function(e,t,n){return Jc.set.call(this,e[0],t,n,e[0])},globalThis.Iterator;var iu,ou=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(kc(e)&&!kc(t)){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if(kc(t)||Zl(6),void 0===n||kc(n)||Zl(7),lc(e)){const i=Fc(this),o=nu(0,e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?Dc(i):$c(i)}return zc(i,n),Bc(r,i)}if(!e||!wc(e)){if(r=t(e),void 0===r&&(r=e),r===Yl&&(r=void 0),this.autoFreeze_&&Ec(r,!0),n){const t=[],i=[];Pc(_c).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Zl(1)},this.produceWithPatches=(e,t)=>{if(kc(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},xc(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),xc(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),xc(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;lc(e)||Zl(8),sc(e)&&(sc(t=e)||Zl(10),e=ru(t));const n=Fc(this),r=nu(0,e,void 0);return r[Xl].isManual_=!0,$c(n),r}finishDraft(e,t){const n=e&&e[Xl];n&&n.isManual_||Zl(9);const{scope_:r}=n;return zc(r,t),Bc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Pc(_c).applyPatches_;return sc(e)?r(e,t):this.produce(e,e=>r(e,t))}},au=ou.produce,su={platform:{desktop:{},tablet:{},mobile:{}},mode:"desktop-first",theme:{default:"system",schemes:["light","dark"]},variables:{},fonts:[],cache:""},lu=(Object.values({DISPLAY:"display",FLEX_WRAP:"flex-wrap",FLEX_DIRECTION:"flex-direction",ALIGN_ITEMS:"align-items",JUSTIFY_ITEMS:"justify-items",JUSTIFY_CONTENT:"justify-content",ALIGN_CONTENT:"align-content",ROW_GAP:"row-gap",COLUMN_GAP:"column-gap",GRID_ROW_GAP:"grid-row-gap",GRID_COLUMN_GAP:"grid-column-gap",GRID_TEMPLATE_AREAS:"grid-template-areas",GRID_TEMPLATE_COLUMNS:"grid-template-columns",GRID_TEMPLATE_ROWS:"grid-template-rows",GRID_AUTO_FLOW:"grid-auto-flow",GRID_AUTO_ROWS:"grid-auto-rows",GRID_AUTO_COLUMNS:"grid-auto-columns",GRID_ROW_START:"grid-row-start",GRID_COLUMN_START:"grid-column-start",GRID_ROW_END:"grid-row-end",GRID_COLUMN_END:"grid-column-end",ALIGN_SELF:"align-self",JUSTIFY_SELF:"justify-self",ORDER:"order",FLEX_GROW:"flex-grow",FLEX_SHRINK:"flex-shrink",FLEX_BASIS:"flex-basis",LIST_STYLE:"list-style",LIST_STYLE_TYPE:"list-style-type",LIST_STYLE_POSITION:"list-style-position",LIST_STYLE_IMAGE:"list-style-image",BACKGROUND_COLOR:"background-color",BACKGROUND_IMAGE:"background-image",BACKGROUND_POSITION:"background-position",BACKGROUND_SIZE:"background-size",BACKGROUND_REPEAT:"background-repeat",BACKGROUND_ORIGIN:"background-origin",BACKGROUND_CLIP:"background-clip",BACKGROUND_ATTACHMENT:"background-attachment",BACKGROUND_BLEND_MODE:"background-blend-mode",MASK_IMAGE:"mask-image",MASK_SIZE:"mask-size",MASK_POSITION:"mask-position",MASK_REPEAT:"mask-repeat",MASK_COMPOSITE:"mask-composite",WEBKIT_MASK_IMAGE:"-webkit-mask-image",BORDER_TOP_STYLE:"border-top-style",BORDER_TOP_WIDTH:"border-top-width",BORDER_TOP_COLOR:"border-top-color",BORDER_BOTTOM_STYLE:"border-bottom-style",BORDER_BOTTOM_WIDTH:"border-bottom-width",BORDER_BOTTOM_COLOR:"border-bottom-color",BORDER_LEFT_STYLE:"border-left-style",BORDER_LEFT_WIDTH:"border-left-width",BORDER_LEFT_COLOR:"border-left-color",BORDER_RIGHT_STYLE:"border-right-style",BORDER_RIGHT_WIDTH:"border-right-width",BORDER_RIGHT_COLOR:"border-right-color",BORDER_TOP_LEFT_RADIUS:"border-top-left-radius",BORDER_TOP_RIGHT_RADIUS:"border-top-right-radius",BORDER_BOTTOM_LEFT_RADIUS:"border-bottom-left-radius",BORDER_BOTTOM_RIGHT_RADIUS:"border-bottom-right-radius",BORDER_COLLAPSE:"border-collapse",BORDER_SPACING:"border-spacing",TABLE_LAYOUT:"table-layout",OPACITY:"opacity",VISIBILITY:"visibility",CURSOR:"cursor",TRANSITION:"transition",TRANSITION_PROPERTY:"transition-property",TRANSITION_DURATION:"transition-duration",TRANSITION_TIMING_FUNCTION:"transition-timing-function",TRANSITION_DELAY:"transition-delay",TRANSITION_BEHAVIOR:"transition-behavior",ANIMATION:"animation",ANIMATION_NAME:"animation-name",ANIMATION_DURATION:"animation-duration",ANIMATION_TIMING_FUNCTION:"animation-timing-function",ANIMATION_DELAY:"animation-delay",ANIMATION_ITERATION_COUNT:"animation-iteration-count",ANIMATION_DIRECTION:"animation-direction",ANIMATION_FILL_MODE:"animation-fill-mode",ANIMATION_PLAY_STATE:"animation-play-state",ANIMATION_TIMELINE:"animation-timeline",ANIMATION_RANGE:"animation-range",BOX_SHADOW:"box-shadow",FILTER:"filter",BACKDROP_FILTER:"backdrop-filter",MIX_BLEND_MODE:"mix-blend-mode",ISOLATION:"isolation",CLIP_PATH:"clip-path",TRANSFORM:"transform",TRANSFORM_ORIGIN:"transform-origin",TRANSLATE:"translate",ROTATE:"rotate",SCALE:"scale",TRANSFORM_STYLE:"transform-style",PERSPECTIVE:"perspective",PERSPECTIVE_ORIGIN:"perspective-origin",BACKFACE_VISIBILITY:"backface-visibility",WILL_CHANGE:"will-change",OUTLINE_WIDTH:"outline-width",OUTLINE_STYLE:"outline-style",OUTLINE_COLOR:"outline-color",OUTLINE_OFFSET:"outline-offset",POINTER_EVENTS:"pointer-events",USER_SELECT:"user-select",TOUCH_ACTION:"touch-action",RESIZE:"resize",APPEARANCE:"appearance",SCROLL_BEHAVIOR:"scroll-behavior",OVERSCROLL_BEHAVIOR:"overscroll-behavior",SCROLL_SNAP_TYPE:"scroll-snap-type",SCROLL_SNAP_ALIGN:"scroll-snap-align",SCROLL_SNAP_STOP:"scroll-snap-stop",SCROLL_PADDING_TOP:"scroll-padding-top",SCROLL_MARGIN_TOP:"scroll-margin-top",ACCENT_COLOR:"accent-color",CARET_COLOR:"caret-color",COLOR_SCHEME:"color-scheme",CONTENT:"content",POSITION:"position",FLOAT:"float",CLEAR:"clear",Z_INDEX:"z-index",TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",BOX_SIZING:"box-sizing",ASPECT_RATIO:"aspect-ratio",WIDTH:"width",HEIGHT:"height",MIN_WIDTH:"min-width",MIN_HEIGHT:"min-height",MAX_WIDTH:"max-width",MAX_HEIGHT:"max-height",OVERFLOW:"overflow",OVERFLOW_X:"overflow-x",OVERFLOW_Y:"overflow-y",SCROLLBAR_WIDTH:"scrollbar-width",SCROLLBAR_COLOR:"scrollbar-color",CONTAINER_TYPE:"container-type",CONTAINER_NAME:"container-name",OBJECT_FIT:"object-fit",OBJECT_POSITION:"object-position",COLUMN_WIDTH:"column-width",COLUMN_COUNT:"column-count",MARGIN_TOP:"margin-top",MARGIN_BOTTOM:"margin-bottom",MARGIN_LEFT:"margin-left",MARGIN_RIGHT:"margin-right",PADDING_TOP:"padding-top",PADDING_BOTTOM:"padding-bottom",PADDING_LEFT:"padding-left",PADDING_RIGHT:"padding-right",FONT_FAMILY:"font-family",FONT_WEIGHT:"font-weight",FONT_SIZE:"font-size",LINE_HEIGHT:"line-height",COLOR:"color",TEXT_ALIGN:"text-align",FONT_STYLE:"font-style",FONT_VARIANT:"font-variant",FONT_VARIANT_NUMERIC:"font-variant-numeric",FONT_FEATURE_SETTINGS:"font-feature-settings",TEXT_DECORATION:"text-decoration",TEXT_DECORATION_LINE:"text-decoration-line",TEXT_DECORATION_COLOR:"text-decoration-color",TEXT_DECORATION_STYLE:"text-decoration-style",TEXT_DECORATION_THICKNESS:"text-decoration-thickness",TEXT_UNDERLINE_OFFSET:"text-underline-offset",LETTER_SPACING:"letter-spacing",WORD_SPACING:"word-spacing",TEXT_INDENT:"text-indent",TEXT_TRANSFORM:"text-transform",DIRECTION:"direction",WRITING_MODE:"writing-mode",TEXT_ORIENTATION:"text-orientation",WHITE_SPACE:"white-space",TEXT_WRAP:"text-wrap",WORD_BREAK:"word-break",OVERFLOW_WRAP:"overflow-wrap",HYPHENS:"hyphens",VERTICAL_ALIGN:"vertical-align",TEXT_OVERFLOW:"text-overflow",TEXT_SHADOW:"text-shadow",LINE_CLAMP:"line-clamp",WEBKIT_LINE_CLAMP:"-webkit-line-clamp",WEBKIT_BOX_ORIENT:"-webkit-box-orient",WEBKIT_TEXT_FILL_COLOR:"-webkit-text-fill-color",WEBKIT_BACKGROUND_CLIP:"-webkit-background-clip",BOX_DECORATION_BREAK:"box-decoration-break",WEBKIT_BOX_DECORATION_BREAK:"-webkit-box-decoration-break",FILL:"fill",STROKE:"stroke",STROKE_WIDTH:"stroke-width"}).map(e=>({path:e,label:e})),"props"),cu={definition:{name:"",permanentUrl:""},flat:{},variables:[],settings:{customCss:""},pages:[],pageFolders:[],components:{}},uu={settled:/* @__PURE__ */new Set([lu])},du=(e,t,n={},r={})=>{let i,{attributes:o,definition:a}=e,{rootId:s,plitziElementLayout:l}=t;t.attributes&&(o={...o,...t.attributes});let c=o;if(Object.keys(n).length>0)if((e=>!!e&&Object.values(e).some(e=>Array.isArray(e)&&e.length>0))(a.bindings)){let t=((e,t,n={})=>{let{attributes:r,definition:i}=t,{bindings:o}=i;return!o||"object"==typeof o&&!Object.keys(o).length?{attributes:r,style:{},definition:i}:au({attributes:r,style:n,definition:i},t=>{Object.keys(o).forEach(n=>{o[n]&&Array.isArray(o[n])&&o[n].length&&o[n].forEach(r=>{let{source:i,transformers:o,when:a,enabled:s=!0}=r,{to:l}=r;if(!l||a&&!Ei(a,e,!1,!0)||!s)return;"style"===n&&!l.startsWith("--")&&(l=function(e){if(!e)return"";let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([0-9])([a-zA-Z])/g,"$1 $2").replace(/([a-zA-Z])([0-9])/g,"$1 $2").replace(/[_\s-]+/g," ").trim().split(/\s+/);return 0===t.length?"":t.map((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}(l));let{fromValue:c,toValue:u}=((e,t,n,r,i)=>{let o="initialState"===r?`definition.${r}.${i}`:`${r}.${i}`;return{fromValue:t?pr(e,t):void 0,toValue:pr(n,o,t?pr(e,t):void 0)}})(e,i,t,n,l),d=c;o&&Array.isArray(o)&&o.length>0&&o.forEach(n=>{let{action:r,params:i,enabled:o=!0}=n;if(!o)return;let a=ss[r];a&&(d=a.callback(d,((e,t)=>{if(!t)return t;let n=t;for(let[r,i]of Object.entries(e.params)){let e=t[r];"true"!==e&&"false"!==e||"checkbox"!==("function"==typeof i.type?i.type(t):i.type)||(n===t&&(n={...t}),n[r]="true"===e)}return n})(a,i)??{},t,{...e,sourceTo:u}))}),"initialState"===n&&"visibility"===l&&i&&void 0!==pr(e,i)&&(d=Yo(d)),("style"!==n||(e=>"number"==typeof e||"string"==typeof e&&!/[;{}<>]/.test(e))(d))&&("boolean"==typeof d||"number"==typeof d||d)&&hr(t,"initialState"===n?`definition.${n}.${l}`:`${n}.${l}`,d)})})})})(n,{...e,attributes:o},i);({attributes:o,definition:a,style:i}=t)}else i={};let u=Vo[a.type]??[],d=Object.keys(o).filter(e=>{let t=o[e];return"string"==typeof t&&t===c[e]&&or(t)&&!u.includes(e)});return d.length>0&&(o=((e,t,n)=>{let{queryParams:r={},routeParams:i={},variables:o={},origin:a="",navigation:s,...l}=n,c={...o,...i,...r,...l,navigation:{...s,routeParams:i,queryParams:r,origin:a}},u={...e};for(let d of t)u[d]=Vn(e[d],c,uu);return u})(o,d,n)),o={...o,...te(r,["visibility","styleSelectors"])},a={...a,styleSelectors:{...a.styleSelectors,...a.initialState?.styleSelectors,...r.styleSelectors??{}}},a.styleSelectors=(e=>{let t=e.initialState?.styleVariant;return Object.fromEntries(Object.entries(e.styleSelectors).map(([n,r])=>{let i="base"===n?`plitzi__${e.type}`:`plitzi__${e.type}-${n}`;if("string"!=typeof r)return[n,r];!(e=>{let t=Go.get(e);return t||(t=RegExp(`(^|\\s)${e}(?=\\s|$)`),Go.set(e,t)),t})(e.type).test(r)&&t?.[e.type]?.[n]&&(r=r?`${e.type} ${r}`:e.type);let o=r.replace(/\S+/g,r=>{let i=t?.[r]?.[n];if(!i)return r;let o=Array.isArray(i)?i:[i];return r===e.type&&"base"===n?o.map(e=>`${r}--${e}`).join(" "):r===e.type&&"base"!==n?o.map(e=>`${r}-${n}--${e}`).join(" "):`${r} ${o.map(e=>`${r}--${e}`).join(" ")}`});return o?[n,`${i} ${o}`]:[n,i]}))})(a),{...t,rootId:pr(l,"rootId",s),attributes:{...o,...te(t,["id","rootId","attributes","definition","plitziElementLayout"])},definition:a,elementState:{...a.initialState,...r},style:i}},pu=(e,t)=>{let n=Vo[t]??[];return Object.entries(e??{}).flatMap(([e,t])=>"string"==typeof t&&or(t)&&!n.includes(e)?[t]:[])},hu=({element:e,children:t,internalProps:n,previewMode:r=!1,parentVisible:i=!0})=>{let{id:o}=n,{state:a,setElementState:s}=(({id:e,bindings:t,previewMode:n})=>{let{scopePath:r}=zt(),i=k(()=>((e,t)=>t?`runtime.elements.${e}.${t}`:`runtime.elements.${e}`)(e,r),[e,r]),[o]=Dt(i),a=o??Ur,s=qt(),l=k(()=>(t?.attributes&&Array.isArray(t.attributes)?t.attributes:[]).filter(e=>!1!==e.enabled).map(e=>pr(e,"to","")),[t]),c=f(e=>!!n&&(s(i,t=>{if(!e)return{};let n="function"==typeof e?e(t??Ur):e;return l.length&&(n=vr(n,l)),n}),!0),[l,i,n,s]);return g(()=>{if(n&&r)return()=>s(i,void 0)},[n,r,i,s,e]),{state:a,setElementState:c}})({id:o,bindings:e.definition.bindings,previewMode:r}),{type:l}=e.definition,c=k(()=>{let t=[...pu(e.attributes,l),...pu(n.attributes,l)];return t.length>0?(e=>["variables",...new Set(e.flatMap(e=>sr(e)))])(t):void 0},[e.attributes,l,n.attributes]),[[u,d,p]]=Dt(["navigation.routeParams","navigation.queryParams","navigation.origin"],{enabled:void 0!==c}),h=(({bindings:e,sources:t})=>{let n=k(()=>{let n=new Set(t??[]);for(let t of Object.values(e??{}))if(Array.isArray(t))for(let e of t)for(let t of lr(e))n.add(t);return n.size>0&&n.add("variables"),(e=>{let t=[];for(let n of[...new Set(e)].filter(Boolean).sort((e,t)=>e.length-t.length))t.some(e=>n.startsWith(`${e}.`))||t.push(n);return t})(n)},[e,t]),r=k(()=>n.map(e=>`runtime.sources.${e}`),[n]),[i]=Dt(r);return k(()=>{let e={};return n.forEach((t,n)=>{void 0!==i[n]&&((e,t,n)=>{let r=t.split("."),i=e;for(let o of r.slice(0,-1)){let e=i[o],t=X(e)?e:{};i[o]=t,i=t}i[r[r.length-1]]=n})(e,t,i[n])}),e},[n,i])})({bindings:e.definition.bindings,sources:c}),m=k(()=>({...du(e,n,{...h,routeParams:u,queryParams:d,origin:p},a),setElementState:s}),[e,n,h,u,d,p,a,s]);return{internalProps:m,customProps:k(()=>te(m,["id","rootId","plitziElementLayout","attributes","definition","style","elementState","setElementState"]),[m]),children:Fi({id:o,definition:m.definition,plitziElementLayout:m.plitziElementLayout,children:t,previewMode:r,visible:i&&ee(m.elementState.visibility)})}},fu=class extends r{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(e,t)}render(){let{children:e}=this.props,{hasError:t}=this.state;return t?/* @__PURE__ */I("div",{children:"Something broke! Please refresh and try again."}):e}},mu=K("EventBridgeContext",{}),gu=Object.freeze({}),yu=Object.freeze({}),bu=K("PlitziContext",{}),vu=()=>{let e=h(bu);if(void 0===e)throw Error("The Plitzi context is undefined. Render the element inside a PlitziProvider.");return e},wu=e=>{let{children:t,value:n}=e;/* @__PURE__ */
24
+ return O(Hl,{className:n,id:x.id,label:i,loading:a,clearable:l,value:m,prefix:u,disabled:s,error:g,intent:h,size:p,onClear:T,...y,children:[t,/* @__PURE__ */I("input",{ref:e,...x.controlProps,type:d,placeholder:o,className:k,disabled:s||a,value:m,onChange:S,...w})]})}),{Icon:zl}),Gl={root:Er("flex flex-col",{variants:{intent:{primary:"",custom:""},disabled:{true:"opacity-60 pointer-events-none",false:""},size:{md:"gap-1.5",sm:"gap-1 text-sm",xs:"gap-1 text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),inputContainer:Er("flex items-center border relative transition-colors duration-150 focus-within:ring-2 focus-within:ring-offset-0",{variants:{intent:{primary:"bg-white text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",custom:""},error:{true:"border-red-500 focus-within:ring-red-500/30",false:"border-gray-300 dark:border-zinc-700 focus-within:ring-primary-500/30 dark:focus-within:ring-primary-400/30 hover:border-gray-400 dark:hover:border-zinc-500"},disabled:{true:"cursor-not-allowed opacity-60 pointer-events-none",false:""},size:{md:"py-2 px-3 gap-2 rounded-lg",sm:"py-1.5 px-2.5 gap-1.5 rounded-md",xs:"py-1 px-2 gap-1 rounded-sm",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",error:!1,disabled:!1,size:"md"}}),input:Er("p-0 border-0 outline-none focus:ring-0 w-full bg-transparent",{variants:{intent:{primary:"text-zinc-900 placeholder:text-zinc-400 dark:text-zinc-200 dark:placeholder:text-zinc-500"},error:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:""},size:{md:"text-sm",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md",disabled:!1,error:!1}}),label:Er("text-sm font-medium text-zinc-700 dark:text-zinc-300",{variants:{inline:{true:"flex select-none items-center",false:""},disabled:{true:"",false:""},size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[{inline:!0,disabled:!0,className:"cursor-not-allowed"},{inline:!0,disabled:!1,className:"cursor-pointer"},{inline:!0,size:"md",className:"gap-2"},{inline:!0,size:"sm",className:"gap-1.5"},{inline:!0,size:"xs",className:"gap-1"}],defaultVariants:{inline:!1,disabled:!1,size:"md"}}),iconFloatingContainer:Er("flex items-center justify-center",{variants:{intent:{primary:""},size:{md:"gap-2",sm:"gap-1.5",xs:"gap-1",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),icon:Er("border-r border-gray-300 dark:border-zinc-700 text-zinc-400 dark:text-zinc-500 shrink-0",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""},size:{md:"pr-2.5 mr-0.5",sm:"pr-2 mr-0.5",xs:"pr-1.5 mr-0.5",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),iconError:Er("",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""}},compoundVariants:[],defaultVariants:{intent:"primary"}}),iconClear:Er("cursor-pointer text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors duration-150"),iconLoading:Er("text-zinc-400 dark:text-zinc-500")},Kl=Vl,Yl=Symbol.for("immer-nothing"),Jl=Symbol.for("immer-draftable"),Xl=Symbol.for("immer-state");function Zl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ql=Object,ec=Ql.getPrototypeOf,tc="constructor",nc="prototype",rc="configurable",ic="enumerable",oc="writable",ac="value",sc=e=>!!e&&!!e[Xl];function lc(e){return!!e&&(dc(e)||yc(e)||!!e[Jl]||!!e[tc]?.[Jl]||bc(e)||vc(e))}var cc=Ql[nc][tc].toString(),uc=/* @__PURE__ */new WeakMap;function dc(e){if(!e||!wc(e))return!1;const t=ec(e);if(null===t||t===Ql[nc])return!0;const n=Ql.hasOwnProperty.call(t,tc)&&t[tc];if(n===Object)return!0;if(!kc(n))return!1;let r=uc.get(n);return void 0===r&&(r=Function.toString.call(n),uc.set(n,r)),r===cc}function pc(e,t,n=!0){0===hc(e)?(n?Reflect.ownKeys(e):Ql.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function hc(e){const t=e[Xl];return t?t.type_:yc(e)?1:bc(e)?2:vc(e)?3:0}var fc=(e,t,n=hc(e))=>2===n?e.has(t):Ql[nc].hasOwnProperty.call(e,t),mc=(e,t,n=hc(e))=>2===n?e.get(t):e[t],gc=(e,t,n,r=hc(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},yc=Array.isArray,bc=e=>e instanceof Map,vc=e=>e instanceof Set,wc=e=>"object"==typeof e,kc=e=>"function"==typeof e,xc=e=>"boolean"==typeof e,Sc=e=>e.copy_||e.base_,Tc=e=>e.modified_?e.copy_:e.base_;function Cc(e,t){if(bc(e))return new Map(e);if(vc(e))return new Set(e);if(yc(e))return Array[nc].slice.call(e);const n=dc(e);if(!0===t||"class_only"===t&&!n){const t=Ql.getOwnPropertyDescriptors(e);delete t[Xl];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o[oc]&&(o[oc]=!0,o[rc]=!0),(o.get||o.set)&&(t[i]={[rc]:!0,[oc]:!0,[ic]:o[ic],[ac]:e[i]})}return Ql.create(ec(e),t)}{const t=ec(e);if(null!==t&&n)return{...e};const r=Ql.create(t);return Ql.assign(r,e)}}function Ec(e,t=!1){return Ic(e)||sc(e)||!lc(e)||(hc(e)>1&&Ql.defineProperties(e,{set:Ac,add:Ac,clear:Ac,delete:Ac}),Ql.freeze(e),t&&pc(e,(e,t)=>{Ec(t,!0)},!1)),e}var Ac={[ac]:function(){Zl(2)}};function Ic(e){return null===e||!wc(e)||Ql.isFrozen(e)}var Oc="MapSet",_c="Patches",Nc="ArrayMethods",Mc={};function Pc(e){const t=Mc[e];return t||Zl(0),t}var Lc,Rc=e=>!!Mc[e],jc=()=>Lc;function zc(e,t){t&&(e.patchPlugin_=Pc(_c),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dc(e){$c(e),e.drafts_.forEach(qc),e.drafts_=null}function $c(e){e===Lc&&(Lc=e.parent_)}var Fc=e=>Lc={drafts_:[],parent_:Lc,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:/* @__PURE__ */new Set,processedForPatches_:/* @__PURE__ */new Set,mapSetPlugin_:Rc(Oc)?Pc(Oc):void 0,arrayMethodsPlugin_:Rc(Nc)?Pc(Nc):void 0};function qc(e){const t=e[Xl];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Bc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[Xl].modified_&&(Dc(t),Zl(4)),lc(e)&&(e=Uc(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Xl].base_,e,t)}else e=Uc(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ec(t,n)}(t,e,!0),Dc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yl?e:void 0}function Uc(e,t){if(Ic(t))return t;const n=t[Xl];if(!n)return Yc(t,e.handledSet_,e);if(!Wc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Kc(n,e)}return n.copy_}function Hc(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wc=(e,t)=>e.scope_===t,Vc=[];function Gc(e,t,n,r){const i=Sc(e),o=e.type_;if(void 0!==r&&mc(i,r,o)===t)return void gc(i,r,n,o);if(!e.draftLocations_){const t=e.draftLocations_=/* @__PURE__ */new Map;pc(i,(e,n)=>{if(sc(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??Vc;for(const s of a)gc(i,s,n,o)}function Kc(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Hc(e)}}function Yc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||sc(e)||t.has(e)||!lc(e)||Ic(e)||(t.add(e),pc(e,(r,i)=>{if(sc(i)){const t=i[Xl];Wc(t,n)&&(gc(e,r,Tc(t),e.type_),Hc(t))}else lc(i)&&Yc(i,t,n)})),e}var Jc={get(e,t){if(t===Xl)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Sc(e);if(!fc(i,t,e.type_))return function(e,t,n){const r=Qc(t,n);return r?ac in r?r[ac]:r.get?.call(e.draft_):void 0}(e,i,t);const o=i[t];if(e.finalized_||!lc(o))return o;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return o;if(o===Zc(e.base_,t)||function(e,t,n){return!(1!==e.type_||!e.allIndicesReassigned_||e.assigned_?.get(t)||!lc(n)||n[Xl])&&e.baseRefs_.has(n)}(e,t,o)){tu(e);const n=1===e.type_?+t:t,r=nu(e.scope_,o,e,n);return e.copy_[n]=r}return o},has:(e,t)=>t in Sc(e),ownKeys:e=>Reflect.ownKeys(Sc(e)),set(e,t,n){const r=Qc(Sc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Zc(Sc(e),t),i=r?.[Xl];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||fc(e.base_,t,e.type_)))return!0;tu(e),eu(e)}return e.copy_[t]===n&&(void 0!==n||fc(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(sc(n)){const i=n[Xl];Wc(i,r)&&i.callbacks_.push(function(){tu(e),Gc(e,n,Tc(i),t)})}else lc(n)&&e.callbacks_.push(function(){const i=Sc(e);3===e.type_?i.has(n)&&Yc(n,r.handledSet_,r):mc(i,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&Yc(mc(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(tu(e),void 0!==Zc(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),eu(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Sc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[oc]:!0,[rc]:1!==e.type_||"length"!==t,[ic]:r[ic],[ac]:n[t]}:r},defineProperty(){Zl(11)},getPrototypeOf:e=>ec(e.base_),setPrototypeOf(){Zl(12)}},Xc={};for(let UM in Jc){let e=Jc[UM];Xc[UM]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}function Zc(e,t){const n=e[Xl];return(n?Sc(n):e)[t]}function Qc(e,t){if(!(t in e))return;let n=ec(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ec(n)}}function eu(e){e.modified_||(e.modified_=!0,e.parent_&&eu(e.parent_))}function tu(e){e.copy_||(e.assigned_=/* @__PURE__ */new Map,e.copy_=Cc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function nu(e,t,n,r){const[i,o]=bc(t)?Pc(Oc).proxyMap_(t,n):vc(t)?Pc(Oc).proxySet_(t,n):function(e,t){const n=yc(e),r={type_:n?1:0,scope_:t?t.scope_:jc(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=Jc;n&&(i=[r],o=Xc);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,[s,r]}(t,n);return(n?.scope_??jc()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const i=t;if(!i||!Wc(i,r))return;r.mapSetPlugin_?.fixSetContents(i);const o=Tc(i);Gc(e,i.draft_??i,o,n),Kc(i,r)})}(n,o,r):o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)}),i}function ru(e){if(!lc(e)||Ic(e))return e;const t=e[Xl];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Cc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Cc(e,!0);return pc(n,(e,t)=>{gc(n,e,ru(t))},r),t&&(t.finalized_=!1),n}Xc.deleteProperty=function(e,t){return Xc.set.call(this,e,t,void 0)},Xc.set=function(e,t,n){return Jc.set.call(this,e[0],t,n,e[0])},globalThis.Iterator;var iu,ou=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(kc(e)&&!kc(t)){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if(kc(t)||Zl(6),void 0===n||kc(n)||Zl(7),lc(e)){const i=Fc(this),o=nu(0,e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?Dc(i):$c(i)}return zc(i,n),Bc(r,i)}if(!e||!wc(e)){if(r=t(e),void 0===r&&(r=e),r===Yl&&(r=void 0),this.autoFreeze_&&Ec(r,!0),n){const t=[],i=[];Pc(_c).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Zl(1)},this.produceWithPatches=(e,t)=>{if(kc(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},xc(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),xc(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),xc(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;lc(e)||Zl(8),sc(e)&&(sc(t=e)||Zl(10),e=ru(t));const n=Fc(this),r=nu(0,e,void 0);return r[Xl].isManual_=!0,$c(n),r}finishDraft(e,t){const n=e&&e[Xl];n&&n.isManual_||Zl(9);const{scope_:r}=n;return zc(r,t),Bc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Pc(_c).applyPatches_;return sc(e)?r(e,t):this.produce(e,e=>r(e,t))}},au=ou.produce,su={platform:{desktop:{},tablet:{},mobile:{}},mode:"desktop-first",theme:{default:"system",schemes:["light","dark"]},variables:{},fonts:[],cache:""},lu=(Object.values({DISPLAY:"display",FLEX_WRAP:"flex-wrap",FLEX_DIRECTION:"flex-direction",ALIGN_ITEMS:"align-items",JUSTIFY_ITEMS:"justify-items",JUSTIFY_CONTENT:"justify-content",ALIGN_CONTENT:"align-content",ROW_GAP:"row-gap",COLUMN_GAP:"column-gap",GRID_ROW_GAP:"grid-row-gap",GRID_COLUMN_GAP:"grid-column-gap",GRID_TEMPLATE_AREAS:"grid-template-areas",GRID_TEMPLATE_COLUMNS:"grid-template-columns",GRID_TEMPLATE_ROWS:"grid-template-rows",GRID_AUTO_FLOW:"grid-auto-flow",GRID_AUTO_ROWS:"grid-auto-rows",GRID_AUTO_COLUMNS:"grid-auto-columns",GRID_ROW_START:"grid-row-start",GRID_COLUMN_START:"grid-column-start",GRID_ROW_END:"grid-row-end",GRID_COLUMN_END:"grid-column-end",ALIGN_SELF:"align-self",JUSTIFY_SELF:"justify-self",ORDER:"order",FLEX_GROW:"flex-grow",FLEX_SHRINK:"flex-shrink",FLEX_BASIS:"flex-basis",LIST_STYLE:"list-style",LIST_STYLE_TYPE:"list-style-type",LIST_STYLE_POSITION:"list-style-position",LIST_STYLE_IMAGE:"list-style-image",BACKGROUND_COLOR:"background-color",BACKGROUND_IMAGE:"background-image",BACKGROUND_POSITION:"background-position",BACKGROUND_SIZE:"background-size",BACKGROUND_REPEAT:"background-repeat",BACKGROUND_ORIGIN:"background-origin",BACKGROUND_CLIP:"background-clip",BACKGROUND_ATTACHMENT:"background-attachment",BACKGROUND_BLEND_MODE:"background-blend-mode",MASK_IMAGE:"mask-image",MASK_SIZE:"mask-size",MASK_POSITION:"mask-position",MASK_REPEAT:"mask-repeat",MASK_COMPOSITE:"mask-composite",WEBKIT_MASK_IMAGE:"-webkit-mask-image",BORDER_TOP_STYLE:"border-top-style",BORDER_TOP_WIDTH:"border-top-width",BORDER_TOP_COLOR:"border-top-color",BORDER_BOTTOM_STYLE:"border-bottom-style",BORDER_BOTTOM_WIDTH:"border-bottom-width",BORDER_BOTTOM_COLOR:"border-bottom-color",BORDER_LEFT_STYLE:"border-left-style",BORDER_LEFT_WIDTH:"border-left-width",BORDER_LEFT_COLOR:"border-left-color",BORDER_RIGHT_STYLE:"border-right-style",BORDER_RIGHT_WIDTH:"border-right-width",BORDER_RIGHT_COLOR:"border-right-color",BORDER_TOP_LEFT_RADIUS:"border-top-left-radius",BORDER_TOP_RIGHT_RADIUS:"border-top-right-radius",BORDER_BOTTOM_LEFT_RADIUS:"border-bottom-left-radius",BORDER_BOTTOM_RIGHT_RADIUS:"border-bottom-right-radius",BORDER_COLLAPSE:"border-collapse",BORDER_SPACING:"border-spacing",TABLE_LAYOUT:"table-layout",OPACITY:"opacity",VISIBILITY:"visibility",CURSOR:"cursor",TRANSITION:"transition",TRANSITION_PROPERTY:"transition-property",TRANSITION_DURATION:"transition-duration",TRANSITION_TIMING_FUNCTION:"transition-timing-function",TRANSITION_DELAY:"transition-delay",TRANSITION_BEHAVIOR:"transition-behavior",ANIMATION:"animation",ANIMATION_NAME:"animation-name",ANIMATION_DURATION:"animation-duration",ANIMATION_TIMING_FUNCTION:"animation-timing-function",ANIMATION_DELAY:"animation-delay",ANIMATION_ITERATION_COUNT:"animation-iteration-count",ANIMATION_DIRECTION:"animation-direction",ANIMATION_FILL_MODE:"animation-fill-mode",ANIMATION_PLAY_STATE:"animation-play-state",ANIMATION_TIMELINE:"animation-timeline",ANIMATION_RANGE:"animation-range",BOX_SHADOW:"box-shadow",FILTER:"filter",BACKDROP_FILTER:"backdrop-filter",MIX_BLEND_MODE:"mix-blend-mode",ISOLATION:"isolation",CLIP_PATH:"clip-path",TRANSFORM:"transform",TRANSFORM_ORIGIN:"transform-origin",TRANSLATE:"translate",ROTATE:"rotate",SCALE:"scale",TRANSFORM_STYLE:"transform-style",PERSPECTIVE:"perspective",PERSPECTIVE_ORIGIN:"perspective-origin",BACKFACE_VISIBILITY:"backface-visibility",WILL_CHANGE:"will-change",OUTLINE_WIDTH:"outline-width",OUTLINE_STYLE:"outline-style",OUTLINE_COLOR:"outline-color",OUTLINE_OFFSET:"outline-offset",POINTER_EVENTS:"pointer-events",USER_SELECT:"user-select",TOUCH_ACTION:"touch-action",RESIZE:"resize",APPEARANCE:"appearance",SCROLL_BEHAVIOR:"scroll-behavior",OVERSCROLL_BEHAVIOR:"overscroll-behavior",SCROLL_SNAP_TYPE:"scroll-snap-type",SCROLL_SNAP_ALIGN:"scroll-snap-align",SCROLL_SNAP_STOP:"scroll-snap-stop",SCROLL_PADDING_TOP:"scroll-padding-top",SCROLL_MARGIN_TOP:"scroll-margin-top",ACCENT_COLOR:"accent-color",CARET_COLOR:"caret-color",COLOR_SCHEME:"color-scheme",CONTENT:"content",POSITION:"position",FLOAT:"float",CLEAR:"clear",Z_INDEX:"z-index",TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",BOX_SIZING:"box-sizing",ASPECT_RATIO:"aspect-ratio",WIDTH:"width",HEIGHT:"height",MIN_WIDTH:"min-width",MIN_HEIGHT:"min-height",MAX_WIDTH:"max-width",MAX_HEIGHT:"max-height",OVERFLOW:"overflow",OVERFLOW_X:"overflow-x",OVERFLOW_Y:"overflow-y",SCROLLBAR_WIDTH:"scrollbar-width",SCROLLBAR_COLOR:"scrollbar-color",CONTAINER_TYPE:"container-type",CONTAINER_NAME:"container-name",OBJECT_FIT:"object-fit",OBJECT_POSITION:"object-position",COLUMN_WIDTH:"column-width",COLUMN_COUNT:"column-count",MARGIN_TOP:"margin-top",MARGIN_BOTTOM:"margin-bottom",MARGIN_LEFT:"margin-left",MARGIN_RIGHT:"margin-right",PADDING_TOP:"padding-top",PADDING_BOTTOM:"padding-bottom",PADDING_LEFT:"padding-left",PADDING_RIGHT:"padding-right",FONT_FAMILY:"font-family",FONT_WEIGHT:"font-weight",FONT_SIZE:"font-size",LINE_HEIGHT:"line-height",COLOR:"color",TEXT_ALIGN:"text-align",FONT_STYLE:"font-style",FONT_VARIANT:"font-variant",FONT_VARIANT_NUMERIC:"font-variant-numeric",FONT_FEATURE_SETTINGS:"font-feature-settings",TEXT_DECORATION:"text-decoration",TEXT_DECORATION_LINE:"text-decoration-line",TEXT_DECORATION_COLOR:"text-decoration-color",TEXT_DECORATION_STYLE:"text-decoration-style",TEXT_DECORATION_THICKNESS:"text-decoration-thickness",TEXT_UNDERLINE_OFFSET:"text-underline-offset",LETTER_SPACING:"letter-spacing",WORD_SPACING:"word-spacing",TEXT_INDENT:"text-indent",TEXT_TRANSFORM:"text-transform",DIRECTION:"direction",WRITING_MODE:"writing-mode",TEXT_ORIENTATION:"text-orientation",WHITE_SPACE:"white-space",TEXT_WRAP:"text-wrap",WORD_BREAK:"word-break",OVERFLOW_WRAP:"overflow-wrap",HYPHENS:"hyphens",VERTICAL_ALIGN:"vertical-align",TEXT_OVERFLOW:"text-overflow",TEXT_SHADOW:"text-shadow",LINE_CLAMP:"line-clamp",WEBKIT_LINE_CLAMP:"-webkit-line-clamp",WEBKIT_BOX_ORIENT:"-webkit-box-orient",WEBKIT_TEXT_FILL_COLOR:"-webkit-text-fill-color",WEBKIT_BACKGROUND_CLIP:"-webkit-background-clip",BOX_DECORATION_BREAK:"box-decoration-break",WEBKIT_BOX_DECORATION_BREAK:"-webkit-box-decoration-break",FILL:"fill",STROKE:"stroke",STROKE_WIDTH:"stroke-width"}).map(e=>({path:e,label:e})),"props"),cu={definition:{name:"",permanentUrl:""},flat:{},variables:[],settings:{customCss:""},pages:[],pageFolders:[],components:{}},uu={settled:/* @__PURE__ */new Set([lu])},du=(e,t,n={},r={})=>{let i,{attributes:o,definition:a}=e,{rootId:s,plitziElementLayout:l}=t;t.attributes&&(o={...o,...t.attributes});let c=o;if(Object.keys(n).length>0)if((e=>!!e&&Object.values(e).some(e=>Array.isArray(e)&&e.length>0))(a.bindings)){let t=((e,t,n={})=>{let{attributes:r,definition:i}=t,{bindings:o}=i;return!o||"object"==typeof o&&!Object.keys(o).length?{attributes:r,style:{},definition:i}:au({attributes:r,style:n,definition:i},t=>{Object.keys(o).forEach(n=>{o[n]&&Array.isArray(o[n])&&o[n].length&&o[n].forEach(r=>{let{source:i,transformers:o,when:a,enabled:s=!0}=r,{to:l}=r;if(!l||a&&!Ei(a,e,!1,!0)||!s)return;"style"===n&&!l.startsWith("--")&&(l=function(e){if(!e)return"";let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([0-9])([a-zA-Z])/g,"$1 $2").replace(/([a-zA-Z])([0-9])/g,"$1 $2").replace(/[_\s-]+/g," ").trim().split(/\s+/);return 0===t.length?"":t.map((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}(l));let{fromValue:c,toValue:u}=((e,t,n,r,i)=>{let o="initialState"===r?`definition.${r}.${i}`:`${r}.${i}`;return{fromValue:t?pr(e,t):void 0,toValue:pr(n,o,t?pr(e,t):void 0)}})(e,i,t,n,l),d=c;o&&Array.isArray(o)&&o.length>0&&o.forEach(n=>{let{action:r,params:i,enabled:o=!0}=n;if(!o)return;let a=ss[r];a&&(d=a.callback(d,((e,t)=>{if(!t)return t;let n=t;for(let[r,i]of Object.entries(e.params)){let e=t[r];"true"!==e&&"false"!==e||"checkbox"!==("function"==typeof i.type?i.type(t):i.type)||(n===t&&(n={...t}),n[r]="true"===e)}return n})(a,i)??{},t,{...e,sourceTo:u}))}),"initialState"===n&&"visibility"===l&&i&&void 0!==pr(e,i)&&(d=Yo(d)),("style"!==n||(e=>"number"==typeof e||"string"==typeof e&&!/[;{}<>]/.test(e))(d))&&("boolean"==typeof d||"number"==typeof d||d)&&hr(t,"initialState"===n?`definition.${n}.${l}`:`${n}.${l}`,d)})})})})(n,{...e,attributes:o},i);({attributes:o,definition:a,style:i}=t)}else i={};let u=Vo[a.type]??[],d=Object.keys(o).filter(e=>{let t=o[e];return"string"==typeof t&&t===c[e]&&or(t)&&!u.includes(e)});return d.length>0&&(o=((e,t,n)=>{let{queryParams:r={},routeParams:i={},variables:o={},origin:a="",navigation:s,...l}=n,c={...o,...i,...r,...l,navigation:{...s,routeParams:i,queryParams:r,origin:a}},u={...e};for(let d of t)u[d]=Vn(e[d],c,uu);return u})(o,d,n)),o={...o,...te(r,["visibility","styleSelectors"])},a={...a,styleSelectors:{...a.styleSelectors,...a.initialState?.styleSelectors,...r.styleSelectors??{}}},a.styleSelectors=(e=>{let t=e.initialState?.styleVariant;return Object.fromEntries(Object.entries(e.styleSelectors).map(([n,r])=>{let i="base"===n?`plitzi__${e.type}`:`plitzi__${e.type}-${n}`;if("string"!=typeof r)return[n,r];!(e=>{let t=Go.get(e);return t||(t=RegExp(`(^|\\s)${e}(?=\\s|$)`),Go.set(e,t)),t})(e.type).test(r)&&t?.[e.type]?.[n]&&(r=r?`${e.type} ${r}`:e.type);let o=r.replace(/\S+/g,r=>{let i=t?.[r]?.[n];if(!i)return r;let o=Array.isArray(i)?i:[i];return r===e.type&&"base"===n?o.map(e=>`${r}--${e}`).join(" "):r===e.type&&"base"!==n?o.map(e=>`${r}-${n}--${e}`).join(" "):`${r} ${o.map(e=>`${r}--${e}`).join(" ")}`});return o?[n,`${i} ${o}`]:[n,i]}))})(a),{...t,rootId:pr(l,"rootId",s),attributes:{...o,...te(t,["id","rootId","attributes","definition","plitziElementLayout"])},definition:a,elementState:{...a.initialState,...r},style:i}},pu=(e,t)=>{let n=Vo[t]??[];return Object.entries(e??{}).flatMap(([e,t])=>"string"==typeof t&&or(t)&&!n.includes(e)?[t]:[])},hu=({element:e,children:t,internalProps:n,previewMode:r=!1,parentVisible:i=!0})=>{let{id:o}=n,{state:a,setElementState:s}=(({id:e,bindings:t,previewMode:n})=>{let{scopePath:r}=zt(),i=k(()=>((e,t)=>t?`runtime.elements.${e}.${t}`:`runtime.elements.${e}`)(e,r),[e,r]),[o]=Dt(i),a=o??Ur,s=qt(),l=k(()=>(t?.attributes&&Array.isArray(t.attributes)?t.attributes:[]).filter(e=>!1!==e.enabled).map(e=>pr(e,"to","")),[t]),c=f(e=>!!n&&(s(i,t=>{if(!e)return{};let n="function"==typeof e?e(t??Ur):e;return l.length&&(n=vr(n,l)),n}),!0),[l,i,n,s]);return g(()=>{if(n&&r)return()=>s(i,void 0)},[n,r,i,s,e]),{state:a,setElementState:c}})({id:o,bindings:e.definition.bindings,previewMode:r}),{type:l}=e.definition,c=k(()=>{let t=[...pu(e.attributes,l),...pu(n.attributes,l)];return t.length>0?(e=>["variables",...new Set(e.flatMap(e=>sr(e)))])(t):void 0},[e.attributes,l,n.attributes]),[[u,d,p]]=Dt(["navigation.routeParams","navigation.queryParams","navigation.origin"],{enabled:void 0!==c}),h=(({bindings:e,sources:t})=>{let n=k(()=>{let n=new Set(t??[]);for(let t of Object.values(e??{}))if(Array.isArray(t))for(let e of t)for(let t of lr(e))n.add(t);return n.size>0&&n.add("variables"),(e=>{let t=[];for(let n of[...new Set(e)].filter(Boolean).sort((e,t)=>e.length-t.length))t.some(e=>n.startsWith(`${e}.`))||t.push(n);return t})(n)},[e,t]),r=k(()=>n.map(e=>`runtime.sources.${e}`),[n]),[i]=Dt(r);return k(()=>{let e={};return n.forEach((t,n)=>{void 0!==i[n]&&((e,t,n)=>{let r=t.split("."),i=e;for(let o of r.slice(0,-1)){let e=i[o],t=X(e)?e:{};i[o]=t,i=t}i[r[r.length-1]]=n})(e,t,i[n])}),e},[n,i])})({bindings:e.definition.bindings,sources:c}),m=k(()=>({...du(e,n,{...h,routeParams:u,queryParams:d,origin:p},a),setElementState:s}),[e,n,h,u,d,p,a,s]);return{internalProps:m,customProps:k(()=>te(m,["id","rootId","plitziElementLayout","attributes","definition","style","elementState","setElementState"]),[m]),children:Fi({id:o,definition:m.definition,plitziElementLayout:m.plitziElementLayout,children:t,previewMode:r,visible:i&&ee(m.elementState.visibility)})}},fu=class extends r{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(e,t)}render(){let{children:e}=this.props,{hasError:t}=this.state;return t?/* @__PURE__ */I("div",{children:"Something broke! Please refresh and try again."}):e}},mu=K("EventBridgeContext",{}),gu=Object.freeze({}),yu=Object.freeze({}),bu=K("PlitziContext",{}),vu=()=>{let e=h(bu);if(void 0===e)throw Error("The Plitzi context is undefined. Render the element inside a PlitziProvider.");return e},wu=e=>{let{children:t,value:n}=e;/* @__PURE__ */
25
25
  return I(bu,{value:n,children:t})},ku=e=>{if(void 0===e)return"undefined";if(null===e)return"null";let t=typeof e;if("function"===t)return"ƒ";if("string"===t){let t=e;return JSON.stringify(t.length>40?`${t.slice(0,40)}…`:t)}return"symbol"===t?e.toString():"number"===t||"boolean"===t||"bigint"===t?`${e}`:Array.isArray(e)?0===e.length?"[]":`[…${e.length}]`:"$$typeof"in e?"<ReactElement>":"{…}"},xu=e=>{if("object"!=typeof e||!e)return ku(e);if("$$typeof"in e)return"<ReactElement>";if(Array.isArray(e))return 0===e.length?"[]":`[${e.slice(0,4).map(ku).join(", ")}${e.length>4?", …":""}]`;let t=e,n=Object.keys(t);return 0===n.length?"{}":`{ ${n.slice(0,4).map(e=>`${e}: ${ku(t[e])}`).join(", ")}${n.length>4?", …":""} }`},Su=(e,t)=>{if(Object.is(e,t))return!0;if(null===e||null===t||"object"!=typeof e||"object"!=typeof t||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.is(e[n],t[n]))},Tu=Xe({enabled:!1,hydrated:!1,commits:[],tree:{}},{id:"tracing"}),Cu=((e={})=>{let{max:t=100,enabled:n}=e,r=new oe,i=[],o=0,a=()=>{r.forEach(e=>e())},s=e=>{o+=1;let n={seq:o,time:typeof performance<"u"?performance.now():Date.now(),path:e.path,prevValue:e.prevValue,nextValue:e.nextValue},r=i.length>=t?i.slice(i.length-t+1):i.slice();r.push(n),i=r,a()};return{middleware:e=>{if(!ae(n,e.getState()))return{onChange:s}},record:s,getEntries:()=>i,entriesSince:e=>i.filter(t=>t.seq>e),lastSeq:()=>o,subscribe:e=>r.add(e),clear:()=>{i=[],a()}}})({max:30}),Eu=[],Au=/* @__PURE__ */new Map,Iu=/* @__PURE__ */new Map,Ou=/* @__PURE__ */new Map,_u=/* @__PURE__ */new Map,Nu=!0,Mu=/* @__PURE__ */new Map,Pu=/* @__PURE__ */new Map,Lu=0,Ru=/* @__PURE__ */new Map,ju=!1,zu=!1,Du=0,$u=!1,Fu=!1,qu="function"==typeof requestAnimationFrame?e=>{requestAnimationFrame(e)}:e=>{setTimeout(e,16)},Bu=()=>{Nu&&(Nu=!1,Tu.setState("tree",(()=>{let e={};for(let[t,n]of _u)e[t]={parentId:Iu.get(t),baseDuration:n,elementId:Ou.get(t)??t,mountedAt:Mu.get(t),unmountedAt:Pu.get(t)};return e})())),Tu.setState("hydrated",Fu),Tu.setState("commits",Eu)},Uu=e=>{Iu.delete(e),Ou.delete(e),_u.delete(e),Mu.delete(e),Pu.delete(e),Nu=!0},Hu=()=>{if($u=!1,Au.size>0){let e=[...Au.values()].sort((e,t)=>e.timestamp-t.timestamp);Au.clear(),(Eu=[...Eu,...e]).length>200&&(Eu=Eu.slice(Eu.length-200)),(e=>{for(let[t,n]of Pu)n<=e&&Uu(t)})(Eu[0].commitId)}zu&&Bu()},Wu=()=>{let e=Cu.entriesSince(Lu);Lu=Cu.lastSeq();let t=/* @__PURE__ */new Map;for(let n of e){if(void 0===n.path)continue;let e=t.get(n.path);e?e.next=n.nextValue:t.set(n.path,{prev:n.prevValue,next:n.nextValue})}return[...t.entries()].map(([e,t])=>({path:e,preview:`${xu(t.prev)} → ${xu(t.next)}`}))},Vu={onRender:(e,t,n,r,i,o)=>{ju||(ju=!0,Tu.setState("enabled",!0));let a=!_u.has(e);_u.set(e,r);let s=Ru.get(e);Ru.delete(e);let l={id:e,elementId:Ou.get(e)??e,parentId:Iu.get(e),phase:t,actualDuration:n,baseDuration:r,changedProps:s},c=Au.get(o);c?(c.elements.push(l),c.elementCount+=1,c.duration=Math.max(c.duration,n)):(Du+=1,Au.set(o,{commitId:Du,timestamp:o,duration:n,elementCount:1,elements:[l],causes:Wu()})),a&&(Mu.set(e,Au.get(o)?.commitId??Du),Nu=!0),$u||($u=!0,qu(Hu))},lastCommitId:()=>Du,commitsSince:e=>{let t=[...Au.values()].sort((e,t)=>e.timestamp-t.timestamp);return[...Eu,...t].filter(t=>t.commitId>e)},linkParent:(e,t,n)=>{(!Iu.has(e)||Iu.get(e)!==t)&&(Nu=!0),Iu.size>=2e4&&!Iu.has(e)&&(Iu.clear(),Ou.clear(),_u.clear(),Mu.clear(),Pu.clear(),Nu=!0),Iu.set(e,t),Ou.set(e,n)},markMounted:e=>{Pu.delete(e)&&(Nu=!0)},markUnmounted:e=>{_u.has(e)?(Pu.set(e,Du),Nu=!0,$u||($u=!0,qu(Hu))):Uu(e)},recordProps:(e,t)=>{Ru.set(e,t)},recordStoreChange:e=>{Cu.record(e)},setHydrated:()=>{Fu||(Fu=!0,zu&&Tu.setState("hydrated",!0))},start:()=>{zu=!0,Hu(),Bu()},stop:()=>{zu=!1},clear:()=>{Eu=[],Au.clear(),Lu=Cu.lastSeq(),Ru.clear(),Du=0;for(let e of[...Pu.keys()])Uu(e);Mu.clear(),Nu=!0,Bu()}},Gu=/* @__PURE__ */$({default:()=>Ku}),Ku=e=>{let t=e.displayName||e.name,n=t=>{let n=x(void 0),r=x(void 0),{id:i,rootId:a}=t.internalProps,s=h(J),l=s?.visible??!0,c=`${i}${b()}`,u=s?.traceId??c,d=k(()=>({id:i,rootId:a,visible:l,traceId:u,plitziJsxSkipHOC:!0}),[i,a,l,u]),p=k(()=>({visible:l,traceId:u}),[l,u]);if(t.plitziJsxSkipHOC)/* @__PURE__ */return I(J,{value:p,children:/* @__PURE__ */I(Y,{value:d,children:/* @__PURE__ */I(e,{...t})})});let{settings:{previewMode:f,debugMode:m},root:{baseElementId:y}}=vu();g(()=>{if(m)return Vu.markMounted(c),()=>Vu.markUnmounted(c)},[m,c]);let[v]=Dt(`schema.flat.${i}`);if(!v)throw Error(`Element ${i} not found, Page ${y}`);let{internalProps:w,customProps:S,children:T}=hu({element:v,internalProps:t.internalProps,children:t.children,previewMode:f,parentVisible:l}),{attributes:C,definition:E,style:A,plitziElementLayout:O,elementState:_,setElementState:N}=w;((e,t=gu,n=yu,r=mu,i=!1)=>{let{eventBridge:o}=h(r);g(()=>{if(i||!o||!e)return;let r=Object.entries(t);for(let[t,i]of r)"function"==typeof i&&o.on(e,t,i,n);return()=>{for(let[t,n]of r)"function"==typeof n&&o.off(e,t,n)}},[e,t,o,n,i])})("element",k(()=>({[`${i}_setState`]:N}),[i,N]));let M=l&&ee(_.visibility),P=k(()=>({id:i,rootId:a,visible:M,traceId:c,attributes:C,definition:E,plitziElementLayout:O,style:A,elementState:_,setElementState:N}),[C,E,_,i,O,a,A,N,M,c]),L=k(()=>({visible:M,traceId:c}),[M,c]),R=k(()=>{let r={...Q(e,w.attributes),...t.extraProps,...S,...te(t,["plitziJsxSkipHOC","internalProps","className","children","extraProps"])};return T&&(r={...r,children:T}),/* @__PURE__ */I(fu,{children:/* @__PURE__ */I(e,{...r,ref:n})})},[w.attributes,t,S,T]),j=/* @__PURE__ */I(J,{value:L,children:/* @__PURE__ */I(Y,{value:P,children:R})});if(m){Vu.linkParent(c,s?.traceId,i);let e={attributes:C,definition:E,style:A,elementState:_,plitziElementLayout:O,children:T,...S,...t.extraProps,...te(t,["plitziJsxSkipHOC","internalProps","className","children","extraProps"])};return Vu.recordProps(c,((e,t)=>{if(!e)return[];let n=[],r=/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r){let r=e[i],o=t[i];if(!Object.is(r,o)&&(n.push({key:i,prev:xu(r),next:xu(o),ref:Su(r,o)}),n.length>=12))break}return n})(r.current,e)),r.current=e,/* @__PURE__ */I(o,{id:c,onRender:Vu.onRender,children:j})}return j};return n.displayName=`withElement(${t})`,n},Yu=()=>{let e=h(Y);if(void 0===e)throw Error("Element data not found. Make sure the element is rendered under withElement.");return e},Ju=({tag:e="div",refProp:t,style:n,className:r,otherProps:i,anchor:o,params:a,serverMarker:s,motion:l,testMarker:u,events:d,children:p})=>""===e?p:c(e,{ref:t,style:n,className:r,...i,...o?{id:o}:{},...a,...l,...d,...s,...u},p),Xu={text:"text",textarea:"textarea",select:"select",boolean:"boolean",number:"text",scalar:"text",json:"codemirror-json",elementIds:"elements"},Zu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[-_\s]+/).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" "),Qu=(e,t)=>({type:t.builderType??Xu[t.type],label:t.label??Zu(e),...void 0===t.default?{}:{defaultValue:t.default},...t.options?{options:t.options.map(e=>({value:e,label:t.optionLabels?.[e]??Zu(e)}))}:{},...t.when?{when:t.when}:{},...void 0===t.canBind?{}:{canBind:t.canBind},...void 0===t.elementType?{}:{elementType:t.elementType}}),ed=/* @__PURE__ */new WeakMap,td=e=>{let t=ed.get(e);return t||(t=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Qu(e,t)])),ed.set(e,t)),t},nd=(e,t,n,r={})=>({action:e,title:t.title,type:t.type??"globalCallback",callback:n,preview:t.preview??{},params:td(t.params),...r}),rd=(e,t,n={})=>Object.fromEntries(Object.keys(e).map(r=>[r,nd(r,e[r],t[r],n[r]??{})])),id=["smooth","auto"],od=["start","center","end","nearest"],ad=/^(-?\d+(?:\.\d+)?)(px|%)?$/,sd=(e,t)=>{if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;let n=ad.exec(e.trim());if(!n)return;let r=Number(n[1]);return"%"===n[2]?r/100*t:r},ld=(e,t,n)=>{let r=Math.max(t-n,0);if("start"===e)return 0;if("end"===e)return r;let i=sd(e,r);return void 0===i?void 0:Math.min(Math.max(i,0),r)},cd={type:"select",description:'How it moves: "smooth" glides there, "auto" jumps.',default:"smooth",options:[...id]},ud={scrollBy:{title:"Scroll By",type:"callback",strictParams:!0,params:{x:{type:"text",description:'How far across: pixels ("240") or a share of what the box shows ("80%"); negative goes back.',default:""},y:{type:"text",description:"How far down, the same way; negative goes up.",default:""},behavior:cd}},scrollTo:{title:"Scroll To",type:"callback",strictParams:!0,params:{x:{type:"text",description:'Where across: "start", "end", pixels from the start, or a share of the way ("50%"). Empty stays.',default:""},y:{type:"text",description:"Where down, the same way. Empty stays.",default:""},behavior:cd}},scrollIntoView:{title:"Scroll Into View",type:"callback",strictParams:!0,params:{block:{type:"select",description:"Where the element lands, top to bottom.",default:"start",options:[...od]},inline:{type:"select",description:"Where it lands, side to side.",default:"nearest",options:[...od]},behavior:cd}}},dd={setState:{title:"Update Element (set attribute / state)",type:"callback",strictParams:!0,params:{category:{type:"select",description:'What to change on the element: "attribute" sets one of its props (the common case — e.g. content, disabled); "state" sets element state (visibility or a style selector). REQUIRED — always set it.',default:"attribute",options:["attribute","state"],required:!0},key:{type:"text",description:'The field to set. When category="attribute", an attribute/prop key of THIS element (e.g. "content", "disabled"). When category="state", "visibility" or "styleSelectors.<selector>". REQUIRED.',required:!0},value:{type:"scalar",description:'The value to set — its type follows the target attribute: a real boolean (true/false) for a boolean attribute, a number for a numeric one, otherwise a string (the strings "true"/"false" also coerce). There is NO separate `type` param (that belongs to the global state setState, not this one). REQUIRED.',when:e=>!!e.category,required:!0},revertOnFinish:{type:"boolean",description:'When true, this change is UNDONE automatically when the whole flow finishes. Use it for a TEMPORARY change (a "loading…" label, disabling a button while it works) instead of adding manual restore steps at the end of the flow.',default:!1,label:"Revert changes after interaction"}}},toggleState:{title:"Toggle Element (flip attribute / state)",type:"callback",strictParams:!0,params:{category:{type:"select",description:'What to flip on the element: "attribute" flips one of its props (e.g. disabled); "state" flips element state ("visibility", or "styleSelectors.<selector>" for an expanded/collapsed look). REQUIRED.',default:"state",options:["attribute","state"],required:!0},key:{type:"text",description:'The field to flip. When category="attribute", an attribute/prop key of THIS element. When category="state", "visibility" or "styleSelectors.<selector>". Anything not already true counts as false, so a field that has never been set flips ON first. REQUIRED.',required:!0},revertOnFinish:{type:"boolean",description:"When true, the flip is UNDONE automatically when the whole flow finishes — a change that lasts only as long as the flow does.",default:!1,label:"Revert changes after interaction"}}},...ud},pd=(e,t)=>n=>{let{category:r}=n;return"attribute"===r?Object.keys(e).map(e=>({value:e,label:e})):"state"===r?[{value:"visibility",label:"Visibility"},...Object.keys(t.styleSelectors).map(e=>({value:`styleSelectors.${e}`,label:`Selector - ${e}`}))]:[]},hd=e=>{if("string"!=typeof e)return e;let t=e.toLowerCase();return"true"===t||"false"===t||"yes"===t||"no"===t?"true"===t||"yes"===t:e},fd="plitzi-component--hidden",md=e=>{let t="string"==typeof e&&""!==e.trim()?Number(e):e;return"number"==typeof t&&Number.isInteger(t)&&t>=250?t:void 0},gd=["ctrl","alt","shift","meta"],yd={ctrl:"ctrl",control:"ctrl",alt:"alt",option:"alt",shift:"shift",meta:"meta",cmd:"meta",command:"meta",mod:"mod"},bd={esc:"escape",space:"space",spacebar:"space",plus:"+",minus:"-",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",del:"delete",return:"enter"},vd=/* @__PURE__ */new Set(["escape","enter","tab","space","backspace","delete","insert","arrowup","arrowdown","arrowleft","arrowright","home","end","pageup","pagedown",...Array.from({length:12},(e,t)=>`f${t+1}`)]),wd=(e,t)=>[...gd.filter(t=>e.has(t)),t].join("+"),kd=(e,t=!1)=>{let n=e.split(",").map(e=>((e,t)=>{let n=e.trim().toLowerCase();if(!n)return{problem:"an empty shortcut (two commas in a row, or one at the end)"};let r=n.endsWith("++")?[...n.slice(0,-2).split("+"),"+"]:n.split("+"),i="+"===n?["+"]:r.filter(e=>""!==e),o=/* @__PURE__ */new Set,a=[];for(let l of i){if(Object.hasOwn(yd,l)){let e=yd[l];o.add("mod"===e?t?"meta":"ctrl":e);continue}a.push(Object.hasOwn(bd,l)?bd[l]:l)}if(1!==a.length)return{problem:`"${e.trim()}" names ${a.length?`${a.length} keys (${a.join(", ")})`:"no key, only modifiers"}: a shortcut is modifiers and ONE key, like "shift+f"`};let[s]=a;return 1===s.length||vd.has(s)?{combo:wd(o,s)}:{problem:`"${s}" in "${e.trim()}" is not a key: use one character ("f", "?", "+") or a key's name (${[...vd].slice(0,15).join(", ")}, f1…f12)`}})(e,t));return{combos:n.flatMap(e=>e.combo?[e.combo]:[]),problems:n.flatMap(e=>e.problem?[e.problem]:[])}},xd=/* @__PURE__ */new Set(["a","z","y","c","x","v"]),Sd=/* @__PURE__ */new Set(["arrowleft","arrowright","arrowup","arrowdown","home","end","backspace","delete"]),Td=e=>id.find(t=>t===e)??"smooth",Cd=(e,t)=>od.find(t=>t===e)??t,Ed={onLoad:{action:"onLoad",title:"On Load",type:"trigger",preview:{},params:{}},onClick:{action:"onClick",title:"On Click",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onPointerDown:{action:"onPointerDown",title:"On Pointer Down",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onMouseEnter:{action:"onMouseEnter",title:"On Mouse Enter",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onMouseLeave:{action:"onMouseLeave",title:"On Mouse Leave",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onHover:{action:"onHover",title:"On Hover",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onFocus:{action:"onFocus",title:"On Focus",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onBlur:{action:"onBlur",title:"On Blur",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onInterval:{action:"onInterval",title:"On Interval",type:"trigger",preview:{interval:"",count:""},params:{interval:{canBind:!1,defaultValue:"5000",type:"text",label:"Every (milliseconds, at least 250)"}}},onKey:{action:"onKey",title:"On Key",type:"trigger",preview:{key:"",shortcuts:""},params:{keys:{canBind:!1,defaultValue:"",type:"text",label:"Keys (e.g. f, shift+f, mod+k, escape)"}}},onScroll:{action:"onScroll",title:"On Scroll",type:"trigger",preview:{x:"",y:"",atStart:"",atEnd:""},params:{}},onFlowEnd:{action:"onFlowEnd",title:"On Server Action End",type:"trigger",preview:{actionId:"",runId:"",status:"",output:{}},params:{}},onFlowError:{action:"onFlowError",title:"On Server Action Error",type:"trigger",preview:{actionId:"",runId:"",error:"",reason:""},params:{}},onFlowProgress:{action:"onFlowProgress",title:"On Server Action Progress",type:"trigger",preview:{actionId:"",runId:"",chunk:""},params:{}}},Ad=["onClick","onPointerDown","onHover","onFocus","onBlur","onMouseEnter","onMouseLeave"],Id=K("InteractionsContext",{}),Od=["variables","navigation","auth","state","host","theme","flags","computed"].filter(e=>"state"!==e&&"computed"!==e),_d=(e,t,n)=>{let r={},i=void 0!==n&&Object.keys(n).length===Object.keys(e).length;for(let[o,a]of Object.entries(e)){let e=Yn(a,{...t,computed:{...r}}),s=n?.[o],l=void 0!==n&&Object.hasOwn(n,o)&&(s===e||ps(s,e));r[o]=l?s:e,i&&=l}return i&&n?n:r},Nd=(e,t,n)=>{let r=Od.map(e=>t[e]);if(iu?.definitions===e&&iu.state===n&&iu.globals.every((e,t)=>e===r[t]))return iu.computed;let i=_d(e,{...Object.fromEntries(Od.map((e,t)=>[e,r[t]])),state:n},iu?.definitions===e?iu.computed:void 0);return iu={definitions:e,state:n,globals:r,computed:i},i},Md=(e,t)=>`${e}_${t}`,Pd=({id:e="",source:t,name:n,fields:r=[]})=>{let{useStoreSetter:i}=jt(),o=i(),a=k(()=>`${e}_${((e,t=!0,n=!0)=>{let r="",i="abcdefghijklmnopqrstuvwxyz";t&&(i=`ABCDEFGHIJKLMNOPQRSTUVWXYZ${i}`),n&&(i=`${i}0123456789`);let o=i.length;for(let a=0;a<e;a++)r+=i.charAt(Math.floor(Math.random()*o));return r})(8)}`,[e]),s=y(()=>{o(`sources.${a}`,{id:a,meta:{id:e,source:t,name:n,fields:r}})});g(()=>{if(t)return s(),()=>o(`sources.${a}`,void 0,{unmount:!0})},[a,t,o]),g(()=>{t&&o(`sources.${a}.meta.name`,n)},[n,t,a,o]),g(()=>{t&&o(`sources.${a}.meta.fields`,r,{raw:!0})},[r,t,a,o])},Ld=(e,t={})=>Array.isArray(e)?e.reduce((e,n)=>{let{name:r,value:i,subValues:o}=n;if(!Array.isArray(o)||0===o.length)return{...e,[r]:i};let a=o.find(e=>Ei(e.when,t));return{...e,[r]:a?a.value:i}},{}):{},Rd=e=>{let t=x(e);return t.current!==e&&!ps(t.current,e)&&(t.current=e),t.current},jd=()=>{let{environment:e}=re(),[[t,n,r,i]]=Dt(["schema.variables","navigation.routeParams","navigation.queryParams","navigation.hostname"]);return Rd(k(()=>Ld(t,{routeParams:n,queryParams:r,hostname:i,environment:e}),[e,i,r,n,t]))},zd=(e,t=2)=>String(e).padStart(t,"0"),Dd=()=>typeof window<"u",$d=new class{callbackInternal;callbackAddProvider;callbackRemoveProvider;pendingLimit=100;logsListenedLimit=1e3;pendingLogs=[];listening=!1;listeningCategory;logsListened=[];listeningParams;#e=[];#t=!1;#n=/* @__PURE__ */new Set;#r=[];recentLimit=200;constructor(e,t=100){this.callbackInternal=e,this.pendingLimit=t}setCallback(e){this.callbackInternal=e}processPendingLogs(){if(this.pendingLogs.length&&this.callbackInternal){for(let e of this.pendingLogs)this.callbackInternal(e.logType,e.category,e.message,e.params,e.time);this.pendingLogs=[]}}addListener(e,{replay:t=!1}={}){if(t)for(let n of this.#r)e(n);return this.#n.add(e),()=>{this.#n.delete(e)}}setCallbackAddProvider(e){this.callbackAddProvider=e}setCallbackRemoveProvider(e){this.callbackRemoveProvider=e}flush(e=!1){this.logsListened=[],e&&(this.pendingLogs=[])}#i(e,t,n,r){if(!this.callbackInternal&&!Dd())return;let i=this.getTime(!0);if(Dd()){let o={logType:e,category:t,message:n,params:r,time:i};this.#r.push(o),this.#r.length>this.recentLimit&&this.#r.shift();for(let e of this.#n)e(o)}if(!this.callbackInternal)return this.pendingLogs.push({logType:e,category:t,message:n,params:r,time:i}),void(this.pendingLogs.length>this.pendingLimit&&this.pendingLogs.shift());this.listening?this.logsListened.push({logType:e,category:t,message:n,params:r,time:i}):(this.#e.push({logType:e,category:t,message:n,params:r,time:i}),this.#o()),this.logsListened.length>this.logsListenedLimit&&this.logsListened.shift()}#o(){this.#t||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=this.callbackInternal,t=this.#e;if(this.#e=[],e)for(let n of t)e(n.logType,n.category,n.message,n.params,n.time)}))}addProviderMethod(e,t){this.callbackAddProvider?.(e,t)}removeProviderMethod(e){"function"==typeof this.callbackRemoveProvider&&this.callbackRemoveProvider(e)}getTime(e=!1){let t=/* @__PURE__ */new Date;return e?(e=>`${zd(e.getHours())}:${zd(e.getMinutes())}:${zd(e.getSeconds())}.${zd(e.getMilliseconds(),3)}`)(t):t}info(e,t,n){this.#i("info",e,t,n)}warning(e,t,n){this.#i("warning",e,t,n)}danger(e,t,n){this.#i("danger",e,t,n)}success(e,t,n){this.#i("success",e,t,n)}begin(e){this.listening=!0,this.listeningParams={category:e}}end(){this.listening=!1,this.listeningCategory&&this.logsListened.length>0&&this.callbackInternal?.("info",this.listeningCategory,`${this.logsListened.length} Log${1===this.logsListened.length?"":"s"}`,{logs:this.logsListened}),this.logsListened=[],this.listeningCategory=void 0}};function Fd(e="store"){return({path:t,prevValue:n,nextValue:r})=>{$d.info("store",e,{storeName:e,path:t,prev:n,next:r})}}var qd=/* @__PURE__ */new WeakSet,Bd=({elementContext:e,previewMode:t,debugMode:n,baseElementId:r,className:i,interactionTriggers:o,interactionCallbacks:a,otherProps:s,ref:l})=>{let{id:c,className:u,attributes:d,definition:p,definition:{interactions:b},plitziElementLayout:v,elementState:w,setElementState:S}=e,{interactionsManager:T,useInteractions:C}=h(Id),E=f((e,t,n,r,i=!1)=>{i||e.preventDefault(),r&&r(e);let o=(e=>"nativeEvent"in e&&X(e.nativeEvent)?e.nativeEvent:e)(e);qd.has(o)||(i||qd.add(o),T.interactionTrigger(t,n,{event:e}))},[T]),A=k(()=>t&&b?Object.values(b).filter(e=>"trigger"===e.type&&e.action&&Ad.includes(e.action)&&e.enabled).reduce((e,t)=>{let n=pr(t,"params.propagateEvent",!1);return{...e,[t.action]:e=>E(e,c,t.action,s[t.action],n)}},{}):{},[c,b,s,t,E]),I=m(kt),O=f(()=>{let e=I?.getPath("runtime.sources");return((e,t,n)=>{let r=X(t)?t:{};return(e=>X(e)&&Object.values(e).every(e=>"string"==typeof e))(n)?{...e,state:r,computed:Nd(n,e,r)}:{...e,state:r}})(X(e)?e:Vr,I?.getPath("runtime.state"),I?.getPath("schema.settings.computed"))},[I]),_=f(()=>({dataSource:O()}),[O]),N=k(()=>({...Ed,...o}),[o]),M=x(null),P=l??M,L=(({attributes:e,definition:t,setElementState:n})=>{let r=f((e,t)=>{let r,i;return n(n=>(r=n,i=au(n,r=>hr(r,e,t(pr(n,e)))),i)),{prevState:r,nextState:i}},[n]),i=f(e=>{if(!e.key||void 0===e.value)return{prevState:void 0,nextState:void 0};let{key:t}=e,n=hd(e.value);return r(t,()=>n)},[r]),o=f(e=>{if(!e.key)return{prevState:void 0,nextState:void 0};let{key:t}=e;return r(t,e=>!0!==hd(e))},[r]),a=f((e,t)=>{let r=t?.prevState;e.revertOnFinish&&r&&n(r)},[n]);return k(()=>((e,t,n,r,i)=>{let o=dd.setState,a=td(o.params),s=dd.toggleState,l=td(s.params),c={type:"select",options:pd(e,t),when:e=>"attribute"===e.category||"state"===e.category};return{setState:nd("setState",o,n,{title:`Update ${t.label}`,postCallback:r,params:{...a,key:{...a.key,...c},value:{...a.value,type:t=>"boolean"==typeof e[t.key]?"select":"text",options:t=>{let{key:n}=t;return"boolean"==typeof e[n]?[{value:"true",label:"True"},{value:"false",label:"False"}]:Object.keys(e).map(e=>({value:e,label:e}))}}}}),toggleState:nd("toggleState",s,i,{title:`Toggle ${t.label}`,postCallback:r,params:{...l,key:{...l.key,...c}}})}})(e,t,i,a,o),[e,t,i,a,o])})({attributes:d,definition:p,setElementState:S}),R=(({id:e,label:t,nodeRef:n,interactions:r,previewMode:i,interactionsManager:o})=>{let a=k(()=>rd(ud,{scrollBy:e=>{let t=n.current;t?.scrollBy({left:sd(e.x,t.clientWidth)??0,top:sd(e.y,t.clientHeight)??0,behavior:Td(e.behavior)})},scrollTo:e=>{let t=n.current;t&&t.scrollTo({left:ld(e.x,t.scrollWidth,t.clientWidth)??t.scrollLeft,top:ld(e.y,t.scrollHeight,t.clientHeight)??t.scrollTop,behavior:Td(e.behavior)})},scrollIntoView:e=>{n.current?.scrollIntoView({block:Cd(e.block,"start"),inline:Cd(e.inline,"nearest"),behavior:Td(e.behavior)})}},{scrollBy:{title:`Scroll ${t} by`},scrollTo:{title:`Scroll ${t} to`},scrollIntoView:{title:`Scroll to ${t}`}}),[t,n]),s=k(()=>Object.values(r??{}).some(e=>"trigger"===e.type&&"onScroll"===e.action&&e.enabled),[r]);return g(()=>{let t=n.current;if(!i||!s||!t||typeof window>"u")return;let r=0,a=()=>{r=0;let n=(e=>{let t=e.scrollWidth-e.clientWidth>1,n=t?e.scrollLeft:e.scrollTop,r=t?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;return{x:Math.round(e.scrollLeft),y:Math.round(e.scrollTop),atStart:n<=1,atEnd:n>=r-1}})(t);o.interactionTrigger(e,"onScroll",n)},l=()=>{0===r&&(r=window.requestAnimationFrame(a))};return t.addEventListener("scroll",l,{passive:!0}),r=window.requestAnimationFrame(a),()=>{t.removeEventListener("scroll",l),window.cancelAnimationFrame(r)}},[e,o,s,n,i]),a})({id:c,label:p.label,nodeRef:P,interactions:b,previewMode:t,interactionsManager:T});C({id:c,interactions:b,triggers:N,callbacks:k(()=>({...a,...R,...L}),[a,R,L]),getAdditionalParams:_}),(({id:e,interactions:t,previewMode:n,interactionsManager:r})=>{let i=k(()=>[...new Set(Object.values(t??{}).flatMap(e=>{let{keys:t}=e.params;return"trigger"===e.type&&"onKey"===e.action&&e.enabled&&"string"==typeof t?[t]:[]}))],[t]);g(()=>{if(!n||!i.length)return;let t=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),o=i.map(e=>({spec:e,combos:kd(e,t).combos})),a=t=>{if(t.isComposing)return;let n=(e=>{let t=e.ctrlKey||e.altKey||e.metaKey,n=/^(?:Key|Digit)([A-Z0-9])$/.exec(e.code),r=t&&n?n[1]:e.key,i=" "===r?"space":r.toLowerCase(),o=1===i.length&&!/[a-z0-9]/.test(i),a=/* @__PURE__ */new Set;return e.ctrlKey&&a.add("ctrl"),e.altKey&&a.add("alt"),e.shiftKey&&!o&&a.add("shift"),e.metaKey&&a.add("meta"),wd(a,i)})(t),i=t.ctrlKey||t.metaKey||t.altKey;if((e=>e instanceof Element&&null!==e.closest('input, textarea, select, [contenteditable=""], [contenteditable="true"]'))(t.target)&&(!i&&"escape"!==n||(e=>{let t=e.split("+"),n=e.endsWith("++")?"+":t[t.length-1];return Sd.has(n)||xd.has(n)&&(e.includes("ctrl+")||e.includes("meta+"))})(n)))return;let a=o.filter(e=>e.combos.includes(n)).map(e=>e.spec);if(!a.length)return;t.preventDefault();let s={key:n,shortcuts:a};r.interactionTrigger(e,"onKey",s)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,r,n,i])})({id:c,interactions:b,previewMode:t,interactionsManager:T}),(({id:e,interactions:t,previewMode:n,interactionsManager:r})=>{let i=k(()=>[...new Set(Object.values(t??{}).flatMap(e=>{let t=md(e.params.interval);return"trigger"===e.type&&"onInterval"===e.action&&e.enabled&&t?[t]:[]}))],[t]);g(()=>{if(!n||!i.length||typeof document>"u")return;let t=new Map(i.map(e=>[e,0])),o=[],a=()=>{o.forEach(e=>clearInterval(e)),o=[]},s=()=>{a(),"visible"===document.visibilityState&&(o=i.map(n=>setInterval(()=>{let i=(t.get(n)??0)+1;t.set(n,i);let o={interval:n,count:i};r.interactionTrigger(e,"onInterval",o)},n)))};return s(),document.addEventListener("visibilitychange",s),()=>{document.removeEventListener("visibilitychange",s),a()}},[e,r,n,i])})({id:c,interactions:b,previewMode:t,interactionsManager:T});let j=y(()=>{if(!t||!b||!Object.keys(b).length)return;let e=!1;return queueMicrotask(()=>{e||T.interactionTrigger(c,"onLoad",{})}),()=>{e=!0}});g(()=>j(),[]),g(()=>{if(n)return $d.addProviderMethod(`getElementDataSource-${c}`,O),()=>{$d.removeProviderMethod(`getElementDataSource-${c}`)}},[n,O,c]);let z=(({id:e,className:t,previewMode:n,baseElementId:r,plitziElementLayout:i,definition:o,elementState:a})=>{let{items:s}=o,l=ee(a.visibility);return k(()=>V(t,{[fd]:!l,"plitzi-component":!n&&!i,"plitzi-component--layout":!n&&!!i,with__container:!n&&!!s,"container--empty":!n&&!!s&&0===s.length&&!i,"container--base-element":!n&&!!s&&r===e,"plitzi-component--layout-body":i?.slots.includes(e)},o.styleSelectors.base),[t,l,n,i,s,r,e,o.styleSelectors.base])})({id:c,className:i,previewMode:t,baseElementId:r,definition:p,elementState:w,plitziElementLayout:v});return{className:V(u,z),events:A,nodeRef:P}},Ud={fade:[{at:0,opacity:0}],"fade-up":[{at:0,opacity:0,translate:"0 24px"}],"fade-down":[{at:0,opacity:0,translate:"0 -24px"}],"slide-left":[{at:0,opacity:0,translate:"32px 0"}],"slide-right":[{at:0,opacity:0,translate:"-32px 0"}],"slide-up":[{at:0,opacity:0,translate:"0 72px"}],scale:[{at:0,opacity:0,scale:"0.94"}],"zoom-in":[{at:0,opacity:0,scale:"0.6"}],"zoom-out":[{at:0,opacity:0,scale:"1.25"}],pop:[{at:0,opacity:0,scale:"0.5"},{at:55,opacity:1,scale:"1.08"},{at:78,scale:"0.97"}],"bounce-in":[{at:0,opacity:0,translate:"0 -64px"},{at:55,opacity:1,translate:"0 10px"},{at:75,translate:"0 -5px"},{at:90,translate:"0 2px"}],tilt:[{at:0,opacity:0,translate:"0 32px",rotate:"-6deg"}],"spin-in":[{at:0,opacity:0,scale:"0.4",rotate:"-180deg"}]},Hd=(Object.fromEntries(["fade","fade-up","fade-down","slide-left","slide-right","slide-up","scale","zoom-in","zoom-out","pop","bounce-in","tilt","spin-in"].map(e=>{let[{at:t,...n}]=Ud[e];return[e,n]})),(e,t)=>{let n=2*t*Math.PI,r=Math.round(Math.sin(n)*e*10)/10,i=Math.round(-Math.cos(n)*e*10)/10;return`translate(${String(r)}px, ${String(i)}px)`}),Wd=(Array.from({length:9},(e,t)=>({at:100*t/8,transform:Hd(6,t/8)})),"data-motion-seen"),Vd=(["[data-motion-loop] { animation-play-state: running, running !important; }",'[data-motion-on="view"][data-motion-enter], [data-motion-on="view"][data-motion-stagger] > * { animation-play-state: running, running !important; }','[data-motion-on="scroll"][data-motion-enter], [data-motion-on="scroll"][data-motion-stagger] > * { animation-timeline: auto, auto !important; }'].join("\n"),e=>"animationName"in e&&"string"==typeof e.animationName&&e.animationName.startsWith("plitzi-motion-")),Gd=({ref:e,children:t,tag:n="div",className:r="",interactionTriggers:i,interactionCallbacks:o,style:a,...s})=>{let l=k(()=>((e="")=>{if(e)return"object"==typeof e?e:Object.fromEntries(e.split(";").map(e=>e.trim()).filter(Boolean).map(e=>{let[t,n]=e.split(":").map(e=>e.trim());return[t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),n]}))})(a),[a]),c=Yu(),u=vu(),d=u.settings.previewMode??!0,p=!!u.settings.debugMode;if(c.plitziJsxSkipHOC)return Ju({tag:n,refProp:e,style:l,className:r,otherProps:s,children:t});let{root:{baseElementId:f}}=u,m=!!h(Id).interactionsManager,{id:g,rootId:y,style:b,plitziElementLayout:v,definition:{type:w,label:x,runtime:S,anchor:T,parentId:C,motion:E}}=c,A=(e=>{if(!e)return{attributes:{},style:{}};let t={},n={};return e.enter&&(t[void 0===e.stagger?"data-motion-enter":"data-motion-stagger"]=e.enter,t["data-motion-on"]=e.on??"load"),e.loop&&(t["data-motion-loop"]=e.loop),void 0!==e.duration&&(n["--plitzi-motion-duration"]=`${String(e.duration)}ms`),void 0!==e.delay&&(n["--plitzi-motion-delay"]=`${String(e.delay)}ms`),void 0!==e.stagger&&(n["--plitzi-motion-stagger"]=`${String(e.stagger)}ms`),{attributes:t,style:n}})(E),I="server"===S?{"data-rsc-id":g}:void 0,O="component"!==v?.type||C||v.rootId===g?void 0:v.rootId,_=!1===u.settings.testAttributes?void 0:{"data-plitzi-el":g,...void 0===O?{}:{"data-plitzi-instance":O}},N=p||!d&&w&&y===f?{"data-id":g,"data-name":x||w||"unknown","data-root-id":y,"data-type":w||"unknown","data-root-render-element":!0}:{};if(!m)return Ju({tag:n,refProp:e,style:{...b,...l,...A.style},className:r,otherProps:s,anchor:T,params:N,serverMarker:I,motion:A.attributes,testMarker:_,children:t});let M=Bd({elementContext:c,previewMode:d,debugMode:p,baseElementId:f,className:r,interactionTriggers:i,interactionCallbacks:o,otherProps:s,ref:e});return Ju({tag:n,refProp:M.nodeRef,style:{...b,...l,...A.style},className:M.className,otherProps:s,anchor:T,params:N,serverMarker:I,motion:A.attributes,testMarker:_,events:M.events,children:t})},Kd=K("NetworkContext",{mutate:async()=>{},query:async()=>{},subscribe:()=>{},subscriptionManager:{subscribe:()=>{},unsubscribe:()=>{},stop:()=>{}},webKey:"",instanceId:"",server:{},userKey:"",webId:"",environment:"development"}),Yd=(e,t)=>X(e)&&X(e.flat)&&Array.isArray(e.pages)?X(t)&&X(t.platform)&&"string"==typeof t.cache?void 0:"`style` has no `platform` and compiled `cache`":"`schema` has no `flat` and `pages`",Jd=/*#__PURE__*/function(e){return e.CHARSET="charset",e.CSS_TEXT="cssText",e.HREF="href",e.HTTPEQUIV="http-equiv",e.INNER_HTML="innerHTML",e.ITEM_PROP="itemprop",e.NAME="name",e.PROPERTY="property",e.REL="rel",e.SRC="src",e.TARGET="target",e}({}),Xd=/*#__PURE__*/function(e){return e.BASE="base",e.BODY="body",e.FRAGMENT="Symbol(react.fragment)",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e}({}),Zd={rel:["amphtml","canonical","alternate"]},Qd={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},ep={type:["application/ld+json"]},tp=Object.values(Xd),np={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},rp=(()=>{const e={};for(const[t,n]of Object.entries(np))e[n]=t;return e})(),ip="data-rh",op=!("undefined"==typeof window||!window.document.createElement);function ap(e,t){for(let n=e.length-1;n>=0;--n){const r=e[n][1][t];if(void 0!==r)return r}}function sp(e){let t=ap(e,Xd.TITLE);const n=ap(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=ap(e,"defaultTitle");return(t||r)??void 0}function lp(e,t){const n={};for(const r of t){const t=r[1][e];t&&Object.assign(n,t)}return n}function cp(e){for(let t=e.length-1;t>=0;--t){const n=e[t][1].base;if(n?.href||n?.target)return n}}function up(e,t,n){const r={};return n.map(([,e])=>e).filter(t=>!!Array.isArray(t[e])||(void 0!==t[e]&&console.warn(`Helmet: ${e} should be of type "Array". Instead found type "${typeof t[e]}"`),!1)).map(t=>t[e]).reverse().reduce((e,n)=>{const i={};n.filter(e=>{const n=function(e,t){let n;for(const r of Object.keys(e)){const i=r;!t.includes(i)||n===Jd.REL&&"canonical"===e[n].toLowerCase()||i===Jd.REL&&"stylesheet"===e[i].toLowerCase()||(n=i),!t.includes(i)||i!==Jd.INNER_HTML&&i!==Jd.CSS_TEXT&&i!==Jd.ITEM_PROP||(n=i)}return n??null}(e,t);if(!n||!e[n])return!1;const o=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][o]&&(i[n][o]=!0,!0)}).reverse().forEach(t=>{e.push(t)});const o=Object.keys(i);for(const t of o){const e={...r[t],...i[t]};r[t]=e}return e},[]).reverse()}function dp(e){return Array.isArray(e)?e.join(""):e}function pp(e,t){for(const n of Object.keys(e))if(t[n]?.includes(e[n]))return!0;return!1}function hp(e,t){const n={default:Array(),priority:Array()};if(e)for(const r of e)pp(r,t)?n.priority.push(r):n.default.push(r);return n}function fp(e,t,n){const r=e[t];r?r.push(n):e[t]=[n]}function mp(e){let t=up(Xd.LINK,[Jd.REL,Jd.HREF],e),n=up("meta",[Jd.NAME,"charSet","httpEquiv",Jd.PROPERTY,"itemProp"],e),r=up("script",[Jd.SRC,Jd.INNER_HTML],e);const i=function(e){for(const[,t]of e)if(t.prioritizeSeoTags)return!0;return!1}(e);let o;if(i){const e=hp(t,Zd);t=e.default;const i=hp(n,Qd);n=i.default;const a=hp(r,ep);r=a.default,o={links:e.priority,meta:i.priority,script:a.priority}}return{base:cp(e),bodyAttributes:lp("bodyAttributes",e),defer:ap(e,"defer"),encodeSpecialCharacters:ap(e,"encodeSpecialCharacters")??!0,htmlAttributes:lp("htmlAttributes",e),links:t,meta:n,noscript:up("noscript",[Jd.INNER_HTML],e),onChangeClientState:ap(e,"onChangeClientState"),priority:o,script:r,style:up("style",[Jd.CSS_TEXT],e),title:sp(e),titleAttributes:lp("titleAttributes",e)}}function gp(e){return rp[e]??e}function yp(e,t){const n=document.head||document.querySelector(Xd.HEAD),r=[],i=[...n.querySelectorAll(`${e}[${ip}]`)],o=[];for(const a of t){const t=document.createElement(e);for(const[e,r]of Object.entries(a))if(Object.prototype.hasOwnProperty.call(a,e)){const n=rp[e]??e;n===Jd.INNER_HTML?t.innerHTML=r:n===Jd.CSS_TEXT?t.styleSheet?t.styleSheet.cssText=a.cssText:t.appendChild(document.createTextNode(a.cssText)):t.setAttribute(n,r??"")}t.setAttribute(ip,"true");const n={};for(const{name:e,value:r}of t.attributes)n[e]=r;r.push(n);for(let e=0;;++e){if(t.isEqualNode(i[e])){i.splice(e,1);break}if(e>=i.length){o.push(t);break}}}return i.forEach(e=>{e.parentNode?.removeChild(e)}),o.forEach(e=>{n.appendChild(e)}),{allTags:r,newTags:o,oldTags:i}}function bp(e,t){const[n]=document.getElementsByTagName(e);if(!n)return;const r=n.getAttribute(ip),i=r?r.split(","):[],o=[...i],a=[];for(const s of Object.keys(t))a.push(rp[s]??s);for(const[s,l]of Object.entries(t)){const e=rp[s]??s;n.getAttribute(e)!==l&&n.setAttribute(e,l??""),i.includes(e)||i.push(e);const t=o.indexOf(e);-1!==t&&o.splice(t,1)}for(let s=o.length-1;s>=0;s-=1)n.removeAttribute(o[s]);i.length===o.length?n.removeAttribute(ip):n.getAttribute("data-rh")!==a.join(",")&&n.setAttribute(ip,a.join(","))}function vp(e,t){const{base:n,bodyAttributes:r,defer:i,htmlAttributes:o,links:a,meta:s,noscript:l,onChangeClientState:c,priority:u,script:d,style:p,title:h,titleAttributes:f}=e;bp(Xd.BODY,r??{}),bp(Xd.HTML,o??{}),function(e,t){void 0!==e&&document.title!==e&&(document.title=dp(e)),bp(Xd.TITLE,t)}(h,f);const m={baseTag:yp(Xd.BASE,n?[n]:[]),linkTags:yp(Xd.LINK,[...u?.links??[],...a??[]]),metaTags:yp(Xd.META,[...u?.meta??[],...s??[]]),noscriptTags:yp(Xd.NOSCRIPT,l??[]),scriptTags:yp(Xd.SCRIPT,[...u?.script??[],...d??[]]),styleTags:yp(Xd.STYLE,p??[])},g={baseTag:[],bodyAttributes:{},defer:i??!1,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],onChangeClientState:c??(()=>{}),scriptTags:[],styleTags:[],title:h??"",titleAttributes:{}},y={},b={};Object.keys(m).forEach(e=>{const{allTags:t,newTags:n,oldTags:r}=m[e];g[e]=t,n.length&&(y[e]=n),r.length&&(b[e]=m[e].oldTags)}),(t||Object.keys(y).length||Object.keys(b).length)&&c?.(g,y,b)}var wp=[Xd.NOSCRIPT,Xd.SCRIPT,Xd.STYLE],kp=(e,t=!0)=>t?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"):e;function xp(e){let t="";for(const[n,r]of Object.entries(e)){const e=gp(n),i=void 0===r?e:`${e}="${r}"`;i&&t&&(t+=" "),t+=i}return t}function Sp(e,t,n){let r="";for(const i of t){let t="";const o=Object.entries(i);for(const[e,r]of o)if(e!==Jd.INNER_HTML&&e!==Jd.CSS_TEXT){const i=rp[e]??e;let o;o=void 0===r?i:`${i}="${kp("string"==typeof r?r:String(r),n)}"`,t?t+=` ${o}`:t=o}const a=i.innerHTML??i.cssText??"",s=!wp.includes(e);r+=`<${e} ${ip}="true" ${t}${s?"/>":`>${a}</${e}>`}`}return r}function Tp(e,t={}){const n={};t.addHelmetDataAttr&&(n[ip]=!0),void 0!==t.addKey&&(n.key=t.addKey);for(const[r,i]of Object.entries(e)){const e=np[r]??r;switch(e){case"cssText":case"innerHTML":n.dangerouslySetInnerHTML={__html:i};break;default:n[e]=i}}return n}function Cp(e,t,n){/*#__PURE__*/
26
26
  return c(e,Tp(t,{addHelmetDataAttr:!0,addKey:n}))}function Ep(e,t){const n=[];for(let r=0;r<t.length;++r)n.push(Cp(e,t[r],r));return n}var Ap=/*#__PURE__*/l(void 0),Ip=({children:e,onServerState:t})=>{const n=x(null);if(null===n.current){const e={firstRender:!0,helmets:[],state:void 0};t&&(e.serverState??=function(e){const t=()=>(e.state??=mp(e.helmets),e.state);return{base:{toComponent(){const e=t().base;return e?Ep("base",[e]):[]},toString(){const e=t();return e.base?Sp("base",[e.base],e.encodeSpecialCharacters):""}},bodyAttributes:{toComponent:()=>Tp(t().bodyAttributes??{}),toString:()=>xp(t().bodyAttributes??{})},htmlAttributes:{toComponent:()=>Tp(t().htmlAttributes??{}),toString:()=>xp(t().htmlAttributes??{})},link:{toComponent:()=>Ep("link",t().links??[]),toString(){const e=t();return Sp("link",e.links??[],e.encodeSpecialCharacters)}},meta:{toComponent:()=>Ep("meta",t().meta??[]),toString(){const e=t();return Sp("meta",e.meta??[],e.encodeSpecialCharacters)}},noscript:{toComponent:()=>Ep("noscript",t().noscript??[]),toString(){const e=t();return Sp("noscript",e.noscript??[],e.encodeSpecialCharacters)}},priority:{toComponent(){const e=t();return[...Ep("meta",e.priority?.meta??[]),...Ep("link",e.priority?.links??[]),...Ep("script",e.priority?.script??[])]},toString(){const e=t(),n=Sp("meta",e.priority?.meta??[],e.encodeSpecialCharacters),r=Sp("link",e.priority?.links??[],e.encodeSpecialCharacters),i=Sp("script",e.priority?.script??[],e.encodeSpecialCharacters);let o=n;return r&&(o&&(o+=" "),o+=r),i&&(o&&(o+=" "),o+=i),o}},script:{toComponent:()=>Ep("script",t().script??[]),toString(){const e=t();return Sp("script",e.script??[],e.encodeSpecialCharacters)}},style:{toComponent:()=>Ep("style",t().style??[]),toString(){const e=t();return Sp("style",e.style??[],e.encodeSpecialCharacters)}},title:{toComponent(){const e=t();return n=e.title??"",r=e.titleAttributes??{},[/*#__PURE__*/I("title",{...Tp(r,{addHelmetDataAttr:!0}),children:n},n)];var n,r},toString(){const e=t();return((e,t,n)=>{let r=xp(t);r&&(r=` ${r}`);const i=dp(e);return`<title ${ip}="true"${r}>${kp(i,n)}</title>`})(e.title??"",e.titleAttributes??{},e.encodeSpecialCharacters)}}}}(e),t(e.serverState)),n.current=e}const r=n.current,[i]=S(()=>({clientApply(){op&&!r.state&&(r.state=mp(r.helmets),r.state.defer?r.nextAnimFrameId??=requestAnimationFrame(()=>{r.state??=mp(r.helmets),vp(r.state,r.firstRender),r.firstRender=!1,delete r.nextAnimFrameId}):(void 0!==r.nextAnimFrameId&&(cancelAnimationFrame(r.nextAnimFrameId),delete r.nextAnimFrameId),vp(r.state,r.firstRender),r.firstRender=!1))},update(e,t){const n=r.helmets.findIndex(t=>t[0]===e);n>=0?(delete r.state,t?r.helmets[n][1]=t:r.helmets.splice(n,1)):t&&(delete r.state,r.helmets.push([e,t]))}}));/*#__PURE__*/
27
27
  return I(Ap,{value:i,children:e})};function Op(e){const t=np[e];return t&&console.warn(`"${e}" is not a valid JSX prop, replace it by "${t}"`),t??e}function _p(e){const t=function(e){const t={};for(const[n,r]of Object.entries(e))t[n]=Array.isArray(r)?r.slice():r;return t}(e);for(const n of Object.values(e))if(Array.isArray(n)){for(const e of n)if(e)for(const t of Object.keys(e)){const n=Op(t);n!==t&&(e[n]=e[t],delete e[t])}}else if(n&&"object"==typeof n){const e=n;for(const t of Object.keys(e)){const n=Op(t);n!==t&&(e[n]=e[t],delete e[t])}}return n.forEach(e.children,e=>{if(null==e)return;if("object"!=typeof e||!("props"in e))throw Error(`"${typeof e}" is not a valid <Helmet> descendant`);let n;const r={};if(e.props)for(const[t,a]of Object.entries(e.props))"children"===t?n=a:r[Op(t)]=a;let{type:i}=e;function o(e){"string"!=typeof e&&console.error(`child of ${i} element should be a string`)}switch("symbol"==typeof i&&(i=i.toString()),function(e,t){if("string"!=typeof e)throw Error("You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.");if(!tp.includes(e))throw Error(`Only elements types ${tp.join(", ")} are allowed. Helmet does not support rendering <${e}> elements. Refer to our API for more information.`);if(t&&"string"!=typeof t&&!Array.isArray(t))throw Error(`Helmet expects a string as a child of <${e}>. Did you forget to wrap your children in braces? ( <${e}>{\`\`}</${e}> ) Refer to our API for more information.`)}(i,n),i){case Xd.BASE:t.base=r;break;case Xd.BODY:t.bodyAttributes=r;break;case Xd.FRAGMENT:!function(e,t){const n=e;for(const[r,i]of Object.entries(t))if(Array.isArray(i)){const e=n[r];n[r]=e?e.concat(i):i}else n[r]=i}(t,_p({children:n}));break;case Xd.HTML:t.htmlAttributes=r;break;case Xd.LINK:case Xd.META:if(n)throw Error(`<${i} /> elements are self-closing and can not contain children. Refer to our API for more information.`);fp(t,i,r);break;case Xd.NOSCRIPT:case Xd.SCRIPT:void 0!==n&&(o(n),r.innerHTML=n),fp(t,i,r);break;case Xd.STYLE:o(n),r.cssText=n,fp(t,i,r);break;case Xd.TITLE:t.titleAttributes=r,"string"==typeof n?t.title=n:Array.isArray(n)&&(t.title=n.join(""));case Xd.HEAD:}}),delete t.children,t}var Np=e=>{const t=N(8),n=h(Ap);if(!n)throw Error("<Helmet> component must be within a <HelmetProvider> children tree");const r=b();let i,o,a;return n.update(r,_p(e)),t[0]!==n||t[1]!==r||t[2]!==e?(i=()=>{n.update(r,_p(e)),n.clientApply()},t[0]=n,t[1]=r,t[2]=e,t[3]=i):i=t[3],g(i),t[4]!==n||t[5]!==r?(o=()=>()=>{n.update(r,void 0),n.clientApply()},a=[n,r],t[4]=n,t[5]=r,t[6]=o,t[7]=a):(o=t[6],a=t[7]),g(o,a),null},Mp=({className:e,children:t,direction:n="column",wrap:r,items:i,justify:o,gap:a,grow:s,shrink:l,basis:c,...u})=>(e=Ll("ContainerCollapsable",{className:e,componentKey:"content"}),/* @__PURE__ */I(Rl,{className:e,direction:n,wrap:r,items:i,justify:o,gap:a,shrink:l,basis:c,grow:s,...u,children:t})),Pp=/* @__PURE__ */I("i",{className:"fas fa-plus"}),Lp=/* @__PURE__ */I("i",{className:"fas fa-minus"}),Rp=({children:e,className:t,title:n="Title",collapsed:r=!1,iconCollapsed:i=Pp,iconExpanded:o=Lp,placement:a="left",onClick:s,...l})=>{let c=Ll("ContainerCollapsable",{className:t,componentKey:["header","headerContainer","headerTitle","headerIconContainer","headerSlot","headerSlotContainer"]});/* @__PURE__ */
@@ -30,17 +30,17 @@ return O(Rl,{className:e,direction:i,wrap:o,items:a,justify:l,gap:c,shrink:p,bas
30
30
  return I("div",{className:e,onClick:a,children:t})},Hp=({className:e,items:t=[],tabSelected:n=0,size:r,onSelect:i})=>(e=Ll("ContainerTabs",{className:e,componentKey:"tabs",variants:{size:r}}),/* @__PURE__ */I("div",{className:e,children:t.map((e,t)=>/* @__PURE__ */I(Up,{label:e.label,active:n===t,index:t,size:r,onSelect:i},t))})),Wp=({children:e,className:t,size:r})=>{t=Ll("ContainerTabs",{className:t,componentKey:"root",variants:{size:r}});let[i,o]=S(0),a=f(e=>o(e),[]),{tabs:l,content:c}=k(()=>{let t={tabs:/* @__PURE__ */I(Hp,{tabSelected:i,size:r,onSelect:a}),content:/* @__PURE__ */I(Bp,{})},o=0;return n.forEach(e,e=>{if(u(e))if(e.type===Hp){let n=e.props;t.tabs=s(e,{...n,key:"tabs",tabSelected:i,size:r,onSelect:a})}else if(e.type===Bp&&o++===i){let n=e.props;t.content=s(e,{...n,key:`content-${i}`,size:r})}}),t},[i,a,e,r]);/* @__PURE__ */
31
31
  return O("div",{className:t,children:[l,c]})};Wp.Tabs=Hp,Wp.TabContent=Bp;var Vp={root:Er("flex flex-col"),content:Er("flex"),tabs:Er("flex bg-gray-100 dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 rounded-lg p-1 select-none gap-0.5"),tab:Er("flex items-center justify-center rounded-md basis-0 grow cursor-pointer py-1 px-3 text-sm font-medium transition-colors duration-150 select-none",{variants:{active:{true:"bg-white dark:bg-zinc-700 text-zinc-900 dark:text-zinc-100 shadow-sm",false:"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200"},size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{active:!1,size:"md"}})},Gp=Wp,Kp={root:Er("",{variants:{size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{size:"md"}})},Yp=({className:e="focus-visible:px-1 focus-visible:m-px focus-visible:outline-dashed focus-visible:outline-1",myWindow:t,value:n="",exitOnEnter:r=!0,exitOnEscape:i=!0,updateMode:o="blur",openMode:a="click",size:s,onChange:l,onEditOpen:c,onEditClose:u})=>{e=Ll("ContentEditable",{className:e,componentKey:"root",variants:{size:s}});let d=x(null),p=k(()=>t||(typeof window<"u"?window:void 0),[t]);g(()=>{d.current&&d.current.textContent!==n&&(d.current.textContent=n)},[n]);let h=f(e=>{"change"===o&&l?.(e.target.textContent)},[l,o]),m=f(e=>{if(!p)return;let t=p.document.createRange(),n=p.getSelection();t.setStart(e,e.childNodes.length),t.collapse(!0),n?.removeAllRanges(),n?.addRange(t)},[p]),y=f(()=>{let e=d.current;e&&(("inherit"===e.contentEditable||"false"===e.contentEditable)&&m(e),"click"===a&&(e.setAttribute("contenteditable","true"),e.focus(),c?.()))},[a,m,c]),b=f(()=>{let e=d.current;e&&"doubleClick"===a&&(e.setAttribute("contenteditable","true"),e.focus(),c?.())},[a,c]),v=f(()=>{let e=d.current;e&&(e.setAttribute("contenteditable","false"),"blur"===o&&e.textContent!==n&&l?.(e.textContent),u?.())},[l,o,n,u]),w=f(e=>{e.stopPropagation(),r&&13===e.keyCode?(e.preventDefault(),e.target.blur()):i&&27===e.keyCode&&(e.preventDefault(),e.target.textContent=n,e.target.blur())},[r,i,n]);/* @__PURE__ */
32
32
  return I("div",{className:e,ref:d,onClick:y,onDoubleClick:b,onBlur:v,onInput:h,onKeyDown:w})},Jp={root:Er("text-zinc-900 dark:text-zinc-100",{variants:{as:{h1:"text-5xl font-extrabold",h2:"text-4xl font-extrabold",h3:"text-3xl font-bold",h4:"text-2xl font-bold",h5:"text-xl font-bold",h6:"text-lg font-bold"}},compoundVariants:[],defaultVariants:{as:"h1"}})},Xp=({children:e,components:t,defaultColorMode:n="light",colorModeStorageKey:r,applyColorModeClass:i=!0,colorModeRoot:o})=>{let a="system"===n,[s,l]=S(()=>ls(r,n));g(()=>{if(!a||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>l(e.matches?"dark":"light");return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}},[a]),g(()=>{if(!i||typeof document>"u")return;let e=o??document.documentElement;"dark"===s?e.classList.add("dark"):e.classList.remove("dark")},[s,i,o]);let c=f(()=>{a||l(e=>{let t="dark"===e?"light":"dark";if(r)try{localStorage.setItem(r,t)}catch{}return t})},[a,r]),u=f(e=>{if(!a&&(l(e),r))try{localStorage.setItem(r,e)}catch{}},[a,r]),d=k(()=>({theme:{components:t&&Object.keys(t).length>0?t:{}},colorMode:s,toggleColorMode:c,setColorMode:u}),[t,s,c,u]);/* @__PURE__ */
33
- return I(cs,{value:d,children:e})},Zp=({children:e,components:t,defaultColorMode:n,colorModeStorageKey:r,applyColorModeClass:i,colorModeRoot:o})=>/* @__PURE__ */I(Xp,{components:t,defaultColorMode:n,colorModeStorageKey:r,applyColorModeClass:i,colorModeRoot:o,children:e}),Qp={root:Er("",{variants:{intent:{primary:"text-primary-text",custom:""},size:{xs:"text-xs",sm:"text-sm",md:"",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl","7xl":"text-7xl","8xl":"text-8xl","9xl":"text-9xl",custom:""},weight:{100:"font-thin",thin:"font-thin",200:"font-extralight",extralight:"font-extralight",300:"font-light",light:"font-light",400:"",normal:"",500:"font-medium",medium:"font-medium",600:"font-semibold",semibold:"font-semibold",700:"font-bold",bold:"font-bold",800:"font-extrabold",extrabold:"font-extrabold",900:"font-black",black:"font-black"}},compoundVariants:[],defaultVariants:{intent:"custom",size:"md",weight:400}})},eh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,th=/^[\\/]{2}/,nh="popstate";function rh(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ih(e,t){if(!1===e||null==e)throw new Error(t)}function oh(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(XN){}}}function ah(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function sh(e,t,n=null,r,i){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?ch(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),mask:i}}function lh({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function ch(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function uh(e,t,n="/"){return dh(e,t,n,!1)}function dh(e,t,n,r,i){let o=Eh(("string"==typeof t?ch(t):t).pathname||"/",n);if(null==o)return null;let a=i??function(e){let t=ph(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}(e),s=null,l=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return oh(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(o);for(let c=0;null==s&&c<a.length;++c)s=xh(a[c],l,r);return s}function ph(e,t=[],n=[],r="",i=!1){let o=(e,o,a=i,s)=>{let l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&a)return;ih(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let c=Mh([r,l.relativePath]),u=n.concat(l);e.children&&e.children.length>0&&(ih(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),ph(e.children,t,u,c,a)),(null!=e.path||e.index)&&t.push({path:c,score:kh(c,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ch(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of hh(e.path))o(e,t,!0,n);else o(e,t)}),t}function hh(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=hh(r.join("/")),s=[];return s.push(...a.map(e=>""===e?o:[o,e].join("/"))),i&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var fh=/^:[\w-]+$/,mh=3,gh=2,yh=1,bh=10,vh=-2,wh=e=>"*"===e;function kh(e,t){let n=e.split("/"),r=n.length;return n.some(wh)&&(r+=vh),t&&(r+=gh),n.filter(e=>!wh(e)).reduce((e,t)=>e+(fh.test(t)?mh:""===t?yh:bh),r)}function xh(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let e=r[s],l=s===r.length-1,c="/"===o?t:t.slice(o.length)||"/",u={path:e.relativePath,caseSensitive:e.caseSensitive,end:l},d=e.matcher&&e.compiledParams?Th(u,c,e.matcher,e.compiledParams):Sh(u,c),p=e.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=Sh({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:Mh([o,d.pathname]),pathnameBase:Lh(Mh([o,d.pathnameBase])),route:p}),"/"!==d.pathnameBase&&(o=Mh([o,d.pathnameBase]))}return a}function Sh(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ch(e.path,e.caseSensitive,e.end);return Th(e,t,n,r)}function Th(e,t,n,r){let i=t.match(n);if(!i)return null;let o=i[0],a=Ph(o,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=s[r]||"";a=Ph(o.slice(0,o.length-e.length),1)}const i=s[r];return e[t]=n&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:a,pattern:e}}function Ch(e,t=!1,n=!0){oh("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,o)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=o.charAt(i+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Eh(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Ah(e,t){let n=Ph(t).split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function Ih(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Oh(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _h(e,t,n,r=!1){let i;"string"==typeof e?i=ch(e):(i={...e},ih(!i.pathname||!i.pathname.includes("?"),Ih("?","pathname","search",i)),ih(!i.pathname||!i.pathname.includes("#"),Ih("#","pathname","hash",i)),ih(!i.search||!i.search.includes("#"),Ih("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t="/"){let n,{pathname:r,search:i="",hash:o=""}="string"==typeof e?ch(e):e;return r?(r=Nh(r),n=r.startsWith("/")||r.startsWith("\\")?Ah(r.substring(1),"/"):Ah(r,t)):n=t,{pathname:n,search:Rh(i),hash:jh(o)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var Nh=e=>e.replace(/[\\/]{2,}/g,"/"),Mh=e=>Nh(e.join("/"));function Ph(e,t=0){let n=e.length;for(;n>t&&47===e.charCodeAt(n-1);)n--;return n===e.length?e:e.slice(0,n)}var Lh=e=>Ph(e).replace(/^\/*/,"/"),Rh=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",jh=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",zh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Dh(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function $h(e){return Mh(e.map(e=>e.route.path).filter(Boolean))||"/"}var Fh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function qh(e,t){let n=e;if("string"!=typeof n||!eh.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Fh)try{let e=new URL(window.location.href),r=th.test(n)?new URL((o=n,e.protocol+o.replace(/\\/g,"/"))):new URL(n),a=Eh(r.pathname,t);r.origin===e.origin&&null!=a?n=a+r.search+r.hash:i=!0}catch(XN){oh(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}var o;return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Bh=new URL("http://localhost");function Uh(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Bh)}catch{return Bh}}function Hh(e,t){return e.origin===t.origin&&("null"!==e.origin||e.protocol===t.protocol&&e.host===t.host)}function Wh(e,t,n,r){let i=null;try{i=null==e?null:new URL(e,n)}catch{}let o=new URL(t,n),a=null!=i&&!Hh(i,n),s=!Hh(o,n);if("reject"===r){if(a||s)throw new Error("External navigation is not allowed")}else if(s&&(null==i||!function(e,t){if(e.startsWith("//"))return!0;let n=t.protocol.toLowerCase();return!!e.toLowerCase().startsWith(n)&&(""===t.host||e.slice(n.length).startsWith("//"))}(e,i)||!Hh(i,o)))throw new Error("External navigation is not allowed")}var Vh=["POST","PUT","PATCH","DELETE"],Gh=(new Set(Vh),["GET",...Vh]);new Set(Gh);var Kh=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"],Yh=e.createContext(null);Yh.displayName="DataRouter";var Jh=e.createContext(null);Jh.displayName="DataRouterState";var Xh=e.createContext(!1);function Zh(){return e.useContext(Xh)}var Qh=e.createContext({isTransitioning:!1});Qh.displayName="ViewTransition",e.createContext(/* @__PURE__ */new Map).displayName="Fetchers",e.createContext(null).displayName="Await";var ef=e.createContext(null);ef.displayName="Navigation";var tf=e.createContext(null);tf.displayName="Location";var nf=e.createContext({outlet:null,matches:[],isDataRoute:!1});nf.displayName="Route";var rf=e.createContext(null);rf.displayName="RouteError";var of="REACT_ROUTER_ERROR";function af(){return null!=e.useContext(tf)}function sf(){return ih(af(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(tf).location}var lf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cf(t){e.useContext(ef).static||e.useLayoutEffect(t)}function uf(){let{isDataRoute:t}=e.useContext(nf);return t?function(){let{router:t}=function(){let t=e.useContext(Yh);return ih(t,bf("useNavigate")),t}(),n=vf("useNavigate"),r=e.useRef(!1);return cf(()=>{r.current=!0}),e.useCallback(async(e,i={})=>{oh(r.current,lf),r.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:n,...i}))},[t,n])}():function(){ih(af(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(Yh),{basename:n,navigator:r}=e.useContext(ef),{matches:i}=e.useContext(nf),{pathname:o}=sf(),a=JSON.stringify(Oh(i)),s=e.useRef(!1);return cf(()=>{s.current=!0}),e.useCallback((e,i={})=>{if(oh(s.current,lf),!s.current)return;if("number"==typeof e)return void r.go(e);let l=_h(e,JSON.parse(a),o,"path"===i.relative);null==t&&"/"!==n&&(l.pathname="/"===l.pathname?n:Mh([n,l.pathname])),Wh("string"==typeof e?e:lh(e),r.createHref(l),Uh(r),"reject"),(i.replace?r.replace:r.push)(l,i.state,i)},[n,r,a,o,t])}()}function df(t,{relative:n}={}){let{matches:r}=e.useContext(nf),{pathname:i}=sf(),o=JSON.stringify(Oh(r));return e.useMemo(()=>_h(t,JSON.parse(o),i,"path"===n),[t,o,i,n])}function pf(){let t=function(){let t=e.useContext(rf),n=function(t){let n=e.useContext(Jh);return ih(n,bf(t)),n}("useRouteError"),r=vf("useRouteError");return void 0!==t?t:n.errors?.[r]}(),n=Dh(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},s=null;return console.error("Error handled by React Router default ErrorBoundary:",t),s=/* @__PURE__ */e.createElement(e.Fragment,null,/* @__PURE__ */e.createElement("p",null,"💿 Hey developer 👋"),/* @__PURE__ */e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",/* @__PURE__ */e.createElement("code",{style:a},"ErrorBoundary")," or"," ",/* @__PURE__ */e.createElement("code",{style:a},"errorElement")," prop on your route.")),/* @__PURE__ */e.createElement(e.Fragment,null,/* @__PURE__ */e.createElement("h2",null,"Unexpected Application Error!"),/* @__PURE__ */e.createElement("h3",{style:{fontStyle:"italic"}},n),r?/* @__PURE__ */e.createElement("pre",{style:o},r):null,s)}e.createContext(null);var hf=/* @__PURE__ */e.createElement(pf,null),ff=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let t=this.state.error;if(this.context&&"object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){const e=function(e){if(e.startsWith(`${of}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new zh(t.status,t.statusText,t.data)}catch{}}(t.digest);e&&(t=e)}let n=void 0!==t?/* @__PURE__ */e.createElement(nf.Provider,{value:this.props.routeContext},/* @__PURE__ */e.createElement(rf.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?/* @__PURE__ */e.createElement(gf,{error:t},n):n}};ff.contextType=Xh;var mf=/* @__PURE__ */new WeakMap;function gf({children:t,error:n}){let{basename:r,navigator:i}=e.useContext(ef);if("object"==typeof n&&n&&"digest"in n&&"string"==typeof n.digest){let t=function(e){if(e.startsWith(`${of}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(n.digest);if(t){let o=mf.get(n);if(o)throw o;let a=qh(t.location,r),s=a.absoluteURL||a.to;if(Wh(t.location,s,Uh(i),"allow-explicit"),function(e){try{return Kh.includes(new URL(e).protocol)}catch{return!1}}(s))throw new Error("Invalid redirect location");if(Fh&&!mf.get(n)){if(!a.isExternal&&!t.reloadDocument){const e=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:t.replace}));throw mf.set(n,e),e}window.location.href=s}/* @__PURE__ */
33
+ return I(cs,{value:d,children:e})},Zp=({children:e,components:t,defaultColorMode:n,colorModeStorageKey:r,applyColorModeClass:i,colorModeRoot:o})=>/* @__PURE__ */I(Xp,{components:t,defaultColorMode:n,colorModeStorageKey:r,applyColorModeClass:i,colorModeRoot:o,children:e}),Qp={root:Er("",{variants:{intent:{primary:"text-primary-text",custom:""},size:{xs:"text-xs",sm:"text-sm",md:"",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl","7xl":"text-7xl","8xl":"text-8xl","9xl":"text-9xl",custom:""},weight:{100:"font-thin",thin:"font-thin",200:"font-extralight",extralight:"font-extralight",300:"font-light",light:"font-light",400:"",normal:"",500:"font-medium",medium:"font-medium",600:"font-semibold",semibold:"font-semibold",700:"font-bold",bold:"font-bold",800:"font-extrabold",extrabold:"font-extrabold",900:"font-black",black:"font-black"}},compoundVariants:[],defaultVariants:{intent:"custom",size:"md",weight:400}})},eh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,th=/^[\\/]{2}/,nh="popstate";function rh(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ih(e,t){if(!1===e||null==e)throw new Error(t)}function oh(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(aM){}}}function ah(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function sh(e,t,n=null,r,i){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?ch(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),mask:i}}function lh({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function ch(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function uh(e,t,n="/"){return dh(e,t,n,!1)}function dh(e,t,n,r,i){let o=Eh(("string"==typeof t?ch(t):t).pathname||"/",n);if(null==o)return null;let a=i??function(e){let t=ph(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}(e),s=null,l=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return oh(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(o);for(let c=0;null==s&&c<a.length;++c)s=xh(a[c],l,r);return s}function ph(e,t=[],n=[],r="",i=!1){let o=(e,o,a=i,s)=>{let l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&a)return;ih(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let c=Mh([r,l.relativePath]),u=n.concat(l);e.children&&e.children.length>0&&(ih(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),ph(e.children,t,u,c,a)),(null!=e.path||e.index)&&t.push({path:c,score:kh(c,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ch(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of hh(e.path))o(e,t,!0,n);else o(e,t)}),t}function hh(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=hh(r.join("/")),s=[];return s.push(...a.map(e=>""===e?o:[o,e].join("/"))),i&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var fh=/^:[\w-]+$/,mh=3,gh=2,yh=1,bh=10,vh=-2,wh=e=>"*"===e;function kh(e,t){let n=e.split("/"),r=n.length;return n.some(wh)&&(r+=vh),t&&(r+=gh),n.filter(e=>!wh(e)).reduce((e,t)=>e+(fh.test(t)?mh:""===t?yh:bh),r)}function xh(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let e=r[s],l=s===r.length-1,c="/"===o?t:t.slice(o.length)||"/",u={path:e.relativePath,caseSensitive:e.caseSensitive,end:l},d=e.matcher&&e.compiledParams?Th(u,c,e.matcher,e.compiledParams):Sh(u,c),p=e.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=Sh({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:Mh([o,d.pathname]),pathnameBase:Lh(Mh([o,d.pathnameBase])),route:p}),"/"!==d.pathnameBase&&(o=Mh([o,d.pathnameBase]))}return a}function Sh(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ch(e.path,e.caseSensitive,e.end);return Th(e,t,n,r)}function Th(e,t,n,r){let i=t.match(n);if(!i)return null;let o=i[0],a=Ph(o,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=s[r]||"";a=Ph(o.slice(0,o.length-e.length),1)}const i=s[r];return e[t]=n&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:a,pattern:e}}function Ch(e,t=!1,n=!0){oh("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,o)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=o.charAt(i+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Eh(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Ah(e,t){let n=Ph(t).split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function Ih(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Oh(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _h(e,t,n,r=!1){let i;"string"==typeof e?i=ch(e):(i={...e},ih(!i.pathname||!i.pathname.includes("?"),Ih("?","pathname","search",i)),ih(!i.pathname||!i.pathname.includes("#"),Ih("#","pathname","hash",i)),ih(!i.search||!i.search.includes("#"),Ih("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t="/"){let n,{pathname:r,search:i="",hash:o=""}="string"==typeof e?ch(e):e;return r?(r=Nh(r),n=r.startsWith("/")||r.startsWith("\\")?Ah(r.substring(1),"/"):Ah(r,t)):n=t,{pathname:n,search:Rh(i),hash:jh(o)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var Nh=e=>e.replace(/[\\/]{2,}/g,"/"),Mh=e=>Nh(e.join("/"));function Ph(e,t=0){let n=e.length;for(;n>t&&47===e.charCodeAt(n-1);)n--;return n===e.length?e:e.slice(0,n)}var Lh=e=>Ph(e).replace(/^\/*/,"/"),Rh=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",jh=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",zh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Dh(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function $h(e){return Mh(e.map(e=>e.route.path).filter(Boolean))||"/"}var Fh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function qh(e,t){let n=e;if("string"!=typeof n||!eh.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Fh)try{let e=new URL(window.location.href),r=th.test(n)?new URL((o=n,e.protocol+o.replace(/\\/g,"/"))):new URL(n),a=Eh(r.pathname,t);r.origin===e.origin&&null!=a?n=a+r.search+r.hash:i=!0}catch(aM){oh(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}var o;return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Bh=new URL("http://localhost");function Uh(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Bh)}catch{return Bh}}function Hh(e,t){return e.origin===t.origin&&("null"!==e.origin||e.protocol===t.protocol&&e.host===t.host)}function Wh(e,t,n,r){let i=null;try{i=null==e?null:new URL(e,n)}catch{}let o=new URL(t,n),a=null!=i&&!Hh(i,n),s=!Hh(o,n);if("reject"===r){if(a||s)throw new Error("External navigation is not allowed")}else if(s&&(null==i||!function(e,t){if(e.startsWith("//"))return!0;let n=t.protocol.toLowerCase();return!!e.toLowerCase().startsWith(n)&&(""===t.host||e.slice(n.length).startsWith("//"))}(e,i)||!Hh(i,o)))throw new Error("External navigation is not allowed")}var Vh=["POST","PUT","PATCH","DELETE"],Gh=(new Set(Vh),["GET",...Vh]);new Set(Gh);var Kh=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"],Yh=e.createContext(null);Yh.displayName="DataRouter";var Jh=e.createContext(null);Jh.displayName="DataRouterState";var Xh=e.createContext(!1);function Zh(){return e.useContext(Xh)}var Qh=e.createContext({isTransitioning:!1});Qh.displayName="ViewTransition",e.createContext(/* @__PURE__ */new Map).displayName="Fetchers",e.createContext(null).displayName="Await";var ef=e.createContext(null);ef.displayName="Navigation";var tf=e.createContext(null);tf.displayName="Location";var nf=e.createContext({outlet:null,matches:[],isDataRoute:!1});nf.displayName="Route";var rf=e.createContext(null);rf.displayName="RouteError";var of="REACT_ROUTER_ERROR";function af(){return null!=e.useContext(tf)}function sf(){return ih(af(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(tf).location}var lf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cf(t){e.useContext(ef).static||e.useLayoutEffect(t)}function uf(){let{isDataRoute:t}=e.useContext(nf);return t?function(){let{router:t}=function(){let t=e.useContext(Yh);return ih(t,bf("useNavigate")),t}(),n=vf("useNavigate"),r=e.useRef(!1);return cf(()=>{r.current=!0}),e.useCallback(async(e,i={})=>{oh(r.current,lf),r.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:n,...i}))},[t,n])}():function(){ih(af(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(Yh),{basename:n,navigator:r}=e.useContext(ef),{matches:i}=e.useContext(nf),{pathname:o}=sf(),a=JSON.stringify(Oh(i)),s=e.useRef(!1);return cf(()=>{s.current=!0}),e.useCallback((e,i={})=>{if(oh(s.current,lf),!s.current)return;if("number"==typeof e)return void r.go(e);let l=_h(e,JSON.parse(a),o,"path"===i.relative);null==t&&"/"!==n&&(l.pathname="/"===l.pathname?n:Mh([n,l.pathname])),Wh("string"==typeof e?e:lh(e),r.createHref(l),Uh(r),"reject"),(i.replace?r.replace:r.push)(l,i.state,i)},[n,r,a,o,t])}()}function df(t,{relative:n}={}){let{matches:r}=e.useContext(nf),{pathname:i}=sf(),o=JSON.stringify(Oh(r));return e.useMemo(()=>_h(t,JSON.parse(o),i,"path"===n),[t,o,i,n])}function pf(){let t=function(){let t=e.useContext(rf),n=function(t){let n=e.useContext(Jh);return ih(n,bf(t)),n}("useRouteError"),r=vf("useRouteError");return void 0!==t?t:n.errors?.[r]}(),n=Dh(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},s=null;return console.error("Error handled by React Router default ErrorBoundary:",t),s=/* @__PURE__ */e.createElement(e.Fragment,null,/* @__PURE__ */e.createElement("p",null,"💿 Hey developer 👋"),/* @__PURE__ */e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",/* @__PURE__ */e.createElement("code",{style:a},"ErrorBoundary")," or"," ",/* @__PURE__ */e.createElement("code",{style:a},"errorElement")," prop on your route.")),/* @__PURE__ */e.createElement(e.Fragment,null,/* @__PURE__ */e.createElement("h2",null,"Unexpected Application Error!"),/* @__PURE__ */e.createElement("h3",{style:{fontStyle:"italic"}},n),r?/* @__PURE__ */e.createElement("pre",{style:o},r):null,s)}e.createContext(null);var hf=/* @__PURE__ */e.createElement(pf,null),ff=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let t=this.state.error;if(this.context&&"object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){const e=function(e){if(e.startsWith(`${of}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new zh(t.status,t.statusText,t.data)}catch{}}(t.digest);e&&(t=e)}let n=void 0!==t?/* @__PURE__ */e.createElement(nf.Provider,{value:this.props.routeContext},/* @__PURE__ */e.createElement(rf.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?/* @__PURE__ */e.createElement(gf,{error:t},n):n}};ff.contextType=Xh;var mf=/* @__PURE__ */new WeakMap;function gf({children:t,error:n}){let{basename:r,navigator:i}=e.useContext(ef);if("object"==typeof n&&n&&"digest"in n&&"string"==typeof n.digest){let t=function(e){if(e.startsWith(`${of}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(n.digest);if(t){let o=mf.get(n);if(o)throw o;let a=qh(t.location,r),s=a.absoluteURL||a.to;if(Wh(t.location,s,Uh(i),"allow-explicit"),function(e){try{return Kh.includes(new URL(e).protocol)}catch{return!1}}(s))throw new Error("Invalid redirect location");if(Fh&&!mf.get(n)){if(!a.isExternal&&!t.reloadDocument){const e=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:t.replace}));throw mf.set(n,e),e}window.location.href=s}/* @__PURE__ */
34
34
  return e.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return t}function yf({routeContext:t,match:n,children:r}){let i=e.useContext(Yh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),/* @__PURE__ */e.createElement(nf.Provider,{value:t},r)}function bf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vf(t){let n=function(t){let n=e.useContext(nf);return ih(n,bf(t)),n}(t),r=n.matches[n.matches.length-1];return ih(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}var wf={};function kf(e,t,n){t||wf[e]||(wf[e]=!0,oh(!1,n))}function xf({basename:t,children:n,initialEntries:r,initialIndex:i,useTransitions:o}){let a=e.useRef();null==a.current&&(a.current=function(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:i=!1}=e;t=n.map((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0,"string"==typeof e?void 0:e.mask));let o=l(null==r?t.length-1:r),a="POP",s=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[o]}function u(e,n=null,r,i){let o=sh(t?c().pathname:"/",e,n,r,i);return oh("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:lh(e)}return{get index(){return o},get action(){return a},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?ch(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){a="PUSH";let r=rh(e)?e:u(e,n);o+=1,t.splice(o,t.length,r),i&&s&&s({action:a,location:r,delta:1})},replace(e,n){a="REPLACE";let r=rh(e)?e:u(e,n);t[o]=r,i&&s&&s({action:a,location:r,delta:0})},go(e){a="POP";let n=l(o+e),r=t[n];o=n,s&&s({action:a,location:r,delta:e})},listen:e=>(s=e,()=>{s=null})}}({initialEntries:r,initialIndex:i,v5Compat:!0}));let s=a.current,[l,c]=e.useState({action:s.action,location:s.location}),u=e.useCallback(t=>{!1===o?c(t):e.startTransition(()=>c(t))},[o]);return e.useLayoutEffect(()=>s.listen(u),[s,u]),/* @__PURE__ */e.createElement(Tf,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,useTransitions:o})}function Sf({to:t,replace:n,state:r,relative:i}){ih(af(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:a}=e.useContext(ef);oh(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=e.useContext(nf),{pathname:l}=sf(),c=uf(),u=_h(t,Oh(s),l,"path"===i);Wh("string"==typeof t?t:lh(t),a.createHref(u),Uh(a),"reject");let d=JSON.stringify(u);return e.useEffect(()=>{c(JSON.parse(d),{replace:n,state:r,relative:i})},[c,d,i,n,r]),null}function Tf({basename:t="/",children:n=null,location:r,navigationType:i="POP",navigator:o,static:a=!1,useTransitions:s}){ih(!af(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),c=e.useMemo(()=>({basename:l,navigator:o,static:a,useTransitions:s,future:{}}),[l,o,a,s]);"string"==typeof r&&(r=ch(r));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:f="default",mask:m}=r,g=e.useMemo(()=>{let e=Eh(u,l);return null==e?null:{location:{pathname:e,search:d,hash:p,state:h,key:f,mask:m},navigationType:i}},[l,u,d,p,h,f,i,m]);return oh(null!=g,`<Router basename="${l}"> is not able to match the URL "${u}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==g?null:/* @__PURE__ */e.createElement(ef.Provider,{value:c},/* @__PURE__ */e.createElement(tf.Provider,{children:n,value:g}))}e.memo(function({routes:t,manifest:n,future:r,state:i,isStatic:o,onError:a}){return function(t,n,r){ih(af(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=e.useContext(ef),{matches:o}=e.useContext(nf),a=o[o.length-1],s=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",u=a&&a.route;{let e=u&&u.path||"";kf(l,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let d,p=sf();if(n){let e="string"==typeof n?ch(n):n;ih("/"===c||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=p;let h=d.pathname||"/",f=h;if("/"!==c){let e=c.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):uh(t,{pathname:f});oh(u||null!=m,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),oh(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=function(t,n=[],r){let i=r?.state;if(null==t){if(!i)return null;if(i.errors)t=i.matches;else{if(0!==n.length||i.initialized||!(i.matches.length>0))return null;t=i.matches}}let o=t,a=i?.errors;if(null!=a){let e=o.findIndex(e=>e.route.id&&void 0!==a?.[e.route.id]);ih(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let s=!1,l=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:n}=i,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){r.isStatic&&(s=!0),o=l>=0?o.slice(0,l+1):[o[0]];break}}}}let c=r?.onError,u=i&&c?(e,t)=>{c(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:$h(i.matches),errorInfo:t})}:void 0;return o.reduceRight((t,r,c)=>{let d,p=!1,h=null,f=null;i&&(d=a&&r.route.id?a[r.route.id]:void 0,h=r.route.errorElement||hf,s&&(l<0&&0===c?(kf("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,f=null):l===c&&(p=!0,f=r.route.hydrateFallbackElement||null)));let m=n.concat(o.slice(0,c+1)),g=()=>{let n;return n=d?h:p?f:r.route.Component?/* @__PURE__ */e.createElement(r.route.Component,null):r.route.element?r.route.element:t,/* @__PURE__ */e.createElement(yf,{match:r,routeContext:{outlet:t,matches:m,isDataRoute:null!=i},children:n})};return i&&(r.route.ErrorBoundary||r.route.errorElement||0===c)?/* @__PURE__ */e.createElement(ff,{location:i.location,revalidation:i.revalidation,component:h,error:d,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):g()},null)}(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Mh([c,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Mh([c,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),o,r);return n&&g?/* @__PURE__ */e.createElement(tf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},g):g}(t,void 0,{manifest:n,state:i,isStatic:o,onError:a,future:r})}),e.Component;var Cf="get",Ef="application/x-www-form-urlencoded";function Af(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var If=null,Of=/* @__PURE__ */new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _f(e){return null==e||Of.has(e)?e:(oh(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ef}"`),null)}function Nf(e,t){if(!1===e||null==e)throw new Error(t)}function Mf(e,t,n,r){let i="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:"/"===i.pathname?i.pathname=`_root.${r}`:t&&"/"===Eh(i.pathname,t)?i.pathname=`${Ph(t)}/_root.${r}`:i.pathname=`${Ph(i.pathname)}.${r}`,i}function Pf(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Lf(e,t,n,r,i,o){let a=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>a(e,t)||s(e,t)):"data"===o?t.filter((t,o)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(a(t,o)||s(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function Rf(e,t,{includeHydrateFallback:n}={}){return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1),[...new Set(r)];var r}function jf(){let t=e.useContext(Yh);return Nf(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function zf(){let t=e.useContext(Jh);return Nf(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Df=e.createContext(void 0);function $f(){let t=e.useContext(Df);return Nf(t,"You must render this element inside a <HydratedRouter> element"),t}function Ff(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function qf({page:t,...n}){let r=Zh(),{nonce:i}=$f(),{router:o}=jf(),a=e.useMemo(()=>uh(o.routes,t,o.basename),[o.routes,t,o.basename]);return a?(null==n.nonce&&i&&(n={...n,nonce:i}),r?/* @__PURE__ */e.createElement(Bf,{page:t,matches:a,...n}):/* @__PURE__ */e.createElement(Uf,{page:t,matches:a,...n})):null}function Bf({page:t,matches:n,...r}){let i=sf(),{future:o}=$f(),{basename:a}=jf(),s=e.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let e=Mf(t,a,o.v8_trailingSlashAwareDataRequests,"rsc"),r=!1,s=[];for(let t of n)"function"==typeof t.route.shouldRevalidate?r=!0:s.push(t.route.id);return r&&s.length>0&&e.searchParams.set("_routes",s.join(",")),[e.pathname+e.search]},[a,o.v8_trailingSlashAwareDataRequests,t,i,n]);/* @__PURE__ */
35
35
  return e.createElement(e.Fragment,null,s.map(t=>/* @__PURE__ */e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...r})))}function Uf({page:t,matches:n,...r}){let i=sf(),{future:o,manifest:a,routeModules:s}=$f(),{basename:l}=jf(),{loaderData:c,matches:u}=zf(),d=e.useMemo(()=>Lf(t,n,u,a,i,"data"),[t,n,u,a,i]),p=e.useMemo(()=>Lf(t,n,u,a,i,"assets"),[t,n,u,a,i]),h=e.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let e=/* @__PURE__ */new Set,r=!1;if(n.forEach(t=>{let n=a.routes[t.route.id];n&&n.hasLoader&&(!d.some(e=>e.route.id===t.route.id)&&t.route.id in c&&s[t.route.id]?.shouldRevalidate||n.hasClientLoader?r=!0:e.add(t.route.id))}),0===e.size)return[];let u=Mf(t,l,o.v8_trailingSlashAwareDataRequests,"data");return r&&e.size>0&&u.searchParams.set("_routes",n.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[u.pathname+u.search]},[l,o.v8_trailingSlashAwareDataRequests,c,i,a,d,n,t,s]),f=e.useMemo(()=>Rf(p,a),[p,a]),m=function(t){let{manifest:n,routeModules:r}=$f(),[i,o]=e.useState([]);return e.useEffect(()=>{let e=!1;return async function(e,t,n){return function(e,t){let n=/* @__PURE__ */new Set;return new Set(t),e.reduce((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e},[])}((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await(import(
36
36
  /* @vite-ignore */
37
37
  /* webpackIgnore: true */
38
38
  e.module));return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Pf).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(t,n,r).then(t=>{e||o(t)}),()=>{e=!0}},[t,n,r]),i}(p);/* @__PURE__ */
39
- return e.createElement(e.Fragment,null,h.map(t=>/* @__PURE__ */e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...r})),f.map(t=>/* @__PURE__ */e.createElement("link",{key:t,rel:"modulepreload",href:t,...r})),m.map(({key:t,link:n})=>/* @__PURE__ */e.createElement("link",{key:t,nonce:r.nonce,...n,crossOrigin:n.crossOrigin??r.crossOrigin})))}Df.displayName="FrameworkContext";function Hf(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}e.Component;var Wf="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Wf&&(window.__reactRouterVersion="7.18.4")}catch(XN){}function Vf({basename:t,children:n,useTransitions:r,window:i}){let o=e.useRef();null==o.current&&(o.current=function(e={}){return function(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s="POP",l=null,c=u();function u(){return(a.state||{idx:null}).idx}function d(){s="POP";let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:h.location,delta:t})}function p(e){return function(e,t,n=!1){let r="http://localhost";e&&(r="null"!==e.location.origin?e.location.origin:e.location.href),ih(r,"No window.location.(origin|href) available to create URL");let i="string"==typeof t?t:lh(t);return i=i.replace(/ $/,"%20"),!n&&th.test(i)&&(i=r+i),new URL(i,r)}(i,e)}null==c&&(c=0,a.replaceState({...a.state,idx:c},""));let h={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(nh,d),l=e,()=>{i.removeEventListener(nh,d),l=null}},createHref:e=>t(i,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=rh(e)?e:sh(h.location,e,t);n&&n(r,e),c=u()+1;let d=ah(r,c),p=h.createHref(r.mask||r);try{a.pushState(d,"",p)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;i.location.assign(p)}o&&l&&l({action:s,location:h.location,delta:1})},replace:function(e,t){s="REPLACE";let r=rh(e)?e:sh(h.location,e,t);n&&n(r,e),c=u();let i=ah(r,c),d=h.createHref(r.mask||r);a.replaceState(i,"",d),o&&l&&l({action:s,location:h.location,delta:0})},go:e=>a.go(e)};return h}(function(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:o}=n||e.location;return sh("",{pathname:r,search:i,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:lh(t)},null,e)}({window:i,v5Compat:!0}));let a=o.current,[s,l]=e.useState({action:a.action,location:a.location}),c=e.useCallback(t=>{!1===r?l(t):e.startTransition(()=>l(t))},[r]);return e.useLayoutEffect(()=>a.listen(c),[a,c]),/* @__PURE__ */e.createElement(Tf,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,useTransitions:r})}var Gf=e.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:a,mask:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:h,...f},m){let{basename:g,navigator:y,useTransitions:b}=e.useContext(ef),v="string"==typeof u&&eh.test(u),w=qh(u,g),k=function(t,{relative:n}={}){ih(af(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=e.useContext(ef),{hash:o,pathname:a,search:s}=df(t,{relative:n}),l=a;return"/"!==r&&(l="/"===a?r:Mh([r,a])),i.createHref({pathname:l,search:s,hash:o})}(u=w.to,{relative:i}),x=sf(),S=null;if(s){let e=_h(s,[],x.mask?x.mask.pathname:"/",!0);"/"!==g&&(e.pathname="/"===e.pathname?g:Mh([g,e.pathname])),S=y.createHref(e)}let[T,C,E]=function(t,n){let r=e.useContext(Df),[i,o]=e.useState(!1),[a,s]=e.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:p}=n,h=e.useRef(null);e.useEffect(()=>{if("render"===t&&s(!0),"viewport"===t){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let f=()=>{o(!0)},m=()=>{o(!1),s(!1)};return r?"intent"!==t?[a,h,{}]:[a,h,{onFocus:Ff(l,f),onBlur:Ff(c,m),onMouseEnter:Ff(u,f),onMouseLeave:Ff(d,m),onTouchStart:Ff(p,f)}]:[!1,h,{}]}(r,f),A=function(t,{target:n,replace:r,mask:i,state:o,preventScrollReset:a,relative:s,viewTransition:l,defaultShouldRevalidate:c,useTransitions:u}={}){let d=uf(),p=sf(),h=df(t,{relative:s});return e.useCallback(f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,n)){f.preventDefault();let n=void 0!==r?r:lh(p)===lh(h),m=()=>d(t,{replace:n,mask:i,state:o,preventScrollReset:a,relative:s,viewTransition:l,defaultShouldRevalidate:c});u?e.startTransition(()=>m()):m()}},[p,d,h,r,i,o,n,t,a,s,l,c,u])}(u,{replace:a,mask:s,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:p,defaultShouldRevalidate:h,useTransitions:b}),I=!(w.isExternal||o),O=/* @__PURE__ */e.createElement("a",{...f,...E,href:(I?S:void 0)||w.absoluteURL||k,onClick:I?function(e){t&&t(e),e.defaultPrevented||A(e)}:t,ref:Hf(m,C),target:c,"data-discover":v||"render"!==n?void 0:"true"});return T&&!v?/* @__PURE__ */e.createElement(e.Fragment,null,O,/* @__PURE__ */e.createElement(qf,{page:k})):O});Gf.displayName="Link";var Kf=e.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:a,viewTransition:s,children:l,...c},u){let d=df(a,{relative:c.relative}),p=sf(),h=e.useContext(Jh),{navigator:f,basename:m}=e.useContext(ef),g=null!=h&&function(t,{relative:n}={}){let r=e.useContext(Qh);ih(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Jf("useViewTransitionState"),o=df(t,{relative:n});if(!r.isTransitioning)return!1;let a=Eh(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=Eh(r.nextLocation.pathname,i)||r.nextLocation.pathname;return null!=Sh(o.pathname,s)||null!=Sh(o.pathname,a)}(d)&&!0===s,y=f.encodeLocation?f.encodeLocation(d).pathname:d.pathname,b=p.pathname,v=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(b=b.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&m&&(v=Eh(v,m)||v);const w="/"!==y&&y.endsWith("/")?y.length-1:y.length;let k,x=b===y||!i&&b.startsWith(y)&&"/"===b.charAt(w),S=null!=v&&(v===y||!i&&v.startsWith(y)&&"/"===v.charAt(y.length)),T={isActive:x,isPending:S,isTransitioning:g},C=x?t:void 0;k="function"==typeof r?r(T):[r,x?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let E="function"==typeof o?o(T):o;/* @__PURE__ */
40
- return e.createElement(Gf,{...c,"aria-current":C,className:k,ref:u,style:E,to:a,viewTransition:s},"function"==typeof l?l(T):l)});Kf.displayName="NavLink";var Yf=e.forwardRef(({discover:t="render",fetcherKey:n,navigate:r,reloadDocument:i,replace:o,state:a,method:s=Cf,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:h,...f},m)=>{let{useTransitions:g}=e.useContext(ef),y=function(){let{router:t}=Jf("useSubmit"),{basename:n}=e.useContext(ef),r=vf("useRouteId"),i=t.fetch,o=t.navigate;return e.useCallback(async(e,t={})=>{let{action:a,method:s,encType:l,formData:c,body:u}=function(e,t){let n,r,i,o,a;if(Af(s=e)&&"form"===s.tagName.toLowerCase()){let a=e.getAttribute("action");r=a?Eh(a,t):null,n=e.getAttribute("method")||Cf,i=_f(e.getAttribute("enctype"))||Ef,o=new FormData(e)}else if(function(e){return Af(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Af(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||a.getAttribute("action");if(r=s?Eh(s,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Cf,i=_f(e.getAttribute("formenctype"))||_f(a.getAttribute("enctype"))||Ef,o=new FormData(a,e),!function(){if(null===If)try{new FormData(document.createElement("form"),0),If=!1}catch(XN){If=!0}return If}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,r)}}else{if(Af(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Cf,r=null,i=Ef,a=e}var s;return o&&"text/plain"===i&&(a=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:a}}(e,n);if(!1===t.navigate){let e=t.fetcherKey||Zf();await i(e,r,t.action||a,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:c,body:u,formMethod:t.method||s,formEncType:t.encType||l,flushSync:t.flushSync})}else await o(t.action||a,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:c,body:u,formMethod:t.method||s,formEncType:t.encType||l,replace:t.replace,state:t.state,fromRouteId:r,flushSync:t.flushSync,viewTransition:t.viewTransition})},[i,o,n,r])}(),b=function(t,{relative:n}={}){let{basename:r}=e.useContext(ef),i=e.useContext(nf);ih(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),a={...df(t||".",{relative:n})},s=sf();if(null==t){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();a.search=n?`?${n}`:""}}return t&&"."!==t||!o.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(a.pathname="/"===a.pathname?r:Mh([r,a.pathname])),lh(a)}(l,{relative:u}),v="get"===s.toLowerCase()?"get":"post",w="string"==typeof l&&eh.test(l);/* @__PURE__ */
39
+ return e.createElement(e.Fragment,null,h.map(t=>/* @__PURE__ */e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...r})),f.map(t=>/* @__PURE__ */e.createElement("link",{key:t,rel:"modulepreload",href:t,...r})),m.map(({key:t,link:n})=>/* @__PURE__ */e.createElement("link",{key:t,nonce:r.nonce,...n,crossOrigin:n.crossOrigin??r.crossOrigin})))}Df.displayName="FrameworkContext";function Hf(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}e.Component;var Wf="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Wf&&(window.__reactRouterVersion="7.18.4")}catch(aM){}function Vf({basename:t,children:n,useTransitions:r,window:i}){let o=e.useRef();null==o.current&&(o.current=function(e={}){return function(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s="POP",l=null,c=u();function u(){return(a.state||{idx:null}).idx}function d(){s="POP";let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:h.location,delta:t})}function p(e){return function(e,t,n=!1){let r="http://localhost";e&&(r="null"!==e.location.origin?e.location.origin:e.location.href),ih(r,"No window.location.(origin|href) available to create URL");let i="string"==typeof t?t:lh(t);return i=i.replace(/ $/,"%20"),!n&&th.test(i)&&(i=r+i),new URL(i,r)}(i,e)}null==c&&(c=0,a.replaceState({...a.state,idx:c},""));let h={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(nh,d),l=e,()=>{i.removeEventListener(nh,d),l=null}},createHref:e=>t(i,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=rh(e)?e:sh(h.location,e,t);n&&n(r,e),c=u()+1;let d=ah(r,c),p=h.createHref(r.mask||r);try{a.pushState(d,"",p)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;i.location.assign(p)}o&&l&&l({action:s,location:h.location,delta:1})},replace:function(e,t){s="REPLACE";let r=rh(e)?e:sh(h.location,e,t);n&&n(r,e),c=u();let i=ah(r,c),d=h.createHref(r.mask||r);a.replaceState(i,"",d),o&&l&&l({action:s,location:h.location,delta:0})},go:e=>a.go(e)};return h}(function(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:o}=n||e.location;return sh("",{pathname:r,search:i,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:lh(t)},null,e)}({window:i,v5Compat:!0}));let a=o.current,[s,l]=e.useState({action:a.action,location:a.location}),c=e.useCallback(t=>{!1===r?l(t):e.startTransition(()=>l(t))},[r]);return e.useLayoutEffect(()=>a.listen(c),[a,c]),/* @__PURE__ */e.createElement(Tf,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,useTransitions:r})}var Gf=e.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:a,mask:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:h,...f},m){let{basename:g,navigator:y,useTransitions:b}=e.useContext(ef),v="string"==typeof u&&eh.test(u),w=qh(u,g),k=function(t,{relative:n}={}){ih(af(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=e.useContext(ef),{hash:o,pathname:a,search:s}=df(t,{relative:n}),l=a;return"/"!==r&&(l="/"===a?r:Mh([r,a])),i.createHref({pathname:l,search:s,hash:o})}(u=w.to,{relative:i}),x=sf(),S=null;if(s){let e=_h(s,[],x.mask?x.mask.pathname:"/",!0);"/"!==g&&(e.pathname="/"===e.pathname?g:Mh([g,e.pathname])),S=y.createHref(e)}let[T,C,E]=function(t,n){let r=e.useContext(Df),[i,o]=e.useState(!1),[a,s]=e.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:p}=n,h=e.useRef(null);e.useEffect(()=>{if("render"===t&&s(!0),"viewport"===t){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let f=()=>{o(!0)},m=()=>{o(!1),s(!1)};return r?"intent"!==t?[a,h,{}]:[a,h,{onFocus:Ff(l,f),onBlur:Ff(c,m),onMouseEnter:Ff(u,f),onMouseLeave:Ff(d,m),onTouchStart:Ff(p,f)}]:[!1,h,{}]}(r,f),A=function(t,{target:n,replace:r,mask:i,state:o,preventScrollReset:a,relative:s,viewTransition:l,defaultShouldRevalidate:c,useTransitions:u}={}){let d=uf(),p=sf(),h=df(t,{relative:s});return e.useCallback(f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,n)){f.preventDefault();let n=void 0!==r?r:lh(p)===lh(h),m=()=>d(t,{replace:n,mask:i,state:o,preventScrollReset:a,relative:s,viewTransition:l,defaultShouldRevalidate:c});u?e.startTransition(()=>m()):m()}},[p,d,h,r,i,o,n,t,a,s,l,c,u])}(u,{replace:a,mask:s,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:p,defaultShouldRevalidate:h,useTransitions:b}),I=!(w.isExternal||o),O=/* @__PURE__ */e.createElement("a",{...f,...E,href:(I?S:void 0)||w.absoluteURL||k,onClick:I?function(e){t&&t(e),e.defaultPrevented||A(e)}:t,ref:Hf(m,C),target:c,"data-discover":v||"render"!==n?void 0:"true"});return T&&!v?/* @__PURE__ */e.createElement(e.Fragment,null,O,/* @__PURE__ */e.createElement(qf,{page:k})):O});Gf.displayName="Link";var Kf=e.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:a,viewTransition:s,children:l,...c},u){let d=df(a,{relative:c.relative}),p=sf(),h=e.useContext(Jh),{navigator:f,basename:m}=e.useContext(ef),g=null!=h&&function(t,{relative:n}={}){let r=e.useContext(Qh);ih(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Jf("useViewTransitionState"),o=df(t,{relative:n});if(!r.isTransitioning)return!1;let a=Eh(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=Eh(r.nextLocation.pathname,i)||r.nextLocation.pathname;return null!=Sh(o.pathname,s)||null!=Sh(o.pathname,a)}(d)&&!0===s,y=f.encodeLocation?f.encodeLocation(d).pathname:d.pathname,b=p.pathname,v=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(b=b.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&m&&(v=Eh(v,m)||v);const w="/"!==y&&y.endsWith("/")?y.length-1:y.length;let k,x=b===y||!i&&b.startsWith(y)&&"/"===b.charAt(w),S=null!=v&&(v===y||!i&&v.startsWith(y)&&"/"===v.charAt(y.length)),T={isActive:x,isPending:S,isTransitioning:g},C=x?t:void 0;k="function"==typeof r?r(T):[r,x?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let E="function"==typeof o?o(T):o;/* @__PURE__ */
40
+ return e.createElement(Gf,{...c,"aria-current":C,className:k,ref:u,style:E,to:a,viewTransition:s},"function"==typeof l?l(T):l)});Kf.displayName="NavLink";var Yf=e.forwardRef(({discover:t="render",fetcherKey:n,navigate:r,reloadDocument:i,replace:o,state:a,method:s=Cf,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:h,...f},m)=>{let{useTransitions:g}=e.useContext(ef),y=function(){let{router:t}=Jf("useSubmit"),{basename:n}=e.useContext(ef),r=vf("useRouteId"),i=t.fetch,o=t.navigate;return e.useCallback(async(e,t={})=>{let{action:a,method:s,encType:l,formData:c,body:u}=function(e,t){let n,r,i,o,a;if(Af(s=e)&&"form"===s.tagName.toLowerCase()){let a=e.getAttribute("action");r=a?Eh(a,t):null,n=e.getAttribute("method")||Cf,i=_f(e.getAttribute("enctype"))||Ef,o=new FormData(e)}else if(function(e){return Af(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Af(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||a.getAttribute("action");if(r=s?Eh(s,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Cf,i=_f(e.getAttribute("formenctype"))||_f(a.getAttribute("enctype"))||Ef,o=new FormData(a,e),!function(){if(null===If)try{new FormData(document.createElement("form"),0),If=!1}catch(aM){If=!0}return If}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,r)}}else{if(Af(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Cf,r=null,i=Ef,a=e}var s;return o&&"text/plain"===i&&(a=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:a}}(e,n);if(!1===t.navigate){let e=t.fetcherKey||Zf();await i(e,r,t.action||a,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:c,body:u,formMethod:t.method||s,formEncType:t.encType||l,flushSync:t.flushSync})}else await o(t.action||a,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:c,body:u,formMethod:t.method||s,formEncType:t.encType||l,replace:t.replace,state:t.state,fromRouteId:r,flushSync:t.flushSync,viewTransition:t.viewTransition})},[i,o,n,r])}(),b=function(t,{relative:n}={}){let{basename:r}=e.useContext(ef),i=e.useContext(nf);ih(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),a={...df(t||".",{relative:n})},s=sf();if(null==t){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();a.search=n?`?${n}`:""}}return t&&"."!==t||!o.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(a.pathname="/"===a.pathname?r:Mh([r,a.pathname])),lh(a)}(l,{relative:u}),v="get"===s.toLowerCase()?"get":"post",w="string"==typeof l&&eh.test(l);/* @__PURE__ */
41
41
  return e.createElement("form",{ref:m,method:v,action:b,onSubmit:i?c:t=>{if(c&&c(t),t.defaultPrevented)return;t.preventDefault();let i=t.nativeEvent.submitter,l=i?.getAttribute("formmethod")||s,f=()=>y(i||t.currentTarget,{fetcherKey:n,method:l,navigate:r,replace:o,state:a,relative:u,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:h});g&&!1!==r?e.startTransition(()=>f()):f()},...f,"data-discover":w||"render"!==t?void 0:"true"})});function Jf(t){let n=e.useContext(Yh);return ih(n,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(t)),n}Yf.displayName="Form";var Xf=0,Zf=()=>`__${String(++Xf)}__`;function Qf({basename:t,children:n,location:r="/"}){"string"==typeof r&&(r=ch(r));let i={pathname:r.pathname||"/",search:r.search||"",hash:r.hash||"",state:null!=r.state?r.state:null,key:r.key||"default",mask:void 0},o={createHref:em,encodeLocation:tm,push(e){throw new Error(`You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)})\` somewhere in your app.`)},replace(e){throw new Error(`You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)}, { replace: true })\` somewhere in your app.`)},go(e){throw new Error(`You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${e})\` somewhere in your app.`)},back(){throw new Error("You cannot use navigator.back() on the server because it is a stateless environment.")},forward(){throw new Error("You cannot use navigator.forward() on the server because it is a stateless environment.")}};/* @__PURE__ */
42
42
  return e.createElement(Tf,{basename:t,children:n,location:i,navigationType:"POP",navigator:o,static:!0,useTransitions:!1})}function em(e){return"string"==typeof e?e:lh(e)}function tm(e){let t="string"==typeof e?e:lh(e);t=t.replace(/ $/,"%20");let n=eh.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:n.pathname,search:n.search,hash:n.hash}}var nm,rm=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],im=()=>{const e=new URLSearchParams(window.location.search),t={};for(const n of rm){const r=e.get(n);r&&(t[n.slice(4)]=r)}return Object.keys(t).length>0?t:void 0},om=()=>"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,am=e=>{nm=e},sm=(e,t)=>{nm?.track(e,t)},lm=({analytics:e})=>{const t=sf(),n=x(!0===e?.firstViewCounted);return g(()=>{if(!e?.endpoint||!e.key)return;const t=((e,t=20,n=5e3)=>{const r=[],i=`${e.endpoint.replace(/\/+$/,"")}/batch?k=${encodeURIComponent(e.key)}`;let o;const a=()=>{0!==r.length&&(e=>{const t=JSON.stringify({events:e});"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(i,t)||fetch(i,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:t,keepalive:!0,mode:"no-cors"}).catch(()=>{})})(r.splice(0,r.length))},s=e=>{r.push(e),r.length>=t&&a()},l=()=>({path:window.location.pathname,title:document.title||void 0});return"undefined"!=typeof window&&(o=setInterval(a,n),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&a()}),window.addEventListener("pagehide",a)),{trackRender:()=>{s({id:om(),type:"render",ts:Date.now(),page:l(),ref:{referrer:document.referrer||void 0,utm:im()}})},track:(e,t)=>{s({id:om(),type:"interaction",ts:Date.now(),page:l(),name:e,props:t})},flush:a,stop:()=>{o&&(clearInterval(o),o=void 0),a()}}})(e);return am(t),()=>{am(void 0),t.stop()}},[e]),g(()=>{n.current?n.current=!1:nm?.trackRender()},[t.pathname,t.search]),null},cm=K("AuthContext",{}),um=({server:e,routerLocation:t})=>{let n=k(()=>typeof window<"u"?window.location:pr(e,"location",{pathname:"/"}),[e]),r=k(()=>{if(!t)return n;let{origin:e,host:r,hostname:i,protocol:o,href:a}=n,{pathname:s,search:l}=t;return{origin:e,host:r,hostname:i,protocol:o,pathname:s,search:l,hash:"",href:e?`${e}${s}${l}`:a}},[n,t]),i=k(()=>function(e){!e&&typeof window<"u"&&(e=window.location.search);let t={};if(!e||0===e.length)return t;let n=e.replace("?","").split("&");for(let r=0;r<n.length;r++){let e=n[r].split("="),i=decodeURIComponent(e[0]),o=decodeURIComponent(e[1]);void 0===t[i]?t[i]=decodeURIComponent(o):"string"==typeof t[i]?t[i]=[t[i],decodeURIComponent(o)]:t[i].push(decodeURIComponent(o))}return t}(r.search),[r.search]),o=k(()=>r.hostname?r.hostname:"localhost",[r.hostname]),a=r.origin||"";return k(()=>({queryParams:i,hostname:o,origin:a,location:r}),[i,o,a,r])},dm=(e,t)=>{let n="string"==typeof e?{path:e,caseSensitive:!1,end:!0}:{path:e.path,caseSensitive:e.caseSensitive??!1,end:e.end??!0},[r,i]=((e,t,n)=>{let r=[],i=`^${e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,o)=>{if(r.push({paramName:t,isOptional:void 0!==n}),void 0===n)return"/([^\\/]+)";let a=o.charAt(i+e.length);return a&&"/"!==a?"/([^\\/]*)":"(?:/([^\\/]*))?"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2")}`;return e.endsWith("*")?(r.push({paramName:"*",isOptional:!1}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]})(n.path,n.caseSensitive,n.end),o=t.match(r);if(!o)return null;let a=o[0],s=o.slice(1),l=a.replace(/(.)\/+$/,"$1");return{params:i.reduce((e,{paramName:t,isOptional:n},r)=>{let i=s[r];if("*"===t){let e=i??"";l=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return n&&!i?(e[t]=void 0,e):(e[t]=(i??"").replace(/%2F/g,"/"),e)},{}),pathname:a,pathnameBase:l,pattern:n}},pm=e=>/^https?:\/\//i.test(e),hm=e=>e.replaceAll(/\/+/g,"/"),fm=e=>hm(e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/gi,":$1")),mm=(e,t)=>{if(!t||!e[t])return"";let{slug:n,parentId:r}=e[t];return r?`${mm(e,r)}/${n}`:n};function gm(e,t,n,r=!1){let i=n.replace(/^\/+/,""),{slug:o="",folder:a,default:s}=e[i]?.attributes??{slug:i,folder:"",default:!1};if(s&&!r)return{"/":n,[`/${n}`]:n};if(s&&r)return"/";if(!a&&!r)return{[fm(`/${o}`)]:n,[fm(`/${n}`)]:n};if(!a&&r)return hm(`/${o}`);if(!t.find(e=>e.id===a))return r?hm(`/${o}`):{[fm(`/${o}`)]:n,[fm(`/${n}`)]:n};let l=[mm(t.reduce((e,t)=>({...e,[t.id]:t}),{}),a),o].filter(Boolean).join("/");return r?hm(`/${l}`):{[fm(`/${l}`)]:n,[fm(`/${n}`)]:n}}var ym=(e,t,n)=>{let r=n.indexOf("#");if(r>0)return`${ym(e,t,n.slice(0,r))}${n.slice(r)}`;let i=e[n];if(!i)return n;let{slug:o,default:a}=i.attributes;return"string"==typeof o?gm(e,t,n,!0):a?"/":`/${n}`},bm=(e,t,n=!0)=>!(e&&n&&void 0!==t&&(!t||"authenticated"!==e)&&(t||"public"!==e)&&(t&&"public"===e||e)),vm=(e={},t=[],n,r="",i=!0)=>Object.keys(e).reduce((o,a)=>{let{attributes:{accessLevel:s,enabled:l=!0,unauthorizedBehaviour:c}}=e[a],u=e[a].attributes.unauthorizedPageRedirect;if(!l&&i)return o;u&&=(e=>pm(e)||e.includes("{{"))(u)?u:gm(e,t,u,!0);let d=gm(e,t,a),p="*"===e[a].attributes.slug,h=Object.keys(d).map(e=>({pageId:a,path:`${r}${e}`.replaceAll("//","/"),accessLevel:s,enabled:l,isRaw:`/${a}`===e,unauthorizedBehaviour:c,unauthorizedPageRedirect:u,hasAccess:bm(s,n,i),...p?{notFound:!0}:{}}));return[...o,...h]},[]).sort((e,t)=>!!e.notFound==!!t.notFound?e.path===t.path?"authenticated"===e.accessLevel?-1:1:e.path>t.path?-1:1:e.notFound?1:-1),wm=(e,t,n)=>{if(!t)return{action:{type:"accessDenied",path:void 0},pathMatch:void 0};let r=[];e.forEach(e=>{let n=dm({path:e.path,end:"*"!==e.path},t);n&&r.push({matchResult:n,path:e,pageId:e.pageId})});let i=e=>e.find(({path:{accessLevel:e}})=>"authenticated"===e&&n||"public"===e&&!n||!e)??e.find(({path:{accessLevel:e}})=>"authenticated"===e&&!n||"public"===e&&n),o=i(r.filter(({path:e})=>!e.notFound))??i(r.filter(({path:e})=>e.notFound));if(!o)return{action:{type:"notFound",path:void 0},pathMatch:void 0};let{pageId:a,matchResult:s,path:{hasAccess:l,unauthorizedBehaviour:c,unauthorizedPageRedirect:u,notFound:d}}=o;return!l&&"redirect"===c&&u?{action:{type:"redirect",path:u},pathMatch:void 0}:l?{action:{type:d?"notFound":"normal",path:void 0},pathMatch:s,pageId:a}:{action:{type:"accessDenied",path:void 0},pathMatch:void 0}},km=e=>e&&"string"==typeof e?(e.match(/:[a-zA-Z0-9-_:*]+/gim)||[]).map(e=>e.replace(":","")):[],xm=({authenticated:e,user:t})=>{let n=t?.details,r={authenticated:!0===e};return n?{...r,email:n.email,username:n.username,roles:n.roles}:r},Sm=/* @__PURE__ */new Set,Tm=async e=>(await Promise.all([...Sm].map(async t=>t(e)))).some(e=>!0===e),Cm=["missing","expired","revoked","inactive","unverified","malformed","outdated","network"],Em=(e,t)=>{if(401!==e)return;let n=t?.reason;return"string"==typeof n&&Cm.includes(n)?n:"expired"},Am=e=>/([^.]+\.[^.]+)$/.exec(e)?.[1]??e,Im=(e,t)=>{let n=e?.attributes[t];return"string"==typeof n?n:""},Om=(e,t,n)=>{let r=[],i=/* @__PURE__ */new Set,o=t,a=n;for(;o&&!i.has(o)&&r.length<16;){let t=e(o);if("layoutContainer"!==t?.definition.type)break;i.add(o),r.push({layout:o,slot:a||o}),o=Im(t,"layout"),a=Im(t,"layoutContainer")}return r},_m=(e,t,n,r)=>{if(void 0===t)return[];let i=n?new Set(n):void 0,o=[],a=/* @__PURE__ */new Set,s=e.flat[t],l=e=>"string"==typeof e?e:"",c=[t,...s?Om(t=>e.flat[t],l(s.attributes.layout),l(s.attributes.layoutContainer)).map(e=>e.layout):[]];for(;c.length>0;){let t=c.pop();if(void 0===t||a.has(t))continue;a.add(t);let n=e.flat[t];if(!n||r&&!Pi(n.definition.flag,r))continue;"server"===n.definition.runtime&&(!i||i.has(n.id))&&o.push(n);let{items:s}=n.definition;s&&c.push(...s)}return o},Nm=/\{[{%]/,Mm=(e,t)=>{if("string"!=typeof e)return;let n=Nm.test(e)?Yn(e,t):e,r="string"==typeof n||"number"==typeof n?String(n).trim():"";return""===r||Nm.test(r)?void 0:r},Pm=e=>`rsc.data.${e}`,Lm=()=>typeof window>"u"?"":`${window.location.pathname}${window.location.search}`,Rm="*",jm=/* @__PURE__ */new Map,zm=/* @__PURE__ */new WeakMap,Dm=()=>({seq:0,inFlight:/* @__PURE__ */new Set,asked:/* @__PURE__ */new Map}),$m=e=>{let t=e.get("rsc.instance");if("string"==typeof t&&t){let e=jm.get(t);if(e)return e;let n=Dm();return jm.set(t,n),n}let n=zm.get(e);if(n)return n;let r=Dm();return zm.set(e,r),r},Fm=(e,t)=>{let n={};t.inFlight.forEach(e=>{e.here&&(e.ids??[Rm]).forEach(e=>{n[e]=!0})}),e.set("rsc.refreshing",n)},qm=async(e,t,n,{location:r,fresh:i=!1}={})=>{let{enabled:o,endpoint:a}=e.get("rsc")??{};if(!o||!a||typeof window>"u")return;let s=r??Lm(),l=e.get("schema"),c=e.get("runtime.sources.auth"),u=r?((e,t,n)=>{if(!e)return;let r=e.pages.reduce((t,n)=>(n in e.flat&&(t[n]=e.flat[n]),t),{});return wm(vm(r,e.pageFolders,n),t.split("?")[0],n).pageId})(l,r,!!c?.details):e.get("navigation.currentPageId"),d=r?void 0:e.get("runtime.sources.flags");if(!l)return;let p=t?.length?((e,t,n,r)=>{let i=new Set(_m(e,t,[...n],r).map(({id:e})=>e));return n.filter(e=>i.has(e))})(l,u,t,d):void 0;if(p?!p.length:!((e,t,n)=>_m(e,t,void 0,n).length>0)(l,u,d))return;let h=new URLSearchParams({location:s});p?.length&&h.set("ids",p.join(",")),Object.entries(n??{}).forEach(([e,t])=>h.set(e,t));let f=`${a}?${h.toString()}`,m=$m(e),g=[...m.inFlight].find(e=>e.url===f&&(e.fresh||!i));if(g)return g.promise;m.inFlight.forEach(e=>{((e,t)=>!e||!!t&&t.every(t=>e.includes(t)))(p,e.ids)&&e.controller.abort()});let y=++m.seq;p?.length?p.forEach(e=>m.asked.set(e,y)):(m.asked.clear(),m.asked.set(Rm,y));let b=new AbortController,v={url:f,...p?.length?{ids:p}:{},here:s===Lm(),fresh:i,seq:y,controller:b,promise:Promise.resolve()},w=async t=>{let n=await fetch(f,{...i?{cache:"no-cache",headers:{Accept:"application/json","Cache-Control":"no-cache"}}:{headers:{Accept:"application/json"}},signal:b.signal});if(!n.ok){let r=Em(n.status,await n.json().catch(()=>{}));return r&&await Tm({reason:r,url:a})&&!t?w(!0):void e.set("rsc.stale",!0)}let{serverData:r,actionRuns:o}=await n.json();o?.length&&ft(o),((e,t,n,r,i)=>{let{ids:o,seq:a}=n;e.batch(()=>{if(o?.length)Object.entries(r).forEach(([n,r])=>{(t.asked.get(n)??0)<=a&&(t.asked.get(Rm)??0)<=a&&e.set(Pm(n),r)});else{let n=e.get("rsc.data")??{},i=e=>e!==Rm&&(t.asked.get(e)??0)>a,o=Object.fromEntries([...Object.entries(r).filter(([e])=>!i(e)),...Object.entries(n).filter(([e])=>i(e))]);e.set("rsc.data",o)}e.set("rsc.loaded",!0),e.set("rsc.stale",!1),e.set("rsc.location",i)})})(e,m,v,r??{},s)};return v.promise=w(!1).catch(()=>{b.signal.aborted||e.set("rsc.stale",!0)}).finally(()=>{m.inFlight.delete(v),Fm(e,m)}),m.inFlight.add(v),Fm(e,m),v.promise},Bm=["wheel","touchmove","keydown","pointerdown"],Um=e=>{const t=document.getElementById(e);return t?.scrollIntoView({block:"start"}),null!==t},Hm=({children:e,currentPageId:t})=>{const{server:n}=h(Kd),r=zt(),{renderMode:i,previewMode:o,environment:a}=re(),[[s,l,c,u,d]]=Bt(["schema.pageFolders","pageDefinitions","schema.variables","schema.flags","flags.overrides"]),p=n.ssr?.renderResult,m="widget"!==i?sf():void 0,{queryParams:y,hostname:b,origin:v,location:w}=um({server:n,routerLocation:m}),S=x(l);S.current=l;const T=x(s);T.current=s;const{authenticated:C,user:E}=h(cm),A="widget"!==i?uf():void 0,_=x(A);g(()=>{_.current=A},[A]);const N=k(()=>vm(l,s,C,n.basePath,o),[l,s,C,n.basePath,o]),{action:M,pageId:P="",pathMatch:L}=k(()=>"widget"===i?{action:{type:"normal",path:""},pageId:t||wm(N,"/",C).pageId}:wm(N,w.pathname,C),[N,w.pathname,C,i,t]),R=t||P;(({hash:e,navigationKey:t,enabled:n})=>{g(()=>{const t=(e=>{const t=e.replace(/^#/,"");try{return decodeURIComponent(t)}catch{return t}})(e);if(!n||!t||"undefined"==typeof document||Um(t))return;const r=new AbortController,i=new MutationObserver(()=>{Um(t)&&r.abort()}),o=setTimeout(()=>r.abort(),3e3);return r.signal.addEventListener("abort",()=>{i.disconnect(),clearTimeout(o)}),i.observe(document.body,{childList:!0,subtree:!0}),Bm.forEach(e=>window.addEventListener(e,()=>r.abort(),{once:!0,passive:!0,signal:r.signal})),()=>r.abort()},[e,t,n])})({hash:m?.hash??"",navigationKey:m?.key,enabled:o&&"widget"!==i}),g(()=>{$d.info("navigation",/* @__PURE__ */O("span",{children:["Navigated to page"," ",
43
- /* @__PURE__ */I("b",{children:pr(l,`${R}.attributes.name`,R||"Unknown")})]}),{status:M.type,elementId:R})},[M.type,R,l]);const j=f(e=>ym(S.current,T.current,e),[]),z=x(0),D=f((e,t=!1)=>{if(t&&"undefined"!=typeof window)return void(window.location.href=e);const n=j(e),i=++z.current;if(!r.get("rsc.enabled"))return r.set("navigation.pendingLocation",""),void _.current?.(n);r.set("navigation.pendingLocation",n);const o=qm(r,void 0,void 0,{location:n}).finally(()=>{z.current===i&&r.set("navigation.pendingLocation","")}),a=()=>{z.current===i&&_.current?.(n)};Promise.race([o,new Promise(e=>setTimeout(e,1500))]).then(a,a)},[j,r]),$=k(()=>{const e=N.find(e=>e.pageId===R&&!e.isRaw);return e?{...km(e.path).reduce((e,t)=>({...e,[t]:""}),{}),...pr(L,"params",{})}:pr(L,"params",{})},[N,L,R]),F=Rd($),q=Rd(y),B=k(()=>new URLSearchParams(w.search),[w.search]),U=v?`${v}${w.pathname}${w.search}`:"",H=Object.hasOwn(l,R)?l[R].definition.flag:void 0,W=void 0!==H&&!Pi(H,Mi(Ni(u,{environment:a,hostname:b,routeParams:F,queryParams:q,user:xm({authenticated:C,user:E})},d))),V=W?((e,t)=>e.find(e=>e.hasAccess&&e.notFound&&dm({path:e.path,end:!0},t))?.pageId)(N,w.pathname)??"":R;if(Ut(["navigation.urlSearchParams","navigation.routeParams","navigation.queryParams","navigation.hostname","navigation.origin","navigation.href","navigation.currentPageId","navigation.navigate"],[B,F,q,b,v,U,V,D],{raw:!0}),"notFound"===M.type||W)return p&&(p.status=404),V?e:"Not Found";if("accessDenied"===M.type)return p&&(p.status=403),"Access Denied";if("redirect"===M.type){const e=Ld(c,{queryParams:y,routeParams:F,hostname:b,environment:a}),t=M.path?String(Vn(M.path,{variables:e},!1,!0)):"";if(t&&pm(t)){const e=new URL(t);return e.searchParams.has("redirect")||e.searchParams.set("redirect",(e=>e.href?e.href:`${e.protocol||"https:"}//${e.host||e.hostname}${e.pathname}${e.search}`)(w)),p?(p.redirect=e.toString(),null):(window.location.assign(e.toString()),null)}return p?(p.redirect=M.path??"",null):/* @__PURE__ */I(Sf,{to:M.path??"",replace:!0})}return e},Wm=(e,{src:t,type:n,isMain:r},i=!1)=>{let o,a=`${e}/${t}`,s=btoa(a);return o="style"===n&&a.endsWith(".css")?{type:"link",id:s,params:{href:a,rel:"stylesheet",type:"text/css"},isMain:r}:{type:"script",id:s,params:{src:a,type:"text/javascript"},isMain:r},i&&delete o.isMain,o},Vm=(e,t)=>{try{let{resource:n,settings:r,type:i}=e,{definition:{name:o="Plitzi's Demo Plugin",owner:a="Plitzi",verified:s=!1,license:l="MIT",website:c="https://plitzi.com",backgroundColor:u="#4422ee",icon:d="https://cdn.plitzi.com/resources/img/favicon.svg"},assets:p,assetsSettings:h,pluginSchema:f}=t;return Object.values(pr(t,"pluginSchema",{})).reduce((e,m)=>{let{definition:g,builder:y,defaultStyle:b,attributes:v}=m,w=[];return g.type===i&&(w=Object.keys(vr(f,[i]))),{...e,[g.type]:{attributes:v,builder:y,defaultStyle:b,definition:g,market:{owner:a,verified:s,license:l,website:c,backgroundColor:u,icon:d,category:o},resource:n,isMain:g.type===i,manifest:t,type:i,settings:r,assetsSettings:Object.values(h).filter(({src:e})=>!!e&&[".css",".js",".mjs",".cjs"].some(t=>e.endsWith(t))).map(e=>Wm(n,e,!0)),assets:Object.values(p).filter(({src:e})=>!!e&&[".css",".js",".mjs",".cjs"].some(t=>e.endsWith(t))).map(e=>Wm(n,e)),subPlugins:w}}},{})}catch{return{}}},Gm=async(e=[])=>{let t={};if(!Array.isArray(e))return t;let n=await(async e=>{if(!Array.isArray(e)||0===e.length)return{};let t=e.map(e=>(async e=>{try{let t=await fetch(e,{headers:{Accept:"application/json"}});return t.ok?await t.json():void 0}catch{return}})(e));return(await Promise.allSettled(t)).reduce((e,t)=>"fulfilled"===t.status&&t.value?{...e,[pr(t.value,"root","")]:t.value}:e,{})})(e.filter(e=>e.resource).reduce((e,t)=>[...e,`${t.resource}/plugin-manifest.json`],[]));return e.forEach(e=>{let{type:r}=e,i=pr(n,r);t={...t,...Vm(e,i)}}),t},Km={},Ym={Init:"\n query InitQuery($environment: String!, $revision: Int) {\n Space(environment: $environment, revision: $revision) {\n schema {\n settings\n rsc\n flat {\n id\n definition {\n label\n type\n initialState\n styleSelectors\n bindings\n interactions\n parentId\n rootId\n items\n runtime\n loadStrategy\n flag {\n name\n is\n }\n anchor\n motion {\n enter\n on\n duration\n delay\n stagger\n loop\n }\n }\n attributes\n }\n pages\n components\n flags\n pageFolders {\n id\n name\n slug\n parentId\n }\n variables {\n name\n type\n value\n subValues {\n when\n value\n }\n }\n }\n plugins {\n type\n resource\n settings\n }\n style {\n variables\n cache\n }\n # The schema fetch is the one moment a client-side render hears from the server at all, so the decision it\n # would have been handed in an SSR bootstrap travels here instead.\n render {\n overQuota\n }\n }\n }\n"},Jm=K("NetworkInternalContext",{}),Xm=e=>({...e.enter?{enter:e.enter}:{},...e.on?{on:e.on}:{},..."number"==typeof e.duration?{duration:e.duration}:{},..."number"==typeof e.delay?{delay:e.delay}:{},..."number"==typeof e.stagger?{stagger:e.stagger}:{},...e.loop?{loop:e.loop}:{}}),Zm=({definition:e,...t})=>{let{parentId:n,items:r,bindings:i,interactions:o,initialState:a,runtime:s,loadStrategy:l,flag:c,anchor:u,motion:d,quiet:p,...h}=e;return{...t,definition:{...h,...null==n?{}:{parentId:n},...null==r?{}:{items:r},...null==i?{}:{bindings:i},...null==o?{}:{interactions:o},...null==a?{}:{initialState:a},...null==s?{}:{runtime:s},...null==l?{}:{loadStrategy:l},...null==c?{}:{flag:c},...null==u?{}:{anchor:u},...null==d?{}:{motion:Xm(d)},...null==p?{}:{quiet:p}}}},Qm=e=>({...e,flat:Object.fromEntries(e.flat.map(e=>[e.id,Zm(e)]))}),eg=class extends Error{failure;statusCode;constructor(e,t,n){super(e),this.name="GraphqlRequestError",this.failure=t,this.statusCode=n}},tg=({children:e,server:t,revision:n,webKey:r="",webId:i,userKey:o="",instanceId:a,offlineMode:s=!1,offlineData:l,offlineDataType:c="json"})=>{const{environment:u,debugMode:d}=re(),p=Wt(),m=s&&!!l&&!!l.schema,y=k(()=>((e,t)=>({request:async(n,r)=>{let i;try{i=await fetch(e,{method:"POST",headers:{accept:"application/graphql-response+json, application/json;q=0.9","content-type":"application/json","sdk-version":"0.38.14",authorization:t?`Bearer ${t}`:""},body:JSON.stringify({query:n,variables:r})})}catch(XN){throw new eg(XN instanceof Error?XN.message:"Network request failed","network")}const o=(e=>{try{return JSON.parse(e)}catch{return}})(await i.text());if(!i.ok){const t=Em(i.status,o);throw t&&Tm({reason:t,url:e}),new eg(`Response not successful: Received status code ${i.status}`,"http",i.status)}const a=(e=>{const t=X(e)?e.errors:void 0;return Array.isArray(t)?t.map(e=>X(e)&&"string"==typeof e.message?e.message:"Unknown error"):[]})(o);if(a.length)throw new eg(a.join("\n"),"graphql",i.status);if(!X(o)||!X(o.data))throw new eg("The server answered without data","graphql",i.status);return o.data}}))(t.serverUrl,r),[t.serverUrl,r]),[b,v]=S(!(s&&l)),[w,x]=S(void 0),{components:T}=h(Wr),[C,E]=S(()=>m&&"json"===c?{...l,plugins:{}}:{plugins:{}}),A=f(async(e,t)=>{try{return{success:!0,result:await y.request(Ym[e],{environment:u,...t})}}catch(XN){return{success:!1,result:void 0,error:XN instanceof Error?XN:String(XN)}}},[y,u]),_=f(async(e,t,n=!0)=>{const r=Km[e];if(!r)return{success:!1,result:void 0,error:"Mutation Not Found"};try{return{success:!0,result:await y.request(r,n?{environment:u,...t}:t)}}catch(XN){return{success:!1,result:void 0,error:XN instanceof Error?XN:String(XN)}}},[y,u]),N=async()=>{let e=n;"number"==typeof n&&0!==n||(e=void 0);const t=await A("Init",{environment:u,revision:e});if(t.error)return v(!1),void x((e=>e instanceof eg?401===e.statusCode?"Access not authorized":"network"===e.failure?"Service not available":e.message:"string"==typeof e?e:e.message)(t.error));if(t.success&&t.result){const{Space:e}=mr(t.result);if(!e)return x(/* @__PURE__ */O("span",{children:["Space not found, publish to ",
43
+ /* @__PURE__ */I("b",{children:pr(l,`${R}.attributes.name`,R||"Unknown")})]}),{status:M.type,elementId:R})},[M.type,R,l]);const j=f(e=>ym(S.current,T.current,e),[]),z=x(0),D=f((e,t=!1)=>{if(t&&"undefined"!=typeof window)return void(window.location.href=e);const n=j(e),i=++z.current;if(!r.get("rsc.enabled"))return r.set("navigation.pendingLocation",""),void _.current?.(n);r.set("navigation.pendingLocation",n);const o=qm(r,void 0,void 0,{location:n}).finally(()=>{z.current===i&&r.set("navigation.pendingLocation","")}),a=()=>{z.current===i&&_.current?.(n)};Promise.race([o,new Promise(e=>setTimeout(e,1500))]).then(a,a)},[j,r]),$=k(()=>{const e=N.find(e=>e.pageId===R&&!e.isRaw);return e?{...km(e.path).reduce((e,t)=>({...e,[t]:""}),{}),...pr(L,"params",{})}:pr(L,"params",{})},[N,L,R]),F=Rd($),q=Rd(y),B=k(()=>new URLSearchParams(w.search),[w.search]),U=v?`${v}${w.pathname}${w.search}`:"",H=Object.hasOwn(l,R)?l[R].definition.flag:void 0,W=void 0!==H&&!Pi(H,Mi(Ni(u,{environment:a,hostname:b,routeParams:F,queryParams:q,user:xm({authenticated:C,user:E})},d))),V=W?((e,t)=>e.find(e=>e.hasAccess&&e.notFound&&dm({path:e.path,end:!0},t))?.pageId)(N,w.pathname)??"":R;if(Ut(["navigation.urlSearchParams","navigation.routeParams","navigation.queryParams","navigation.hostname","navigation.origin","navigation.href","navigation.currentPageId","navigation.navigate"],[B,F,q,b,v,U,V,D],{raw:!0}),"notFound"===M.type||W)return p&&(p.status=404),V?e:"Not Found";if("accessDenied"===M.type)return p&&(p.status=403),"Access Denied";if("redirect"===M.type){const e=Ld(c,{queryParams:y,routeParams:F,hostname:b,environment:a}),t=M.path?String(Vn(M.path,{variables:e},!1,!0)):"";if(t&&pm(t)){const e=new URL(t);return e.searchParams.has("redirect")||e.searchParams.set("redirect",(e=>e.href?e.href:`${e.protocol||"https:"}//${e.host||e.hostname}${e.pathname}${e.search}`)(w)),p?(p.redirect=e.toString(),null):(window.location.assign(e.toString()),null)}return p?(p.redirect=M.path??"",null):/* @__PURE__ */I(Sf,{to:M.path??"",replace:!0})}return e},Wm=(e,{src:t,type:n,isMain:r},i=!1)=>{let o,a=`${e}/${t}`,s=btoa(a);return o="style"===n&&a.endsWith(".css")?{type:"link",id:s,params:{href:a,rel:"stylesheet",type:"text/css"},isMain:r}:{type:"script",id:s,params:{src:a,type:"text/javascript"},isMain:r},i&&delete o.isMain,o},Vm=(e,t)=>{try{let{resource:n,settings:r,type:i}=e,{definition:{name:o="Plitzi's Demo Plugin",owner:a="Plitzi",verified:s=!1,license:l="MIT",website:c="https://plitzi.com",backgroundColor:u="#4422ee",icon:d="https://cdn.plitzi.com/resources/img/favicon.svg"},assets:p,assetsSettings:h,pluginSchema:f}=t;return Object.values(pr(t,"pluginSchema",{})).reduce((e,m)=>{let{definition:g,builder:y,defaultStyle:b,attributes:v}=m,w=[];return g.type===i&&(w=Object.keys(vr(f,[i]))),{...e,[g.type]:{attributes:v,builder:y,defaultStyle:b,definition:g,market:{owner:a,verified:s,license:l,website:c,backgroundColor:u,icon:d,category:o},resource:n,isMain:g.type===i,manifest:t,type:i,settings:r,assetsSettings:Object.values(h).filter(({src:e})=>!!e&&[".css",".js",".mjs",".cjs"].some(t=>e.endsWith(t))).map(e=>Wm(n,e,!0)),assets:Object.values(p).filter(({src:e})=>!!e&&[".css",".js",".mjs",".cjs"].some(t=>e.endsWith(t))).map(e=>Wm(n,e)),subPlugins:w}}},{})}catch{return{}}},Gm=async(e=[])=>{let t={};if(!Array.isArray(e))return t;let n=await(async e=>{if(!Array.isArray(e)||0===e.length)return{};let t=e.map(e=>(async e=>{try{let t=await fetch(e,{headers:{Accept:"application/json"}});return t.ok?await t.json():void 0}catch{return}})(e));return(await Promise.allSettled(t)).reduce((e,t)=>"fulfilled"===t.status&&t.value?{...e,[pr(t.value,"root","")]:t.value}:e,{})})(e.filter(e=>e.resource).reduce((e,t)=>[...e,`${t.resource}/plugin-manifest.json`],[]));return e.forEach(e=>{let{type:r}=e,i=pr(n,r);t={...t,...Vm(e,i)}}),t},Km={},Ym={Init:"\n query InitQuery($environment: String!, $revision: Int) {\n Space(environment: $environment, revision: $revision) {\n schema {\n settings\n rsc\n flat {\n id\n definition {\n label\n type\n initialState\n styleSelectors\n bindings\n interactions\n parentId\n rootId\n items\n runtime\n loadStrategy\n flag {\n name\n is\n }\n anchor\n motion {\n enter\n on\n duration\n delay\n stagger\n loop\n }\n }\n attributes\n }\n pages\n components\n flags\n pageFolders {\n id\n name\n slug\n parentId\n }\n variables {\n name\n type\n value\n subValues {\n when\n value\n }\n }\n }\n plugins {\n type\n resource\n settings\n }\n style {\n variables\n cache\n }\n # The schema fetch is the one moment a client-side render hears from the server at all, so the decision it\n # would have been handed in an SSR bootstrap travels here instead.\n render {\n overQuota\n }\n }\n }\n"},Jm=K("NetworkInternalContext",{}),Xm=e=>({...e.enter?{enter:e.enter}:{},...e.on?{on:e.on}:{},..."number"==typeof e.duration?{duration:e.duration}:{},..."number"==typeof e.delay?{delay:e.delay}:{},..."number"==typeof e.stagger?{stagger:e.stagger}:{},...e.loop?{loop:e.loop}:{}}),Zm=({definition:e,...t})=>{let{parentId:n,items:r,bindings:i,interactions:o,initialState:a,runtime:s,loadStrategy:l,flag:c,anchor:u,motion:d,quiet:p,...h}=e;return{...t,definition:{...h,...null==n?{}:{parentId:n},...null==r?{}:{items:r},...null==i?{}:{bindings:i},...null==o?{}:{interactions:o},...null==a?{}:{initialState:a},...null==s?{}:{runtime:s},...null==l?{}:{loadStrategy:l},...null==c?{}:{flag:c},...null==u?{}:{anchor:u},...null==d?{}:{motion:Xm(d)},...null==p?{}:{quiet:p}}}},Qm=e=>({...e,flat:Object.fromEntries(e.flat.map(e=>[e.id,Zm(e)]))}),eg=class extends Error{failure;statusCode;constructor(e,t,n){super(e),this.name="GraphqlRequestError",this.failure=t,this.statusCode=n}},tg=({children:e,server:t,revision:n,webKey:r="",webId:i,userKey:o="",instanceId:a,offlineMode:s=!1,offlineData:l,offlineDataType:c="json"})=>{const{environment:u,debugMode:d}=re(),p=Wt(),m=s&&!!l&&!!l.schema,y=k(()=>((e,t)=>({request:async(n,r)=>{let i;try{i=await fetch(e,{method:"POST",headers:{accept:"application/graphql-response+json, application/json;q=0.9","content-type":"application/json","sdk-version":"0.38.16",authorization:t?`Bearer ${t}`:""},body:JSON.stringify({query:n,variables:r})})}catch(aM){throw new eg(aM instanceof Error?aM.message:"Network request failed","network")}const o=(e=>{try{return JSON.parse(e)}catch{return}})(await i.text());if(!i.ok){const t=Em(i.status,o);throw t&&Tm({reason:t,url:e}),new eg(`Response not successful: Received status code ${i.status}`,"http",i.status)}const a=(e=>{const t=X(e)?e.errors:void 0;return Array.isArray(t)?t.map(e=>X(e)&&"string"==typeof e.message?e.message:"Unknown error"):[]})(o);if(a.length)throw new eg(a.join("\n"),"graphql",i.status);if(!X(o)||!X(o.data))throw new eg("The server answered without data","graphql",i.status);return o.data}}))(t.serverUrl,r),[t.serverUrl,r]),[b,v]=S(!(s&&l)),[w,x]=S(void 0),{components:T}=h(Wr),[C,E]=S(()=>m&&"json"===c?{...l,plugins:{}}:{plugins:{}}),A=f(async(e,t)=>{try{return{success:!0,result:await y.request(Ym[e],{environment:u,...t})}}catch(aM){return{success:!1,result:void 0,error:aM instanceof Error?aM:String(aM)}}},[y,u]),_=f(async(e,t,n=!0)=>{const r=Km[e];if(!r)return{success:!1,result:void 0,error:"Mutation Not Found"};try{return{success:!0,result:await y.request(r,n?{environment:u,...t}:t)}}catch(aM){return{success:!1,result:void 0,error:aM instanceof Error?aM:String(aM)}}},[y,u]),N=async()=>{let e=n;"number"==typeof n&&0!==n||(e=void 0);const t=await A("Init",{environment:u,revision:e});if(t.error)return v(!1),void x((e=>e instanceof eg?401===e.statusCode?"Access not authorized":"network"===e.failure?"Service not available":e.message:"string"==typeof e?e:e.message)(t.error));if(t.success&&t.result){const{Space:e}=mr(t.result);if(!e)return x(/* @__PURE__ */O("span",{children:["Space not found, publish to ",
44
44
  /* @__PURE__ */I("b",{children:u})," environment"]})),void v(!1);let n={};e.plugins.length>0&&(n=await Gm(e.plugins.filter(e=>!T.current[e.type]))),p("render.overQuota",e.render?.overQuota??!1),E({schema:{...cu,...Qm(e.schema)},plugins:n,style:e.style})}v(!1)};g(()=>{s&&l?m&&(async()=>{let e={};l?.plugins&&l.plugins.length>0&&(e=await Gm(l.plugins.filter(e=>!T.current[e.type]))),E(t=>({...t,plugins:e})),v(!1)})():(v(e=>e||!0),N())},[m,s&&c,r,u,d]);const M=k(()=>({query:A,mutate:_,webKey:r,webId:i,server:t,environment:u,instanceId:a,userKey:o}),[A,_,r,i,t,u,a,o]);return w?/* @__PURE__ */I("div",{children:w}):b?null:/* @__PURE__ */I(Kd,{value:M,children:/* @__PURE__ */I(Jm,{value:C,children:e})})},ng=({children:e,plugins:t,sdkStylePath:n="./plitzi-sdk.css",sdkIconsPath:r="./plitzi-sdk-icons.css"})=>{const{renderMode:i}=re(),[o,a]=S({}),s=h(Jm),l=k(()=>t||s.plugins,[t,s]),{components:c}=h(Wr),u=f((e,t,n="")=>t?pr(l,`${e}.settings.${t}`,n):pr(l,`${e}.settings`,{}),[l]),d=f((e=[])=>{const t=e.reduce((e,t)=>{let n="";return n="script"===t.type?t.params.src:t.params.href,n?(n=btoa(n),{...e,[n]:{...t,key:n}}):e},{});0!==Object.keys(t).length&&a(e=>({...e,...t}))},[]),p=f((e=[])=>{const t=e.filter(e=>!function(e){return null==e||"number"!=typeof e&&"boolean"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e&&("string"==typeof e||Array.isArray(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"==typeof e&&0===Object.keys(e).length)}(e)).map(e=>btoa(e));a(e=>vr(e,t))},[]),m=k(()=>(e=>Object.values(e).reduce((e,t)=>({...e,...pr(t,"assets",[]).filter(e=>"link"===e.type).reduce((e,t)=>({...e,[btoa(t.id)]:t}),{})}),{}))(l),[l]),g=k(()=>Object.keys(c.current).filter(e=>"local-custom"===c.current[e].origin).reduce((e,t)=>({...e,...pr(c,`${t}.assets`,[]).reduce((e,n,r)=>({...e,[`${t}-${r}`]:{type:"link",id:`${t}-${r}`,params:n}}),{})}),{}),[c.current]),y=k(()=>{const e={};return"iframe"!==i&&"shadow"!==i||(e["static-99"]={type:"link",id:"static-99",params:{type:"text/css",href:n,rel:"stylesheet"}},e["static-100"]={type:"link",id:"static-100",params:{type:"text/css",href:r,rel:"stylesheet"}}),{...e,...g,...m,...o}},[g,m,o,i,n,r]),b=k(()=>({assets:y,getSettings:u,plugins:l,registerCustomAssets:d,unregisterCustomAssets:p}),[y,u,l,d,p]),v=k(()=>Object.values({...m,...o}).map((e,t)=>/* @__PURE__ */I(e.type,{...e.params},t)),[m,o]);/* @__PURE__ */
45
45
  return O(A,{children:[/* @__PURE__ */I(Np,{children:("raw"===i||"widget"===i)&&v}),/* @__PURE__ */I(Li,{value:b,children:e})]})},rg=({children:e,schema:t})=>{const n=h(Jm),r=k(()=>({...cu,...t||n.schema}),[t,n.schema]);Ut("schema",r);const{flat:i,pages:o}=r,a=Rd(k(()=>fr(i,o),[i,o]));return Ut("pageDefinitions",a),e},ig=l({});ig.displayName="ContainerRootContext";var og=({className:e="",children:t,...n})=>{let r=x(null),i=f(()=>r.current instanceof HTMLElement?r.current.getRootNode():void 0,[r]),o=f(()=>i()instanceof ShadowRoot,[i]),a=k(()=>({getHost:i,rootRef:r,isRootShadow:o}),[i,r,o]);/* @__PURE__ */
46
46
  return I("div",{...n,ref:r,className:e,children:/* @__PURE__ */I(ig,{value:a,children:t})})},ag={desktop:1024,tablet:768,mobile:0},sg=e=>0===ag[e]?"0":`${String(ag[e]/16)}rem`,lg=e=>e<=ag.tablet?"mobile":e<=ag.desktop?"tablet":"desktop",cg="plitzi-sdk-runtime",ug=e=>e.links.filter(e=>"stylesheet"===e.rel).reduce((e,t,n)=>{let r=`font-${n}`;return{...e,[r]:{type:"link",id:r,params:{href:t.href,type:"text/css",rel:"stylesheet"}}}},{}),dg="https://fonts.googleapis.com",pg={woff2:"font/woff2",woff:"font/woff"},hg=e=>{try{let t=new URL(e);return"https:"===t.protocol&&!t.username&&!t.password}catch{return!1}},fg=e=>{try{return new URL(e).origin}catch{return}},mg={"<":"\\3c ",">":"\\3e "},gg=e=>`"${e.replace(/[\\"<>]/g,e=>mg[e]??`\\${e}`)}"`,yg=/^U\+[0-9A-Fa-f?]{1,6}(-[0-9A-Fa-f]{1,6})?(\s*,\s*U\+[0-9A-Fa-f?]{1,6}(-[0-9A-Fa-f]{1,6})?)*$/,bg=e=>encodeURIComponent(e).replace(/%20/g,"+"),vg=(e,t)=>["@font-face{",`font-family:${gg(e.family)};`,`font-style:${"italic"===t.style?"italic":"normal"};`,`font-weight:${Number.parseInt(String(t.weight),10)||400};`,`font-display:${e.display??"swap"};`,`src:url(${gg(t.url)}) format(${gg(t.format)});`,t.unicodeRange&&yg.test(t.unicodeRange)?`unicode-range:${t.unicodeRange};`:"","}"].join(""),wg="/*plitzi:style-cache*/",kg="/*plitzi:style-cache-end*/",xg=(e="theme")=>Xe({mode:"system",scheme:"light",areas:{}},{id:e}),Sg=xg(),Tg=(e,t)=>"system"===e?t:e,Cg=(e,t=Sg)=>{t.batch(()=>{t.setState("mode",e),t.setState("areas",{})})},Eg=(e,t=Sg)=>{t.setState("scheme",e)},Ag=K("ThemeScopeContext",void 0),Ig=K("ThemeStartContext",void 0),Og=e=>{let t=h(Ig),n=k(()=>void 0===t?void 0:(e=>({mode:"system",scheme:"light",areas:{},mode:e}))(t),[t]);return T(e.subscribe,e.getState,()=>n??e.getState())},_g="canvas",Ng=e=>{let t=h(Ag)??Sg,n=Og(t),r=((e,t)=>(t?e.areas[t]:void 0)??e.mode)(n,e),i=Tg(r,n.scheme),o=f(n=>e?((e,t,n=Sg)=>{n.setState(`areas.${e}`,t)})(e,n,t):Cg(n,t),[e,t]),a=f(()=>o("dark"===i?"light":"dark"),[i,o]);return k(()=>({theme:r,resolvedTheme:i,setTheme:o,toggleTheme:a}),[r,i,o,a])},Mg=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/,Pg=/^rgba?\(\s*(\d{1,3}%?\s*,\s*){2,3}\d{1,3}%?\s*\)$/,Lg=/^hsla?\(\s*\d{1,3}(deg|rad|turn)?\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(\s*,\s*(0|0?\.\d+|1))?\s*\)$/,Rg=/* @__PURE__ */new Set(["black","white","red","green","blue","yellow","cyan","magenta","orange","purple","brown","pink","gray","lime","teal","navy","silver","maroon","olive","aqua","fuchsia"]),jg=({children:e,contentDidMount:t,contentDidDismount:n})=>(g(()=>(t?.(),()=>{n?.()}),[]),e),zg=({ref:e,className:t="",ssrMode:r=!1,id:i="",css:o="",style:a,zoom:s=1,assets:l,viewport:c="width=device-width, initial-scale=1",children:u,contentDidMount:d,contentDidDismount:p,contentDidUpdate:h,onLoad:m})=>{t=Ll("ContainerFrame",{className:t,componentKey:"root"});let y=x(null);v(e,()=>y.current,[y]);let[b,w]=S(!1),[k,T]=S(null),C=f((e,t,n)=>{let r=[...t.childNodes],i=n.getElementById("customStyle");Object.values(e).forEach(e=>{let o=n.createElement(e.type);e.id&&o.setAttribute("data-id",e.id),Object.keys(e.params).forEach(t=>{("link"===e.type||"script"===e.type)&&o.setAttribute(t,e.params[t])}),r.find(t=>"link"===e.type&&t.href===o.href||"script"===e.type&&t.src===o.src)||(t.insertBefore(o,i),r.push(o))})},[]),E=f((e,t)=>{let{head:n}=e,r=n.querySelectorAll('*:not([asset-static="true"])');Object.values(r).forEach(e=>{n.removeChild(e)}),t&&C(t,n,e)},[C]),[N]=S(()=>(e=>{if(!e)return"";let t=[];return Object.values(e).forEach(e=>{t.push(`<${e.type} ${Object.keys(e.params).map(t=>`${t}="${e.params[t]}"`).join(" ")}>`)}),t.join("")})(l)),M=f(()=>d?.(),[d]);g(()=>{b&&k&&E(k,l)},[b,l,k,E]);let P=f(()=>{let e=y.current&&k,t=y.current?.contentDocument===k;!e||t?b||(m?.(y.current),w(!0),T(y.current?.contentDocument)):T(y.current?.contentDocument)},[b,k,m]);return g(()=>{k&&(k.body.style.zoom=1===s?"":`${s}`)},[k,s]),/* @__PURE__ */O("iframe",{ref:y,className:t,title:"#",srcDoc:`<!DOCTYPE html><html><head>${N}</head><body></body></html>`,id:i,onLoad:P,style:a,children:[b&&k&&_(/* @__PURE__ */O(A,{children:[
@@ -57,7 +57,7 @@ return O(Gd,{ref:e,tag:i?r:"div",className:V("plitzi-component__heading",{[`plit
57
57
  return I(Gd,{tag:"a",...E,onClick:e=>{if(!m)return;e.stopPropagation();let t="self"!==i||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button;("page"===o||"internal"===o)&&!t&&(e.preventDefault(),w(T))},children:/* @__PURE__ */I(iy,{content:l,icon:u,iconPlacement:d,iconClassName:f.icon,contentPlacement:c,children:t})})}),wy=Object.assign(vy,Xi),ky=e=>"text"===e.type?e.value??"":(e.children??[]).map(ky).join("");function xy(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function Sy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ty(e){return function(e){if(Array.isArray(e))return Sy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Sy(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sy(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cy(e){return Cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cy(e)}function Ey(e,t,n){return(t=function(e){var t=function(e){if("object"!=Cy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Cy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cy(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ay.apply(null,arguments)}function Iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iy(Object(n),!0).forEach(function(t){Ey(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _y={};function Ny(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return function(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return _y[r]||(_y[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),_y[r]}(e.filter(function(e){return"token"!==e})).reduce(function(e,t){return Oy(Oy({},e),n[t])},t)}function My(e){return e.join(" ")}function Py(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,a=e.useInlineStyles,s=e.key,l=n.properties,c=n.type,u=n.tagName,d=n.value;if("text"===c)return d;if(u){var p,h=function(e,t){var n=0;return function(r){return n+=1,r.map(function(r,i){return Py({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})})}}(r,a);if(a){var f=Object.keys(r).reduce(function(e,t){return t.split(".").forEach(function(t){e.includes(t)||e.push(t)}),e},[]),m=l.className&&l.className.includes("token")?["token"]:[],g=l.className&&m.concat(l.className.filter(function(e){return!f.includes(e)}));p=Oy(Oy({},l),{},{className:My(g)||void 0,style:Ny(l.className,Object.assign({},l.style,o),r)})}else p=Oy(Oy({},l),{},{className:My(l.className)});var y=h(n.children);/*#__PURE__*/
58
58
  return t.createElement(u,Ay({key:s},p),y)}}var Ly=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ry(Object(n),!0).forEach(function(t){Ey(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ry(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var zy=/\n/g;function Dy(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,a=e.numberStyle,s=void 0===a?{}:a,l=e.startingLineNumber;/*#__PURE__*/
59
59
  return t.createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.startingLineNumber,r=e.style;return e.lines.map(function(e,i){var o=i+n;/*#__PURE__*/
60
- return t.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(o):r},"".concat(o,"\n"))})}({lines:n.replace(/\n$/,"").split("\n"),style:s,startingLineNumber:l}))}function $y(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Fy(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return jy(jy({},i),o)}function qy(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,a=e.lineProps,s=void 0===a?{}:a,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,p=e.wrapLines,h=void 0!==p&&p?jy({},"function"==typeof s?s(n):s):{};if(h.className=h.className?[].concat(Ty(h.className.trim().split(/\s+/)),Ty(c)):c,n&&o){var f=Fy(r,n,i);t.unshift($y(n,f))}return d&u&&(h.style=jy({display:"flex"},h.style)),{type:"element",tagName:"span",properties:h,children:t}}function By(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++){var i=e[r];if("text"===i.type)n.push(qy({children:[i],className:Ty(new Set(t))}));else if(i.children){var o,a=t.concat((null===(o=i.properties)||void 0===o?void 0:o.className)||[]);By(i.children,a).forEach(function(e){return n.push(e)})}}return n}function Uy(e,t,n,r,i,o,a,s,l){var c,u=By(e.value),d=[],p=-1,h=0;function f(e,o){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||c.length>0?function(e,o){return qy({children:e,lineNumber:o,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],showLineNumbers:r,wrapLongLines:l,wrapLines:t})}(e,o,c):function(e,t){if(r&&t&&i){var n=Fy(s,t,a);e.unshift($y(t,n))}return e}(e,o)}for(var m=function(){var e=u[h],t=e.children[0].value;if(t.match(zy)){var n=t.split("\n");n.forEach(function(t,i){var a=r&&d.length+o,s={type:"text",value:"".concat(t,"\n")};if(0===i){var l=f(u.slice(p+1,h).concat(qy({children:[s],className:e.properties.className})),a);d.push(l)}else if(i===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],m={type:"text",value:"".concat(t)};if(c){var g=qy({children:[m],className:e.properties.className});u.splice(h+1,0,g)}else{var y=f([m],a,e.properties.className);d.push(y)}}else{var b=f([s],a,e.properties.className);d.push(b)}}),p=h}h++};h<u.length;)m();if(p!==u.length-1){var g=u.slice(p+1,u.length);if(g&&g.length){var y=f(g,r&&d.length+o);d.push(y)}}return t?d:(c=[]).concat.apply(c,d)}function Hy(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(e,t){return Py({node:e,stylesheet:n,useInlineStyles:r,key:"code-segment-".concat(t)})})}function Wy(e){return e&&void 0!==e.highlightAuto}var Vy=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};function Gy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Vy(n,r,t)}function Ky(e){return e.toLowerCase()}Vy.prototype.normal={},Vy.prototype.property={},Vy.prototype.space=void 0;var Yy=class{constructor(e,t){this.attribute=t,this.property=e}};Yy.prototype.attribute="",Yy.prototype.booleanish=!1,Yy.prototype.boolean=!1,Yy.prototype.commaOrSpaceSeparated=!1,Yy.prototype.commaSeparated=!1,Yy.prototype.defined=!1,Yy.prototype.mustUseProperty=!1,Yy.prototype.number=!1,Yy.prototype.overloadedBoolean=!1,Yy.prototype.property="",Yy.prototype.spaceSeparated=!1,Yy.prototype.space=void 0;var Jy=/* @__PURE__ */$({boolean:()=>Zy,booleanish:()=>Qy,commaOrSpaceSeparated:()=>ib,commaSeparated:()=>rb,number:()=>tb,overloadedBoolean:()=>eb,spaceSeparated:()=>nb}),Xy=0,Zy=ob(),Qy=ob(),eb=ob(),tb=ob(),nb=ob(),rb=ob(),ib=ob();function ob(){return 2**++Xy}var ab=Object.keys(Jy),sb=class extends Yy{constructor(e,t,n,r){let i=-1;if(super(e,t),lb(this,"space",r),"number"==typeof n)for(;++i<ab.length;){const e=ab[i];lb(this,ab[i],(n&Jy[e])===Jy[e])}}};function lb(e,t,n){n&&(e[t]=n)}function cb(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new sb(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ky(r)]=r,n[Ky(o.attribute)]=r}return new Vy(t,n,e.space)}sb.prototype.defined=!0;var ub=cb({properties:{ariaActiveDescendant:null,ariaAtomic:Qy,ariaAutoComplete:null,ariaBusy:Qy,ariaChecked:Qy,ariaColCount:tb,ariaColIndex:tb,ariaColSpan:tb,ariaControls:nb,ariaCurrent:null,ariaDescribedBy:nb,ariaDetails:null,ariaDisabled:Qy,ariaDropEffect:nb,ariaErrorMessage:null,ariaExpanded:Qy,ariaFlowTo:nb,ariaGrabbed:Qy,ariaHasPopup:null,ariaHidden:Qy,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nb,ariaLevel:tb,ariaLive:null,ariaModal:Qy,ariaMultiLine:Qy,ariaMultiSelectable:Qy,ariaOrientation:null,ariaOwns:nb,ariaPlaceholder:null,ariaPosInSet:tb,ariaPressed:Qy,ariaReadOnly:Qy,ariaRelevant:null,ariaRequired:Qy,ariaRoleDescription:nb,ariaRowCount:tb,ariaRowIndex:tb,ariaRowSpan:tb,ariaSelected:Qy,ariaSetSize:tb,ariaSort:null,ariaValueMax:tb,ariaValueMin:tb,ariaValueNow:tb,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function db(e,t){return t in e?e[t]:t}function pb(e,t){return db(e,t.toLowerCase())}var hb=cb({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rb,acceptCharset:nb,accessKey:nb,action:null,allow:null,allowFullScreen:Zy,allowPaymentRequest:Zy,allowUserMedia:Zy,alpha:Zy,alt:null,as:null,async:Zy,autoCapitalize:null,autoComplete:nb,autoFocus:Zy,autoPlay:Zy,blocking:nb,capture:null,charSet:null,checked:Zy,cite:null,className:nb,closedBy:null,colorSpace:null,cols:tb,colSpan:tb,command:null,commandFor:null,content:null,contentEditable:Qy,controls:Zy,controlsList:nb,coords:tb|rb,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Zy,defer:Zy,dir:null,dirName:null,disabled:Zy,download:eb,draggable:Qy,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Zy,formTarget:null,headers:nb,height:tb,hidden:eb,high:tb,href:null,hrefLang:null,htmlFor:nb,httpEquiv:nb,id:null,imageSizes:null,imageSrcSet:null,inert:Zy,inputMode:null,integrity:null,is:null,isMap:Zy,itemId:null,itemProp:nb,itemRef:nb,itemScope:Zy,itemType:nb,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Zy,low:tb,manifest:null,max:null,maxLength:tb,media:null,method:null,min:null,minLength:tb,multiple:Zy,muted:Zy,name:null,nonce:null,noModule:Zy,noValidate:Zy,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Zy,optimum:tb,pattern:null,ping:nb,placeholder:null,playsInline:Zy,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Zy,referrerPolicy:null,rel:nb,required:Zy,reversed:Zy,rows:tb,rowSpan:tb,sandbox:nb,scope:null,scoped:Zy,seamless:Zy,selected:Zy,shadowRootClonable:Zy,shadowRootCustomElementRegistry:Zy,shadowRootDelegatesFocus:Zy,shadowRootMode:null,shadowRootSerializable:Zy,shape:null,size:tb,sizes:null,slot:null,span:tb,spellCheck:Qy,src:null,srcDoc:null,srcLang:null,srcSet:null,start:tb,step:null,style:null,tabIndex:tb,target:null,title:null,translate:null,type:null,typeMustMatch:Zy,useMap:null,value:Qy,width:tb,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nb,axis:null,background:null,bgColor:null,border:tb,borderColor:null,bottomMargin:tb,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Zy,declare:Zy,event:null,face:null,frame:null,frameBorder:null,hSpace:tb,leftMargin:tb,link:null,longDesc:null,lowSrc:null,marginHeight:tb,marginWidth:tb,noResize:Zy,noHref:Zy,noShade:Zy,noWrap:Zy,object:null,profile:null,prompt:null,rev:null,rightMargin:tb,rules:null,scheme:null,scrolling:Qy,standby:null,summary:null,text:null,topMargin:tb,valueType:null,version:null,vAlign:null,vLink:null,vSpace:tb,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Zy,disablePictureInPicture:Zy,disableRemotePlayback:Zy,exportParts:rb,part:nb,prefix:null,property:null,results:tb,security:null,unselectable:null},space:"html",transform:pb}),fb=cb({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ib,accentHeight:tb,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:tb,amplitude:tb,arabicForm:null,ascent:tb,attributeName:null,attributeType:null,azimuth:tb,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:tb,by:null,calcMode:null,capHeight:tb,className:nb,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:tb,diffuseConstant:tb,direction:null,display:null,dur:null,divisor:tb,dominantBaseline:null,download:Zy,dx:null,dy:null,edgeMode:null,editable:null,elevation:tb,enableBackground:null,end:null,event:null,exponent:tb,externalResourcesRequired:null,fill:null,fillOpacity:tb,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rb,g2:rb,glyphName:rb,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:tb,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:tb,horizOriginX:tb,horizOriginY:tb,id:null,ideographic:tb,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:tb,k:tb,k1:tb,k2:tb,k3:tb,k4:tb,kernelMatrix:ib,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:tb,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:tb,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:tb,overlineThickness:tb,paintOrder:null,panose1:null,path:null,pathLength:tb,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nb,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:tb,pointsAtY:tb,pointsAtZ:tb,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ib,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ib,rev:ib,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ib,requiredFeatures:ib,requiredFonts:ib,requiredFormats:ib,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:tb,specularExponent:tb,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:tb,strikethroughThickness:tb,string:null,stroke:null,strokeDashArray:ib,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:tb,strokeOpacity:tb,strokeWidth:null,style:null,surfaceScale:tb,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ib,tabIndex:tb,tableValues:null,target:null,targetX:tb,targetY:tb,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ib,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:tb,underlineThickness:tb,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:tb,values:null,vAlphabetic:tb,vMathematical:tb,vectorEffect:null,vHanging:tb,vIdeographic:tb,version:null,vertAdvY:tb,vertOriginX:tb,vertOriginY:tb,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:tb,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:db}),mb=cb({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),gb=cb({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pb}),yb=cb({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),bb={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},vb=/[A-Z]/g,wb=/-[a-z]/g,kb=/^data[-\w.:]+$/i;function xb(e,t){const n=Ky(t);let r=t,i=Yy;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&kb.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(wb,Tb);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!wb.test(e)){let n=e.replace(vb,Sb);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=sb}return new i(r,t)}function Sb(e){return"-"+e.toLowerCase()}function Tb(e){return e.charAt(1).toUpperCase()}var Cb=Gy([ub,hb,mb,gb,yb],"html"),Eb=Gy([ub,fb,mb,gb,yb],"svg");function Ab(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){-1===r&&(r=n.length,o=!0);const e=n.slice(i,r).trim();!e&&o||t.push(e),i=r+1,r=n.indexOf(",",i)}return t}var Ib=/[#.]/g;function Ob(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function _b(e,t,n){const r=n?function(e){const t=/* @__PURE__ */new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}(n):void 0;return function(n,i,...o){let a;if(null==n){a={type:"root",children:[]};const e=i;o.unshift(e)}else{a=function(e,t){const n=e||"",r={};let i,o,a=0;for(;a<n.length;){Ib.lastIndex=a;const e=Ib.exec(n),t=n.slice(a,e?e.index:n.length);t&&(i?"#"===i?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,a+=t.length),e&&(i=e[0],a++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}(n,t);const s=a.tagName.toLowerCase(),l=r?r.get(s):void 0;if(a.tagName=l||s,function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!0;if("string"!=typeof e.type)return!1;const t=e,n=Object.keys(e);for(const r of n){const e=t[r];if(e&&"object"==typeof e){if(!Array.isArray(e))return!0;const t=e;for(const e of t)if("number"!=typeof e&&"string"!=typeof e)return!0}}return!(!("children"in e)||!Array.isArray(e.children))}(i))o.unshift(i);else for(const[t,n]of Object.entries(i))Nb(e,a.properties,t,n)}for(const e of o)Mb(a.children,e);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function Nb(e,t,n,r){const i=xb(e,n);let o;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;o=r}else o="boolean"==typeof r?r:"string"==typeof r?i.spaceSeparated?Ob(r):i.commaSeparated?Ab(r):i.commaOrSpaceSeparated?Ob(Ab(r).join(" ")):Pb(i,i.property,r):Array.isArray(r)?[...r]:"style"===i.property?function(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}(r):String(r);if(Array.isArray(o)){const e=[];for(const t of o)e.push(Pb(i,i.property,t));o=e}"className"===i.property&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[i.property]=o}}function Mb(e,t){if(null==t);else if("number"==typeof t||"string"==typeof t)e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Mb(e,n);else{if("object"!=typeof t||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");"root"===t.type?Mb(e,t.children):e.push(t)}}function Pb(e,t,n){if("string"==typeof n){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(""===n||Ky(n)===Ky(t)))return!0}return n}var Lb=_b(Cb,"div"),Rb=(_b(Eb,"g",["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]),["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"]),jb={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function zb(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}function Db(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function $b(e){return function(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||zb(e)}var Fb={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},qb={}.hasOwnProperty;function Bb(e){return!!qb.call(Fb,e)&&Fb[e]}var Ub=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Hb(e,t){const n=t||{},r="string"==typeof n.additional?n.additional.charCodeAt(0):n.additional,i=[];let o,a,s=0,l=-1,c="";n.position&&("start"in n.position||"indent"in n.position?(a=n.position.indent,o=n.position.start):o=n.position);let u,d=(o?o.line:0)||1,p=(o?o.column:0)||1,h=f();for(s--;++s<=e.length;)if(10===u&&(p=(a?a[l]:0)||1),u=e.charCodeAt(s),38===u){const t=e.charCodeAt(s+1);if(9===t||10===t||12===t||32===t||38===t||60===t||Number.isNaN(t)||r&&t===r){c+=String.fromCharCode(u),p++;continue}const o=s+1;let a,l=o,d=o;if(35===t){d=++l;const t=e.charCodeAt(d);88===t||120===t?(a="hexadecimal",d=++l):a="decimal"}else a="named";let y="",b="",v="";const w="named"===a?$b:"decimal"===a?zb:Db;for(d--;++d<=e.length;){const t=e.charCodeAt(d);if(!w(t))break;v+=String.fromCharCode(t),"named"===a&&Rb.includes(v)&&(y=v,b=Bb(v))}let k=59===e.charCodeAt(d);if(k){d++;const e="named"===a&&Bb(v);e&&(y=v,b=e)}let x=1+d-o,S="";if(k||!1!==n.nonTerminated)if(v)if("named"===a){if(k&&!b)m(5,1);else if(y!==v&&(d=l+y.length,x=1+d-l,k=!1),!k){const t=y?1:3;if(n.attribute){const n=e.charCodeAt(d);61===n?(m(t,x),b=""):$b(n)?b="":m(t,x)}else m(t,x)}S=b}else{k||m(2,x);let e=Number.parseInt(v,"hexadecimal"===a?16:10);if(Wb(e))m(7,x),S=String.fromCharCode(65533);else if(e in jb)m(6,x),S=jb[e];else{let t="";Vb(e)&&m(6,x),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|1023&e),S=t+String.fromCharCode(e)}}else"named"!==a&&m(4,x);if(S){g(),h=f(),s=d-1,p+=d-o+1,i.push(S);const t=f();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,S,{start:h,end:t},e.slice(o-1,d)),h=t}else v=e.slice(o-1,d),c+=v,p+=v.length,s=d-1}else 10===u&&(d++,l++,p=0),Number.isNaN(u)?g():(c+=String.fromCharCode(u),p++);return i.join("");function f(){return{line:d,column:p,offset:s+((o?o.offset:0)||0)}}function m(e,t){let r;n.warning&&(r=f(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Ub[e],r,e))}function g(){c&&(i.push(c),n.text&&n.text.call(n.textContext||void 0,c,{start:h,end:f()}),c="")}}function Wb(e){return e>=55296&&e<=57343||e>1114111}function Vb(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||!(65535&~e)||65534==(65535&e)}var Gb=0,Kb={},Yb={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Gb}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},Yb.util.type(t)){case"Object":if(i=Yb.util.objId(t),n[i])return n[i];for(var o in r={},n[i]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case"Array":return i=Yb.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:Kb,plaintext:Kb,text:Kb,txt:Kb,extend:function(e,t){var n=Yb.util.clone(Yb.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||Yb.languages)[e],o={};for(var a in i)if(i.hasOwnProperty(a)){if(a==t)for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);n.hasOwnProperty(a)||(o[a]=i[a])}var l=r[e];return r[e]=o,Yb.languages.DFS(Yb.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,i){i=i||{};var o=Yb.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var s=t[a],l=Yb.util.type(s);"Object"!==l||i[o(s)]?"Array"!==l||i[o(s)]||(i[o(s)]=!0,e(s,n,a,i)):(i[o(s)]=!0,e(s,n,null,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Yb.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Yb.tokenize(r.code,r.grammar),Yb.hooks.run("after-tokenize",r),Jb.stringify(Yb.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new Qb;return ev(i,i.head,e),Zb(e,i,t,i.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=Yb.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Yb.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:Jb};function Jb(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function Xb(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function Zb(e,t,n,r,i,o){for(var a in n)if(n.hasOwnProperty(a)&&n[a]){var s=n[a];s=Array.isArray(s)?s:[s];for(var l=0;l<s.length;++l){if(o&&o.cause==a+","+l)return;var c=s[l],u=c.inside,d=!!c.lookbehind,p=!!c.greedy,h=c.alias;if(p&&!c.pattern.global){var f=c.pattern.toString().match(/[imsuy]*$/)[0];c.pattern=RegExp(c.pattern.source,f+"g")}for(var m=c.pattern||c,g=r.next,y=i;g!==t.tail&&!(o&&y>=o.reach);y+=g.value.length,g=g.next){var b=g.value;if(t.length>e.length)return;if(!(b instanceof Jb)){var v,w=1;if(p){if(!(v=Xb(m,y,e,d))||v.index>=e.length)break;var k=v.index,x=v.index+v[0].length,S=y;for(S+=g.value.length;k>=S;)S+=(g=g.next).value.length;if(y=S-=g.value.length,g.value instanceof Jb)continue;for(var T=g;T!==t.tail&&(S<x||"string"==typeof T.value);T=T.next)w++,S+=T.value.length;w--,b=e.slice(y,S),v.index-=y}else if(!(v=Xb(m,0,b,d)))continue;k=v.index;var C=v[0],E=b.slice(0,k),A=b.slice(k+C.length),I=y+b.length;o&&I>o.reach&&(o.reach=I);var O=g.prev;if(E&&(O=ev(t,O,E),y+=E.length),tv(t,O,w),g=ev(t,O,new Jb(a,u?Yb.tokenize(C,u):C,h,C)),A&&ev(t,g,A),w>1){var _={cause:a+","+l,reach:I};Zb(e,t,n,g.prev,y,_),o&&_.reach>o.reach&&(o.reach=_.reach)}}}}}}function Qb(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function ev(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function tv(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}var nv=Yb;function rv(){}rv.prototype=nv;var iv=new rv;iv.highlight=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&"object"==typeof t)n=t;else{if(r=t,"string"!=typeof r)throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(!Object.hasOwn(iv.languages,r))throw new Error("Unknown language: `"+r+"` is not registered");n=iv.languages[r]}return{type:"root",children:nv.highlight.call(iv,e,n,r)}},iv.register=function(e){if("function"!=typeof e||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(iv.languages,e.displayName)||e(iv)},iv.alias=function(e,t){const n=iv.languages;let r,i={};for(r in"string"==typeof e?t&&(i[e]=t):i=e,i)if(Object.hasOwn(i,r)){const e=i[r],t="string"==typeof e?[e]:e;let o=-1;for(;++o<t.length;)n[t[o]]=n[r]}},iv.registered=function(e){if("string"!=typeof e)throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(iv.languages,e)},iv.listLanguages=function(){const e=iv.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&"object"==typeof e[n]&&t.push(n);return t},iv.util.encode=function(e){return e},iv.Token.stringify=function e(t,n){if("string"==typeof t)return{type:"text",value:t};if(Array.isArray(t)){const r=[];let i=-1;for(;++i<t.length;)null!==t[i]&&void 0!==t[i]&&""!==t[i]&&r.push(e(t[i],n));return r}const r={attributes:{},classes:["token",t.type],content:e(t.content,n),language:n,tag:"span",type:t.type};return t.alias&&r.classes.push(..."string"==typeof t.alias?[t.alias]:t.alias),iv.hooks.run("wrap",r),Lb(r.tag+"."+r.classes.join("."),function(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=Hb(e[t]));return e}(r.attributes),r.content)};var ov,av,sv=(ov=iv,av={},function(e){var n,r,i=e.language,o=e.children,a=e.style,s=void 0===a?av:a,l=e.customStyle,c=void 0===l?{}:l,u=e.codeTagProps,d=void 0===u?{className:i?"language-".concat(i):void 0,style:jy(jy({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:u,p=e.useInlineStyles,h=void 0===p||p,f=e.showLineNumbers,m=void 0!==f&&f,g=e.showInlineLineNumbers,y=void 0===g||g,b=e.startingLineNumber,v=void 0===b?1:b,w=e.lineNumberContainerStyle,k=e.lineNumberStyle,x=void 0===k?{}:k,S=e.wrapLines,T=e.wrapLongLines,C=void 0!==T&&T,E=e.lineProps,A=void 0===E?{}:E,I=e.renderer,O=e.PreTag,_=void 0===O?"pre":O,N=e.CodeTag,M=void 0===N?"code":N,P=e.code,L=void 0===P?(Array.isArray(o)?o[0]:o)||"":P,R=e.astGenerator,j=function(e,t){if(null==e)return{};var n,r,i=xy(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Ly);R=R||ov;var z=m?/*#__PURE__*/t.createElement(Dy,{containerStyle:w,codeStyle:d.style||{},numberStyle:x,startingLineNumber:v,codeString:L}):null,D=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},$=Wy(R)?"hljs":"prismjs",F=h?Object.assign({},j,{style:Object.assign({},D,c)}):Object.assign({},j,{className:j.className?"".concat($," ").concat(j.className):$,style:Object.assign({},c)});if(d.style=jy(C?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"},d.style),!R)/*#__PURE__*/return t.createElement(_,F,z,/*#__PURE__*/t.createElement(M,d,L));(void 0===S&&I||C)&&(S=!0),I=I||Hy;var q=[{type:"text",value:L}],B=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(Wy(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(XN){return{value:i}}}({astGenerator:R,language:i,code:L,defaultCodeValue:q});null===B.language&&(B.value=q);var U=Uy(B,S,A,m,y,v,v+(null!==(n=null===(r=L.match(/\n/g))||void 0===r?void 0:r.length)&&void 0!==n?n:0),x,C);/*#__PURE__*/
60
+ return t.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(o):r},"".concat(o,"\n"))})}({lines:n.replace(/\n$/,"").split("\n"),style:s,startingLineNumber:l}))}function $y(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Fy(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return jy(jy({},i),o)}function qy(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,a=e.lineProps,s=void 0===a?{}:a,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,p=e.wrapLines,h=void 0!==p&&p?jy({},"function"==typeof s?s(n):s):{};if(h.className=h.className?[].concat(Ty(h.className.trim().split(/\s+/)),Ty(c)):c,n&&o){var f=Fy(r,n,i);t.unshift($y(n,f))}return d&u&&(h.style=jy({display:"flex"},h.style)),{type:"element",tagName:"span",properties:h,children:t}}function By(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++){var i=e[r];if("text"===i.type)n.push(qy({children:[i],className:Ty(new Set(t))}));else if(i.children){var o,a=t.concat((null===(o=i.properties)||void 0===o?void 0:o.className)||[]);By(i.children,a).forEach(function(e){return n.push(e)})}}return n}function Uy(e,t,n,r,i,o,a,s,l){var c,u=By(e.value),d=[],p=-1,h=0;function f(e,o){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||c.length>0?function(e,o){return qy({children:e,lineNumber:o,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],showLineNumbers:r,wrapLongLines:l,wrapLines:t})}(e,o,c):function(e,t){if(r&&t&&i){var n=Fy(s,t,a);e.unshift($y(t,n))}return e}(e,o)}for(var m=function(){var e=u[h],t=e.children[0].value;if(t.match(zy)){var n=t.split("\n");n.forEach(function(t,i){var a=r&&d.length+o,s={type:"text",value:"".concat(t,"\n")};if(0===i){var l=f(u.slice(p+1,h).concat(qy({children:[s],className:e.properties.className})),a);d.push(l)}else if(i===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],m={type:"text",value:"".concat(t)};if(c){var g=qy({children:[m],className:e.properties.className});u.splice(h+1,0,g)}else{var y=f([m],a,e.properties.className);d.push(y)}}else{var b=f([s],a,e.properties.className);d.push(b)}}),p=h}h++};h<u.length;)m();if(p!==u.length-1){var g=u.slice(p+1,u.length);if(g&&g.length){var y=f(g,r&&d.length+o);d.push(y)}}return t?d:(c=[]).concat.apply(c,d)}function Hy(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(e,t){return Py({node:e,stylesheet:n,useInlineStyles:r,key:"code-segment-".concat(t)})})}function Wy(e){return e&&void 0!==e.highlightAuto}var Vy=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};function Gy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Vy(n,r,t)}function Ky(e){return e.toLowerCase()}Vy.prototype.normal={},Vy.prototype.property={},Vy.prototype.space=void 0;var Yy=class{constructor(e,t){this.attribute=t,this.property=e}};Yy.prototype.attribute="",Yy.prototype.booleanish=!1,Yy.prototype.boolean=!1,Yy.prototype.commaOrSpaceSeparated=!1,Yy.prototype.commaSeparated=!1,Yy.prototype.defined=!1,Yy.prototype.mustUseProperty=!1,Yy.prototype.number=!1,Yy.prototype.overloadedBoolean=!1,Yy.prototype.property="",Yy.prototype.spaceSeparated=!1,Yy.prototype.space=void 0;var Jy=/* @__PURE__ */$({boolean:()=>Zy,booleanish:()=>Qy,commaOrSpaceSeparated:()=>ib,commaSeparated:()=>rb,number:()=>tb,overloadedBoolean:()=>eb,spaceSeparated:()=>nb}),Xy=0,Zy=ob(),Qy=ob(),eb=ob(),tb=ob(),nb=ob(),rb=ob(),ib=ob();function ob(){return 2**++Xy}var ab=Object.keys(Jy),sb=class extends Yy{constructor(e,t,n,r){let i=-1;if(super(e,t),lb(this,"space",r),"number"==typeof n)for(;++i<ab.length;){const e=ab[i];lb(this,ab[i],(n&Jy[e])===Jy[e])}}};function lb(e,t,n){n&&(e[t]=n)}function cb(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new sb(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ky(r)]=r,n[Ky(o.attribute)]=r}return new Vy(t,n,e.space)}sb.prototype.defined=!0;var ub=cb({properties:{ariaActiveDescendant:null,ariaAtomic:Qy,ariaAutoComplete:null,ariaBusy:Qy,ariaChecked:Qy,ariaColCount:tb,ariaColIndex:tb,ariaColSpan:tb,ariaControls:nb,ariaCurrent:null,ariaDescribedBy:nb,ariaDetails:null,ariaDisabled:Qy,ariaDropEffect:nb,ariaErrorMessage:null,ariaExpanded:Qy,ariaFlowTo:nb,ariaGrabbed:Qy,ariaHasPopup:null,ariaHidden:Qy,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nb,ariaLevel:tb,ariaLive:null,ariaModal:Qy,ariaMultiLine:Qy,ariaMultiSelectable:Qy,ariaOrientation:null,ariaOwns:nb,ariaPlaceholder:null,ariaPosInSet:tb,ariaPressed:Qy,ariaReadOnly:Qy,ariaRelevant:null,ariaRequired:Qy,ariaRoleDescription:nb,ariaRowCount:tb,ariaRowIndex:tb,ariaRowSpan:tb,ariaSelected:Qy,ariaSetSize:tb,ariaSort:null,ariaValueMax:tb,ariaValueMin:tb,ariaValueNow:tb,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function db(e,t){return t in e?e[t]:t}function pb(e,t){return db(e,t.toLowerCase())}var hb=cb({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rb,acceptCharset:nb,accessKey:nb,action:null,allow:null,allowFullScreen:Zy,allowPaymentRequest:Zy,allowUserMedia:Zy,alpha:Zy,alt:null,as:null,async:Zy,autoCapitalize:null,autoComplete:nb,autoFocus:Zy,autoPlay:Zy,blocking:nb,capture:null,charSet:null,checked:Zy,cite:null,className:nb,closedBy:null,colorSpace:null,cols:tb,colSpan:tb,command:null,commandFor:null,content:null,contentEditable:Qy,controls:Zy,controlsList:nb,coords:tb|rb,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Zy,defer:Zy,dir:null,dirName:null,disabled:Zy,download:eb,draggable:Qy,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Zy,formTarget:null,headers:nb,height:tb,hidden:eb,high:tb,href:null,hrefLang:null,htmlFor:nb,httpEquiv:nb,id:null,imageSizes:null,imageSrcSet:null,inert:Zy,inputMode:null,integrity:null,is:null,isMap:Zy,itemId:null,itemProp:nb,itemRef:nb,itemScope:Zy,itemType:nb,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Zy,low:tb,manifest:null,max:null,maxLength:tb,media:null,method:null,min:null,minLength:tb,multiple:Zy,muted:Zy,name:null,nonce:null,noModule:Zy,noValidate:Zy,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Zy,optimum:tb,pattern:null,ping:nb,placeholder:null,playsInline:Zy,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Zy,referrerPolicy:null,rel:nb,required:Zy,reversed:Zy,rows:tb,rowSpan:tb,sandbox:nb,scope:null,scoped:Zy,seamless:Zy,selected:Zy,shadowRootClonable:Zy,shadowRootCustomElementRegistry:Zy,shadowRootDelegatesFocus:Zy,shadowRootMode:null,shadowRootSerializable:Zy,shape:null,size:tb,sizes:null,slot:null,span:tb,spellCheck:Qy,src:null,srcDoc:null,srcLang:null,srcSet:null,start:tb,step:null,style:null,tabIndex:tb,target:null,title:null,translate:null,type:null,typeMustMatch:Zy,useMap:null,value:Qy,width:tb,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nb,axis:null,background:null,bgColor:null,border:tb,borderColor:null,bottomMargin:tb,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Zy,declare:Zy,event:null,face:null,frame:null,frameBorder:null,hSpace:tb,leftMargin:tb,link:null,longDesc:null,lowSrc:null,marginHeight:tb,marginWidth:tb,noResize:Zy,noHref:Zy,noShade:Zy,noWrap:Zy,object:null,profile:null,prompt:null,rev:null,rightMargin:tb,rules:null,scheme:null,scrolling:Qy,standby:null,summary:null,text:null,topMargin:tb,valueType:null,version:null,vAlign:null,vLink:null,vSpace:tb,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Zy,disablePictureInPicture:Zy,disableRemotePlayback:Zy,exportParts:rb,part:nb,prefix:null,property:null,results:tb,security:null,unselectable:null},space:"html",transform:pb}),fb=cb({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ib,accentHeight:tb,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:tb,amplitude:tb,arabicForm:null,ascent:tb,attributeName:null,attributeType:null,azimuth:tb,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:tb,by:null,calcMode:null,capHeight:tb,className:nb,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:tb,diffuseConstant:tb,direction:null,display:null,dur:null,divisor:tb,dominantBaseline:null,download:Zy,dx:null,dy:null,edgeMode:null,editable:null,elevation:tb,enableBackground:null,end:null,event:null,exponent:tb,externalResourcesRequired:null,fill:null,fillOpacity:tb,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rb,g2:rb,glyphName:rb,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:tb,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:tb,horizOriginX:tb,horizOriginY:tb,id:null,ideographic:tb,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:tb,k:tb,k1:tb,k2:tb,k3:tb,k4:tb,kernelMatrix:ib,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:tb,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:tb,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:tb,overlineThickness:tb,paintOrder:null,panose1:null,path:null,pathLength:tb,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nb,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:tb,pointsAtY:tb,pointsAtZ:tb,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ib,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ib,rev:ib,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ib,requiredFeatures:ib,requiredFonts:ib,requiredFormats:ib,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:tb,specularExponent:tb,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:tb,strikethroughThickness:tb,string:null,stroke:null,strokeDashArray:ib,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:tb,strokeOpacity:tb,strokeWidth:null,style:null,surfaceScale:tb,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ib,tabIndex:tb,tableValues:null,target:null,targetX:tb,targetY:tb,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ib,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:tb,underlineThickness:tb,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:tb,values:null,vAlphabetic:tb,vMathematical:tb,vectorEffect:null,vHanging:tb,vIdeographic:tb,version:null,vertAdvY:tb,vertOriginX:tb,vertOriginY:tb,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:tb,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:db}),mb=cb({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),gb=cb({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pb}),yb=cb({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),bb={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},vb=/[A-Z]/g,wb=/-[a-z]/g,kb=/^data[-\w.:]+$/i;function xb(e,t){const n=Ky(t);let r=t,i=Yy;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&kb.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(wb,Tb);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!wb.test(e)){let n=e.replace(vb,Sb);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=sb}return new i(r,t)}function Sb(e){return"-"+e.toLowerCase()}function Tb(e){return e.charAt(1).toUpperCase()}var Cb=Gy([ub,hb,mb,gb,yb],"html"),Eb=Gy([ub,fb,mb,gb,yb],"svg");function Ab(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){-1===r&&(r=n.length,o=!0);const e=n.slice(i,r).trim();!e&&o||t.push(e),i=r+1,r=n.indexOf(",",i)}return t}var Ib=/[#.]/g;function Ob(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function _b(e,t,n){const r=n?function(e){const t=/* @__PURE__ */new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}(n):void 0;return function(n,i,...o){let a;if(null==n){a={type:"root",children:[]};const e=i;o.unshift(e)}else{a=function(e,t){const n=e||"",r={};let i,o,a=0;for(;a<n.length;){Ib.lastIndex=a;const e=Ib.exec(n),t=n.slice(a,e?e.index:n.length);t&&(i?"#"===i?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,a+=t.length),e&&(i=e[0],a++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}(n,t);const s=a.tagName.toLowerCase(),l=r?r.get(s):void 0;if(a.tagName=l||s,function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!0;if("string"!=typeof e.type)return!1;const t=e,n=Object.keys(e);for(const r of n){const e=t[r];if(e&&"object"==typeof e){if(!Array.isArray(e))return!0;const t=e;for(const e of t)if("number"!=typeof e&&"string"!=typeof e)return!0}}return!(!("children"in e)||!Array.isArray(e.children))}(i))o.unshift(i);else for(const[t,n]of Object.entries(i))Nb(e,a.properties,t,n)}for(const e of o)Mb(a.children,e);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function Nb(e,t,n,r){const i=xb(e,n);let o;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;o=r}else o="boolean"==typeof r?r:"string"==typeof r?i.spaceSeparated?Ob(r):i.commaSeparated?Ab(r):i.commaOrSpaceSeparated?Ob(Ab(r).join(" ")):Pb(i,i.property,r):Array.isArray(r)?[...r]:"style"===i.property?function(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}(r):String(r);if(Array.isArray(o)){const e=[];for(const t of o)e.push(Pb(i,i.property,t));o=e}"className"===i.property&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[i.property]=o}}function Mb(e,t){if(null==t);else if("number"==typeof t||"string"==typeof t)e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Mb(e,n);else{if("object"!=typeof t||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");"root"===t.type?Mb(e,t.children):e.push(t)}}function Pb(e,t,n){if("string"==typeof n){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(""===n||Ky(n)===Ky(t)))return!0}return n}var Lb=_b(Cb,"div"),Rb=(_b(Eb,"g",["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]),["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"]),jb={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function zb(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}function Db(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function $b(e){return function(e){const t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||zb(e)}var Fb={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},qb={}.hasOwnProperty;function Bb(e){return!!qb.call(Fb,e)&&Fb[e]}var Ub=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Hb(e,t){const n=t||{},r="string"==typeof n.additional?n.additional.charCodeAt(0):n.additional,i=[];let o,a,s=0,l=-1,c="";n.position&&("start"in n.position||"indent"in n.position?(a=n.position.indent,o=n.position.start):o=n.position);let u,d=(o?o.line:0)||1,p=(o?o.column:0)||1,h=f();for(s--;++s<=e.length;)if(10===u&&(p=(a?a[l]:0)||1),u=e.charCodeAt(s),38===u){const t=e.charCodeAt(s+1);if(9===t||10===t||12===t||32===t||38===t||60===t||Number.isNaN(t)||r&&t===r){c+=String.fromCharCode(u),p++;continue}const o=s+1;let a,l=o,d=o;if(35===t){d=++l;const t=e.charCodeAt(d);88===t||120===t?(a="hexadecimal",d=++l):a="decimal"}else a="named";let y="",b="",v="";const w="named"===a?$b:"decimal"===a?zb:Db;for(d--;++d<=e.length;){const t=e.charCodeAt(d);if(!w(t))break;v+=String.fromCharCode(t),"named"===a&&Rb.includes(v)&&(y=v,b=Bb(v))}let k=59===e.charCodeAt(d);if(k){d++;const e="named"===a&&Bb(v);e&&(y=v,b=e)}let x=1+d-o,S="";if(k||!1!==n.nonTerminated)if(v)if("named"===a){if(k&&!b)m(5,1);else if(y!==v&&(d=l+y.length,x=1+d-l,k=!1),!k){const t=y?1:3;if(n.attribute){const n=e.charCodeAt(d);61===n?(m(t,x),b=""):$b(n)?b="":m(t,x)}else m(t,x)}S=b}else{k||m(2,x);let e=Number.parseInt(v,"hexadecimal"===a?16:10);if(Wb(e))m(7,x),S=String.fromCharCode(65533);else if(e in jb)m(6,x),S=jb[e];else{let t="";Vb(e)&&m(6,x),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|1023&e),S=t+String.fromCharCode(e)}}else"named"!==a&&m(4,x);if(S){g(),h=f(),s=d-1,p+=d-o+1,i.push(S);const t=f();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,S,{start:h,end:t},e.slice(o-1,d)),h=t}else v=e.slice(o-1,d),c+=v,p+=v.length,s=d-1}else 10===u&&(d++,l++,p=0),Number.isNaN(u)?g():(c+=String.fromCharCode(u),p++);return i.join("");function f(){return{line:d,column:p,offset:s+((o?o.offset:0)||0)}}function m(e,t){let r;n.warning&&(r=f(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Ub[e],r,e))}function g(){c&&(i.push(c),n.text&&n.text.call(n.textContext||void 0,c,{start:h,end:f()}),c="")}}function Wb(e){return e>=55296&&e<=57343||e>1114111}function Vb(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||!(65535&~e)||65534==(65535&e)}var Gb=0,Kb={},Yb={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Gb}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},Yb.util.type(t)){case"Object":if(i=Yb.util.objId(t),n[i])return n[i];for(var o in r={},n[i]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case"Array":return i=Yb.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:Kb,plaintext:Kb,text:Kb,txt:Kb,extend:function(e,t){var n=Yb.util.clone(Yb.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||Yb.languages)[e],o={};for(var a in i)if(i.hasOwnProperty(a)){if(a==t)for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);n.hasOwnProperty(a)||(o[a]=i[a])}var l=r[e];return r[e]=o,Yb.languages.DFS(Yb.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,i){i=i||{};var o=Yb.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var s=t[a],l=Yb.util.type(s);"Object"!==l||i[o(s)]?"Array"!==l||i[o(s)]||(i[o(s)]=!0,e(s,n,a,i)):(i[o(s)]=!0,e(s,n,null,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Yb.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Yb.tokenize(r.code,r.grammar),Yb.hooks.run("after-tokenize",r),Jb.stringify(Yb.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new Qb;return ev(i,i.head,e),Zb(e,i,t,i.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=Yb.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Yb.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:Jb};function Jb(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function Xb(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function Zb(e,t,n,r,i,o){for(var a in n)if(n.hasOwnProperty(a)&&n[a]){var s=n[a];s=Array.isArray(s)?s:[s];for(var l=0;l<s.length;++l){if(o&&o.cause==a+","+l)return;var c=s[l],u=c.inside,d=!!c.lookbehind,p=!!c.greedy,h=c.alias;if(p&&!c.pattern.global){var f=c.pattern.toString().match(/[imsuy]*$/)[0];c.pattern=RegExp(c.pattern.source,f+"g")}for(var m=c.pattern||c,g=r.next,y=i;g!==t.tail&&!(o&&y>=o.reach);y+=g.value.length,g=g.next){var b=g.value;if(t.length>e.length)return;if(!(b instanceof Jb)){var v,w=1;if(p){if(!(v=Xb(m,y,e,d))||v.index>=e.length)break;var k=v.index,x=v.index+v[0].length,S=y;for(S+=g.value.length;k>=S;)S+=(g=g.next).value.length;if(y=S-=g.value.length,g.value instanceof Jb)continue;for(var T=g;T!==t.tail&&(S<x||"string"==typeof T.value);T=T.next)w++,S+=T.value.length;w--,b=e.slice(y,S),v.index-=y}else if(!(v=Xb(m,0,b,d)))continue;k=v.index;var C=v[0],E=b.slice(0,k),A=b.slice(k+C.length),I=y+b.length;o&&I>o.reach&&(o.reach=I);var O=g.prev;if(E&&(O=ev(t,O,E),y+=E.length),tv(t,O,w),g=ev(t,O,new Jb(a,u?Yb.tokenize(C,u):C,h,C)),A&&ev(t,g,A),w>1){var _={cause:a+","+l,reach:I};Zb(e,t,n,g.prev,y,_),o&&_.reach>o.reach&&(o.reach=_.reach)}}}}}}function Qb(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function ev(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function tv(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}var nv=Yb;function rv(){}rv.prototype=nv;var iv=new rv;iv.highlight=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&"object"==typeof t)n=t;else{if(r=t,"string"!=typeof r)throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(!Object.hasOwn(iv.languages,r))throw new Error("Unknown language: `"+r+"` is not registered");n=iv.languages[r]}return{type:"root",children:nv.highlight.call(iv,e,n,r)}},iv.register=function(e){if("function"!=typeof e||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(iv.languages,e.displayName)||e(iv)},iv.alias=function(e,t){const n=iv.languages;let r,i={};for(r in"string"==typeof e?t&&(i[e]=t):i=e,i)if(Object.hasOwn(i,r)){const e=i[r],t="string"==typeof e?[e]:e;let o=-1;for(;++o<t.length;)n[t[o]]=n[r]}},iv.registered=function(e){if("string"!=typeof e)throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(iv.languages,e)},iv.listLanguages=function(){const e=iv.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&"object"==typeof e[n]&&t.push(n);return t},iv.util.encode=function(e){return e},iv.Token.stringify=function e(t,n){if("string"==typeof t)return{type:"text",value:t};if(Array.isArray(t)){const r=[];let i=-1;for(;++i<t.length;)null!==t[i]&&void 0!==t[i]&&""!==t[i]&&r.push(e(t[i],n));return r}const r={attributes:{},classes:["token",t.type],content:e(t.content,n),language:n,tag:"span",type:t.type};return t.alias&&r.classes.push(..."string"==typeof t.alias?[t.alias]:t.alias),iv.hooks.run("wrap",r),Lb(r.tag+"."+r.classes.join("."),function(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=Hb(e[t]));return e}(r.attributes),r.content)};var ov,av,sv=(ov=iv,av={},function(e){var n,r,i=e.language,o=e.children,a=e.style,s=void 0===a?av:a,l=e.customStyle,c=void 0===l?{}:l,u=e.codeTagProps,d=void 0===u?{className:i?"language-".concat(i):void 0,style:jy(jy({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:u,p=e.useInlineStyles,h=void 0===p||p,f=e.showLineNumbers,m=void 0!==f&&f,g=e.showInlineLineNumbers,y=void 0===g||g,b=e.startingLineNumber,v=void 0===b?1:b,w=e.lineNumberContainerStyle,k=e.lineNumberStyle,x=void 0===k?{}:k,S=e.wrapLines,T=e.wrapLongLines,C=void 0!==T&&T,E=e.lineProps,A=void 0===E?{}:E,I=e.renderer,O=e.PreTag,_=void 0===O?"pre":O,N=e.CodeTag,M=void 0===N?"code":N,P=e.code,L=void 0===P?(Array.isArray(o)?o[0]:o)||"":P,R=e.astGenerator,j=function(e,t){if(null==e)return{};var n,r,i=xy(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Ly);R=R||ov;var z=m?/*#__PURE__*/t.createElement(Dy,{containerStyle:w,codeStyle:d.style||{},numberStyle:x,startingLineNumber:v,codeString:L}):null,D=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},$=Wy(R)?"hljs":"prismjs",F=h?Object.assign({},j,{style:Object.assign({},D,c)}):Object.assign({},j,{className:j.className?"".concat($," ").concat(j.className):$,style:Object.assign({},c)});if(d.style=jy(C?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"},d.style),!R)/*#__PURE__*/return t.createElement(_,F,z,/*#__PURE__*/t.createElement(M,d,L));(void 0===S&&I||C)&&(S=!0),I=I||Hy;var q=[{type:"text",value:L}],B=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(Wy(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(aM){return{value:i}}}({astGenerator:R,language:i,code:L,defaultCodeValue:q});null===B.language&&(B.value=q);var U=Uy(B,S,A,m,y,v,v+(null!==(n=null===(r=L.match(/\n/g))||void 0===r?void 0:r.length)&&void 0!==n?n:0),x,C);/*#__PURE__*/
61
61
  return t.createElement(_,F,/*#__PURE__*/t.createElement(M,d,!y&&z,I({rows:U,stylesheet:s,useInlineStyles:h})))});sv.registerLanguage=function(e,t){return iv.register(t)},sv.alias=function(e,t){return iv.alias(e,t)};var lv=()=>{let e=typeof navigator>"u"?void 0:Reflect.get(navigator,"clipboard"),t="object"==typeof e&&e?Reflect.get(e,"writeText"):void 0;if("function"==typeof t)return async n=>{await Reflect.apply(t,e,[n])}},cv=async e=>{let t=lv();if(!t)return!1;try{return await t(e),!0}catch{return!1}},uv="This page cannot reach the clipboard: it is not served over https, or the browser refused.",dv={idle:"Copy",copied:"Copied",refused:"Not copied"},pv=({language:e,code:t,classNames:n,children:r})=>{let[i,o]=S("idle");g(()=>{if("idle"===i)return;let e=setTimeout(()=>o("idle"),2e3);return()=>clearTimeout(e)},[i]);let a=f(()=>{cv(t).then(e=>o(e?"copied":"refused"))},[t]);/* @__PURE__ */
62
62
  return O("div",{className:V("markdown-code",n.codeBlockFrame),"data-language":e,children:[/* @__PURE__ */O("div",{className:V("markdown-code-header",n.codeBlockHeader),children:[/* @__PURE__ */I("span",{className:V("markdown-code-language",n.codeBlockLanguage),children:e??"text"}),/* @__PURE__ */I("button",{type:"button",className:V("markdown-code-copy",n.codeBlockCopy),onClick:a,"aria-live":"polite",title:"refused"===i?uv:void 0,children:dv[i]})]}),r]})},hv={'pre[class*="language-"]':{color:"#d4d4d4",fontSize:"13px",textShadow:"none",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",background:"#1e1e1e"},'code[class*="language-"]':{color:"#d4d4d4",fontSize:"13px",textShadow:"none",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#264F78"},'code[class*="language-"]::selection':{textShadow:"none",background:"#264F78"},'pre[class*="language-"] *::selection':{textShadow:"none",background:"#264F78"},'code[class*="language-"] *::selection':{textShadow:"none",background:"#264F78"},':not(pre) > code[class*="language-"]':{padding:".1em .3em",borderRadius:".3em",color:"#db4c69",background:"#1e1e1e"},".namespace":{Opacity:".7"},"doctype.doctype-tag":{color:"#569CD6"},"doctype.name":{color:"#9cdcfe"},comment:{color:"#6a9955"},prolog:{color:"#6a9955"},punctuation:{color:"#d4d4d4"},".language-html .language-css .token.punctuation":{color:"#d4d4d4"},".language-html .language-javascript .token.punctuation":{color:"#d4d4d4"},property:{color:"#9cdcfe"},tag:{color:"#569cd6"},boolean:{color:"#569cd6"},number:{color:"#b5cea8"},constant:{color:"#9cdcfe"},symbol:{color:"#b5cea8"},inserted:{color:"#b5cea8"},unit:{color:"#b5cea8"},selector:{color:"#d7ba7d"},"attr-name":{color:"#9cdcfe"},string:{color:"#ce9178"},char:{color:"#ce9178"},builtin:{color:"#ce9178"},deleted:{color:"#ce9178"},".language-css .token.string.url":{textDecoration:"underline"},operator:{color:"#d4d4d4"},entity:{color:"#569cd6"},"operator.arrow":{color:"#569CD6"},atrule:{color:"#ce9178"},"atrule.rule":{color:"#c586c0"},"atrule.url":{color:"#9cdcfe"},"atrule.url.function":{color:"#dcdcaa"},"atrule.url.punctuation":{color:"#d4d4d4"},keyword:{color:"#569CD6"},"keyword.module":{color:"#c586c0"},"keyword.control-flow":{color:"#c586c0"},function:{color:"#dcdcaa"},"function.maybe-class-name":{color:"#dcdcaa"},regex:{color:"#d16969"},important:{color:"#569cd6"},italic:{fontStyle:"italic"},"class-name":{color:"#4ec9b0"},"maybe-class-name":{color:"#4ec9b0"},console:{color:"#9cdcfe"},parameter:{color:"#9cdcfe"},interpolation:{color:"#9cdcfe"},"punctuation.interpolation-punctuation":{color:"#569cd6"},variable:{color:"#9cdcfe"},"imports.maybe-class-name":{color:"#9cdcfe"},"exports.maybe-class-name":{color:"#9cdcfe"},escape:{color:"#d7ba7d"},"tag.punctuation":{color:"#808080"},cdata:{color:"#808080"},"attr-value":{color:"#ce9178"},"attr-value.punctuation":{color:"#ce9178"},"attr-value.punctuation.attr-equals":{color:"#d4d4d4"},namespace:{color:"#4ec9b0"},'pre[class*="language-javascript"]':{color:"#9cdcfe"},'code[class*="language-javascript"]':{color:"#9cdcfe"},'pre[class*="language-jsx"]':{color:"#9cdcfe"},'code[class*="language-jsx"]':{color:"#9cdcfe"},'pre[class*="language-typescript"]':{color:"#9cdcfe"},'code[class*="language-typescript"]':{color:"#9cdcfe"},'pre[class*="language-tsx"]':{color:"#9cdcfe"},'code[class*="language-tsx"]':{color:"#9cdcfe"},'pre[class*="language-css"]':{color:"#ce9178"},'code[class*="language-css"]':{color:"#ce9178"},'pre[class*="language-html"]':{color:"#d4d4d4"},'code[class*="language-html"]':{color:"#d4d4d4"},".language-regex .token.anchor":{color:"#dcdcaa"},".language-html .token.punctuation":{color:"#808080"},'pre[class*="language-"] > code[class*="language-"]':{position:"relative",zIndex:"1"},".line-highlight.line-highlight":{background:"#f7ebc6",boxShadow:"inset 5px 0 0 #f7d87c",zIndex:"0"}},fv={h1:"heading1",h2:"heading2",h3:"heading3",h4:"heading4",h5:"heading5",h6:"heading6"},mv=/language-(\w+)/,gv=(e,t)=>({className:n,...r})=>c(e,{...vr(r,["node"]),className:V(n,t)||void 0}),yv=(e,{classNames:t,headingLinks:n})=>({children:r,node:i,className:o,...a})=>/* @__PURE__ */O(e,{...a,className:V(o,t.heading,t[fv[e]])||void 0,children:[n&&a.id&&/* @__PURE__ */I("a",{className:V("anchor",t.anchor),href:`#${a.id}`,"aria-label":`Link to “${i?ky(i):a.id}”`,children:/* @__PURE__ */I("span",{className:"octicon octicon-link","aria-hidden":"true"})}),r]}),bv=/* @__PURE__ */new Set(["h1","h2","h3","h4","h5","h6"]),vv=e=>()=>t=>{let n=/* @__PURE__ */new Set,r=t=>{"element"===t.type&&t.tagName&&bv.has(t.tagName)&&(t.properties={...t.properties,id:e(ky(t).trim(),n)}),t.children?.forEach(r)};r(t)},wv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xv={};function Sv(e,t){return((t||xv).jsx?kv:wv).test(e)}var Tv=/[ \t\n\f\r]/g;function Cv(e){return""===e.replace(Tv,"")}var Ev=/* @__PURE__ */D((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,u="";function d(e){return e?e.replace(c,u):u}t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var c=1,p=1;function h(e){var t=e.match(r);t&&(c+=t.length);var n=e.lastIndexOf("\n");p=~n?e.length-n:p+e.length}function f(){var e={line:c,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:c,column:p},this.source=t.source}function g(n){var r=/* @__PURE__ */new Error(t.source+":"+c+":"+p+": "+n);if(r.reason=n,r.filename=t.source,r.line=c,r.column=p,r.source=e,!t.silent)throw r}function y(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function b(){y(i)}function v(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return p+=2,h(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function k(){var e=f(),t=y(o);if(t){if(w(),!y(a))return g("property missing ':'");var r=y(s),i=e({type:"declaration",property:d(t[0].replace(n,u)),value:r?d(r[0].replace(n,u)):u});return y(l),i}}return m.prototype.content=e,b(),function(){var e,t=[];for(v(t);e=k();)!1!==e&&(t.push(e),v(t));return t}()}}),Av=/* @__PURE__ */D(e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){let r=null;if(!e||"string"!=typeof e)return r;const i=(0,n.default)(e),o="function"==typeof t;return i.forEach(e=>{if("declaration"!==e.type)return;const{property:n,value:i}=e;o?t(n,i,e):i&&(r=r||{},r[n]=i)}),r};var n=t(Ev())}),Iv=/* @__PURE__ */D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},s=function(e,t){return"".concat(t,"-")};e.camelCase=function(e,l){return void 0===l&&(l={}),function(e){return!e||r.test(e)||t.test(e)}(e)?e:(e=e.toLowerCase(),(e=l.reactCompat?e.replace(o,s):e.replace(i,s)).replace(n,a))}}),Ov=/* @__PURE__ */D((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Av()),r=Iv();function i(e,t){var i={};return e&&"string"==typeof e?((0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i):i}i.default=i,t.exports=i}),_v=Mv("end"),Nv=Mv("start");function Mv(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Pv(e){return e&&"object"==typeof e?"position"in e||"type"in e?Rv(e.position):"start"in e||"end"in e?Rv(e):"line"in e||"column"in e?Lv(e):"":""}function Lv(e){return jv(e&&e.line)+":"+jv(e&&e.column)}function Rv(e){return Lv(e&&e.start)+"-"+Lv(e&&e.end)}function jv(e){return e&&"number"==typeof e?e:1}var zv=class extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Pv(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};zv.prototype.file="",zv.prototype.name="",zv.prototype.reason="",zv.prototype.message="",zv.prototype.stack="",zv.prototype.column=void 0,zv.prototype.line=void 0,zv.prototype.ancestors=void 0,zv.prototype.cause=void 0,zv.prototype.fatal=void 0,zv.prototype.place=void 0,zv.prototype.ruleId=void 0,zv.prototype.source=void 0;var Dv=/* @__PURE__ */F(Ov(),1),$v={}.hasOwnProperty,Fv=/* @__PURE__ */new Map,qv=/[A-Z]/g,Bv=/* @__PURE__ */new Set(["table","tbody","thead","tfoot","tr"]),Uv=/* @__PURE__ */new Set(["td","th"]),Hv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Wv(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=Eb,e.schema=i),e.ancestors.push(t);const o=Jv(e,t.tagName,!1),a=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&$v.call(t.properties,i)){const o=Yv(e,i,t.properties[i]);if(o){const[i,a]=o;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof a&&Uv.has(t.tagName)?r=a:n[i]=a}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(e,t);let s=Kv(e,t);return Bv.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Cv(t.value):Cv(t));var t})),Vv(e,a,o,t),Gv(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];
63
63
  /* @__PURE__ */return n.type,e.evaluater.evaluateExpression(n.expression)}Xv(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=Eb,e.schema=i),e.ancestors.push(t);const o=null===t.name?e.Fragment:Jv(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];
@@ -93,7 +93,7 @@ return O(Np,{children:[!!c&&/* @__PURE__ */I("title",{children:c}),!!u&&/* @__PU
93
93
  return I(Gd,{ref:e,tag:"i",className:V("plitzi-component__fontawesome",t,n,r,i),...a})}),vE=Object.assign(bE,Co),wE=[320,480,640,768,960,1280,1600,1920],kE=(e,t,n)=>`${e}?url=${encodeURIComponent(t)}&w=${String(n)}`,xE=(e,t)=>wE.map(n=>`${kE(e,t,n)} ${String(n)}w`).join(", "),SE="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 1200" fill="none">\n <rect width="1200" height="1200" fill="#EAEAEA" rx="3"/>\n <path fill="#FAFAFA" opacity="0.5" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/>\n <path stroke="#C9C9C9" stroke-width="2.418" opacity="0.5" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/>\n <path stroke="url(#a)" stroke-width="2.418" d="M0-1.209h553.581" transform="scale(1 -1) rotate(45 1163.11 91.165)"/>\n <path stroke="url(#b)" stroke-width="2.418" d="M404.846 598.671h391.726"/>\n <path stroke="url(#c)" stroke-width="2.418" d="M599.5 795.742V404.017"/>\n <path stroke="url(#d)" stroke-width="2.418" d="m795.717 796.597-391.441-391.44"/>\n <path fill="#fff" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/>\n <path fill="#666" fill-rule="evenodd" d="M616.426 586.58h-31.434v16.176l3.553-3.554.531-.531h9.068l.074-.074 8.463-8.463h2.565l7.18 7.181V586.58Zm-15.715 14.654 3.698 3.699 1.283 1.282-2.565 2.565-1.282-1.283-5.2-5.199h-6.066l-5.514 5.514-.073.073v2.876a2.418 2.418 0 0 0 2.418 2.418h26.598a2.418 2.418 0 0 0 2.418-2.418v-8.317l-8.463-8.463-7.181 7.181-.071.072Zm-19.347 5.442v4.085a6.045 6.045 0 0 0 6.046 6.045h26.598a6.044 6.044 0 0 0 6.045-6.045v-7.108l1.356-1.355-1.282-1.283-.074-.073v-17.989h-38.689v23.43l-.146.146.146.147Z" clip-rule="evenodd"/>\n <path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/>\n <defs>\n <linearGradient id="a" x1="554.061" x2="-.48" y1=".083" y2=".087" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <linearGradient id="b" x1="796.912" x2="404.507" y1="599.963" y2="599.965" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <linearGradient id="c" x1="600.792" x2="600.794" y1="403.677" y2="796.082" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <linearGradient id="d" x1="404.85" x2="796.972" y1="403.903" y2="796.02" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <clipPath id="e"><path fill="#fff" d="M581.364 580.535h38.689v38.689h-38.689z"/></clipPath>\n </defs>\n</svg>'),TE=Ku(({ref:e,className:t="",src:n,alt:r="",decorative:i=!1,fetchPriority:o="auto",loadMode:a,sizes:s="100vw",width:l,height:c,resize:u=!0})=>{let{settings:{previewMode:d}}=vu(),p=n||SE,h=i?"":r,[m,g]=S(void 0),y=m===p,b=f(()=>g(p),[p]),v=y?SE:p,w=y?{"data-plitzi-failed":p}:{},k="auto"===a?void 0:a,[x]=Dt("images.endpoint"),T=d&&x&&u&&!y&&(e=>(e=>/^https?:\/\//i.test(e))(e)&&!/\.svgz?(?:[?#]|$)/i.test(e))(p)?{src:kE(x,p,1280),srcSet:xE(x,p),sizes:s}:{src:v},C={...l?{width:l}:{},...c?{height:c}:{}};/* @__PURE__ */
94
94
  return I(Gd,d?{tag:"img",draggable:!1,ref:e,className:V("plitzi-component__image",t),...T,...C,alt:h,loading:k,fetchPriority:o,onError:y?void 0:b,...w}:{ref:e,className:V("plitzi-component__image image--edit-mode",t),children:/* @__PURE__ */I("img",{draggable:!1,src:v,alt:h,loading:k,fetchPriority:o,onError:y?void 0:b,...w})})}),CE=Object.assign(TE,Eo),EE=/<\s*foreignObject\b[\s\S]*?<\s*\/\s*foreignObject\s*>|<\s*\/?\s*foreignObject\b[^>]*>/gi,AE=/\s(to|from|values|by)\s*=\s*(?:"[^"]*javascript\s*:[^"]*"|'[^']*javascript\s*:[^']*')/gi,IE=/^\s*(?:<!--[\s\S]*?-->\s*)*<svg\b[\s\S]*<\/svg>\s*$/i,OE=/<svg\b[^>]*>/i,_E=Ku(({ref:e,content:t="",label:n="",className:r=""})=>{let{settings:{previewMode:i}}=vu(),o=k(()=>(e=>IE.test(e))(t)?(e=>e.replace(OE,e=>e.replace(/\s(width|height)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/^<svg\b/i,'<svg width="100%" height="100%"')))((e=>SC(e).replace(EE,"").replace(AE,""))(t)):"",[t]),a=n?{role:"img","aria-label":n}:{"aria-hidden":!0};return o||i?/* @__PURE__ */I(Gd,{tag:"span",ref:e,className:V("plitzi-component__svg",r),...a,dangerouslySetInnerHTML:{__html:o}}):/* @__PURE__ */O(Gd,{ref:e,className:V("plitzi-component__svg svg--empty",r),children:["Paste one ","<svg>…</svg>"," here"]})}),NE=Object.assign(_E,Ao),ME=Ku(({ref:e,src:t,autoPlay:n=!1,playsInline:r=!1,loop:i=!1,muted:o=!0,className:a=""})=>{let{settings:{previewMode:s}}=vu();/* @__PURE__ */
95
95
  return I(Gd,s?{tag:"video",draggable:!1,ref:e,className:V("plitzi-component__video",a),src:t,autoPlay:n,playsInline:r,loop:i,muted:o}:{ref:e,className:V("plitzi-component__video video--edit-mode",a),children:/* @__PURE__ */I("video",{src:t,autoPlay:n,playsInline:r,loop:i,muted:o,children:/* @__PURE__ */I("track",{kind:"captions"})})})}),PE=Object.assign(ME,Io),LE=()=>{let e=zt();return f((t,n,{fresh:r}={})=>qm(e,t,n,{fresh:r}),[e])},RE=()=>{let{id:e,rootId:t}=Yu(),[[n=!1,r=!1,i=!1,o,a,s,l,c]]=Dt(["rsc.enabled","rsc.loaded","rsc.stale","rsc.location",Pm(e),"navigation.currentPageId","schema.pages","rsc.refreshing"]),u=LE(),d=zt(),p=f(()=>((e,t)=>{$m(e).inFlight.forEach(e=>{(!t||e.ids?.some(e=>t.includes(e)))&&e.controller.abort()})})(d,[e]),[d,e]),h=void 0!==o&&o!==Lm()||void 0!==t&&t!==s&&Array.isArray(l)&&l.includes(t),m=x(void 0);!h&&void 0!==a&&(m.current=a);let g=h&&void 0!==m.current?m.current:a;return{enabled:n,loaded:r,stale:i,location:o,elementData:g??null,isServerElement:void 0!==g,refreshing:!0===c?.[e]||!0===c?.["*"],refresh:u,cancel:p}},jE=(e,t,n)=>n?void 0===e.record:Array.isArray(e.records)?0===t.length:(e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length)(e.data),zE=e=>{let t=e;if("string"==typeof t)try{t=JSON.parse(t||"{}")}catch{return}if("object"==typeof t&&t&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).flatMap(([e,t])=>"string"==typeof t||"number"==typeof t||"boolean"==typeof t?[[e,String(t)]]:[]))},DE=3e5,$E=e=>{let t=3735928559,n=1103547991;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,2654435761),n=Math.imul(n^i,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2097151&n)+(t>>>0)).toString(36)},FE=e=>`entries.${$E(e)}`,qE=new class{store;runtimes=/* @__PURE__ */new Map;epochValue=0;unwatch;constructor(e=Xe({entries:{}},{id:"queries"})){this.store=e}get epoch(){return this.epochValue}getEntry(e){let t=this.store.getPath(FE(e));return t?.key===e?t:void 0}hasAnswer(e){return void 0!==this.getEntry(e)&&void 0!==this.store.getFreshness(FE(e))}usage(e){let t=this.runtimes.get($E(e));return t&&{observers:t.observers.size,holds:t.holds,collectAt:t.collectAt}}remove(e){let t=this.runtimes.get($E(e));return!(!t||t.observers.size>0||t.holds>0||(this.cancelGc(t),this.collect(t),0))}hold(e,t=DE){let n=this.ensure(e);return n.gcTime=t,n.holds++,this.cancelGc(n),()=>{n.holds--,this.scheduleGc(n)}}observe(e,t){let n=this.ensure(e),{isCacheable:r}=t,i={meta:t.meta,staleTime:t.staleTime,fetcher:t.fetcher,isCacheable:r&&(e=>r(e))};return n.observers.add(i),this.cancelGc(n),(!this.hasAnswer(e)||this.store.isStale(FE(e)))&&this.fetch(n,i),()=>{n.observers.delete(i),this.scheduleGc(n)}}async fetchQuery(e,t){let n=this.ensure(e);if(void 0!==t.gcTime&&(n.gcTime=t.gcTime),this.hasAnswer(e)&&!this.store.isStale(FE(e)))return this.scheduleGc(n),this.getEntry(e)?.data;let{isCacheable:r}=t;await this.fetch(n,{meta:t.meta,staleTime:t.staleTime,fetcher:t.fetcher,isCacheable:r&&(e=>r(e))});let i=this.getEntry(e)?.data;return this.scheduleGc(n),i}cancel(e){let t=this.runtimes.get($E(e));if(!t?.controller)return!1;t.controller.abort(),t.controller=void 0,t.inFlight=void 0;let n=FE(e);return this.getEntry(e)?this.store.setState(`${n}.isFetching`,!1):this.markUnasked(t),!0}refetch(e){let t=this.runtimes.get($E(e));return t?this.invalidateOne(t):Promise.resolve()}invalidate(e){let t=[];return this.runtimes.forEach(n=>{let r=this.getEntry(n.key);!r||e&&!e({url:r.url,tags:r.tags})||t.push(this.invalidateOne(n))}),Promise.all(t).then(()=>{})}reset({refetch:e=!0}={}){if(this.epochValue++,this.runtimes.forEach(e=>{e.version++,e.inFlight=void 0,e.controller?.abort(),e.controller=void 0}),this.store.setState("entries",{}),!e)return this.runtimes.forEach(e=>this.markUnasked(e)),Promise.resolve();let t=[];return this.runtimes.forEach(e=>t.push(this.fetchActive(e))),Promise.all(t).then(()=>{})}markUnasked(e){let t=e.observers.values().next();if(t.done)return;let n={key:e.key,url:t.value.meta.url,tags:[...e.tags],isFetching:!1};this.store.setState(FE(e.key),n,{ttl:0})}invalidateOne(e){return 0===this.store.expire(FE(e.key)).length&&e.version++,this.fetchActive(e)}onExpired(e){let t=this.runtimes.get(e.slice(8).split(".")[0]);t&&(t.version++,this.fetchActive(t))}fetchActive(e){let t=e.observers.values().next();return t.done?Promise.resolve():this.fetch(e,t.value)}fetch(e,t){if(e.inFlight)return e.inFlight;let{key:n}=e,{url:r}=t.meta;t.meta.tags?.forEach(t=>e.tags.add(t));let i=[...e.tags],o=FE(n);this.getEntry(n)?this.store.setState(`${o}.isFetching`,!0):this.store.setState(o,{key:n,url:r,tags:i,isFetching:!0});let a=this.epochValue,s=e.version,l=new AbortController,c=c=>{if(a!==this.epochValue||this.runtimes.get($E(n))!==e||e.controller!==l)return Promise.resolve();e.inFlight=void 0,e.controller=void 0;let u=s!==e.version;if("error"in c){let e=this.getEntry(n);this.store.setState(o,{key:n,url:r,tags:i,data:e?.data,error:c.error,isFetching:!1},{ttl:0})}else{let a=!u&&(t.isCacheable?.(c.data)??!0);this.store.setState(o,{key:n,url:r,tags:i,data:c.data,isFetching:!1},{ttl:a?this.ttlOf(e,t):0})}return u?this.fetchActive(e):Promise.resolve()};return e.controller=l,e.inFlight=t.fetcher(l.signal).then(e=>c({data:e}),e=>c({error:e})),e.inFlight}ttlOf(e,t){let n=e.observers.size>0?1/0:t.staleTime;return e.observers.forEach(e=>{n=Math.min(n,e.staleTime)}),n}ensure(e){let t=$E(e),n=this.runtimes.get(t);return n||(n={key:e,tags:/* @__PURE__ */new Set,observers:/* @__PURE__ */new Set,holds:0,version:0,gcTime:3e5},this.runtimes.set(t,n)),this.unwatch??=this.store.watchFreshness("entries",e=>{"expired"===e.type&&this.onExpired(e.path)}),n}cancelGc(e){clearTimeout(e.gcTimer),e.gcTimer=void 0,e.collectAt=void 0}scheduleGc(e){if(!(e.holds>0||e.observers.size>0)){if(this.cancelGc(e),e.gcTime<=0)return void this.collect(e);e.collectAt=Date.now()+e.gcTime,e.gcTimer=setTimeout(()=>this.collect(e),e.gcTime)}}collect(e){let t=$E(e.key);this.runtimes.get(t)===e&&0===e.holds&&0===e.observers.size&&(this.runtimes.delete(t),e.controller?.abort(),this.store.setState(FE(e.key),void 0,{unmount:!0}))}},BE=/* @__PURE__ */new Set,UE=e=>Promise.allSettled([...BE].filter(t=>!e||e(t)).map(e=>e.refresh())).then(()=>{}),{useStore:HE}=jt(),WE=()=>typeof location>"u"?void 0:location.href,VE=e=>{try{return new URL(e,WE()).origin}catch{return}},GE=(e,t)=>({id:n,url:r})=>(!t||void 0!==r)&&e({url:r??"",tags:[n]}),KE=e=>Array.isArray(e)?e.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>e.trim()):"string"==typeof e?e.split(",").map(e=>e.trim()).filter(Boolean):[],YE=e=>{try{return new URL(e,WE()).href}catch{return e}},JE=(e={})=>{let t=e.url||e.elements?.length?(({url:e,elements:t})=>{let n=e?YE(e):void 0;return e=>(void 0===n||YE(e.url).startsWith(n))&&(!t?.length||t.some(t=>e.tags?.includes(t)??!1))})(e):void 0;return Promise.all([qE.invalidate(t),UE(t&&GE(t,!!e.url))]).then(()=>{})},XE=({method:e,url:t,credentials:n,headers:r})=>JSON.stringify([e.toLowerCase(),t,n,Object.entries(r).filter(([e])=>"content-type"!==e.toLowerCase()).sort(([e],[t])=>e<t?-1:+(e>t))]),ZE=({mode:e,fallback:t,elements:n,url:r})=>{let i="origin"===e||"all"===e||"elements"===e||"none"===e?e:t;if("none"===i)return Promise.resolve();if("elements"===i){let e=KE(n);return e.length>0?JE({elements:e}):Promise.resolve()}return"origin"===i&&r?(e=>{let t=VE(e);if(!t)return Promise.resolve();let n=e=>VE(e.url)===t;return Promise.all([qE.invalidate(n),UE(GE(n,!0))]).then(()=>{})})(r):JE()},QE=async(e,t,n,r,i,o=!1)=>{if(!e)return{status:400,data:"URL is required"};let a=new Headers(r);a.has("Accept")||a.set("Accept","application/json");let s={method:t,credentials:n,headers:a,signal:i};"get"!==t&&(s.body="{}",a.has("Content-Type")||a.set("Content-Type","application/json"));try{let a=await fetch(e,s),l=await a.json(),c=Em(a.status,l);return c&&await Tm({reason:c,url:e})&&!o&&!i.aborted?await QE(e,t,n,r,i,!0):{status:a.status,data:l}}catch(e){if(i.aborted)throw e;return console.error(e.message),{status:500,data:e.message}}},eA=e=>e.status<400,tA=(e,t)=>{let n="number"==typeof e?e:Number(e);return 1e3*(Number.isFinite(n)&&n>=0?n:t)},nA=e=>Gr(e).map(e=>({path:e,name:e.split(".").slice(-2).join(" ")})),rA=(e,t)=>e?{runtime:{sources:{[e]:t}}}:Vr,iA=Ku(({ref:e,className:t="",children:r,query:i="",method:o="get",accessToken:a="",when:s=Vr,headers:l=Vr,mockData:c="{}",subType:d="",credentials:p="same-origin",singleRecord:m=!1,pagination:y="none",pageParam:v="page",renderWhileLoading:w=!1,loadingSlot:T="",cache:C=!1,staleTime:E=30,gcTime:A=300,refreshSeconds:O=0,connector:_="",action:N="",input:M})=>{let{id:P,visible:L,definition:{label:R="Api Container",runtime:j,items:z}}=Yu(),D="server"===j,{loaded:$,stale:F,location:q,elementData:B,refreshing:U,refresh:H,cancel:W}=RE(),G=Md(Oo.sourceType,P),{settings:{previewMode:K}}=vu(),{interactionsManager:Y}=h(Id),[[J,X,Z]]=Bt(["navigation.routeParams","navigation.queryParams","navigation.navigate"]),Q=k(()=>a?{...l,Authorization:`Bearer ${a}`}:l,[l,a]),ee=k(()=>!(D||!L||!(K&&i&&(s===Vr||Ei(s,{...J,...X}))||!K&&(i||c&&"{}"!==c&&c!==Vr))),[D,L,K,i,s,J,X,c]),te=k(()=>[P],[P]),{isLoading:ne,isFetching:re,data:ie,refetch:oe,cancel:ae,isSuccess:se,isError:le}=(({url:e="",method:t="get",mock:n,customHeaders:r=Vr,enabled:i=!0,credentials:o="same-origin",cache:a=!1,staleTime:s=30,gcTime:l=300,tags:c})=>{let u=(e=>!!e&&"{}"!==e&&e!==Vr)(n),d=b(),p=!u&&(!e||or(e)),h=k(()=>{if(u||p)return;let n=XE({method:t,url:e,credentials:o,headers:r});return a?n:`${n}#${d}`},[u,p,e,t,o,r,a,d]),m=f(n=>QE(e,t,o,r,n),[e,t,o,r]),y=(({key:e,meta:t,fetcher:n,enabled:r=!0,staleTime:i,gcTime:o=DE,isCacheable:a})=>{let s=void 0!==e,[l]=HE(FE(e??""),{store:qE.store,enabled:s}),c=s&&l?.key===e?l:void 0,u=void 0!==c&&qE.hasAnswer(c.key),d=x(n),p=x(a);g(()=>{d.current=n,p.current=a},[n,a]),g(()=>void 0===e?void 0:qE.hold(e,o),[e,o]);let{url:h}=t,m=t.tags?.join("\0")??"";g(()=>{if(r&&void 0!==e)return qE.observe(e,{meta:{url:h,tags:m?m.split("\0"):[]},staleTime:i,fetcher:e=>d.current(e),isCacheable:e=>p.current?.(e)??!0})},[r,e,h,m,i]);let y=u?c.data:void 0,b=x(void 0);void 0===y?b.current&&b.current.epoch!==qE.epoch&&(b.current=void 0):b.current={epoch:qE.epoch,data:y};let v=y??b.current?.data,w=(c?.isFetching??!1)||r&&s&&!u;return{data:v,isFetching:w,isLoading:w&&void 0===v,refetch:f(()=>{r&&void 0!==e&&qE.refetch(e)},[r,e]),cancel:f(()=>{void 0!==e&&qE.cancel(e)},[e])}})({key:h,meta:{url:e,tags:c},fetcher:m,enabled:i,staleTime:a?tA(s,30):0,gcTime:a?tA(l,300):0,isCacheable:eA}),v=k(()=>u?(e=>{if("string"!=typeof e)return{status:200,data:e};try{return{status:200,data:JSON.parse(e)}}catch(e){return{status:500,data:e.message}}})(n):void 0,[u,n]),w=i&&v?v:y.data,S=!v&&y.isFetching;return{isLoading:S&&void 0===w,isFetching:S,data:w,refetch:y.refetch,cancel:y.cancel,isSuccess:!p&&!S&&!!w&&w.status<400,isError:!p&&!S&&!!w&&w.status>=400}})({url:i,method:o,credentials:p,mock:K?void 0:c,customHeaders:Q,enabled:ee,cache:C,staleTime:E,gcTime:A,tags:te}),ce=D&&!!q&&q!==Lm(),ue=D&&$&&!ce&&null===B,de=D&&!_&&!N,pe=k(()=>D?B||($?Vr:((e,t)=>{let n;if("string"!=typeof e)n=e;else try{n=JSON.parse(e||"{}")}catch{return Vr}return t?{status:200,data:n}:n})(c,de)):ie??Vr,[D,ie,B,$,c,de]),he=D?ce||U:re,fe=D?ce:ne,me=x({}),ge=f((e,t)=>H(e,{...me.current,...t}),[H]),ye=f(async e=>{D?await H([P],me.current,{fresh:e}):oe()},[D,oe,H,P]),be=f(()=>ye(!0),[ye]),ve=f(()=>ye(!1),[ye]);(({id:e,url:t,enabled:n,active:r,refresh:i})=>{let o=x(!1);g(()=>{if(n)return r&&o.current&&(o.current=!1,i()),(e=>{let t={...e};return BE.add(t),()=>{BE.delete(t)}})({id:e,url:t,refresh:()=>r?i():(o.current=!0,Promise.resolve())})},[n,r,e,t,i])})({id:P,url:de&&i?i:void 0,enabled:D&&$,active:L,refresh:be});let we=f(async({input:e}={})=>{let t=zE(e);t&&(me.current=t),await be()},[be]),ke=f(()=>{D?W():ae()},[D,W,ae]),[xe]=Dt(`schema.flat.${P}.attributes.input`,{mode:"mount"});(({enabled:e,input:t,savedInput:n,performQuery:r})=>{let i=JSON.stringify(zE(t)??{}),o=x(JSON.stringify(zE(n)??{}));g(()=>{e&&i!==o.current&&(o.current=i,r({input:t}))},[e,i,t,r])})({enabled:D&&$,input:M,savedInput:xe,performQuery:we}),(({seconds:e,enabled:t,refresh:n})=>{let r=x(n);r.current=n;let i=Number(e),o=t&&Number.isFinite(i)&&i>0;g(()=>{if(!o)return;let e=!1,t=setInterval(()=>{e||"hidden"===document.visibilityState||(e=!0,Promise.resolve().then(()=>r.current()).catch(()=>{}).finally(()=>{e=!1}))},1e3*i);return()=>clearInterval(t)},[o,i])})({seconds:O,enabled:L&&(D?$&&!ce:ee),refresh:ve});let Se=pe,Te=k(()=>Array.isArray(Se.records)?Se.records:[],[Se.records]),{records:Ce,isLoadingMore:Ee,goToPage:Ae,loadMore:Ie}=(({elementId:e,mode:t,pageParam:n,records:r,page:i,refresh:o,navigate:a})=>{let[s,l]=S(r),[c,u]=S(!1),d=x(0);g(()=>{if("append"===t){if(i<=1)return d.current=1,void l(r);d.current!==i&&(d.current=i,l(e=>[...e,...r]))}},[t,i,r]);let p=f(async r=>{let i=Math.max(r,1);if("url"!==t){if(o){u(!0);try{await o([e],{[n]:String(i)})}finally{u(!1)}}}else a?.(((e,t)=>{if(typeof window>"u")return"";let n=new URL(window.location.href);return t<=1?n.searchParams.delete(e):n.searchParams.set(e,String(t)),`${n.pathname}${n.search}`})(n,i))},[t,a,n,o,e]),h=f(()=>p(i+1),[p,i]);return{records:"append"===t?s:r,isLoadingMore:c,goToPage:p,loadMore:h}})({elementId:P,mode:y,pageParam:v,records:Te,page:Se.pageInfo?.page??1,refresh:ge,navigate:Z}),Oe=(({serverMode:e,isSuccess:t,isError:n,rscResolved:r,rscPending:i,elementData:o})=>e?r&&!i?null==o?"error":"success":void 0:t?"success":n?"error":void 0)({serverMode:D,isSuccess:se,isError:le,rscResolved:$,rscPending:ce,elementData:B}),_e=x(void 0);g(()=>{!he&&P&&Oe&&(_e.current?.data!==pe||_e.current.outcome!==Oe)&&(_e.current={data:pe,outcome:Oe},Y.interactionTrigger(P,"success"===Oe?"onApiSuccess":"onApiError",{url:i,method:o,...pe}))},[pe,P,Y,he,o,Oe,i]);let Ne=k(()=>({...pe,...Array.isArray(Se.records)?{records:Ce}:Vr,isLoading:he||Ee,isEmpty:jE(Se,Ce,m),hasError:ue,errorMessage:ue?"The data provider could not be reached":"",isStale:D&&F}),[pe,Se,Ce,he,Ee,m,ue,D,F]),Me=f(()=>nA(Ne),[Ne]);Pd({id:P,source:G,name:R||`API - ${P}`,fields:Me});let{writeRecord:Pe}=(({elementId:e,enabled:t,actionPath:n="/_action",onDone:r})=>({writeRecord:f(async(i={})=>{let{action:o,recordId:a,...s}=i;if(!t||"string"!=typeof o||!o)return;let l=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({elementId:e,action:o,recordId:a,values:s})});if(!l.ok){let e=Em(l.status,await l.json().catch(()=>{}));throw e&&Tm({reason:e,url:n}),Error(`Write failed with status ${l.status}`)}let c=await l.json();return JE(),await(r?.()),c.record},[n,e,t,r])}))({elementId:P,enabled:D,onDone:be}),Le=k(()=>{let e={performQuery:{...Oo.callbacks.performQuery,title:`Perform Query ${R}`,callback:we},cancelQuery:{...Oo.callbacks.cancelQuery,title:`Cancel Query ${R}`,callback:ke},loadMore:{...Oo.callbacks.loadMore,title:`Load More ${R}`,callback:Ie},goToPage:{...Oo.callbacks.goToPage,title:`Go To Page ${R}`,callback:({page:e})=>Ae(Number(e)||1)}};return D&&(e.writeRecord={...Oo.callbacks.writeRecord,title:`Write Record ${R}`,callback:Pe}),e},[R,we,ke,Ie,Ae,D,Pe]),Re=k(()=>T&&K?((e,t,r)=>n.toArray(e).filter(e=>{let n=u(e)&&"string"==typeof e.key&&e.key.endsWith(`$${t}`);return r?n:!n}))(r,T,fe):r,[r,fe,T,K]),je=k(()=>rA(G,Ne),[Ne,G]);/* @__PURE__ */
96
- return I(Gd,{ref:e,tag:K||z?.length?d:"div",className:V("plitzi-component__api-container",t),interactionTriggers:Oo.triggers,interactionCallbacks:Le,children:(!fe||w||T)&&/* @__PURE__ */I(Mt,{inherit:"live",name:`Api:${P}`,value:je,children:Re})})}),oA=Object.assign(iA,Oo),aA=/^[A-Za-z0-9:_.-]{1,128}$/,sA=e=>aA.test(e),lA=[500,1e3,2e3,5e3,1e4],cA=e=>"object"==typeof e&&!!e&&"connection"in e&&"string"==typeof e.connection&&"refused"in e&&Array.isArray(e.refused),uA=e=>"object"==typeof e&&!!e&&"topic"in e&&"string"==typeof e.topic&&"type"in e&&"string"==typeof e.type,dA=e=>{let t="message",n=[];for(let r of e.split("\n"))r.startsWith("event: ")?t=r.slice(7):r.startsWith("data: ")&&n.push(r.slice(6));if(n.length)try{return{event:t,data:JSON.parse(n.join("\n"))}}catch{return}},pA=(e,t,n)=>{"success"===e?$d.success("realtime",t,n):"warning"===e?$d.warning("realtime",t,n):"danger"===e?$d.danger("realtime",t,n):$d.info("realtime",t,n)},hA=/* @__PURE__ */new Map,fA=/* @__PURE__ */new WeakMap,mA=(e,{grant:t,presence:n,onMessage:r,onJoin:i,onLeave:o}={})=>{let[a]=Dt("schema.settings.channels"),s=e&&(a?((e,t)=>{if(!t||!sA(e))return;let n=Object.keys(t).find(t=>(e=>RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map(e=>/^\{[A-Za-z0-9_]+\}$/.test(e)?"[A-Za-z0-9_.-]{1,64}":e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}$`))(t).test(e));return void 0===n?void 0:{pattern:n,declaration:t[n]}})(e,a):sA(e))?e:void 0,[l]=Dt("realtime.endpoint"),[c]=Dt("realtime.transport"),u=k(()=>l&&typeof window<"u"?((e,t="sse")=>{let n=`${t} ${e}`,r=hA.get(n);if(r)return r;let i=((e,{transport:t="sse",fetchImpl:n=fetch,WebSocketImpl:r=globalThis.WebSocket}={})=>{let i,o,a,s=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,c=/* @__PURE__ */new Set,u="idle",d=/* @__PURE__ */new Map,p=0,h="websocket"===t&&"function"==typeof r,f=()=>[...s.keys()].sort().join(","),m=e=>{u=e;let t=f().split(",").filter(Boolean),n=i?.transport??(h?"websocket":"sse");pA("open"===e?"success":"closed"===e?"warning":"info",`${e} · ${t.join(", ")||"no topics"}`,{event:"status",status:e,topics:t,transport:n}),c.forEach(t=>t(e))},g=e=>{for(let[t,n]of e)d.set(t,n),pA("danger",`${t} refused: ${n}`,{event:"refused",topic:t,reason:n})},y=e=>{"$revoked"===e.type&&"server"===e.from&&g([[e.topic,"revoked"]]),pA("info",`${e.topic} ← ${e.type}`,{event:"received",message:e}),s.get(e.topic)?.forEach(t=>t(e))},b=(e,t)=>{e.me=t.connection,d=/* @__PURE__ */new Map,g(t.refused.map(e=>[e.topic,e.reason])),p=0,m("open")},v=e=>{if(i!==e)return;m("connecting");let t=lA[Math.min(p,lA.length-1)];p+=1,a=setTimeout(x,t)},w=(t,r)=>{let o,a=new AbortController,s={topics:t,transport:"sse",close:()=>a.abort(),publish:async(t,r,a,{echo:l})=>{if(!o)return!1;let c=await n(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({token:o,topic:t,type:r,data:a,...l?{echo:l}:{}})}).catch(()=>{});return 401===c?.status&&i===s&&x(),c?.ok??!1}};return n(`${e}?${r}`,{headers:{accept:"text/event-stream"},credentials:"same-origin",signal:a.signal}).then(async e=>{if(!e.ok)return d=/* @__PURE__ */new Map,g(t.split(",").map(t=>[t,`http_${String(e.status)}`])),void m("closed");throw await(async e=>{let t=e.body?.getReader();if(!t)return;let n=new TextDecoder,r="";for(;;){let{done:e,value:i}=await t.read();if(e)return;r+=n.decode(i,{stream:!0});let a=r.indexOf("\n\n");for(;-1!==a;){let e=dA(r.slice(0,a));r=r.slice(a+2),a=r.indexOf("\n\n"),"ready"===e?.event&&cA(e.data)?(o=e.data.token,b(s,e.data)):"message"===e?.event&&uA(e.data)&&y(e.data)}}})(e),Error("The realtime stream ended")}).catch(()=>{a.signal.aborted||v(s)}),s},k=(t,n)=>{let o=new r(((e,t)=>{let n=new URL(`${e}?${t}`,globalThis.location.href);return n.protocol="https:"===n.protocol?"wss:":"ws:",n.href})(e,n)),a=/* @__PURE__ */new Map,s=0,l=!1,c=!1,u=()=>{a.forEach(e=>e(!1)),a.clear()},d={topics:t,transport:"websocket",close:()=>{c=!0,u(),o.close()},publish:(e,t,n,{echo:r})=>new Promise(i=>{if(o.readyState!==o.OPEN)return void i(!1);s+=1;let l=s,c=setTimeout(()=>{a.delete(l),i(!1)},5e3);a.set(l,e=>{clearTimeout(c),i(e)}),o.send(JSON.stringify({id:l,topic:e,type:t,data:n,...r?{echo:r}:{}}))})};return o.onmessage=e=>{let t=(e=>{try{let t=JSON.parse(String(e));return"object"==typeof t&&t&&"event"in t&&"string"==typeof t.event?{event:t.event,data:"data"in t?t.data:void 0}:void 0}catch{return}})(e.data);"ready"===t?.event&&cA(t.data)?(l=!0,b(d,t.data)):"message"===t?.event&&uA(t.data)?y(t.data):"ack"===t?.event&&(e=>"object"==typeof e&&!!e&&"id"in e&&"number"==typeof e.id&&"ok"in e&&"boolean"==typeof e.ok)(t.data)&&(a.get(t.data.id)?.(t.data.ok),a.delete(t.data.id))},o.onclose=()=>{if(u(),!c&&i===d){if(!l)return h=!1,void x();v(d)}},d};function x(){i?.close(),i=void 0;let e=f();if(!e)return void m("idle");m("connecting");let t=(e=>{let t=e.split(",").flatMap(e=>l.get(e)??[]);return`topics=${encodeURIComponent(e)}${t.length?`&grants=${encodeURIComponent(t.join(","))}`:""}`})(e);i=h?k(e,t):w(e,t)}let S=(e=!1)=>{clearTimeout(o),clearTimeout(a),o=setTimeout(()=>{(e||i?.topics!==f())&&x()},30)},T=e=>"open"===u&&!0===i?.topics.split(",").includes(e),C={subscribe:(e,t)=>{let n=s.get(e)??/* @__PURE__ */new Set;return n.add(t),s.set(e,n),S(),()=>{n.delete(t),n.size||(s.delete(e),l.delete(e),S())}},grant:(e,t)=>{if(l.get(e)===t)return;t?l.set(e,t):l.delete(e);let n=T(e)&&!d.has(e);t&&s.has(e)&&!n&&S(!0)},publish:async(e,t,n,r={})=>{let o=!(!(await(e=>T(e)?Promise.resolve(!0):new Promise(t=>{let n=setTimeout(()=>{r(),t(!1)},5e3),r=C.onStatus(i=>{("closed"===i||T(e))&&(clearTimeout(n),r(),t("closed"!==i))})}))(e))||!i)&&await i.publish(e,t,n,r);return pA(o?"info":"danger",`${e} → ${t}${o?"":" (not delivered)"}`,{event:"published",topic:e,type:t,data:n,delivered:o}),o},onStatus:e=>(c.add(e),()=>c.delete(e)),get status(){return u},get me(){return i?.me},get transport(){return i?.transport??(h?"websocket":"sse")},refusal:e=>d.get(e)};return C})(e,{transport:t});return hA.set(n,i),i})(l,c):void 0,[l,c]),[d,p]=S(!1),[h,m]=S([]),y=x(void 0),b=x({onMessage:r,onJoin:i,onLeave:o});g(()=>{b.current={onMessage:r,onJoin:i,onLeave:o}}),g(()=>{u&&s&&t&&u.grant(s,t)},[u,s,t]),g(()=>{if(!u||!s)return;let e=((e,t,n)=>{let r=fA.get(e)??/* @__PURE__ */new Map;fA.set(e,r);let i=r.get(t)??((e,t,n)=>{let r,i=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set,a=/* @__PURE__ */new Set,s=!1,l=()=>[...s&&e.me?[{from:e.me,state:r,me:!0}]:[],...[...i.values()].map(e=>e.member)],c=()=>{let e=l();a.forEach(t=>t.onChange(e))},u=e=>{let t=e.flatMap(e=>{let t=i.get(e);return i.delete(e),t?[t.member]:[]});if(t.length){c();for(let e of t)a.forEach(t=>t.onDepart?.(e))}},d=()=>{s&&e.publish(t,"$presence",r)},p=e.subscribe(t,t=>{if(t.from!==e.me||!0===t.echo){if("$presence"===t.type){let e={from:t.from,...t.user?{user:t.user}:{},state:t.data,me:!1},n=!i.has(t.from)&&o.delete(t.from);i.set(t.from,{member:e,heardAt:Date.now()}),c(),n&&a.forEach(t=>t.onArrive?.(e))}else"$leave"===t.type?(o.delete(t.from),u([t.from])):"$join"===t.type?(o.add(t.from),d()):"$revoked"===t.type&&"server"===t.from&&(i.clear(),o.clear(),c());a.forEach(e=>e.onMessage?.(t))}}),h=e.onStatus(e=>{"open"===e&&(d(),c())}),f=setInterval(()=>{d();let e=Date.now();u([...i].filter(([,t])=>e-t.heardAt>65e3).map(([e])=>e))},2e4);return{members:l,set:e=>{r=e,s=!0,d(),c()},listeners:a,teardown:()=>{clearInterval(f),h(),p(),n()}}})(e,t,()=>r.delete(t));r.set(t,i),i.listeners.add(n);let o=i.members();return o.length&&n.onChange(o),{set:i.set,members:i.members,stop:()=>{i.listeners.delete(n)&&!i.listeners.size&&i.teardown()}}})(u,s,{onChange:m,onMessage:e=>{"$revoked"===e.type&&"server"===e.from&&p(!1),b.current.onMessage?.(e)},onArrive:e=>b.current.onJoin?.(e),onDepart:e=>b.current.onLeave?.(e)});y.current=e,p("open"===u.status&&!u.refusal(s));let t=u.onStatus(e=>p("open"===e&&!u.refusal(s)));return()=>{t(),e.stop(),y.current=void 0,m([]),p(!1)}},[u,s]);let v=void 0===n?void 0:JSON.stringify(n);g(()=>{void 0!==v&&y.current?.set(JSON.parse(v))},[v,u,s]);let w=f((e,t,n)=>u&&s?u.publish(s,e,t,n):Promise.resolve(!1),[u,s]),T=f(e=>y.current?.set(e),[]);return{connected:d,me:d?u?.me:void 0,members:h,publish:w,setPresence:T}},gA=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}},yA=/* @__PURE__ */new Set(["$presence","$join","$leave"]),bA=Ku(({ref:e,className:t,children:n,topic:r="",grant:i="",presence:o,keep:a=20,subType:s=""})=>{let{id:l,definition:{label:c="Channel"}}=Yu(),{settings:{previewMode:u}}=vu(),{interactionsManager:d}=h(Id),p=Math.max(0,Number(a)||0),[m,g]=S([]),y=f(e=>{yA.has(e.type)||(p>0&&g(t=>[...t,e].slice(-p)),d.interactionTrigger(l,"onMessage",{...e}))},[l,d,p]),b=f(({from:e,user:t,state:n})=>{d.interactionTrigger(l,"onJoin",{from:e,user:t??"",state:n})},[l,d]),v=f(({from:e,user:t,state:n})=>{d.interactionTrigger(l,"onLeave",{from:e,user:t??"",state:n})},[l,d]),w=mA(u&&r?r:void 0,{grant:i||void 0,presence:void 0===o||""===o?void 0:gA(o),onMessage:y,onJoin:b,onLeave:v}),x=k(()=>({publish:{..._o.callbacks.publish,callback:({type:e,data:t,echo:n})=>"string"==typeof e&&e?w.publish(e,gA(t),{echo:Yo(n)}):Promise.resolve(!1)},setPresence:{..._o.callbacks.setPresence,callback:({data:e})=>w.setPresence(gA(e))}}),[w]),T=Md(_o.sourceType,l),C=k(()=>({connected:w.connected,me:w.me??"",members:w.members,messages:m,last:m.at(-1)??null}),[w.connected,w.me,w.members,m]),E=f(()=>nA(C),[C]);Pd({id:l,source:T,name:c||`Channel - ${l}`,fields:E});let A=k(()=>rA(T,C),[C,T]);/* @__PURE__ */
96
+ return I(Gd,{ref:e,tag:K||z?.length?d:"div",className:V("plitzi-component__api-container",t),interactionTriggers:Oo.triggers,interactionCallbacks:Le,children:(!fe||w||T)&&/* @__PURE__ */I(Mt,{inherit:"live",name:`Api:${P}`,value:je,children:Re})})}),oA=Object.assign(iA,Oo),aA=/^[A-Za-z0-9:_.-]{1,128}$/,sA=e=>aA.test(e),lA=[500,1e3,2e3,5e3,1e4],cA=e=>"object"==typeof e&&!!e&&"connection"in e&&"string"==typeof e.connection&&"refused"in e&&Array.isArray(e.refused),uA=e=>"object"==typeof e&&!!e&&"topic"in e&&"string"==typeof e.topic&&"type"in e&&"string"==typeof e.type,dA=e=>{let t="message",n=[];for(let r of e.split("\n"))r.startsWith("event: ")?t=r.slice(7):r.startsWith("data: ")&&n.push(r.slice(6));if(n.length)try{return{event:t,data:JSON.parse(n.join("\n"))}}catch{return}},pA=(e,t,n)=>{"success"===e?$d.success("realtime",t,n):"warning"===e?$d.warning("realtime",t,n):"danger"===e?$d.danger("realtime",t,n):$d.info("realtime",t,n)},hA=/* @__PURE__ */new Map,fA=/* @__PURE__ */new WeakMap,mA=(e,{grant:t,presence:n,onMessage:r,onJoin:i,onLeave:o}={})=>{let[a]=Dt("schema.settings.channels"),s=e&&(a?((e,t)=>{if(!t||!sA(e))return;let n=Object.keys(t).find(t=>(e=>RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map(e=>/^\{[A-Za-z0-9_]+\}$/.test(e)?"[A-Za-z0-9_.-]{1,64}":e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}$`))(t).test(e));return void 0===n?void 0:{pattern:n,declaration:t[n]}})(e,a):sA(e))?e:void 0,[l]=Dt("realtime.endpoint"),[c]=Dt("realtime.transport"),u=k(()=>l&&typeof window<"u"?((e,t="sse")=>{let n=`${t} ${e}`,r=hA.get(n);if(r)return r;let i=((e,{transport:t="sse",fetchImpl:n=fetch,WebSocketImpl:r=globalThis.WebSocket}={})=>{let i,o,a,s=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,c=/* @__PURE__ */new Set,u="idle",d=/* @__PURE__ */new Map,p=0,h="websocket"===t&&"function"==typeof r,f=()=>[...s.keys()].sort().join(","),m=e=>{u=e;let t=f().split(",").filter(Boolean),n=i?.transport??(h?"websocket":"sse");pA("open"===e?"success":"closed"===e?"warning":"info",`${e} · ${t.join(", ")||"no topics"}`,{event:"status",status:e,topics:t,transport:n}),c.forEach(t=>t(e))},g=e=>{for(let[t,n]of e)d.set(t,n),pA("danger",`${t} refused: ${n}`,{event:"refused",topic:t,reason:n})},y=e=>{"$revoked"===e.type&&"server"===e.from&&g([[e.topic,"revoked"]]),pA("info",`${e.topic} ← ${e.type}`,{event:"received",message:e}),s.get(e.topic)?.forEach(t=>t(e))},b=(e,t)=>{e.me=t.connection,d=/* @__PURE__ */new Map,g(t.refused.map(e=>[e.topic,e.reason])),p=0,m("open")},v=e=>{if(i!==e)return;m("connecting");let t=lA[Math.min(p,lA.length-1)];p+=1,a=setTimeout(x,t)},w=(t,r)=>{let o,a=new AbortController,s={topics:t,transport:"sse",close:()=>a.abort(),publish:async(t,r,a,{echo:l})=>{if(!o)return!1;let c=await n(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({token:o,topic:t,type:r,data:a,...l?{echo:l}:{}})}).catch(()=>{});return 401===c?.status&&i===s&&x(),c?.ok??!1}};return n(`${e}?${r}`,{headers:{accept:"text/event-stream"},credentials:"same-origin",signal:a.signal}).then(async e=>{if(!e.ok)return d=/* @__PURE__ */new Map,g(t.split(",").map(t=>[t,`http_${String(e.status)}`])),void m("closed");throw await(async e=>{let t=e.body?.getReader();if(!t)return;let n=new TextDecoder,r="";for(;;){let{done:e,value:i}=await t.read();if(e)return;r+=n.decode(i,{stream:!0});let a=r.indexOf("\n\n");for(;-1!==a;){let e=dA(r.slice(0,a));r=r.slice(a+2),a=r.indexOf("\n\n"),"ready"===e?.event&&cA(e.data)?(o=e.data.token,b(s,e.data)):"message"===e?.event&&uA(e.data)&&y(e.data)}}})(e),Error("The realtime stream ended")}).catch(()=>{a.signal.aborted||v(s)}),s},k=(t,n)=>{let o=new r(((e,t)=>{let n=new URL(`${e}?${t}`,globalThis.location.href);return n.protocol="https:"===n.protocol?"wss:":"ws:",n.href})(e,n)),a=/* @__PURE__ */new Map,s=0,l=!1,c=!1,u=()=>{a.forEach(e=>e(!1)),a.clear()},d={topics:t,transport:"websocket",close:()=>{c=!0,u(),o.close()},publish:(e,t,n,{echo:r})=>new Promise(i=>{if(o.readyState!==o.OPEN)return void i(!1);s+=1;let l=s,c=setTimeout(()=>{a.delete(l),i(!1)},5e3);a.set(l,e=>{clearTimeout(c),i(e)}),o.send(JSON.stringify({id:l,topic:e,type:t,data:n,...r?{echo:r}:{}}))})};return o.onmessage=e=>{let t=(e=>{try{let t=JSON.parse(String(e));return"object"==typeof t&&t&&"event"in t&&"string"==typeof t.event?{event:t.event,data:"data"in t?t.data:void 0}:void 0}catch{return}})(e.data);"ready"===t?.event&&cA(t.data)?(l=!0,b(d,t.data)):"message"===t?.event&&uA(t.data)?y(t.data):"ack"===t?.event&&(e=>"object"==typeof e&&!!e&&"id"in e&&"number"==typeof e.id&&"ok"in e&&"boolean"==typeof e.ok)(t.data)&&(a.get(t.data.id)?.(t.data.ok),a.delete(t.data.id))},o.onclose=()=>{if(u(),!c&&i===d){if(!l)return h=!1,void x();v(d)}},d};function x(){i?.close(),i=void 0;let e=f();if(!e)return void m("idle");m("connecting");let t=(e=>{let t=e.split(",").flatMap(e=>l.get(e)??[]);return`topics=${encodeURIComponent(e)}${t.length?`&grants=${encodeURIComponent(t.join(","))}`:""}`})(e);i=h?k(e,t):w(e,t)}let S=(e=!1)=>{clearTimeout(o),clearTimeout(a),o=setTimeout(()=>{(e||i?.topics!==f())&&x()},30)},T=e=>"open"===u&&!0===i?.topics.split(",").includes(e),C={subscribe:(e,t)=>{let n=s.get(e)??/* @__PURE__ */new Set;return n.add(t),s.set(e,n),S(),()=>{n.delete(t),n.size||(s.delete(e),l.delete(e),S())}},grant:(e,t)=>{if(l.get(e)===t)return;t?l.set(e,t):l.delete(e);let n=T(e)&&!d.has(e);t&&s.has(e)&&!n&&S(!0)},publish:async(e,t,n,r={})=>{let o=!(!(await(e=>T(e)?Promise.resolve(!0):new Promise(t=>{let n=setTimeout(()=>{r(),t(!1)},5e3),r=C.onStatus(i=>{("closed"===i||T(e))&&(clearTimeout(n),r(),t("closed"!==i))})}))(e))||!i)&&await i.publish(e,t,n,r);return pA(o?"info":"danger",`${e} → ${t}${o?"":" (not delivered)"}`,{event:"published",topic:e,type:t,data:n,delivered:o}),o},onStatus:e=>(c.add(e),()=>c.delete(e)),get status(){return u},get me(){return i?.me},get transport(){return i?.transport??(h?"websocket":"sse")},refusal:e=>d.get(e)};return C})(e,{transport:t});return hA.set(n,i),i})(l,c):void 0,[l,c]),[d,p]=S(!1),[h,m]=S([]),[y,b]=S({}),v=x(void 0),w=x({onMessage:r,onJoin:i,onLeave:o});g(()=>{w.current={onMessage:r,onJoin:i,onLeave:o}}),g(()=>{u&&s&&t&&u.grant(s,t)},[u,s,t]),g(()=>{if(!u||!s)return;let e=((e,t,n)=>{let r=fA.get(e)??/* @__PURE__ */new Map;fA.set(e,r);let i=r.get(t)??((e,t,n)=>{let r,i=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set,a=/* @__PURE__ */new Set,s=!1,l=()=>[...s&&e.me?[{from:e.me,state:r,me:!0}]:[],...[...i.values()].map(e=>e.member)],c=()=>{let e=l();a.forEach(t=>t.onChange(e))},u=e=>{let t=e.flatMap(e=>{let t=i.get(e);return i.delete(e),t?[t.member]:[]});if(t.length){c();for(let e of t)a.forEach(t=>t.onDepart?.(e))}},d=()=>{s&&e.publish(t,"$presence",r)},p=e.subscribe(t,t=>{if(t.from!==e.me||!0===t.echo){if("$presence"===t.type){let e={from:t.from,...t.user?{user:t.user}:{},state:t.data,me:!1},n=!i.has(t.from)&&o.delete(t.from);i.set(t.from,{member:e,heardAt:Date.now()}),c(),n&&a.forEach(t=>t.onArrive?.(e))}else"$leave"===t.type?(o.delete(t.from),u([t.from])):"$join"===t.type?(o.add(t.from),d()):"$revoked"===t.type&&"server"===t.from&&(i.clear(),o.clear(),c());a.forEach(e=>e.onMessage?.(t))}}),h=e.onStatus(e=>{"open"===e&&(d(),c())}),f=setInterval(()=>{d();let e=Date.now();u([...i].filter(([,t])=>e-t.heardAt>65e3).map(([e])=>e))},2e4);return{members:l,set:e=>{r=e,s=!0,d(),c()},listeners:a,teardown:()=>{clearInterval(f),h(),p(),n()}}})(e,t,()=>r.delete(t));r.set(t,i),i.listeners.add(n);let o=i.members();return o.length&&n.onChange(o),{set:i.set,members:i.members,stop:()=>{i.listeners.delete(n)&&!i.listeners.size&&i.teardown()}}})(u,s,{onChange:m,onMessage:e=>{"$revoked"===e.type&&"server"===e.from&&p(!1),!0===e.retained&&"server"===e.from&&b(t=>((e,t)=>{if(Object.hasOwn(e,t.type)&&e[t.type].at>t.at)return e;let n=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t.type));return null===t.data?n:{...n,[t.type]:t}})(t,e)),w.current.onMessage?.(e)},onArrive:e=>w.current.onJoin?.(e),onDepart:e=>w.current.onLeave?.(e)});v.current=e,p("open"===u.status&&!u.refusal(s));let t=u.onStatus(e=>p("open"===e&&!u.refusal(s)));return()=>{t(),e.stop(),v.current=void 0,m([]),b({}),p(!1)}},[u,s]);let T=void 0===n?void 0:JSON.stringify(n);g(()=>{void 0!==T&&v.current?.set(JSON.parse(T))},[T,u,s]);let C=f((e,t,n)=>u&&s?u.publish(s,e,t,n):Promise.resolve(!1),[u,s]),E=f(e=>v.current?.set(e),[]),A=k(()=>Object.fromEntries(Object.entries(y).map(([e,t])=>[e,t.data])),[y]);return{connected:d,me:d?u?.me:void 0,members:h,retained:A,publish:C,setPresence:E}},gA=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}},yA=/* @__PURE__ */new Set(["$presence","$join","$leave"]),bA=Ku(({ref:e,className:t,children:n,topic:r="",grant:i="",presence:o,keep:a=20,subType:s=""})=>{let{id:l,definition:{label:c="Channel"}}=Yu(),{settings:{previewMode:u}}=vu(),{interactionsManager:d}=h(Id),p=Math.max(0,Number(a)||0),[m,g]=S([]),y=f(e=>{yA.has(e.type)||(p>0&&g(t=>[...t,e].slice(-p)),d.interactionTrigger(l,"onMessage",{...e}))},[l,d,p]),b=f(({from:e,user:t,state:n})=>{d.interactionTrigger(l,"onJoin",{from:e,user:t??"",state:n})},[l,d]),v=f(({from:e,user:t,state:n})=>{d.interactionTrigger(l,"onLeave",{from:e,user:t??"",state:n})},[l,d]),w=mA(u&&r?r:void 0,{grant:i||void 0,presence:void 0===o||""===o?void 0:gA(o),onMessage:y,onJoin:b,onLeave:v}),x=k(()=>({publish:{..._o.callbacks.publish,callback:({type:e,data:t,echo:n})=>"string"==typeof e&&e?w.publish(e,gA(t),{echo:Yo(n)}):Promise.resolve(!1)},setPresence:{..._o.callbacks.setPresence,callback:({data:e})=>w.setPresence(gA(e))}}),[w]),T=Md(_o.sourceType,l),C=k(()=>({connected:w.connected,me:w.me??"",members:w.members,messages:m,last:m.at(-1)??null,retained:w.retained}),[w.connected,w.me,w.members,w.retained,m]),E=f(()=>nA(C),[C]);Pd({id:l,source:T,name:c||`Channel - ${l}`,fields:E});let A=k(()=>rA(T,C),[C,T]);/* @__PURE__ */
97
97
  return I(Gd,{ref:e,tag:s,className:V("plitzi-component__channel",t),interactionTriggers:_o.triggers,interactionCallbacks:x,children:/* @__PURE__ */I(Mt,{inherit:"live",name:`Channel:${l}`,value:A,children:n})})}),vA=Object.assign(bA,_o),wA=l(void 0);wA.displayName="CarouselContext";var kA=(e,t,n,r)=>{if(t<=0)return 0;let i=e+n;return r?(i%t+t)%t:Math.min(t-1,Math.max(0,i))},xA=(e,t)=>{let n="number"==typeof e?e:Number(e);return!Number.isFinite(n)||t<=0?0:Math.min(t-1,Math.max(0,Math.trunc(n)))},SA=(e,t)=>t<e?"previous":"next",TA=e=>{let t=e.firstElementChild;if(!(t instanceof HTMLElement))return 0;let n=Number.parseFloat(getComputedStyle(e).columnGap);return t.offsetWidth+(Number.isFinite(n)?n:0)},CA=(e,t)=>{let n=e.map(e=>{let n=pr(e,t);return"string"==typeof n||"number"==typeof n?`${t}:${String(n)}`:void 0});if(n.every(e=>void 0!==e)&&new Set(n).size===n.length)return n},EA=(e,t)=>(t?CA(e,t):void 0)??CA(e,"id")??e.map((e,t)=>t),AA=Ku(({ref:e,className:t="",children:n,items:r=[],mode:i="slide",autoplay:o=0,pauseOnHover:a=!0,loop:s=!0,transition:l="slide",speed:c=30,itemKey:u,label:d=""})=>{let{id:p,definition:{label:m="Carousel"}}=Yu(),y=Md(Mo.sourceType,p),{settings:{previewMode:b}}=vu(),{interactionsManager:v}=h(Id),w=k(()=>Array.isArray(r)?r:[],[r]),T=k(()=>EA(w,u),[w,u]),C=w.length,E=!!b,[A,O]=S(0),[_,N]=S("next"),[M,P]=S(!1),[L,R]=S(o>0),j=x(null),z=e??j,D=x(null),$=xA(A,C);g(()=>{A!==$&&O($)},[A,$]);let F=f((e,t)=>{0!==C&&e!==$&&(N(t),P(!0),O(e),v.interactionTrigger(p,"onChange",{index:e,item:w[e]}))},[C,$,p,v,w]),q=f(e=>{let t=D.current,n=t?TA(t):0;t&&n>0&&t.scrollBy({left:e*n,behavior:"smooth"})},[]),B=f(()=>{"scroll"!==i?F(kA($,C,1,s),"next"):q(1)},[C,$,s,i,F,q]),U=f(()=>{"scroll"!==i?F(kA($,C,-1,s),"previous"):q(-1)},[C,$,s,i,F,q]),H=f(e=>{let t=xA(e.index,C);"scroll"!==i?F(t,SA($,t)):q(t-$)},[C,$,i,F,q]),W=f(e=>{e!==$&&F(e,SA($,e))},[$,F]);(({delay:e,active:t,rootRef:n,pauseOnHover:r,position:i,onTick:o})=>{let[a,s]=S(!1),[l,c]=S(!1),u=x(o);g(()=>{u.current=o},[o]),g(()=>{let e=n.current;if(!e||!t)return;let r=()=>s(!0),i=()=>s(!1),o=e=>{e.target instanceof Element&&e.target.matches(":focus-visible")&&c(!0)},a=t=>{(!(t.relatedTarget instanceof Node)||!e.contains(t.relatedTarget))&&c(!1)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",i),e.addEventListener("focusin",o),e.addEventListener("focusout",a),()=>{e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",i),e.removeEventListener("focusin",o),e.removeEventListener("focusout",a)}},[n,t]);let d=r&&a||l;g(()=>{if(!t||e<=0||d||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let n=window.setInterval(()=>{"visible"===document.visibilityState&&u.current()},e);return()=>window.clearInterval(n)},[t,e,d,i])})({delay:"slide"===i?o:0,active:E&&L&&C>1,rootRef:z,pauseOnHover:a,position:$,onTick:B});let G=k(()=>({next:{...Mo.callbacks.next,callback:B},previous:{...Mo.callbacks.previous,callback:U},goTo:{...Mo.callbacks.goTo,callback:H},play:{...Mo.callbacks.play,callback:()=>R(!0)},pause:{...Mo.callbacks.pause,callback:()=>R(!1)}}),[H,B,U]),K=k(()=>({items:w,count:C,index:$,item:w[$],playing:L&&o>0}),[o,C,$,w,L]),Y=f(()=>nA(K),[K]);Pd({id:p,source:y,name:m||`Carousel - ${p}`,fields:Y});let J=k(()=>rA(y,K),[y,K]),X=k(()=>({source:y,items:w,keys:T,index:$,direction:_,moved:M,mode:i,transition:l,speed:c,pauseOnHover:a,live:E,scrollerRef:D,onScrolledTo:W}),[$,_,T,w,E,i,M,W,a,y,c,l]);/* @__PURE__ */
98
98
  return I(Gd,{ref:z,className:V("plitzi-component__carousel",`carousel--${i}`,t),role:"region","aria-roledescription":"carousel","aria-label":d||void 0,interactionTriggers:Mo.triggers,interactionCallbacks:G,children:/* @__PURE__ */I(Mt,{inherit:"live",name:`Carousel:${p}`,value:J,children:/* @__PURE__ */I(wA,{value:X,children:n})})})}),IA=({children:e,className:t="",isTemplate:n=!1,index:r=0,record:i,source:o=""})=>{let a=b(),s=k(()=>rA(o,{item:i,index:r}),[o,i,r]),l=/* @__PURE__ */I(Yg,{children:/* @__PURE__ */I(Mt,{inherit:"live",name:`Row:${o}`,segment:a,value:s,children:e})});return n?/* @__PURE__ */O("div",{className:V("plitzi-component__controlled-list-item",t),children:[/* @__PURE__ */I("div",{className:"controlled-list-item__counter",children:`List Item - ${r+1}`}),l]}):l},OA=({source:e,item:t,position:r,count:i,copy:o=!1,className:a="",children:s})=>{let l=0===n.count(s);/* @__PURE__ */
99
99
  return O("div",{className:V("carousel__slide",a),role:"group","aria-roledescription":"slide","aria-label":`${String(r+1)} of ${String(i)}`,"aria-hidden":o||void 0,inert:o||void 0,children:[l&&/* @__PURE__ */I("div",{className:"carousel__slide--empty",children:`Slide ${String(r+1)}`}),!l&&/* @__PURE__ */I(IA,{index:r,isTemplate:!1,record:t,source:e,children:s})]})},_A=({source:e,items:t,keys:n,speed:r,pauseOnHover:i,live:o,children:a})=>{let s=x(null),[l,c]=S(void 0);g(()=>{let e=s.current;if(!e||r<=0)return;let t=()=>c(e.scrollWidth/2/r);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,t.length]);let u={"--plitzi-marquee-duration":`${String(l??0)}s`};/* @__PURE__ */
@@ -112,46 +112,47 @@ return I(Gd,{ref:e,className:V("plitzi-component__tab-container",t),children:/*
112
112
  return I(Gd,{ref:e,className:V("plitzi-component__tab-container-body",t),children:r})}),tI=Object.assign(eI,Bo),nI=Ku(({ref:e,className:t="",children:n})=>{let r=QA(n,!0);/* @__PURE__ */
113
113
  return I(Gd,{ref:e,role:"tablist",className:V("plitzi-component__tab-container-header",t),children:r})}),rI=Object.assign(nI,Uo),iI=Ku(({className:e="",children:t,ref:n,baseId:r="",tabSelected:i,tabIndex:o=0,tabCount:a=0,isHeader:s,onSelect:l})=>{let c=i===o,u=`${r}_tab_${o}`,d=`${r}_panel_${o}`,p=f(()=>{s&&!c&&l?.(o)},[s,c,o,l]),h=f(e=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void l?.(o);let t=((e,t,n)=>{switch(e){case"ArrowRight":case"ArrowDown":return(t+1)%n;case"ArrowLeft":case"ArrowUp":return(t-1+n)%n;case"Home":return 0;case"End":return n-1;default:return}})(e.key,o,a);void 0!==t&&0!==a&&(e.preventDefault(),l?.(t),e.currentTarget.ownerDocument.getElementById(`${r}_tab_${t}`)?.focus())},[r,o,a,l]),m=s?{id:u,role:"tab","aria-selected":c,"aria-controls":d,tabIndex:c?0:-1,onKeyDown:h}:{id:d,role:"tabpanel","aria-labelledby":u,tabIndex:0,hidden:!c};/* @__PURE__ */
114
114
  return I(Gd,{ref:n,onClick:p,className:V("plitzi-component__tab-container-item",e,{active:c}),...r?m:{},children:t})}),oI=Object.assign(iI,Ho),aI=Object.assign(ZA,{...qo,plugins:{tabContainerHeader:rI,tabContainerBody:tI,tabContainerItem:oI}}),sI=l({addToast:()=>{}});sI.displayName="ToastContext";var lI=e=>"number"==typeof e&&!isNaN(e),cI=e=>"string"==typeof e,uI=e=>"function"==typeof e,dI=e=>cI(e)||uI(e)?e:null,pI=(e,t)=>!1===e||lI(e)&&e>0?e:t,hI=e=>u(e)||cI(e)||uI(e)||lI(e);function fI({enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:o=300}){return function({children:a,position:s,preventExitTransition:l,done:c,nodeRef:u,isIn:d,playToast:p}){let h=r?`${e}--${s}`:e,f=r?`${n}--${s}`:n,m=x(0);return w(()=>{let e=u.current,t=h.split(" "),n=r=>{r.target===u.current&&(p(),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===m.current&&"animationcancel"!==r.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)},[]),g(()=>{let e=u.current,t=()=>{e.removeEventListener("animationend",t),i?function(e,t,n=300){let{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}(e,c,o):c()};d||(l?t():(m.current=1,e.className+=` ${f}`,e.addEventListener("animationend",t)))},[d]),t.createElement(t.Fragment,null,a)}}function mI(e,t){return{content:gI(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function gI(e,t,n=!1){return u(e)&&!cI(e.type)?s(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):uI(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function yI({delay:e,isRunning:n,closeToast:r,type:i="default",hide:o,className:a,controlledProgress:s,progress:l,rtl:c,isIn:u,theme:d}){let p=o||s&&0===l,h={animationDuration:`${e}ms`,animationPlayState:n?"running":"paused"};s&&(h.transform=`scaleX(${l})`);let f=V("Toastify__progress-bar",s?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":c}),m=uI(a)?a({rtl:c,type:i,defaultClassName:f}):V(f,a),g={[s&&l>=1?"onTransitionEnd":"onAnimationEnd"]:s&&l<1?null:()=>{u&&r()}};return t.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},t.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${i}`}),t.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer","aria-valuenow":s?Math.round(100*l):void 0,"aria-valuemin":0,"aria-valuemax":100,className:m,style:h,...g}))}var bI=1,vI=()=>""+bI++;var wI=/* @__PURE__ */new Map,kI=[],xI=/* @__PURE__ */new Set,SI=e=>xI.forEach(t=>t(e)),TI=()=>wI.size>0;function CI(e,t){var n;if(t)return!(null==(n=wI.get(t))||!n.isToastActive(e));let r=!1;return wI.forEach(t=>{t.isToastActive(e)&&(r=!0)}),r}function EI(e,t){hI(e)&&(TI()||kI.push({content:e,options:t}),wI.forEach(n=>{n.buildToast(e,t)}))}function AI(e,t){wI.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function II(e){let t=e.containerId||1;return{subscribe(n){let r=function(e,t,n){let r=1,i=0,o=[],a=[],s=t,l=/* @__PURE__ */new Map,c=/* @__PURE__ */new Set,u=()=>{a=Array.from(l.values()),c.forEach(e=>e())},d=e=>{var t,r;e.isActive&&(null==(r=null==(t=e.props)?void 0:t.onClose)||r.call(t,e.removalReason),e.isActive=!1,n(mI(e,"removed")))},p=e=>{if(null==e)l.forEach(d);else{let t=l.get(e);t&&d(t)}u()},h=e=>{var t,r;let{toastId:i,updateId:o}=e.props,a=null==o;e.staleId&&l.delete(e.staleId),e.isActive=!0,l.set(i,e),u(),n(mI(e,a?"added":"updated")),a&&(null==(r=(t=e.props).onOpen)||r.call(t))};return{id:e,props:s,observe:e=>(c.add(e),()=>c.delete(e)),toggle:(e,t)=>{l.forEach(n=>{var r;(null==t||t===n.props.toastId)&&(null==(r=n.toggle)||r.call(n,e))})},removeToast:p,toasts:l,clearQueue:()=>{i-=o.length,o=[]},buildToast:(t,n)=>{if((({containerId:t,toastId:n,updateId:r})=>{let i=t?t!==e:1!==e,o=l.has(n)&&null==r;return i||o})(n))return;let{toastId:a,updateId:c,data:d,staleId:f,delay:m}=n,g=null==c;g&&i++;let y={...s,style:s.toastStyle,key:r++,...Object.fromEntries(Object.entries(n).filter(([e,t])=>null!=t)),toastId:a,updateId:c,data:d,isIn:!1,className:dI(n.className||s.toastClassName),progressClassName:dI(n.progressClassName||s.progressClassName),autoClose:!n.isLoading&&pI(n.autoClose,s.autoClose),closeToast(e){let t=l.get(a);t&&(t.removalReason=e,p(a))},deleteToast(){if(null!=l.get(a)){if(l.delete(a),i--,i<0&&(i=0),o.length>0)return void h(o.shift());u()}}};y.closeButton=s.closeButton,!1===n.closeButton||hI(n.closeButton)?y.closeButton=n.closeButton:!0===n.closeButton&&(y.closeButton=!hI(s.closeButton)||s.closeButton);let b={content:t,props:y,staleId:f};s.limit&&s.limit>0&&i>s.limit&&g?o.push(b):lI(m)?setTimeout(()=>{h(b)},m):h(b)},setProps(e){s=e},setToggle:(e,t)=>{let n=l.get(e);n&&(n.toggle=t)},isToastActive:e=>{var t;return null==(t=l.get(e))?void 0:t.isActive},getSnapshot:()=>a}}(t,e,SI);wI.set(t,r);let i=r.observe(n);return kI.forEach(e=>EI(e.content,e.options)),kI=[],()=>{i(),wI.delete(t)}},setProps(e){var n;null==(n=wI.get(t))||n.setProps(e)},getSnapshot(){var e;return null==(e=wI.get(t))?void 0:e.getSnapshot()}}}function OI(e){return e&&(cI(e.toastId)||lI(e.toastId))?e.toastId:vI()}function _I(e,t){return EI(e,t),t.toastId}function NI(e,t){return{...t,type:t&&t.type||e,toastId:OI(t)}}function MI(e){return(t,n)=>_I(t,NI(e,n))}function PI(e,t){return _I(e,NI("default",t))}PI.loading=(e,t)=>_I(e,NI("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),PI.promise=function(e,{pending:t,error:n,success:r},i){let o;t&&(o=cI(t)?PI.loading(t,i):PI.loading(t.render,{...i,...t}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(e,t,n)=>{if(null==t)return void PI.dismiss(o);let r={type:e,...a,...i,data:n},s=cI(t)?{render:t}:t;return o?PI.update(o,{...r,...s}):PI(s.render,{...r,...s}),n},l=uI(e)?e():e;return l.then(e=>s("success",r,e)).catch(e=>s("error",n,e)),l},PI.success=MI("success"),PI.info=MI("info"),PI.error=MI("error"),PI.warning=MI("warning"),PI.warn=PI.warning,PI.dark=(e,t)=>_I(e,NI("default",{theme:"dark",...t})),PI.dismiss=function(e){!function(e){if(TI()){if(null==e||(e=>cI(e)||lI(e))(e))wI.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=wI.get(e.containerId);t?t.removeToast(e.id):wI.forEach(t=>{t.removeToast(e.id)})}}else kI=kI.filter(t=>null!=e&&t.options.toastId!==e)}(e)},PI.clearWaitingQueue=(e={})=>{wI.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},PI.isActive=CI,PI.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=wI.get(t||1))?void 0:n.toasts.get(e)})(e,t);if(n){let{props:r,content:i}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:vI()};o.toastId!==e&&(o.staleId=e);let a=o.render||i;delete o.render,_I(a,o)}},PI.done=e=>{PI.update(e,{progress:1})},PI.onChange=function(e){return xI.add(e),()=>{xI.delete(e)}},PI.play=e=>AI(!0,e),PI.pause=e=>AI(!1,e);var LI="undefined"!=typeof window?w:g,RI=({theme:e,type:n,isLoading:r,...i})=>t.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===e?"currentColor":`var(--toastify-icon-color-${n})`,...i}),jI={info:function(e){return t.createElement(RI,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return t.createElement(RI,{...e},t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return t.createElement(RI,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return t.createElement(RI,{...e},t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return t.createElement("div",{className:"Toastify__spinner"})}};var zI=e=>{let{isRunning:n,preventExitTransition:r,toastRef:i,eventHandlers:o,playToast:a}=function(e){let[t,n]=S(!1),[r,i]=S(!1),o=x(null),a=x({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:d}=e;function p(){n(!0)}function h(){n(!1)}function f(n){let r=o.current;if(a.canDrag&&r){a.didMove=!0,t&&h(),"x"===e.draggableDirection?a.delta=n.clientX-a.start:a.delta=n.clientY-a.start,a.start!==n.clientX&&(a.canCloseOnClick=!1);let i="x"===e.draggableDirection?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;r.style.transform=`translate3d(${i},0)`,r.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance))}}function m(){document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",m);let t=o.current;if(a.canDrag&&a.didMove&&t){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return i(!0),e.closeToast(!0),void e.collapseAll();t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}(function(e){var t;null==(t=wI.get(e.containerId||1))||t.setToggle(e.id,e.fn)})({id:e.toastId,containerId:e.containerId,fn:n}),g(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||h(),window.addEventListener("focus",p),window.addEventListener("blur",h),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",h)}},[e.pauseOnFocusLoss]);let y={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){a.didMove=!1,document.addEventListener("pointermove",f),document.addEventListener("pointerup",m);let n=o.current;a.canCloseOnClick=!0,a.canDrag=!0,n.style.transition="none","x"===e.draggableDirection?(a.start=t.clientX,a.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(a.start=t.clientY,a.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(t){let{top:n,bottom:r,left:i,right:a}=o.current.getBoundingClientRect();"mouse"===t.pointerType&&e.pauseOnHover&&t.clientX>=i&&t.clientX<=a&&t.clientY>=n&&t.clientY<=r?h():p()}};return s&&l&&(y.onMouseEnter=h,e.stacked||(y.onMouseLeave=p)),d&&(y.onClick=e=>{u&&u(e),a.canCloseOnClick&&c(!0)}),{playToast:p,pauseToast:h,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:y}}(e),{closeButton:l,children:c,autoClose:d,onClick:p,type:h,hideProgressBar:f,closeToast:m,transition:y,position:b,className:v,style:w,progressClassName:k,updateId:T,role:C,progress:E,rtl:A,toastId:I,deleteToast:O,isIn:_,isLoading:N,closeOnClick:M,theme:P,ariaLabel:L}=e,R=V("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":A},{"Toastify__toast--close-on-click":M}),j=uI(v)?v({rtl:A,position:b,type:h,defaultClassName:R}):V(R,v),z=function({theme:e,type:t,isLoading:n,icon:r}){let i=null,o={theme:e,type:t};return!1===r||(uI(r)?i=r({...o,isLoading:n}):u(r)?i=s(r,o):n?i=jI.spinner():(e=>e in jI)(t)&&(i=jI[t](o))),i}(e),D=!!E||!d,$={closeToast:m,type:h,theme:P},F=null;return!1===l||(F=uI(l)?l($):u(l)?s(l,$):function({closeToast:e,theme:n,ariaLabel:r="close"}){return t.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:t=>{t.stopPropagation(),e(!0)},"aria-label":r},t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}($)),t.createElement(y,{isIn:_,done:O,position:b,preventExitTransition:r,nodeRef:i,playToast:a},t.createElement("div",{id:I,tabIndex:0,onClick:p,"data-in":_,className:j,...o,style:w,ref:i,..._&&{role:C,"aria-label":L}},null!=z&&t.createElement("div",{className:V("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!N})},z),gI(c,e,!n),F,!e.customProgressBar&&t.createElement(yI,{...T&&!D?{key:`p-${T}`}:{},rtl:A,theme:P,delay:d,isRunning:n,isIn:_,closeToast:m,hide:f,type:h,className:k,controlledProgress:D,progress:E||0})))},DI=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),$I=fI(DI("bounce",!0)),FI=(fI(DI("slide",!0)),fI(DI("zoom")),fI(DI("flip")),{position:"top-right",transition:$I,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&"KeyT"===e.code});function qI(e){let n={...FI,...e},r=e.stacked,[i,o]=S(!0),a=x(null),{getToastToRender:s,isToastActive:l,count:c}=function(e){var t;let{subscribe:n,getSnapshot:r,setProps:i}=x(II(e)).current;i(e);let o=null==(t=T(n,r,r))?void 0:t.slice();return{getToastToRender:function(t){if(!o)return[];let n=/* @__PURE__ */new Map;return e.newestOnTop&&o.reverse(),o.forEach(e=>{let{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},isToastActive:CI,count:null==o?void 0:o.length}}(n),{className:u,style:d,rtl:p,containerId:h,hotKeys:f}=n;function m(e){let t=V("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":p});return uI(u)?u({position:e,rtl:p,defaultClassName:t}):V(t,dI(u))}function y(){r&&(o(!0),PI.play())}return LI(()=>{var e;if(r){let t=a.current.querySelectorAll('[data-in="true"]'),r=12,o=null==(e=n.position)?void 0:e.includes("top"),s=0,l=0;Array.from(t).reverse().forEach((e,t)=>{let n=e;n.classList.add("Toastify__toast--stacked"),t>0&&(n.dataset.collapsed=`${i}`),n.dataset.pos||(n.dataset.pos=o?"top":"bot");let a=s*(i?.2:1)+(i?0:r*t),c=Math.max(.5,1-(i?l:0));n.style.setProperty("--y",`${o?a:-1*a}px`),n.style.setProperty("--g",`${r}`),n.style.setProperty("--s",`${c}`),s+=n.offsetHeight,l+=.025})}},[i,c,r]),g(()=>{function e(e){var t;let n=a.current;f(e)&&(null==(t=null==n?void 0:n.querySelector('[tabIndex="0"]'))||t.focus(),o(!1),PI.pause()),"Escape"===e.key&&(document.activeElement===n||null!=n&&n.contains(document.activeElement))&&(o(!0),PI.play())}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[f]),t.createElement("section",{ref:a,className:"Toastify",id:h,onMouseEnter:()=>{r&&(o(!1),PI.pause())},onMouseLeave:y,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":n["aria-label"]},s((e,n)=>{let i=n.length?{...d}:{...d,pointerEvents:"none"};return t.createElement("div",{tabIndex:-1,className:m(e),"data-stacked":r,style:i,key:`c-${e}`},n.map(({content:e,props:n})=>t.createElement(zI,{...n,stacked:r,collapseAll:y,isIn:l(n.toastId,n.containerId),key:`t-${n.key}`},e)))}))}var BI=/* @__PURE__ */new Map;function UI(e){return((e,t)=>{LI(()=>{if("undefined"==typeof document)return;let n=document,r=BI.get(n);if(r)return void(t&&r.setAttribute("nonce",t));let i=n.createElement("style");i.textContent=e,t&&i.setAttribute("nonce",t),n.head.appendChild(i),BI.set(n,i)},[t])})(":root {\n --toastify-color-light: #fff;\n --toastify-color-dark: #121212;\n --toastify-color-info: #3498db;\n --toastify-color-success: #07bc0c;\n --toastify-color-warning: #f1c40f;\n --toastify-color-error: hsl(6, 78%, 57%);\n --toastify-color-transparent: rgba(255, 255, 255, 0.7);\n\n --toastify-icon-color-info: var(--toastify-color-info);\n --toastify-icon-color-success: var(--toastify-color-success);\n --toastify-icon-color-warning: var(--toastify-color-warning);\n --toastify-icon-color-error: var(--toastify-color-error);\n\n --toastify-container-width: fit-content;\n --toastify-toast-width: 320px;\n --toastify-toast-offset: 16px;\n --toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));\n --toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));\n --toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));\n --toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));\n --toastify-toast-background: #fff;\n --toastify-toast-padding: 14px;\n --toastify-toast-min-height: 64px;\n --toastify-toast-max-height: 800px;\n --toastify-toast-bd-radius: 6px;\n --toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);\n --toastify-font-family: sans-serif;\n --toastify-z-index: 9999;\n --toastify-text-color-light: #757575;\n --toastify-text-color-dark: #fff;\n\n /* Used only for colored theme */\n --toastify-text-color-info: #fff;\n --toastify-text-color-success: #fff;\n --toastify-text-color-warning: #fff;\n --toastify-text-color-error: #fff;\n\n --toastify-spinner-color: #616161;\n --toastify-spinner-color-empty-area: #e0e0e0;\n --toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);\n --toastify-color-progress-dark: #bb86fc;\n --toastify-color-progress-info: var(--toastify-color-info);\n --toastify-color-progress-success: var(--toastify-color-success);\n --toastify-color-progress-warning: var(--toastify-color-warning);\n --toastify-color-progress-error: var(--toastify-color-error);\n /* used to control the opacity of the progress trail */\n --toastify-color-progress-bgo: 0.2;\n}\n\n.Toastify__toast-container {\n z-index: var(--toastify-z-index);\n -webkit-transform: translate3d(0, 0, var(--toastify-z-index));\n position: fixed;\n width: var(--toastify-container-width);\n box-sizing: border-box;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n\n.Toastify__toast-container--top-left {\n top: var(--toastify-toast-top);\n left: var(--toastify-toast-left);\n}\n.Toastify__toast-container--top-center {\n top: var(--toastify-toast-top);\n left: 50%;\n transform: translateX(-50%);\n align-items: center;\n}\n.Toastify__toast-container--top-right {\n top: var(--toastify-toast-top);\n right: var(--toastify-toast-right);\n align-items: end;\n}\n.Toastify__toast-container--bottom-left {\n bottom: var(--toastify-toast-bottom);\n left: var(--toastify-toast-left);\n}\n.Toastify__toast-container--bottom-center {\n bottom: var(--toastify-toast-bottom);\n left: 50%;\n transform: translateX(-50%);\n align-items: center;\n}\n.Toastify__toast-container--bottom-right {\n bottom: var(--toastify-toast-bottom);\n right: var(--toastify-toast-right);\n align-items: end;\n}\n\n.Toastify__toast {\n --y: 0px;\n position: relative;\n touch-action: none;\n width: var(--toastify-toast-width);\n min-height: var(--toastify-toast-min-height);\n box-sizing: border-box;\n margin-bottom: 1rem;\n padding: var(--toastify-toast-padding);\n border-radius: var(--toastify-toast-bd-radius);\n box-shadow: var(--toastify-toast-shadow);\n max-height: var(--toastify-toast-max-height);\n font-family: var(--toastify-font-family);\n /* webkit only issue #791 */\n z-index: 0;\n /* inner swag */\n display: flex;\n flex: 1 auto;\n align-items: center;\n word-break: break-word;\n}\n\n@media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n width: 100vw;\n left: env(safe-area-inset-left);\n margin: 0;\n }\n .Toastify__toast-container--top-left,\n .Toastify__toast-container--top-center,\n .Toastify__toast-container--top-right {\n top: env(safe-area-inset-top);\n transform: translateX(0);\n }\n .Toastify__toast-container--bottom-left,\n .Toastify__toast-container--bottom-center,\n .Toastify__toast-container--bottom-right {\n bottom: env(safe-area-inset-bottom);\n transform: translateX(0);\n }\n .Toastify__toast-container--rtl {\n right: env(safe-area-inset-right);\n left: initial;\n }\n .Toastify__toast {\n --toastify-toast-width: 100%;\n margin-bottom: 0;\n border-radius: 0;\n }\n}\n\n.Toastify__toast-container[data-stacked='true'] {\n width: var(--toastify-toast-width);\n}\n\n@media only screen and (max-width: 480px) {\n .Toastify__toast-container[data-stacked='true'] {\n width: 100vw;\n }\n}\n\n.Toastify__toast--stacked {\n position: absolute;\n width: 100%;\n transform: translate3d(0, var(--y), 0) scale(var(--s));\n transition: transform 0.3s;\n}\n\n.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,\n.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {\n transition: opacity 0.1s;\n}\n\n.Toastify__toast--stacked[data-collapsed='false'] {\n overflow: visible;\n}\n\n.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {\n opacity: 0;\n}\n\n.Toastify__toast--stacked:after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n height: calc(var(--g) * 1px);\n bottom: 100%;\n}\n\n.Toastify__toast--stacked[data-pos='top'] {\n top: 0;\n}\n\n.Toastify__toast--stacked[data-pos='bot'] {\n bottom: 0;\n}\n\n.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {\n transform-origin: top;\n}\n\n.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {\n transform-origin: bottom;\n}\n\n.Toastify__toast--stacked:before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n transform: scaleY(3);\n z-index: -1;\n}\n\n.Toastify__toast--rtl {\n direction: rtl;\n}\n\n.Toastify__toast--close-on-click {\n cursor: pointer;\n}\n\n.Toastify__toast-icon {\n margin-inline-end: 10px;\n width: 22px;\n flex-shrink: 0;\n display: flex;\n}\n\n.Toastify--animate {\n animation-fill-mode: both;\n animation-duration: 0.5s;\n}\n\n.Toastify--animate-icon {\n animation-fill-mode: both;\n animation-duration: 0.3s;\n}\n\n.Toastify__toast-theme--dark {\n background: var(--toastify-color-dark);\n color: var(--toastify-text-color-dark);\n}\n\n.Toastify__toast-theme--light {\n background: var(--toastify-color-light);\n color: var(--toastify-text-color-light);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--default {\n background: var(--toastify-color-light);\n color: var(--toastify-text-color-light);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--info {\n color: var(--toastify-text-color-info);\n background: var(--toastify-color-info);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--success {\n color: var(--toastify-text-color-success);\n background: var(--toastify-color-success);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--warning {\n color: var(--toastify-text-color-warning);\n background: var(--toastify-color-warning);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--error {\n color: var(--toastify-text-color-error);\n background: var(--toastify-color-error);\n}\n\n.Toastify__progress-bar-theme--light {\n background: var(--toastify-color-progress-light);\n}\n\n.Toastify__progress-bar-theme--dark {\n background: var(--toastify-color-progress-dark);\n}\n\n.Toastify__progress-bar--info {\n background: var(--toastify-color-progress-info);\n}\n\n.Toastify__progress-bar--success {\n background: var(--toastify-color-progress-success);\n}\n\n.Toastify__progress-bar--warning {\n background: var(--toastify-color-progress-warning);\n}\n\n.Toastify__progress-bar--error {\n background: var(--toastify-color-progress-error);\n}\n\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {\n background: var(--toastify-color-transparent);\n}\n\n.Toastify__close-button {\n color: #fff;\n position: absolute;\n top: 6px;\n right: 6px;\n background: transparent;\n outline: none;\n border: none;\n padding: 0;\n cursor: pointer;\n opacity: 0.7;\n transition: 0.3s ease;\n z-index: 1;\n}\n\n.Toastify__toast--rtl .Toastify__close-button {\n left: 6px;\n right: unset;\n}\n\n.Toastify__close-button--light {\n color: #000;\n opacity: 0.3;\n}\n\n.Toastify__close-button > svg {\n fill: currentColor;\n height: 16px;\n width: 14px;\n}\n\n.Toastify__close-button:hover,\n.Toastify__close-button:focus {\n opacity: 1;\n}\n\n@keyframes Toastify__trackProgress {\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n}\n\n.Toastify__progress-bar {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n opacity: 0.7;\n transform-origin: left;\n}\n\n.Toastify__progress-bar--animated {\n animation: Toastify__trackProgress linear 1 forwards;\n}\n\n.Toastify__progress-bar--controlled {\n transition: transform 0.2s;\n}\n\n.Toastify__progress-bar--rtl {\n right: 0;\n left: initial;\n transform-origin: right;\n border-bottom-left-radius: initial;\n}\n\n.Toastify__progress-bar--wrp {\n position: absolute;\n overflow: hidden;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 5px;\n border-bottom-left-radius: var(--toastify-toast-bd-radius);\n border-bottom-right-radius: var(--toastify-toast-bd-radius);\n}\n\n.Toastify__progress-bar--wrp[data-hidden='true'] {\n opacity: 0;\n}\n\n.Toastify__progress-bar--bg {\n opacity: var(--toastify-color-progress-bgo);\n width: 100%;\n height: 100%;\n}\n\n.Toastify__spinner {\n width: 20px;\n height: 20px;\n box-sizing: border-box;\n border: 2px solid;\n border-radius: 100%;\n border-color: var(--toastify-spinner-color-empty-area);\n border-right-color: var(--toastify-spinner-color);\n animation: Toastify__spin 0.65s linear infinite;\n}\n\n@keyframes Toastify__bounceInRight {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n from {\n opacity: 0;\n transform: translate3d(3000px, 0, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(-25px, 0, 0);\n }\n 75% {\n transform: translate3d(10px, 0, 0);\n }\n 90% {\n transform: translate3d(-5px, 0, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutRight {\n 20% {\n opacity: 1;\n transform: translate3d(-20px, var(--y), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(2000px, var(--y), 0);\n }\n}\n\n@keyframes Toastify__bounceInLeft {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n 0% {\n opacity: 0;\n transform: translate3d(-3000px, 0, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(25px, 0, 0);\n }\n 75% {\n transform: translate3d(-10px, 0, 0);\n }\n 90% {\n transform: translate3d(5px, 0, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutLeft {\n 20% {\n opacity: 1;\n transform: translate3d(20px, var(--y), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(-2000px, var(--y), 0);\n }\n}\n\n@keyframes Toastify__bounceInUp {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n from {\n opacity: 0;\n transform: translate3d(0, 3000px, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(0, -20px, 0);\n }\n 75% {\n transform: translate3d(0, 10px, 0);\n }\n 90% {\n transform: translate3d(0, -5px, 0);\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n\n@keyframes Toastify__bounceOutUp {\n 20% {\n transform: translate3d(0, calc(var(--y) - 10px), 0);\n }\n 40%,\n 45% {\n opacity: 1;\n transform: translate3d(0, calc(var(--y) + 20px), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(0, -2000px, 0);\n }\n}\n\n@keyframes Toastify__bounceInDown {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n 0% {\n opacity: 0;\n transform: translate3d(0, -3000px, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(0, 25px, 0);\n }\n 75% {\n transform: translate3d(0, -10px, 0);\n }\n 90% {\n transform: translate3d(0, 5px, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutDown {\n 20% {\n transform: translate3d(0, calc(var(--y) - 10px), 0);\n }\n 40%,\n 45% {\n opacity: 1;\n transform: translate3d(0, calc(var(--y) + 20px), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(0, 2000px, 0);\n }\n}\n\n.Toastify__bounce-enter--top-left,\n.Toastify__bounce-enter--bottom-left {\n animation-name: Toastify__bounceInLeft;\n}\n\n.Toastify__bounce-enter--top-right,\n.Toastify__bounce-enter--bottom-right {\n animation-name: Toastify__bounceInRight;\n}\n\n.Toastify__bounce-enter--top-center {\n animation-name: Toastify__bounceInDown;\n}\n\n.Toastify__bounce-enter--bottom-center {\n animation-name: Toastify__bounceInUp;\n}\n\n.Toastify__bounce-exit--top-left,\n.Toastify__bounce-exit--bottom-left {\n animation-name: Toastify__bounceOutLeft;\n}\n\n.Toastify__bounce-exit--top-right,\n.Toastify__bounce-exit--bottom-right {\n animation-name: Toastify__bounceOutRight;\n}\n\n.Toastify__bounce-exit--top-center {\n animation-name: Toastify__bounceOutUp;\n}\n\n.Toastify__bounce-exit--bottom-center {\n animation-name: Toastify__bounceOutDown;\n}\n\n@keyframes Toastify__zoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n 50% {\n opacity: 1;\n }\n}\n\n@keyframes Toastify__zoomOut {\n from {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);\n }\n to {\n opacity: 0;\n }\n}\n\n.Toastify__zoom-enter {\n animation-name: Toastify__zoomIn;\n}\n\n.Toastify__zoom-exit {\n animation-name: Toastify__zoomOut;\n}\n\n@keyframes Toastify__flipIn {\n from {\n transform: perspective(400px) rotate3d(1, 0, 0, 90deg);\n animation-timing-function: ease-in;\n opacity: 0;\n }\n 40% {\n transform: perspective(400px) rotate3d(1, 0, 0, -20deg);\n animation-timing-function: ease-in;\n }\n 60% {\n transform: perspective(400px) rotate3d(1, 0, 0, 10deg);\n opacity: 1;\n }\n 80% {\n transform: perspective(400px) rotate3d(1, 0, 0, -5deg);\n }\n to {\n transform: perspective(400px);\n }\n}\n\n@keyframes Toastify__flipOut {\n from {\n transform: translate3d(0, var(--y), 0) perspective(400px);\n }\n 30% {\n transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);\n opacity: 1;\n }\n to {\n transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);\n opacity: 0;\n }\n}\n\n.Toastify__flip-enter {\n animation-name: Toastify__flipIn;\n}\n\n.Toastify__flip-exit {\n animation-name: Toastify__flipOut;\n}\n\n@keyframes Toastify__slideInRight {\n from {\n transform: translate3d(110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInLeft {\n from {\n transform: translate3d(-110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInUp {\n from {\n transform: translate3d(0, 110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInDown {\n from {\n transform: translate3d(0, -110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutRight {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(110%, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutLeft {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(-110%, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutDown {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, 500px, 0);\n }\n}\n\n@keyframes Toastify__slideOutUp {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, -500px, 0);\n }\n}\n\n.Toastify__slide-enter--top-left,\n.Toastify__slide-enter--bottom-left {\n animation-name: Toastify__slideInLeft;\n}\n\n.Toastify__slide-enter--top-right,\n.Toastify__slide-enter--bottom-right {\n animation-name: Toastify__slideInRight;\n}\n\n.Toastify__slide-enter--top-center {\n animation-name: Toastify__slideInDown;\n}\n\n.Toastify__slide-enter--bottom-center {\n animation-name: Toastify__slideInUp;\n}\n\n.Toastify__slide-exit--top-left,\n.Toastify__slide-exit--bottom-left {\n animation-name: Toastify__slideOutLeft;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--top-right,\n.Toastify__slide-exit--bottom-right {\n animation-name: Toastify__slideOutRight;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--top-center {\n animation-name: Toastify__slideOutUp;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--bottom-center {\n animation-name: Toastify__slideOutDown;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n@keyframes Toastify__spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",e.nonce),t.createElement(qI,{...e})}var HI=({children:e,classNameToast:t="",classNameContainer:n="",isFixed:r=!0,containerId:i})=>{let o=k(()=>i??crypto.randomUUID(),[i]),a=f(async(e,n={})=>{let{appeareance:r="default",placement:i="top-right",autoDismiss:a=!0,autoDismissTimeout:s=5e3,theme:l="light",icon:c}=n,u=PI;r&&"default"!==r&&PI[r]&&(u=PI[r]),u(e,{className:t,position:i,autoClose:!!a&&s,hideProgressBar:!a,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:l,icon:c,containerId:o})},[t,o]),s=k(()=>({addToast:a}),[a]);/* @__PURE__ */
115
- return O(sI,{value:s,children:[/* @__PURE__ */I(UI,{containerId:o,pauseOnFocusLoss:!1,className:V(n,{"toast-container--absolute":!r})}),e]})},WI={source:"space",title:"Add Notification",strictParams:!0,params:{content:{type:"textarea",description:"The notification text shown to the user — this is the message body. There is no separate title/message/type param.",default:"Content"},placement:{type:"select",description:"Where the toast appears on screen.",default:"top-right",options:["top-right","top-center","top-left","bottom-right","bottom-center","bottom-left"]},appearance:{type:"select",description:"Visual style of the notification: success, danger, warning or info.",default:"success",options:["success","danger","warning","info"]},autoDismiss:{type:"boolean",description:"Whether the notification dismisses itself after a timeout.",default:!0,canBind:!1},autoDismissTimeout:{type:"number",description:"Milliseconds before auto-dismiss. Only applies when autoDismiss is true.",default:5e3,when:e=>!0===e.autoDismiss}}},VI=({children:e})=>{const{addToast:t}=(()=>{let e=h(sI);if(void 0===e)throw Error("ToastContext value is undefined. Make sure you use the ToastProvider before using the hook.");return e})(),{useInteractions:n}=h(Id),{resolvedTheme:r}=Ng(_g),i=f(e=>{const{placement:n,appearance:i,autoDismiss:o,autoDismissTimeout:a}=e;let{content:s}=e;"string"!=typeof s&&(s=JSON.stringify(s)),t(/* @__PURE__ */I("div",{className:"whitespace-break-spaces",children:s}),{appeareance:i,autoDismiss:o,placement:n,autoDismissTimeout:a,theme:r})},[t,r]);return n({id:"space",callbacks:k(()=>({addNotification:nd("addNotification",WI,i)}),[i])}),/* @__PURE__ */I(A,{children:e})},GI=({children:e})=>{const{webId:t}=h(Kd);/* @__PURE__ */
116
- return I(HI,{containerId:`toast-container-${t}`,classNameContainer:"plitzi-sdk-toasts",children:/* @__PURE__ */I(VI,{children:e})})},KI=()=>{const{overQuota:e}=re();return e?/* @__PURE__ */O("div",{className:"plitzi-over-quota",role:"status",children:[/* @__PURE__ */I("span",{className:"plitzi-over-quota__text",children:"This site is over its monthly plan limit."}),/* @__PURE__ */I("a",{className:"plitzi-over-quota__cta",href:"https://plitzi.com/pricing",rel:"noreferrer noopener",target:"_blank",children:"Upgrade"})]}):null},YI=p(({pageId:e="",style:t="",plitziContextValue:n,assets:r=Vr,ref:i})=>{const o=k(()=>({id:e,rootId:e}),[e]);/* @__PURE__ */
117
- return I(zg,{ref:i,id:"i-sdk",css:t,assets:r,className:"w-full grow",children:/* @__PURE__ */O(GI,{children:[/* @__PURE__ */I(wu,{value:n,children:e&&/* @__PURE__ */I(mE,{internalProps:o})}),/* @__PURE__ */I(KI,{})]})})}),JI=p(({pageId:e="",style:t="",plitziContextValue:n,renderMode:r="raw"})=>{const i=k(()=>({id:e,rootId:e}),[e]),[o]=Bt("schema.flat"),a=k(()=>e&&"widget"===r?pr(o,`${e}.definition.type`,"page"):"page",[e,r,o]);/* @__PURE__ */
118
- return O(GI,{children:[
115
+ return O(sI,{value:s,children:[/* @__PURE__ */I(UI,{containerId:o,pauseOnFocusLoss:!1,className:V(n,{"toast-container--absolute":!r})}),e]})},WI=["top-right","top-center","top-left","bottom-right","bottom-center","bottom-left"],VI=["success","danger","warning","info"],GI={placement:"top-right",appearance:"success",autoDismiss:!0,autoDismissTimeout:5e3},KI={addNotification:{source:"space",title:"Add Notification",strictParams:!0,params:{content:{type:"textarea",description:"The notification text shown to the user — this is the message body. There is no separate title/message/type param.",default:"Content"},placement:{type:"select",description:"Where the toast appears on screen.",default:GI.placement,options:[...WI]},appearance:{type:"select",description:"Visual style of the notification: success, danger, warning or info.",default:GI.appearance,options:[...VI]},autoDismiss:{type:"boolean",description:"Whether the notification dismisses itself after a timeout.",default:GI.autoDismiss,canBind:!1},autoDismissTimeout:{type:"number",description:"Milliseconds before auto-dismiss. Only applies when autoDismiss is true.",default:GI.autoDismissTimeout,when:e=>!0===e.autoDismiss}}}},YI=K("NotifyContext",e=>{console.warn(`[plitzi] useNotify: no space is rendered around this element, so "${e}" was not shown`)}),JI=()=>h(YI),XI={success:"success",danger:"error",warning:"warning",info:"info"},ZI=({children:e})=>{const{addToast:t}=(()=>{let e=h(sI);if(void 0===e)throw Error("ToastContext value is undefined. Make sure you use the ToastProvider before using the hook.");return e})(),{useInteractions:n}=h(Id),{resolvedTheme:r}=Ng(_g),i=f((e,n={})=>{const{options:i,ignored:o}=(e=>{let t=WI.find(t=>t===e.placement),n=VI.find(t=>t===e.appearance),{autoDismiss:r,autoDismissTimeout:i}=e,o="number"==typeof i&&Number.isFinite(i)&&i>0?i:void 0,a={placement:void 0!==t,appearance:void 0!==n,autoDismiss:"boolean"==typeof r,autoDismissTimeout:void 0!==o};return{options:{...void 0===t?{}:{placement:t},...void 0===n?{}:{appearance:n},..."boolean"==typeof r?{autoDismiss:r}:{},...void 0===o?{}:{autoDismissTimeout:o}},ignored:Object.entries(a).filter(([t,n])=>!n&&void 0!==e[t]).map(([e])=>e)}})(n);o.length>0&&console.warn(`[plitzi] notification "${e}": ${o.join(", ")} not one it takes — shown with the default instead`);const{placement:a,appearance:s,autoDismiss:l,autoDismissTimeout:c}={...GI,...i};t(/* @__PURE__ */I("div",{className:"whitespace-break-spaces",children:e}),{appeareance:XI[s],autoDismiss:l,placement:a,autoDismissTimeout:c,theme:r})},[t,r]),o=f(e=>{const{content:t,...n}=e;i("string"==typeof t?t:JSON.stringify(t),n)},[i]);return n({id:"space",callbacks:k(()=>({addNotification:nd("addNotification",KI.addNotification,o)}),[o])}),/* @__PURE__ */I(A,{children:/* @__PURE__ */I(YI,{value:i,children:e})})},QI=({children:e})=>{const{webId:t}=h(Kd);/* @__PURE__ */
116
+ return I(HI,{containerId:`toast-container-${t}`,classNameContainer:"plitzi-sdk-toasts",children:/* @__PURE__ */I(ZI,{children:e})})},eO=()=>{const{overQuota:e}=re();return e?/* @__PURE__ */O("div",{className:"plitzi-over-quota",role:"status",children:[/* @__PURE__ */I("span",{className:"plitzi-over-quota__text",children:"This site is over its monthly plan limit."}),/* @__PURE__ */I("a",{className:"plitzi-over-quota__cta",href:"https://plitzi.com/pricing",rel:"noreferrer noopener",target:"_blank",children:"Upgrade"})]}):null},tO=p(({pageId:e="",style:t="",plitziContextValue:n,assets:r=Vr,ref:i})=>{const o=k(()=>({id:e,rootId:e}),[e]);/* @__PURE__ */
117
+ return I(zg,{ref:i,id:"i-sdk",css:t,assets:r,className:"w-full grow",children:/* @__PURE__ */O(QI,{children:[/* @__PURE__ */I(wu,{value:n,children:e&&/* @__PURE__ */I(mE,{internalProps:o})}),/* @__PURE__ */I(eO,{})]})})}),nO=p(({pageId:e="",style:t="",plitziContextValue:n,renderMode:r="raw"})=>{const i=k(()=>({id:e,rootId:e}),[e]),[o]=Bt("schema.flat"),a=k(()=>e&&"widget"===r?pr(o,`${e}.definition.type`,"page"):"page",[e,r,o]);/* @__PURE__ */
118
+ return O(QI,{children:[
119
119
  /* @__PURE__ */I("style",{type:"text/css",rel:"stylesheet","data-id":"plitzi-runtime-style",children:t}),
120
120
  /* @__PURE__ */O(wu,{value:n,children:[e&&"widget"!==r&&/* @__PURE__ */I(mE,{internalProps:i}),e&&"widget"===r&&/* @__PURE__ */I(Kg,{type:a,internalProps:i},e)]}),
121
- /* @__PURE__ */I(KI,{})]})}),XI=({children:e,contentDidMount:t,contentDidDismount:n})=>(g(()=>(t?.(),()=>{n?.()}),[]),e),ZI=l({shadowRoot:null});ZI.displayName="ContainerShadowContext";var QI=({href:e,onLoad:t,onError:n,onRegister:r,onUnregister:i,...o})=>{let[a,s]=S(!1),l=x(null);return g(()=>(r?.(l),s(!0),()=>{i?.(l)}),[]),/* @__PURE__ */I("link",a?{ref:l,href:e,onLoad:t,onError:n,rel:"stylesheet",...o}:{ref:l,rel:"stylesheet",...o})},eO=({children:e,...t})=>{let n=x(null);/* @__PURE__ */
122
- return I("style",{ref:n,...t,children:e})},tO=({ref:e,className:t="",children:r,mode:i="open",delegatesFocus:o=!1,stylesheets:a,fallback:l})=>{let c=x(null);v(e,()=>c.current,[c]);let[d,p]=S(null),[h,f]=S(!1),m=e=>{M(t=>{if(!e.current)return t;let n=[...t.pending,e.current];return{isLoading:n.length>0,pending:n}})},y=e=>{M(t=>{let n=t.pending.filter(t=>t!==e.current);return{isLoading:n.length>0,pending:n}})},b=e=>{M(t=>{let n=t.pending.filter(t=>t!==e.target);return{isLoading:n.length>0,pending:n}})},w=e=>{M(t=>{let n=t.pending.filter(t=>t!==e.target);return{isLoading:n.length>0,pending:n}})},T=()=>{},{content:C,links:E,styles:A}=k(()=>{let e={content:/* @__PURE__ */I(XI,{},"shadow-content"),links:[],styles:[]};return n.forEach(r,(t,n)=>{u(t)&&(t.type===XI?e.content=s(t,{...t.props,key:"shadow-content",contentDidMount:T}):t.type===QI?e.links.push(s(t,{...t.props,key:n,onRegister:m,onUnregister:y,onLoad:b,onError:w})):t.type===eO&&(e.content=s(t,{...t.props,key:n})))}),e},[r]),[N,M]=S({isLoading:0!==E.length,pending:[]});g(()=>{if(c.current){let e=c.current.attachShadow({mode:i,delegatesFocus:o});a&&(e.adoptedStyleSheets=a),p(e),f(!0)}},[]);let P=k(()=>({shadowRoot:d}),[d]),{isLoading:L}=N;/* @__PURE__ */
123
- return I("div",{ref:c,className:t,children:h&&d&&_(/* @__PURE__ */O(ZI,{value:P,children:[E,A,!L&&C,L&&l]}),d)})};tO.Content=XI,tO.Link=QI,tO.Style=eO;var nO=tO,rO=p(({pageId:e="",sdkStylePath:t="",style:n="",plitziContextValue:r,assets:i})=>{const o=k(()=>({id:e,rootId:e}),[e]),a=k(()=>Object.values(i),[i]);/* @__PURE__ */
124
- return O(nO,{children:[a.map((e,t)=>/* @__PURE__ */I(nO.Link,{href:e.params.href},t)),
125
- /* @__PURE__ */I(nO.Link,{href:t}),
126
- /* @__PURE__ */I(nO.Content,{children:/* @__PURE__ */O(GI,{children:[
121
+ /* @__PURE__ */I(eO,{})]})}),rO=({children:e,contentDidMount:t,contentDidDismount:n})=>(g(()=>(t?.(),()=>{n?.()}),[]),e),iO=l({shadowRoot:null});iO.displayName="ContainerShadowContext";var oO=({href:e,onLoad:t,onError:n,onRegister:r,onUnregister:i,...o})=>{let[a,s]=S(!1),l=x(null);return g(()=>(r?.(l),s(!0),()=>{i?.(l)}),[]),/* @__PURE__ */I("link",a?{ref:l,href:e,onLoad:t,onError:n,rel:"stylesheet",...o}:{ref:l,rel:"stylesheet",...o})},aO=({children:e,...t})=>{let n=x(null);/* @__PURE__ */
122
+ return I("style",{ref:n,...t,children:e})},sO=({ref:e,className:t="",children:r,mode:i="open",delegatesFocus:o=!1,stylesheets:a,fallback:l})=>{let c=x(null);v(e,()=>c.current,[c]);let[d,p]=S(null),[h,f]=S(!1),m=e=>{M(t=>{if(!e.current)return t;let n=[...t.pending,e.current];return{isLoading:n.length>0,pending:n}})},y=e=>{M(t=>{let n=t.pending.filter(t=>t!==e.current);return{isLoading:n.length>0,pending:n}})},b=e=>{M(t=>{let n=t.pending.filter(t=>t!==e.target);return{isLoading:n.length>0,pending:n}})},w=e=>{M(t=>{let n=t.pending.filter(t=>t!==e.target);return{isLoading:n.length>0,pending:n}})},T=()=>{},{content:C,links:E,styles:A}=k(()=>{let e={content:/* @__PURE__ */I(rO,{},"shadow-content"),links:[],styles:[]};return n.forEach(r,(t,n)=>{u(t)&&(t.type===rO?e.content=s(t,{...t.props,key:"shadow-content",contentDidMount:T}):t.type===oO?e.links.push(s(t,{...t.props,key:n,onRegister:m,onUnregister:y,onLoad:b,onError:w})):t.type===aO&&(e.content=s(t,{...t.props,key:n})))}),e},[r]),[N,M]=S({isLoading:0!==E.length,pending:[]});g(()=>{if(c.current){let e=c.current.attachShadow({mode:i,delegatesFocus:o});a&&(e.adoptedStyleSheets=a),p(e),f(!0)}},[]);let P=k(()=>({shadowRoot:d}),[d]),{isLoading:L}=N;/* @__PURE__ */
123
+ return I("div",{ref:c,className:t,children:h&&d&&_(/* @__PURE__ */O(iO,{value:P,children:[E,A,!L&&C,L&&l]}),d)})};sO.Content=rO,sO.Link=oO,sO.Style=aO;var lO=sO,cO=p(({pageId:e="",sdkStylePath:t="",style:n="",plitziContextValue:r,assets:i})=>{const o=k(()=>({id:e,rootId:e}),[e]),a=k(()=>Object.values(i),[i]);/* @__PURE__ */
124
+ return O(lO,{children:[a.map((e,t)=>/* @__PURE__ */I(lO.Link,{href:e.params.href},t)),
125
+ /* @__PURE__ */I(lO.Link,{href:t}),
126
+ /* @__PURE__ */I(lO.Content,{children:/* @__PURE__ */O(QI,{children:[
127
127
  /* @__PURE__ */I("style",{dangerouslySetInnerHTML:{__html:n}}),
128
128
  /* @__PURE__ */I(wu,{value:r,children:e&&/* @__PURE__ */I(mE,{internalProps:o})}),
129
- /* @__PURE__ */I(KI,{})]})})]})}),iO=e=>{},oO="data-plitzi-fonts",aO=({head:e})=>((e=>{g(()=>{if(typeof document>"u")return;let{head:t}=document,n=[];if(e.preconnect.forEach(e=>{if(t.querySelector(`link[rel="preconnect"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel="preconnect",r.href=e.href,e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.links.forEach(e=>{if(t.querySelector(`link[rel="${e.rel}"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel=e.rel,r.href=e.href,e.as&&(r.as=e.as),e.type&&(r.type=e.type),e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.faces&&!t.querySelector(`style[${oO}]`)){let r=document.createElement("style");r.setAttribute(oO,""),r.textContent=e.faces,t.appendChild(r),n.push(r)}return()=>n.forEach(e=>e.remove())},[e])})(e),null),sO=[],lO=({externalStyle:e="",sdkStylePath:t="./plitzi-sdk.css",server:n})=>{const{resolvedTheme:r}=Ng(),{assets:i}=h(Li),o=x(null),{rootRef:a}=h(ig),[[s,l,c,u=sO]]=Bt(["schema.settings","style.cache","navigation.currentPageId","style.fonts"]),d=jd(),{renderMode:p,previewMode:m,debugMode:y,environment:v,isHydrating:w,enclosed:S}=re();(e=>{let t=zt(),n=b(),[r]=Dt("schema.rsc",{mode:"mount"}),[i]=Dt(["navigation.routeParams","navigation.queryParams","navigation.currentPageId","navigation.href"]),o=JSON.stringify(i),{rscData:a,rscPath:s}=e??{},l=(r?.enabled??!1)&&!!s;$t(["rsc.enabled","rsc.endpoint","rsc.instance"],[l,s,n]),$t(["rsc.data","rsc.loaded","rsc.location"],[a?.serverData??{},void 0!==a,Lm()],{mode:"mount"}),g(()=>()=>(e=>{jm.get(e)?.inFlight.forEach(e=>e.controller.abort()),jm.delete(e)})(n),[n]),g(()=>{!l||t.get("rsc.loaded")&&t.get("rsc.location")===Lm()&&!t.get("rsc.stale")||qm(t)},[l,o,t])})(n?.ssr),(e=>{$t(["actions.endpoint"],[e?.actionPath])})(n?.ssr),(e=>{$t(["realtime.endpoint","realtime.transport"],[e?.realtimePath,e?.realtimeTransport])})(n?.ssr),(e=>{$t(["images.endpoint"],[e?.imagePath])})(n?.ssr);const T=k(()=>((e,t)=>{let n=[],r=[],i=[],o=/* @__PURE__ */new Map,a=/* @__PURE__ */new Set,s=(e,t)=>{e&&(a.add(e),o.set(e,(o.get(e)??!1)||t))},l=e.filter(e=>"google"===e.source);if(l.length>0){let e=(e=>{let t=[...e].sort((e,t)=>((e,t)=>e===t?0:e<t?-1:1)(e.family,t.family)).map(e=>{let t=(e=>{let t=[...new Set(e.weights)].filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:[400]})(e);if(!e.styles.includes("italic"))return`family=${bg(e.family)}:wght@${t.join(";")}`;let n=[0,1].flatMap(e=>t.map(t=>`${e},${t}`));return`family=${bg(e.family)}:ital,wght@${n.join(";")}`}),n=[...new Set(e.map(e=>e.display??"swap"))],r=1===n.length?n[0]:"swap";return`${dg}/css2?${t.join("&")}&display=${r}`})(l);s(dg,!1),s("https://fonts.gstatic.com",!0),l.some(e=>e.preload)&&r.push({href:e,rel:"preload",as:"style"}),n.push({href:e,rel:"stylesheet"})}return e.forEach(e=>{if("remote"===e.source&&e.stylesheet&&hg(e.stylesheet))return s(fg(e.stylesheet),!1),e.preload&&r.push({href:e.stylesheet,rel:"preload",as:"style"}),void n.push({href:e.stylesheet,rel:"stylesheet"});"remote"===e.source&&e.files?e.files.filter(e=>hg(e.url)).forEach(t=>{s(fg(t.url),!0),i.push(vg(e,{...t,url:t.url})),e.preload&&r.push({href:t.url,rel:"preload",as:"font",type:pg[t.format],crossorigin:!0})}):"hosted"===e.source&&e.files.forEach(n=>{let o=t(n.path);s(fg(o),!0),i.push(vg(e,{...n,url:o})),e.preload&&r.push({href:o,rel:"preload",as:"font",type:pg[n.format],crossorigin:!0})})}),{preconnect:[...o].map(([e,t])=>t?{href:e,crossorigin:t}:{href:e}),links:[...r,...n],faces:i.join(""),origins:[...a]}})(u,((e="/fonts")=>t=>`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`)(n?.fontsBaseUrl)),[u,n?.fontsBaseUrl]),C=k(()=>{const t=(e=>e?Object.keys(e).filter(t=>"string"==typeof e[t]||"number"==typeof e[t]).map(t=>{let n=e[t];return(e=>{if(!e||"string"!=typeof e)return!1;let t=e.trim().toLowerCase();return Mg.test(t)||Pg.test(t)||Lg.test(t)||Rg.has(t)})(n)?`--${t}:${n};`:`--${t}:"${n}";`}).join("\n"):"")(d),n=((e="",t={},n={missing:""})=>{let r=n.missing??"";return e.replace(/\{\{\s*([a-z0-9_\-.$]+)\s*\}\}/gi,(e,n)=>{let i=n.split("."),o=t;for(let t of i){if("object"!=typeof o||!o)return r;if(!(t in o))return r;o=o[t]}return"string"==typeof o||"number"==typeof o||"boolean"==typeof o?String(o):r})})(l,d),r=`.plitzi-sdk{${t}}\n${(e=>`${wg}${e}${kg}`)(n)}\n${s.customCss}\n${e}`;return`@layer plitzi-sdk-plugin, ${cg};@layer ${cg}{${S?(e=>`@scope{${e.replace(/:root\b/g,":scope")}}`)(r):r}}`},[d,l,s.customCss,e,S]),E=k(()=>({...i,...ug(T)}),[i,T]),_=f(()=>o.current?o.current.contentWindow:"undefined"!=typeof window?window:{innerWidth:1440,innerHeight:900},[o]),N=m?"":c,M=k(()=>({settings:{isHydrating:w,previewMode:m,debugMode:y,renderMode:p,environment:v,...s,theme:r},root:{baseElementId:N},utils:{displayBorderComponents:!1,getWindow:_,rootRef:a}}),[w,m,y,N,p,v,s,r,_,a]);/* @__PURE__ */
130
- return O(A,{children:["iframe"!==p&&/* @__PURE__ */I(aO,{head:T}),("raw"===p||"widget"===p)&&/* @__PURE__ */I(JI,{renderMode:p,style:C,plitziContextValue:M,pageId:c}),"shadow"===p&&/* @__PURE__ */I(rO,{sdkStylePath:t,style:C,plitziContextValue:M,pageId:c,assets:i}),!["raw","widget","shadow"].includes(p)&&/* @__PURE__ */I(YI,{style:T.faces?`${T.faces}\n${C}`:C,plitziContextValue:M,pageId:c,assets:E,ref:o})]})};lO.Plugin=iO;var cO,uO,dO,pO=lO,hO=["loginUrl","userUrl","refreshUrl","logoutUrl","mfaUrl","sessionHintCookie"],fO=e=>{let[t,n]=e.split("."),r=Number(t);if(!Number.isFinite(r)||r<=0)return;let i=Number(n);return{expiresAt:r,refreshExpiresAt:Number.isFinite(i)&&i>0?i:void 0}},mO=e=>{if(e&&typeof document<"u")for(let t of document.cookie.split(";")){let n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return fO(decodeURIComponent(t.slice(n+1).trim()))}},gO=class{kind;key;constructor(e,t){this.kind=e,this.key=t}get area(){try{if("localStorage"===this.kind&&typeof localStorage<"u")return localStorage;if("sessionStorage"===this.kind&&typeof sessionStorage<"u")return sessionStorage}catch{}}read(){let e=this.area?.getItem(this.key);if(e)try{let t=JSON.parse(e);return(e=>"object"==typeof e&&!!e&&1===e.version)(t)?t:void 0}catch{return}}write(e){try{this.area?.setItem(this.key,JSON.stringify({version:1,...e}))}catch{}}clear(){try{this.area?.removeItem(this.key)}catch{}}subscribe(e){if("localStorage"!==this.kind||typeof window>"u")return()=>{};let t=t=>{(null===t.key||t.key===this.key)&&e(this.read())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}},yO=e=>{if(!e)return;let t=e.split(".");if(3!==t.length)return;let n=(e=>{try{let t=e.replaceAll("-","+").replaceAll("_","/"),n=t.padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&r?r:void 0}catch{return}})(t[1])?.exp;return"number"==typeof n&&Number.isFinite(n)?n:void 0},bO=()=>Math.floor(Date.now()/1e3),vO=e=>{if("number"==typeof e&&Number.isFinite(e)&&!(e<=0))return Math.floor(e>1e11?e/1e3:e)},wO=class{state="init";session={validatedAt:0};store;gate;hintCookie;revalidateSeconds;listeners=/* @__PURE__ */new Set;renewal;epoch=0;renewalTimer;detachListeners;offline=!1;spaceKey;constructor({spaceKey:e="",tokenStorage:t="localStorage",sessionHintCookie:n,sessionGate:r="optimistic",sessionRevalidateSeconds:i=300,storageKey:o="plitzi_auth_session"}={}){this.spaceKey=e,this.store=new gO(t,o),this.gate=r,this.hintCookie=n,this.revalidateSeconds=i}get endpoints(){return[]}requestExchange(){return Promise.resolve(void 0)}consumeRedirect(){return Promise.resolve(void 0)}get user(){return this.session.user}get token(){return this.session.token}getState(){return this.state}can(e){let t=this.session.user?.permissions;return Array.isArray(t)&&t.includes(e)}peekState(){return this.peek().state}peek(){let e=this.store.read(),t=mO(this.hintCookie);if(this.hintCookie&&!t)return{state:"guest"};let n=e?.token,r=vO(n?.expiresAt)??yO(n?.accessToken);return n?.accessToken&&(void 0===r||r-60>bO())&&e?.user?{state:"authenticated",user:e.user,token:e.token}:n?.accessToken||n?.refreshToken||t?{state:"init",user:e?.user,token:e?.token}:{state:"guest"}}async init(e={}){this.attach(),await this.decide(e),this.settle()}settle(){("init"===this.state||"initLoading"===this.state)&&this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest","settled")}async decide(e){if(e.skipAuth)return void this.setState("guest","skip-auth");let t=await this.consumeRedirect();if(t)return void(t.ok?(this.adopt(t),await this.handOffToServer(),this.emit({type:"login",token:this.session.token})):this.endSession(t.reason));if(e.user)return void this.adopt({ok:!0,user:e.user,token:e.accessToken?{accessToken:e.accessToken,expiresAt:e.expiresAt??null,refreshToken:null}:this.session.token},!0,"bootstrap");let n=this.store.read(),r=mO(this.hintCookie);if(this.session={user:n?.user,token:n?.token,validatedAt:n?.validatedAt??0},!this.hintCookie||r){if(this.hasLiveToken()&&this.session.user){this.setState("authenticated","restored"),this.scheduleRenewal();let e=this.isFresh()&&"strict"!==this.gate?void 0:this.revalidate(!0);return void("strict"===this.gate&&await e)}this.hasEvidence()?(this.setState("initLoading","no-evidence"),this.hasLiveToken()&&this.capabilities.identity?await this.loadIdentity():this.capabilities.renew?await this.renew():this.capabilities.identity?await this.loadIdentity():this.endSession()):this.endSession(void 0,"no-evidence")}else this.endSession(void 0,"hint-missing")}dispose(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.detachListeners?.(),this.detachListeners=void 0}async login(e){this.epoch+=1,this.setState("authenticating","authenticating");let t=await this.requestLogin(e);if(!t.ok&&"mfa"===t.reason)return this.endSession(),t;if(!t.ok)return this.endSession(t.reason),{ok:!1,reason:t.reason};this.adopt(t);let n=await this.handOffToServer();return n?{ok:!1,reason:n}:(!this.session.user&&this.capabilities.identity&&await this.loadIdentity(),"authenticated"===this.state?(this.emit({type:"login",token:this.session.token}),{ok:!0,...this.session.token??{accessToken:"",expiresAt:null,refreshToken:null}}):{ok:!1,reason:"inactive"})}async handOffToServer(){let e=await this.requestExchange();if(e)return e.ok?void this.adopt(e):"network"===e.reason?void(this.offline=!0):(this.endSession(e.reason),e.reason)}async refresh(){return await this.renew(),this.session.token}async revalidate(e=!1){return this.hasEvidence()?!e&&this.isFresh()&&this.hasLiveToken()?"authenticated"===this.state:this.hasLiveToken()&&this.capabilities.identity?this.loadIdentity():this.capabilities.renew?this.renew():this.capabilities.identity?this.loadIdentity():(this.hasLiveToken()||this.endSession("expired"),"authenticated"===this.state):("guest"!==this.state&&this.endSession(),!1)}invalidate(e="expired"){this.recover(e)}async recover(e){return"network"===e?(this.offline=!0,!1):this.renewable(e)?this.renew():(this.endSession(e),!1)}async logout(){await this.requestLogout(),this.endSession(),this.emit({type:"logout"})}on(e){let t=Array.isArray(e)?e:[e];return t.forEach(e=>this.listeners.add(e)),()=>t.forEach(e=>this.listeners.delete(e))}emit(e){for(let t of this.listeners)t(e)}setState(e,t){this.state!==e&&(this.state=e,this.emit({type:"state",state:e,reason:t}))}async renew(){return this.renewal??=this.performRenewal().finally(()=>{this.renewal=void 0}),this.renewal}async performRenewal(){let e=this.epoch,t=await this.requestRenewal(this.session.token?.refreshToken??void 0);return e===this.epoch?t.ok?(this.adopt(t),!this.session.user&&this.capabilities.identity?this.loadIdentity():"authenticated"===this.state):(this.handleFailure(t.reason),!1):"authenticated"===this.state}async loadIdentity(){let e=this.epoch,t=await this.requestIdentity();return e===this.epoch?t.ok?(this.adopt(t),"authenticated"===this.state):this.renewable(t.reason)&&!this.renewal?this.renew():(this.handleFailure(t.reason),!1):"authenticated"===this.state}handleFailure(e){"network"!==e?this.endSession(e):this.offline=!0}adopt(e,t=!0,n="granted"){this.session={user:e.user??this.session.user,token:e.token??this.session.token,validatedAt:bO()},this.offline=!1,t&&this.store.write(this.session),this.scheduleRenewal(),this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest",n)}endSession(e,t="signed-out"){this.epoch+=1,clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:bO()},this.store.write(this.session),this.setState("guest",t),e&&this.emit({type:"expired",reason:e})}expiresAt(){return vO(this.session.token?.expiresAt)??yO(this.session.token?.accessToken)}renewable(e){if(!this.capabilities.renew)return!1;if("expired"===e)return!0;if("missing"!==e)return!1;if(this.session.token?.refreshToken)return!0;let t=mO(this.hintCookie);return void 0!==t&&(void 0===t.refreshExpiresAt||t.refreshExpiresAt>bO())}hasLiveToken(){if(!this.session.token?.accessToken)return!1;let e=this.expiresAt();return void 0===e||e-60>bO()}isFresh(){return bO()-this.session.validatedAt<this.revalidateSeconds}hasEvidence(){if(this.session.token?.accessToken||this.session.token?.refreshToken)return!0;let e=mO(this.hintCookie);return!(void 0!==e?.refreshExpiresAt&&e.refreshExpiresAt<=bO()||!e)}scheduleRenewal(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0;let e=this.expiresAt();if(void 0===e||typeof window>"u"||"guest"===this.state)return;let t=Math.min(1e3*(e-60-bO()),2147483647);t<=0?this.onRenewalDue():this.renewalTimer=setTimeout(()=>this.onRenewalDue(),t)}onRenewalDue(){this.capabilities.renew?this.renew():this.endSession("expired")}attach(){if(typeof window>"u"||this.detachListeners)return;let e=()=>{"visible"===document.visibilityState&&this.revalidate()},t=()=>{this.offline&&this.revalidate(!0)},n=this.store.subscribe(e=>this.adoptFromStorage(e)),r=(e=>(Sm.add(e),()=>Sm.delete(e)))(({reason:e,url:t})=>{let n=this.endpoints.filter(Boolean);return!(0!==n.length&&!n.some(e=>((e,t)=>{if(!e||!t)return!1;try{let n=typeof window>"u"?void 0:window.location.href;return Am(new URL(e,n).hostname)===Am(new URL(t,n).hostname)}catch{return!1}})(e,t)))&&this.recover(e)});document.addEventListener("visibilitychange",e),window.addEventListener("online",t),this.detachListeners=()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("online",t),n(),r()}}adoptFromStorage(e){if(this.epoch+=1,!e?.token&&!e?.user)return clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:bO()},this.setState("guest","another-tab"),void this.emit({type:"logout"});this.adopt({ok:!0,user:e.user,token:e.token},!1)}},kO=(e,t)=>pr(e,t,void 0),xO=(e,t)=>{let n=kO(e,t);return"string"==typeof n&&""!==n?n:null},SO=(e,t)=>{let n=kO(e,t),r="string"==typeof n?Number(n):n;return"number"==typeof r&&Number.isFinite(r)?r:null},TO=e=>"string"==typeof e?e:"number"==typeof e&&Number.isFinite(e)?String(e):"",CO=class extends wO{name="basic";options;constructor({loginUrl:e="",userUrl:t="",refreshUrl:n="",logoutUrl:r="",sessionExchangeUrl:i="",mfaUrl:o="",detailsPath:a="details",tokenPath:s="access_token",refreshTokenPath:l="refresh_token",expirationTimePath:c="expire_at",refreshExpirationTimePath:u="refresh_expire_at",...d}={}){super(d),this.options={loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r,sessionExchangeUrl:i,mfaUrl:o,detailsPath:a,tokenPath:s,refreshTokenPath:l,expirationTimePath:c,refreshExpirationTimePath:u}}get capabilities(){return{renew:!!this.options.refreshUrl,identity:!!this.options.userUrl}}get endpoints(){let{loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r}=this.options;return[e,t,n,r]}async requestLogin(e){let t=TO(e.token).trim();if("token"===e.mode)return t?this.adoptToken(t):{ok:!1,reason:"missing"};if("mfa"===e.mode){let t=TO(e.mfaToken).trim();return this.options.mfaUrl&&t?this.toResult(await this.request(this.options.mfaUrl,{method:"POST",body:JSON.stringify({mfaToken:t,code:TO(e.code).trim()})})):{ok:!1,reason:"missing"}}if(!this.options.loginUrl)return console.warn('[plitzi] auth.login: the "basic" provider has no loginUrl to post the credentials to. Declare loginUrl in the space settings, or serve the space from createServer({ auth }), which names it for you.'),{ok:!1,reason:"missing"};let n=await this.request(this.options.loginUrl,{method:"POST",body:JSON.stringify({username:TO(e.username),password:TO(e.password)})});return this.challengeOf(n)??this.toResult(n)}async adoptToken(e){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.userUrl,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),n=this.toResult(t);return n.ok?{ok:!0,user:n.user,token:{accessToken:e,expiresAt:null,refreshToken:null}}:n}async requestRenewal(e){if(!this.options.refreshUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.refreshUrl,{method:"POST",body:JSON.stringify(e?{[this.options.refreshTokenPath]:e}:{})});return this.toResult(t)}async requestExchange(){let e=this.token?.accessToken;if(!this.options.sessionExchangeUrl||!e)return;let t=await this.request(this.options.sessionExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",...this.spaceKey?{"x-access-token":this.spaceKey}:{}},body:JSON.stringify({provider:this.name,token:e})});return this.toResult(t)}async requestIdentity(){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let e=await this.request(this.options.userUrl,{method:"GET"});return this.toResult(e)}async requestLogout(){this.options.logoutUrl&&await this.request(this.options.logoutUrl,{method:"POST"})}async request(e,t){let n,r;try{n=await fetch(e,{credentials:"include",headers:{"Content-Type":"application/json"},...t})}catch{return{status:0,reason:"network"}}try{r=await n.json()}catch{r=void 0}return{data:r,status:n.status,reason:n.ok?void 0:Em(n.status,r)??"network"}}challengeOf(e){let t=kO(e.data,"mfaToken");return!e.reason&&!0===kO(e.data,"mfaRequired")&&"string"==typeof t&&t?{ok:!1,reason:"mfa",mfaToken:t}:void 0}toResult(e){if(e.reason)return{ok:!1,reason:e.reason};let t=kO(e.data,this.options.detailsPath);return{ok:!0,user:"object"==typeof t&&t?t:void 0,token:this.tokenFrom(e.data)}}tokenFrom(e){let t=xO(e,this.options.tokenPath);if(!t)return;let n=kO(e,"errors");return{..."object"==typeof n&&n?{errors:n}:{},accessToken:t,expiresAt:SO(e,this.options.expirationTimePath),refreshToken:xO(e,this.options.refreshTokenPath),refreshExpiresAt:SO(e,this.options.refreshExpirationTimePath)}}},EO=class extends wO{name="server";loginUrl;logoutUrl;constructor({loginUrl:e="",logoutUrl:t="",...n}={}){super({...n,tokenStorage:""}),this.loginUrl=e||"/auth/sign-in",this.logoutUrl=t||"/auth/logout"}get capabilities(){return{renew:!1,identity:!1}}requestLogin(){let e=`${window.location.pathname}${window.location.search}`;return window.location.assign(`${this.loginUrl}?return=${encodeURIComponent(e)}`),new Promise(()=>{})}requestRenewal(){return Promise.resolve({ok:!1,reason:"expired"})}requestIdentity(){return Promise.resolve({ok:!1,reason:"missing"})}async requestLogout(){await fetch(this.logoutUrl,{method:"POST",credentials:"same-origin"})}revalidate(){return Promise.resolve("authenticated"===this.getState())}},AO=/* @__PURE__ */new Map([["basic",e=>new CO(e)],["server",e=>new EO(e)]]),IO=class{providerType;provider;settings;listeners;constructor(e,t,n){this.providerType=e,this.settings=n,this.listeners=Array.isArray(t)?t:[t];let r=AO.get(e);r&&(this.provider=r(n),this.provider.on(this.listeners))}getProviderType(){return this.providerType}getProvider(){return this.provider}getState(){return this.provider?.getState()??"guest"}peekState(){return this.peek().state}peek(){return(this.provider??new CO(this.settings)).peek()}can(e){return this.provider?.can(e)??!1}init(e){if(!this.provider){let t=this.peekState(),n=e?.user||"authenticated"===t?"authenticated":"guest";return this.listeners.forEach(e=>e({type:"state",state:n,reason:"no-provider"})),Promise.resolve()}return this.provider.init(e)}login(...e){return this.provider?this.provider.login(...e):(console.warn(this.providerType?`[plitzi] auth.login: no auth provider is registered as "${this.providerType}". Register it with registerAuthProvider before the SDK mounts, or set the userProvider of the space to one that exists ("basic", "server").`:'[plitzi] auth.login: this space has no auth provider to sign in with. Serve it from createServer({ auth }), which needs nothing declared, or declare userProvider in the space settings ("server" on the Plitzi platform, "basic" with loginUrl for your own API).'),Promise.resolve({ok:!1,reason:"missing"}))}refresh(){return this.provider?.refresh()??Promise.resolve(void 0)}revalidate(e){return this.provider?.revalidate(e)??Promise.resolve(!1)}invalidate(e){this.provider?.invalidate(e)}logout(){return this.provider?.logout()??Promise.resolve()}dispose(){this.provider?.dispose()}on(e){return this.provider?.on(e)}},OO=["loginUrl","userUrl","refreshUrl","logoutUrl","detailsPath","tokenPath","refreshTokenPath","expirationTimePath","refreshExpirationTimePath","sessionHintCookie","sessionExchangeUrl","mfaUrl"],_O=({children:e,server:t})=>{let{previewMode:n,isHydrating:r,environment:i}=re(),{webKey:o}=h(Kd),[[a,s]]=Dt(["schema.settings","schema.variables"]),{queryParams:l,hostname:c}=um({server:t}),u=k(()=>({queryParams:l,hostname:c,environment:i}),[l,c,i]),d=k(()=>Array.isArray(s)?s.reduce((e,t)=>{let{name:n,value:r,subValues:i}=t;if(!Array.isArray(i)||0===i.length)return{...e,[n]:r};let o=i.find(e=>Ei(e.when,u));return o?{...e,[n]:o.value}:{...e,[n]:r}},{}):{},[s,u]),p=k(()=>{let e=Object.fromEntries(OO.map(e=>[e,a[e]]));try{return JSON.parse(Vn(JSON.stringify(e),d))}catch{return e}},[a,d]),{provider:m,settings:y}=k(()=>{let e=((e,t,n)=>{if(!n||e&&e!==n.userProvider)return{provider:e??"",settings:t};let r={...t};for(let i of hO)r[i]||(r[i]=n[i]);return{provider:n.userProvider,settings:r}})(a.userProvider,{...p,tokenStorage:a.tokenStorage??"localStorage",sessionGate:a.sessionGate,sessionRevalidateSeconds:a.sessionRevalidateSeconds},t.auth);return{provider:e.provider,settings:{...e.settings,spaceKey:o}}},[p,a,o,t.auth]),{manager:b,loading:v,authenticated:w,state:T,bootstrapUser:C,bootstrapToken:E,peekedUser:A,peekedToken:O}=(({server:e,isHydrating:t=!1,provider:n="",settings:r})=>{let i=e?.authenticated?e.user?.details:void 0,o="string"==typeof e?.user?.accessToken?e.user.accessToken:void 0,[a,s]=S("init"),l=f(e=>{"state"===e.type&&s(e.state)},[]),c=k(()=>new IO(n,l,r),[n,l,r]),u=k(()=>t||i?void 0:c.peek(),[c,t,i]),d="init"!==a&&"initLoading"!==a||!!i||t||"authenticated"===u?.state||"guest"===u?.state;return g(()=>(c.init({user:i,accessToken:o,expiresAt:e?.user?.expiresAt,skipAuth:e?.skipAuth}),()=>c.dispose()),[c,i,o,e?.user?.expiresAt,e?.skipAuth]),k(()=>({manager:c,state:a,bootstrapUser:i,bootstrapToken:o,peekedUser:u?.user,peekedToken:u?.token?.accessToken,loading:"initLoading"===a||!d,authenticated:"authenticated"===a||"init"===a&&(!!i||"authenticated"===u?.state)}),[c,a,i,o,d,u])})({server:t,isHydrating:r,provider:m,settings:y}),_=b.getProvider(),{user:N,accessToken:M}=(e=>{let{state:t,provider:n,bootstrap:r,peeked:i}=e;return n?.user?{user:n.user,accessToken:n.accessToken}:"guest"===t?{}:r?.user?{user:r.user,accessToken:r.accessToken}:i?.user?{user:i.user,accessToken:i.accessToken}:{}})({state:T,provider:{user:_?.user,accessToken:_?.token?.accessToken},bootstrap:{user:C,accessToken:E},peeked:{user:A,accessToken:O}}),P=x(void 0),L=k(()=>{let e=N?{details:N,accessToken:M}:void 0,t=P.current;return t?.accessToken===e?.accessToken&&((e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t;return[.../* @__PURE__ */new Set([...Object.keys(n),...Object.keys(r)])].every(e=>JSON.stringify(n[e])===JSON.stringify(r[e]))})(t?.details,e?.details)||(P.current=e),P.current},[N,M]);(e=>{let t=x(e);Et(()=>{t.current!==e&&(t.current=e,qE.reset({refetch:""!==e}))},[e])})(w?String(L?.details?.id??""):"");let R=k(()=>({login:b.login.bind(b),refresh:b.refresh.bind(b),revalidate:b.revalidate.bind(b),invalidate:b.invalidate.bind(b),can:b.can.bind(b),logout:b.logout.bind(b),provider:b.getProviderType(),state:T,authenticated:w||!n,user:L}),[b,T,w,n,L]);/* @__PURE__ */
131
- return I(cm,{value:R,children:!v&&e})},NO=(e,t=0,n=/* @__PURE__ */new WeakSet)=>{if("function"==typeof e)return;if("object"!=typeof e||!e)return e;if(n.has(e)||t>12)return"[…]";n.add(e);let r=Array.isArray(e)?e.map(e=>NO(e,t+1,n)):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,NO(r,t+1,n)]).filter(([,e])=>void 0!==e));return n.delete(e),r},MO=(e,...t)=>{let n=e;for(let r of t)n=X(n)?n[r]:void 0;return X(n)?n:{}},PO=e=>Array.isArray(e)?e:[],LO=e=>Object.entries(MO(e,"definition","bindings")).flatMap(([e,t])=>PO(t).flatMap(t=>{let{to:n,source:r,transformers:i}=MO(t),o=PO(i).map(e=>MO(e,"params").template).find(e=>"string"==typeof e);return"string"==typeof n&&"string"==typeof r?[{category:e,to:n,source:r,..."string"==typeof o?{template:o}:{}}]:[]})),RO=(e,t,n)=>{let{element:r,inComponent:i}=((e,t)=>{let n=MO(e,"flat");if(Object.hasOwn(n,t))return{element:n[t]};for(let[r,i]of Object.entries(MO(e,"components"))){let e=MO(i,"flat");if(Object.hasOwn(e,t))return{element:e[t],inComponent:r}}return{}})(MO(e,"schema"),t),o=Array.from(n.querySelectorAll(`[data-id="${t}"]`));if(!X(r)&&0===o.length)return;let a=o.at(0),s=a?.getBoundingClientRect(),l=a?getComputedStyle(a):void 0,c=void 0!==s&&s.width>0&&s.height>0&&"none"!==l?.display&&"hidden"!==l?.visibility,u=MO(r,"definition").type,d=MO(r,"attributes"),p="reference"===u&&"component"===d.referenceType&&"string"==typeof d.referenceId?d.referenceId:void 0,h=MO(e,"runtime","elements")[t];return{id:t,..."string"==typeof u?{type:u}:{},...void 0===i?{}:{inComponent:i},...void 0===p?{}:{instanceOf:p},...X(r)?{attributes:MO(NO(r),"attributes"),bindings:LO(r)}:{},...void 0===h?{}:{state:NO(h)},copies:o.length,visible:c,...s?{box:{x:Math.round(s.x),y:Math.round(s.y),width:Math.round(s.width),height:Math.round(s.height)}}:{}}},jO=(e,t)=>X(e)&&X(t)&&Object.keys(t).some(t=>!Object.hasOwn(e,t)),zO=K("DevToolsContext",{logs:[],providers:{}}),DO="data-plitzi-devtools",$O=e=>{let t=m(kt),n=qt();g(()=>{if(!e||!t)return;let r=[],i=!1,o=$d.addListener(e=>{let t=(e=>{if("interactions"!==e.category||!(e=>"object"==typeof e&&"nodes"in e&&"startTime"in e&&"node"in e)(e.params))return;let{node:t,hostElementId:n,status:r,startTime:i,endTime:o,nodes:a}=e.params,s=Object.values(a).filter(e=>e.node.id!==t.id).toSorted((e,t)=>e.startTime-t.startTime).map(e=>{let t=(e=>{if("failed"===e.status)return e.result instanceof Error?e.result.message:"string"==typeof e.result?e.result:void 0})(e);return{title:e.node.title,action:e.node.action,status:e.status,ms:Math.round(e.endTime-e.startTime),...void 0===t?{}:{error:t}}});return{at:e.time??"",trigger:`${t.title} [${t.action}]`,...void 0===n?{}:{on:n},status:r,ms:Math.round(o-i),steps:s}})(e);t&&(r.push(t),r.length>100&&r.shift())},{replay:!0}),a=(({root:e,writeState:t,stores:n,runs:r,setWatching:i,document:o})=>({help:()=>"window.__plitzi — this page, in text (debug mode only):\n state(key?) runtime.state, or one key of it\n setState(key, value) writes runtime.state.<key>, as a setState step would\n sources(name?) every source's current value by name (apiContainer_site, list_products…), or one\n element(id) an element by its id, in a page or a component: type, attributes, what it reads, its own state,\n the component it places, copies, on screen, box\n flows(limit = 20) the last flows that ran: trigger, element, status, every step with its time and error\n watch(on = true) one console line per flow as it ends",state:t=>{let n=MO(e.getState(),"runtime","state");return NO(void 0===t?n:n[t])},setState:t,sources:t=>{let r={},i={};for(let a of[e,...n()]){let e=MO(a.getState(),"runtime","sources");for(let[t,n]of Object.entries(MO(a.getOwnState(),"runtime","sources")))jO(n,e[t])?i[t]=n:r[t]=n}let o={...i,...r};return NO(void 0===t?o:o[t])},element:t=>RO(e.getState(),t,o),flows:(e=20)=>r().slice(-e),watch:(e=!0)=>(i(e),e?"Each flow is said in the console as it ends.":"Flows are no longer said in the console.")}))({root:t,writeState:(e,t)=>n(`runtime.state.${e}`,t),stores:()=>st().map(e=>e.store),runs:()=>r,setWatching:e=>{i=e},document:document});return window.__plitzi=a,()=>{o(),window.__plitzi===a&&delete window.__plitzi}},[e,t,n])},FO=({children:e})=>{let[t,n]=S([]),[r,i]=S({}),o=x(!1),a=f((e,t,r,i,o)=>{n(n=>[...n,{logType:e,category:t,message:r,time:o,params:i}])},[n]),s=f((e,t)=>i(n=>({...n,[e]:t})),[]),l=f(e=>i(t=>vr(t,[e])),[]),c=f((e,...t)=>{if(e&&"function"==typeof r[e])return r[e](...t)},[r]),u=f(()=>n([]),[]);o.current||=($d.setCallback(a),$d.setCallbackAddProvider(s),$d.setCallbackRemoveProvider(l),!0),g(()=>($d.setCallback(a),$d.setCallbackAddProvider(s),$d.setCallbackRemoveProvider(l),$d.processPendingLogs(),()=>{$d.setCallback(void 0),$d.setCallbackAddProvider(void 0),$d.setCallbackRemoveProvider(void 0),$d.flush()}),[a,s,l]);let d=k(()=>({providers:r,logs:t,setLogs:n,clearLogs:u,getData:c}),[r,t,n,u,c]);/* @__PURE__ */
132
- return I(zO,{value:d,children:e})},qO={display:"contents"},BO=({children:e})=>{let t=x(null),n=x(void 0),r=x(void 0),i=m(kt),o=h(Ag),a=h(Li),s=h(Wr),l=h(cs);return w(()=>{let e=t.current;if(e)return clearTimeout(r.current),n.current??=C(e),()=>{let e=n.current;r.current=setTimeout(()=>{e?.unmount(),n.current===e&&(n.current=void 0)},0)}},[]),w(()=>{n.current?.render(/* @__PURE__ */I(kt,{value:i,children:/* @__PURE__ */I(cs,{value:l,children:/* @__PURE__ */I(Ag,{value:o,children:/* @__PURE__ */I(Li,{value:a,children:/* @__PURE__ */I(Wr,{value:s,children:e})})})})}))}),/* @__PURE__ */I("div",{ref:t,style:qO})},UO=[],HO=/* @__PURE__ */new Set,WO=[],VO=()=>{WO=[...UO];for(let e of HO)e()},GO=e=>(HO.add(e),()=>{HO.delete(e)}),KO=()=>WO,YO=()=>cO,JO=e=>{cO!==e&&(cO=e,VO())},XO=()=>({instanceIds:T(GO,KO,KO),selectedId:T(GO,YO,YO)}),ZO=()=>()=>{},QO=(e,t,n)=>{window.dispatchEvent(new CustomEvent("customstorage-changed",{detail:{key:e,oldValue:t,newValue:n}}))},e_=()=>{let e={};if(typeof document>"u"||!document.cookie)return e;for(let t of document.cookie.split(";")){let n=t.indexOf("=");-1!==n&&(e[t.slice(0,n).trim()]=decodeURIComponent(t.slice(n+1).trim()))}return e},t_=e=>new Proxy(e,{get(e,t,n){if("setItem"===t)return(t,n)=>{let r=e.getItem(t);e.setItem.call(e,t,n),r!==n&&QO(t,r,n)};if("removeItem"===t)return t=>{let n=e.getItem(t);e.removeItem.call(e,t),null!==n&&QO(t,n,null)};let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}}),n_=e=>"cookie"===e?typeof document<"u"?t_((()=>{let e={getItem(e){let t=e_();return e in t?t[e]:null},setItem(e,t){typeof document<"u"&&(document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`)},removeItem(e){typeof document<"u"&&(document.cookie=`${e}=; path=/; max-age=0; samesite=lax`)},clear(){for(let t of Object.keys(e_()))e.removeItem(t)},key:e=>Object.keys(e_())[e]??null,get length(){return Object.keys(e_()).length}};return e})()):void 0:"sessionStorage"===e?typeof sessionStorage<"u"?t_(sessionStorage):void 0:typeof localStorage<"u"?t_(localStorage):void 0,r_=function(e,t,n="localStorage",r=!0){let[i,o]=k(()=>{if(e.includes(".")){let t=e.split(".").filter(Boolean);return[t.shift(),t.join(".")]}return[e,""]},[e]),a=x(n_(n));Wl(()=>{a.current=n_(n)},[n]);let[s,l]=S(()=>{try{if(!a.current)return t;let e=a.current.getItem(i);if(!e)return t;let n=JSON.parse(e);return o?pr(n,o,t):n}catch{return t}});g(()=>{try{if(!a.current)return;let e=s;if(o){let t=a.current.getItem(i);e=au(t?JSON.parse(t):{},e=>{hr(e,o,s)})}a.current.setItem(i,JSON.stringify(e))}catch(XN){}},[i,o,s]);let c=f(e=>{if(e.key===i)try{let n=e.newValue?JSON.parse(e.newValue):t;l(o?pr(n,o,t):n)}catch{}},[i,o,t]),u=f(e=>{if(e.detail.key===i)try{let n=e.detail.newValue?JSON.parse(e.detail.newValue):t;l(o?pr(n,o,t):n)}catch{}},[i,o,t]);return g(()=>{if(typeof window<"u"&&r)return window.addEventListener("storage",c),window.addEventListener("customstorage-changed",u),()=>{window.removeEventListener("storage",c),window.removeEventListener("customstorage-changed",u)}},[c,u,n,r]),[s,l]},i_=d(()=>import("./plitzi-sdk-devtools-DFKIflfa.js")),o_="horizontal",a_=0,s_=({children:e,className:t,innerClassName:n,enabled:r=!1,instanceId:i,renderMode:o="default",scroll:s="container",qa:l=!1,devToolsStyle:c="",devToolsStyleLink:u="",devToolsIconsLink:d=""})=>{let{resolvedTheme:p}=Ng(),[h,y]=r_("plitzi-sdk.dev-tools.orientation",o_),[b,v]=r_("plitzi-sdk.dev-tools.collapsed",!0),[w,k]=r_("plitzi-sdk.dev-tools.tab","logs"),[C,E]=S(),A=x(void 0),_=x(null);A.current||="sdk-instance-"+ ++a_;let N=i||A.current,M=T(ZO,()=>!0,()=>!1),P=M?h:o_,L=((e,t)=>{g(()=>{if(t)return(e=>(UO.push(e),void 0===cO&&(cO=e),VO(),()=>{let t=UO.indexOf(e);-1!==t&&UO.splice(t,1),cO===e&&(cO=UO[0]),VO()}))(e)},[t,e]);let n=T(GO,YO,YO);return t&&n===e})(N,r);(e=>{let t=m(kt);g(()=>{if(e&&!ze&&t)return ot(t)},[e,t])})(r),((e,t)=>{g(()=>{if(e)return ot(qE.store,t,"Queries")},[e,t])})(L,N),$O(L);let R=f(e=>y(e),[y]),j=f(e=>{e&&k("logs"),E(e),v(!1)},[v,k]),z=f(()=>v(!0),[v]),D=f(e=>{E(void 0),k(e)},[k]);if(!r)return e;let $="document"===s&&(!M||b),F=/* @__PURE__ */I(i_,{className:V({dark:"dark"===p}),collapsed:b,orientation:P,tabSelected:w,logTypeFilter:C,onOpen:j,onCollapse:z,onTabSelect:D,onChangeOrientation:R,pageRef:_,qa:l}),q=L&&M&&/* @__PURE__ */I(BO,{children:/* @__PURE__ */I(FO,{children:/* @__PURE__ */O(a,{fallback:null,children:["default"===o&&F,"shadow"===o&&/* @__PURE__ */I("div",{style:{display:"contents"},"data-plitzi-devtools":"",children:/* @__PURE__ */O(nO,{children:[d&&/* @__PURE__ */I(nO.Link,{href:d}),u&&/* @__PURE__ */I(nO.Link,{href:u}),
133
- /* @__PURE__ */O(nO.Content,{children:[/* @__PURE__ */I("style",{dangerouslySetInnerHTML:{__html:c}}),F]})]})})]})})});/* @__PURE__ */
134
- return O("div",{className:V("relative flex min-w-0 grow",{"overflow-auto":!$,"flex-col":$||"horizontal"===P,"h-screen":!$&&"vertical"===P},t),children:[/* @__PURE__ */I(wt,{value:N,children:/* @__PURE__ */I("div",{ref:_,className:V("grow",{"basis-0 flex-col overflow-auto":!$},n),children:e})}),$?/* @__PURE__ */I("div",{className:"sticky bottom-0 h-0",children:q}):q]})},l_=({children:e})=>{let[[t,n,r,i,o,a=""]]=Dt(["navigation.routeParams","navigation.queryParams","navigation.origin","navigation.href","navigation.currentPageId","navigation.pendingLocation"]),s=jd(),l=f(()=>Gr(s).map(e=>({path:e,name:`variables.${e}`})),[s]);Pd({id:"global",source:"variables",name:"Variables",fields:l}),$t("runtime.sources.variables",s);let[c={}]=Dt("pageDefinitions"),u=k(()=>Object.values(c).map(e=>({value:e.id,label:pr(e,"attributes.name",e.id)})),[c]),d=k(()=>({routeParams:t,queryParams:n,origin:r,href:i,currentPageId:o,pending:""!==a,pendingLocation:a}),[t,n,r,i,o,a]),p=f(()=>[...Gr({routeParams:t,queryParams:n}).map(e=>({path:e,name:`navigation.${e}`})),{path:"origin",name:"Origin"},{path:"href",name:"This page’s address"},{path:"pending",name:"A navigation is on its way"},{path:"pendingLocation",name:"Where a navigation is going"},u.length>0?{path:"currentPageId",name:"Current Page",inputType:"select",values:u}:{path:"currentPageId",name:"Current Page"}],[t,n,u]);Pd({id:"global",source:"navigation",name:"Navigation",fields:p}),$t("runtime.sources.navigation",d);let m=h(cm),{user:y,authenticated:b,state:v,provider:w}=m,S=k(()=>w?{isAuthenticated:b,...void 0===v?{}:{status:v},accessToken:y?.accessToken??"",details:{username:"",email:"",roles:"",permissions:"",verified:"",...y?.details??{}}}:{},[w,y,b,v]),T=f(()=>Gr(S).map(e=>({path:e,name:`user.${e}`})),[S]);Pd({id:"global",source:"auth",name:"Auth State",fields:T}),$t("runtime.sources.auth",S);let C=(e=>{let{environment:t}=re(),[[n,r,i,o,a]]=Dt(["schema.flags","navigation.routeParams","navigation.queryParams","navigation.hostname","flags.overrides"]),{authenticated:s,user:l}=e,c=k(()=>xm({authenticated:s,user:l}),[s,l]);return Rd(k(()=>Ni(n,{environment:t,hostname:o,routeParams:r,queryParams:i,user:c},a),[n,t,o,r,i,c,a]))})(m),E=k(()=>Mi(C),[C]),A=f(()=>Object.keys(E).map(e=>({path:e,name:`flags.${e}`,inputType:"checkbox"})),[E]);Pd({id:"global",source:"flags",name:"Feature Flags",fields:A}),$t("runtime.sources.flags",E),$t("flags.resolved",C);let[I,O]=Dt(["schema.flags","flags.overrides"])[0],_=Rd(((e,t)=>Oi.flatMap(n=>Object.keys(t[n]??{}).filter(t=>!Object.hasOwn(e??{},t)).map(e=>({layer:n,name:e}))))(I,O??{}));g(()=>{_.forEach(({layer:e,name:t})=>console.warn(`[plitzi] The ${e} sets the feature flag "${t}", which this space does not declare: the override is ignored. Declare the flag in the space, or remove the override.`))},[_]);let[N]=Dt("runtime.state"),M=f(()=>Gr(N).map(e=>({path:e,name:`state.${e}`})),[N]);Pd({id:"global",source:"state",name:"State",fields:M}),$t("runtime.sources.state",N);let[P]=Dt("runtime.host"),L=f(()=>Gr(P).map(e=>({path:e,name:`host.${e}`})),[P]);Pd({id:"global",source:"host",name:"Host",fields:L}),$t("runtime.sources.host",P);let{theme:R,resolvedTheme:j}=Ng(_g),z=k(()=>({mode:R,resolved:j}),[R,j]),D=f(()=>Gr(z).map(e=>({path:e,name:`theme.${e}`})),[z]);Pd({id:"global",source:"theme",name:"Theme",fields:D}),$t("runtime.sources.theme",z);let[$]=Dt("schema.settings.computed"),F=x(void 0),q=k(()=>_d($??{},{variables:s,navigation:d,auth:S,state:N??{},host:P??{},theme:z,flags:E},F.current),[$,s,d,S,N,P,z,E]);F.current=q;let B=f(()=>Gr(q).map(e=>({path:e,name:`computed.${e}`})),[q]);return Pd({id:"global",source:"computed",name:"Computed",fields:B}),$t("runtime.sources.computed",q),e},c_=class{debugMode=!1;events;listeners=/* @__PURE__ */new Map;counts=/* @__PURE__ */new Map;constructor({events:e,debugMode:t=!1}={}){this.events=e??{},this.debugMode=t;for(let[n,r]of Object.entries(this.events))this.counts.set(n,Object.keys(r).length)}has(e,t){if(!e)throw Error("Module name is required");return this.events[e]&&this.events[e][t]}on(e,t,n,r={}){let{filter:i,override:o=!1}=r;if(!e)throw Error("Module name is required");if(!n||"function"!=typeof n)throw Error("Callback must be a function");this.events[e]||(this.events[e]={}),this.events[e][t]||this.counts.set(e,(this.counts.get(e)??0)+1),(!this.events[e][t]||o&&this.events[e][t].length>0)&&(this.events[e][t]=[]),this.events[e][t].push({callback:n,filter:i})}get(e,t){return this.has(e,t)?this.events[e]?.[t]:[]}off(e,t,n){if(this.has(e,t)&&this.events[e]&&(this.events[e][t]=n?this.events[e][t]?.filter(e=>e.callback!==n):[],0===this.events[e][t]?.length)){delete this.events[e][t];let n=(this.counts.get(e)??1)-1;n>0?this.counts.set(e,n):(this.counts.delete(e),delete this.events[e])}}async emit(e,t=[],...n){let r;this.debugMode&&$d.info("eventBridge","Event Triggered",{module:e,events:t,data:n}),r=Array.isArray(t)?t:[t];let i=[];r.forEach(t=>{if(!this.has(e,t))return;let r=this.get(e,t);r&&r.forEach(e=>{let{callback:t,filter:r}=e;(!r||"function"!=typeof r||r(...n))&&i.push(t(...n))})});let o=await Promise.all(i);return this.touch(r.reduce((e,t)=>({...e,[t]:n}),{})),o}async emitWithResponse(e,t,...n){if(!this.has(e,t))return;let r=this.get(e,t);if(!r)return;let i=await Promise.all(r.filter(e=>!e.filter||e.filter(...n)).map(e=>e.callback(...n)));return 1===i.length?i[0]:i}once(e,t,n,r){if(!e)throw Error("Module name is required");let i=async r=>{await n(r),this.off(e,t,i)};this.on(e,t,i,{filter:r})}clear(e){if(!e)return this.events={},void this.counts.clear();this.events[e]&&(delete this.events[e],this.counts.delete(e))}getEvents(e){return e?this.events[e]?this.events[e]:{}:this.events}getModuleEventsNames(e){return e&&this.events[e]?Object.keys(this.events[e]):[]}getModuleEventsCount(e){return this.getModuleEventsNames(e).length}listen(e,t){let n=Array.isArray(e)?e:[e];return n.forEach(e=>{this.listeners.has(e)||this.listeners.set(e,/* @__PURE__ */new Set),this.listeners.get(e)?.add(t)}),()=>{n.forEach(e=>{let n=this.listeners.get(e);n&&(n.delete(t),0===n.size&&this.listeners.delete(e))})}}touch(e){for(let t in e){let n=this.listeners.get(t);if(n)for(let t of n)t(e)}}},u_=({children:e,debugMode:t,onInit:n})=>{let r=k(()=>new c_({debugMode:t}),[t]);g(()=>()=>{r.clear()},[r]);let i=k(()=>({eventBridge:r}),[r]);return g(()=>{n?.(i)},[n,i]),/* @__PURE__ */I(mu,{value:i,children:e})},d_=({id:e,interactions:t,triggers:n,callbacks:r,getAdditionalParams:i})=>{let{interactionsManager:o}=h(Id);g(()=>{if(e)return o.subscribe(e),()=>{o.unsubscribe(e)}},[e,o]),g(()=>{e&&o.update(e,t,n,r,i)},[e,t,n,r,i,o])},p_=(e,t)=>"function"==typeof e.type?e.type(t):e.type,h_=(e,t)=>{if("string"!=typeof t)return t;if("number"===e){let e=t.trim();if(""===e)return;let n=Number(e);return Number.isFinite(n)?n:t}return"boolean"!==e||"true"!==t&&"false"!==t?t:"true"===t},f_=(e,t)=>{if(!e)return t;let n="function"==typeof e?e(t):e,r={...t};for(let[i,o]of Object.entries(n))Object.hasOwn(t,i)&&(r[i]=h_(p_(o,t),t[i]));return r},m_=nd("copyToClipboard",{title:"Copy To Clipboard",type:"utility",strictParams:!0,params:{text:{type:"text",description:"The words to copy — a template reads the page: {{ navigation.href }} is its address.",default:"",label:"Text",required:!0}}},async({text:e})=>{let t=lv();if(!t)throw Error("This page has no clipboard to write to: the browser offers none here (a page not on https?)");await t(e)}),g_={action:"delayTime",title:"Delay Time",type:"utility",params:{time:{label:"Time (Milliseconds)",type:"number"}},preview:{},callback:({time:e},t)=>new Promise(n=>{let r=t?.signal;if(r?.aborted)return void n(void 0);let i=()=>{clearTimeout(o),r?.removeEventListener("abort",i),n(void 0)},o=setTimeout(i,e);r?.addEventListener("abort",i,{once:!0})})},y_={action:"twigTemplate",title:"Twig Template",type:"utility",params:{returnMode:{label:"Mode",canBind:!1,type:"select",defaultValue:"text",options:[{label:"Text",value:"text"},{label:"Json Text",value:"json"},{label:"Json Object",value:"jsonObject"}]},template:{label:"Template",canBind:!1,defaultValue:"",type:e=>{let{returnMode:t}=e;return"text"===t?"codemirror-text":"codemirror-json"}}},preview:e=>{let{template:t,returnMode:n}=e;if("jsonObject"===n)try{let n=JSON.parse(Vn(t,e));if(n&&"object"==typeof n)return{template:"",content:Gr(n).reduce((e,t)=>({...e,[t]:""}),{})}}catch{}return{template:"",content:""}},callback:e=>{let{template:t,returnMode:n}=e,r="";try{r=Vn(t,e)}catch(XN){console.error(XN)}if("jsonObject"===n)try{return{content:JSON.parse(r)}}catch(XN){console.error(XN)}else if("json"===n)try{return JSON.parse(r),{content:r}}catch{return{content:""}}return{content:r}}},b_={origin:"Requests to the same site",all:"All cached requests",elements:"Only these containers",none:"None — this only reads"},v_=(e,t=()=>!0)=>({invalidateQueries:{type:"select",description:"What to refresh once the write succeeded, so the page shows the new data: the requests to the same site, every provider on the page, only the api containers named in `invalidateElements`, or none for a step that only reads. Server-driven containers are refreshed too, asking the server past its cache. Containers on screen ask again at once; the rest when they are shown.",default:e[0],options:[...e],optionLabels:Object.fromEntries(e.map(e=>[e,b_[e]])),label:"Refresh cached requests",canBind:!1,when:t},invalidateElements:{type:"elementIds",elementType:"apiContainer",description:"The api containers to refresh, by element id.",default:[],label:"Containers (ids)",when:e=>t(e)&&"elements"===e.invalidateQueries}}),w_=e=>{let t="string"==typeof e.method?e.method.toLowerCase():"get";return"get"===t||"head"===t},k_={title:"Webhook",type:"utility",strictParams:!0,params:{url:{type:"text",description:"The URL to call.",default:"",label:"Url"},method:{type:"select",description:"HTTP method.",default:"get",options:["get","post","put","delete","patch","head"],canBind:!1},body:{type:"json",description:'Request body: an object of fields (sent as JSON, or as form data when one of them is a file). Pass a real object, with templates for its values — `{ email: "{{ submitted.values.email }}" }`.',default:"",builderType:"textarea"},authorizationToken:{type:"text",description:"Value sent as the Authorization header.",default:""},headers:{type:"json",description:'Headers of the request, as an object of name to value, with templates for the values like the body: `{ "x-api-key": "{{ apiKey }}" }`. Authorization is set by `authorizationToken` and the content type follows the body, so neither is set here.',default:"",builderType:"textarea"},credentials:{type:"select",description:"fetch credentials mode.",default:"same-origin",options:["include","omit","same-origin"],optionLabels:{"same-origin":"Same Origin"}},cache:{type:"boolean",description:"Serve a GET from the page’s query cache while it is fresh, and keep the answer there — shared with any api container asking the same thing.",default:!1,label:"Cache response",when:w_},staleTime:{type:"number",description:"With `cache`: seconds the answer is served without asking again.",default:30,label:"Fresh for (s)",when:e=>w_(e)&&(!0===e.cache||"true"===e.cache)},...v_(["origin","all","elements","none"],e=>!w_(e))},preview:{response:{status:"",data:""}}},x_=/* @__PURE__ */new Set(["GET","HEAD"]),S_=/* @__PURE__ */new Set(["GET","HEAD","DELETE"]),T_=e=>{let t=Number(e);return 1e3*(Number.isFinite(t)&&t>=0?t:Number(k_.params.staleTime.default))},C_=e=>e?{Authorization:`Bearer ${e}`}:{},E_=/* @__PURE__ */new Set(["authorization","content-type"]),A_=e=>"object"==typeof e&&e?Object.fromEntries(Object.entries(e).flatMap(([e,t])=>"string"!=typeof t&&"number"!=typeof t||""===t||E_.has(e.toLowerCase())?[]:[[e,String(t)]])):{},I_=async({url:e,authorizationToken:t,headers:n,body:r,credentials:i},o,a)=>{let s=(e=>"object"==typeof e&&e?e:{})(r),l=Object.values(s).some(e=>e instanceof Blob),c={method:o,headers:{...A_(n),...l?{}:{"Content-Type":"application/json"},...C_(t)},credentials:i,...a?{signal:a}:{}};if(!S_.has(o))if(l){let e=new FormData;Object.entries(s).forEach(([t,n])=>{e.append(t,n)}),c.body=e}else c.body=JSON.stringify(s);let u=await fetch(e,c).catch(t=>{throw Error(`${o} ${e} got no answer: ${t instanceof Error?t.message:String(t)}`)}),d="";try{d=await u.json()}catch{}return{status:u.status,data:d}},O_=nd("webHook",k_,async(e,t)=>{let n=(e.method||"get").toUpperCase();if(x_.has(n)){if(!0!==e.cache&&"true"!==e.cache)return{response:await I_(e,n,t?.signal)};let r=XE({method:n,url:e.url,credentials:e.credentials,headers:{...A_(e.headers),...C_(e.authorizationToken)}});return{response:await qE.fetchQuery(r,{meta:{url:e.url},fetcher:()=>I_(e,n),staleTime:T_(e.staleTime),isCacheable:e=>e.status<400})}}let r=await I_(e,n,t?.signal);return r.status>=200&&r.status<300&&ZE({mode:e.invalidateQueries,fallback:"origin",elements:e.invalidateElements,url:e.url}),{response:r}}),__={copyToClipboard:m_,delayTime:g_,twigTemplate:y_,webHook:O_},N_=(e,t,n,r,i)=>{if("utility"===e&&"twigTemplate"===i)return t;let o={...n,...r},a=(e,t,n)=>{if("string"==typeof e){let{value:n,unresolved:r}=((e,t)=>{let n=e,r=5;for((e=>"string"==typeof e&&/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/.test(e))(n)&&!or(e)&&(n=Xn(e,t),r--);"string"==typeof n&&or(n)&&r>0;)n=Xn(n,t),r--;return{value:n,unresolved:"string"==typeof n&&or(n)}})(e,o);return r&&$d.warning("interactions",/* @__PURE__ */O("span",{children:["Twig token resolution exceeded ",5," passes for ",
135
- /* @__PURE__ */I("b",{children:t}),", leaving unresolved tokens"]}),{param:t,value:n}),n}return n>=5||"object"!=typeof e||!e?e:Array.isArray(e)?e.map(e=>a(e,t,n+1)):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,a(r,t,n+1)]))};return Object.keys(t).reduce((n,r)=>{let i="trigger"===e?t[r]:a(t[r],r,0);return{...n,[r]:i}},{})},M_=e=>Object.fromEntries(Object.entries(e).filter(e=>(e=>"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e)(e[1]))),P_=e=>"object"==typeof e&&!!e&&"then"in e&&"function"==typeof e.then,L_=(e,t={},n={},r={},i={})=>{let o=[],{id:a,action:s,enabled:l,params:c,elementId:u,type:d,when:p}=e;if(!s||!l)return{status:"disabled",result:{},postCallbacks:o};let h=M_({...r,...n,[a]:c});if(p&&!Ei(p,h))return{status:"skipped",result:{},postCallbacks:o,whenParams:h};let f,m=t=>($d.danger("interactions",/* @__PURE__ */O("span",{children:["Interaction node failed ",/* @__PURE__ */I("b",{children:s})]}),{error:t instanceof Error?t.message:String(t),node:e}),{status:"failed",result:{},postCallbacks:o,whenParams:h});switch(d){case"callback":case"globalCallback":if(!u)return $d.warning("interactions",/* @__PURE__ */O("span",{children:["Step ",
129
+ /* @__PURE__ */I(eO,{})]})})]})}),uO=e=>{},dO="data-plitzi-fonts",pO=({head:e})=>((e=>{g(()=>{if(typeof document>"u")return;let{head:t}=document,n=[];if(e.preconnect.forEach(e=>{if(t.querySelector(`link[rel="preconnect"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel="preconnect",r.href=e.href,e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.links.forEach(e=>{if(t.querySelector(`link[rel="${e.rel}"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel=e.rel,r.href=e.href,e.as&&(r.as=e.as),e.type&&(r.type=e.type),e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.faces&&!t.querySelector(`style[${dO}]`)){let r=document.createElement("style");r.setAttribute(dO,""),r.textContent=e.faces,t.appendChild(r),n.push(r)}return()=>n.forEach(e=>e.remove())},[e])})(e),null),hO=[],fO=({externalStyle:e="",sdkStylePath:t="./plitzi-sdk.css",server:n})=>{const{resolvedTheme:r}=Ng(),{assets:i}=h(Li),o=x(null),{rootRef:a}=h(ig),[[s,l,c,u=hO]]=Bt(["schema.settings","style.cache","navigation.currentPageId","style.fonts"]),d=jd(),{renderMode:p,previewMode:m,debugMode:y,environment:v,isHydrating:w,enclosed:S}=re();(e=>{let t=zt(),n=b(),[r]=Dt("schema.rsc",{mode:"mount"}),[i]=Dt(["navigation.routeParams","navigation.queryParams","navigation.currentPageId","navigation.href"]),o=JSON.stringify(i),{rscData:a,rscPath:s}=e??{},l=(r?.enabled??!1)&&!!s;$t(["rsc.enabled","rsc.endpoint","rsc.instance"],[l,s,n]),$t(["rsc.data","rsc.loaded","rsc.location"],[a?.serverData??{},void 0!==a,Lm()],{mode:"mount"}),g(()=>()=>(e=>{jm.get(e)?.inFlight.forEach(e=>e.controller.abort()),jm.delete(e)})(n),[n]),g(()=>{!l||t.get("rsc.loaded")&&t.get("rsc.location")===Lm()&&!t.get("rsc.stale")||qm(t)},[l,o,t])})(n?.ssr),(e=>{$t(["actions.endpoint"],[e?.actionPath])})(n?.ssr),(e=>{$t(["realtime.endpoint","realtime.transport"],[e?.realtimePath,e?.realtimeTransport])})(n?.ssr),(e=>{$t(["images.endpoint"],[e?.imagePath])})(n?.ssr);const T=k(()=>((e,t)=>{let n=[],r=[],i=[],o=/* @__PURE__ */new Map,a=/* @__PURE__ */new Set,s=(e,t)=>{e&&(a.add(e),o.set(e,(o.get(e)??!1)||t))},l=e.filter(e=>"google"===e.source);if(l.length>0){let e=(e=>{let t=[...e].sort((e,t)=>((e,t)=>e===t?0:e<t?-1:1)(e.family,t.family)).map(e=>{let t=(e=>{let t=[...new Set(e.weights)].filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:[400]})(e);if(!e.styles.includes("italic"))return`family=${bg(e.family)}:wght@${t.join(";")}`;let n=[0,1].flatMap(e=>t.map(t=>`${e},${t}`));return`family=${bg(e.family)}:ital,wght@${n.join(";")}`}),n=[...new Set(e.map(e=>e.display??"swap"))],r=1===n.length?n[0]:"swap";return`${dg}/css2?${t.join("&")}&display=${r}`})(l);s(dg,!1),s("https://fonts.gstatic.com",!0),l.some(e=>e.preload)&&r.push({href:e,rel:"preload",as:"style"}),n.push({href:e,rel:"stylesheet"})}return e.forEach(e=>{if("remote"===e.source&&e.stylesheet&&hg(e.stylesheet))return s(fg(e.stylesheet),!1),e.preload&&r.push({href:e.stylesheet,rel:"preload",as:"style"}),void n.push({href:e.stylesheet,rel:"stylesheet"});"remote"===e.source&&e.files?e.files.filter(e=>hg(e.url)).forEach(t=>{s(fg(t.url),!0),i.push(vg(e,{...t,url:t.url})),e.preload&&r.push({href:t.url,rel:"preload",as:"font",type:pg[t.format],crossorigin:!0})}):"hosted"===e.source&&e.files.forEach(n=>{let o=t(n.path);s(fg(o),!0),i.push(vg(e,{...n,url:o})),e.preload&&r.push({href:o,rel:"preload",as:"font",type:pg[n.format],crossorigin:!0})})}),{preconnect:[...o].map(([e,t])=>t?{href:e,crossorigin:t}:{href:e}),links:[...r,...n],faces:i.join(""),origins:[...a]}})(u,((e="/fonts")=>t=>`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`)(n?.fontsBaseUrl)),[u,n?.fontsBaseUrl]),C=k(()=>{const t=(e=>e?Object.keys(e).filter(t=>"string"==typeof e[t]||"number"==typeof e[t]).map(t=>{let n=e[t];return(e=>{if(!e||"string"!=typeof e)return!1;let t=e.trim().toLowerCase();return Mg.test(t)||Pg.test(t)||Lg.test(t)||Rg.has(t)})(n)?`--${t}:${n};`:`--${t}:"${n}";`}).join("\n"):"")(d),n=((e="",t={},n={missing:""})=>{let r=n.missing??"";return e.replace(/\{\{\s*([a-z0-9_\-.$]+)\s*\}\}/gi,(e,n)=>{let i=n.split("."),o=t;for(let t of i){if("object"!=typeof o||!o)return r;if(!(t in o))return r;o=o[t]}return"string"==typeof o||"number"==typeof o||"boolean"==typeof o?String(o):r})})(l,d),r=`.plitzi-sdk{${t}}\n${(e=>`${wg}${e}${kg}`)(n)}\n${s.customCss}\n${e}`;return`@layer plitzi-sdk-plugin, ${cg};@layer ${cg}{${S?(e=>`@scope{${e.replace(/:root\b/g,":scope")}}`)(r):r}}`},[d,l,s.customCss,e,S]),E=k(()=>({...i,...ug(T)}),[i,T]),_=f(()=>o.current?o.current.contentWindow:"undefined"!=typeof window?window:{innerWidth:1440,innerHeight:900},[o]),N=m?"":c,M=k(()=>({settings:{isHydrating:w,previewMode:m,debugMode:y,renderMode:p,environment:v,...s,theme:r},root:{baseElementId:N},utils:{displayBorderComponents:!1,getWindow:_,rootRef:a}}),[w,m,y,N,p,v,s,r,_,a]);/* @__PURE__ */
130
+ return O(A,{children:["iframe"!==p&&/* @__PURE__ */I(pO,{head:T}),("raw"===p||"widget"===p)&&/* @__PURE__ */I(nO,{renderMode:p,style:C,plitziContextValue:M,pageId:c}),"shadow"===p&&/* @__PURE__ */I(cO,{sdkStylePath:t,style:C,plitziContextValue:M,pageId:c,assets:i}),!["raw","widget","shadow"].includes(p)&&/* @__PURE__ */I(tO,{style:T.faces?`${T.faces}\n${C}`:C,plitziContextValue:M,pageId:c,assets:E,ref:o})]})};fO.Plugin=uO;var mO,gO,yO,bO=fO,vO=["loginUrl","userUrl","refreshUrl","logoutUrl","mfaUrl","sessionHintCookie"],wO=e=>{let[t,n]=e.split("."),r=Number(t);if(!Number.isFinite(r)||r<=0)return;let i=Number(n);return{expiresAt:r,refreshExpiresAt:Number.isFinite(i)&&i>0?i:void 0}},kO=e=>{if(e&&typeof document<"u")for(let t of document.cookie.split(";")){let n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return wO(decodeURIComponent(t.slice(n+1).trim()))}},xO=class{kind;key;constructor(e,t){this.kind=e,this.key=t}get area(){try{if("localStorage"===this.kind&&typeof localStorage<"u")return localStorage;if("sessionStorage"===this.kind&&typeof sessionStorage<"u")return sessionStorage}catch{}}read(){let e=this.area?.getItem(this.key);if(e)try{let t=JSON.parse(e);return(e=>"object"==typeof e&&!!e&&1===e.version)(t)?t:void 0}catch{return}}write(e){try{this.area?.setItem(this.key,JSON.stringify({version:1,...e}))}catch{}}clear(){try{this.area?.removeItem(this.key)}catch{}}subscribe(e){if("localStorage"!==this.kind||typeof window>"u")return()=>{};let t=t=>{(null===t.key||t.key===this.key)&&e(this.read())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}},SO=e=>{if(!e)return;let t=e.split(".");if(3!==t.length)return;let n=(e=>{try{let t=e.replaceAll("-","+").replaceAll("_","/"),n=t.padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&r?r:void 0}catch{return}})(t[1])?.exp;return"number"==typeof n&&Number.isFinite(n)?n:void 0},TO=()=>Math.floor(Date.now()/1e3),CO=e=>{if("number"==typeof e&&Number.isFinite(e)&&!(e<=0))return Math.floor(e>1e11?e/1e3:e)},EO=class{state="init";session={validatedAt:0};store;gate;hintCookie;revalidateSeconds;listeners=/* @__PURE__ */new Set;renewal;epoch=0;renewalTimer;detachListeners;offline=!1;spaceKey;constructor({spaceKey:e="",tokenStorage:t="localStorage",sessionHintCookie:n,sessionGate:r="optimistic",sessionRevalidateSeconds:i=300,storageKey:o="plitzi_auth_session"}={}){this.spaceKey=e,this.store=new xO(t,o),this.gate=r,this.hintCookie=n,this.revalidateSeconds=i}get endpoints(){return[]}requestExchange(){return Promise.resolve(void 0)}consumeRedirect(){return Promise.resolve(void 0)}get user(){return this.session.user}get token(){return this.session.token}getState(){return this.state}can(e){let t=this.session.user?.permissions;return Array.isArray(t)&&t.includes(e)}peekState(){return this.peek().state}peek(){let e=this.store.read(),t=kO(this.hintCookie);if(this.hintCookie&&!t)return{state:"guest"};let n=e?.token,r=CO(n?.expiresAt)??SO(n?.accessToken);return n?.accessToken&&(void 0===r||r-60>TO())&&e?.user?{state:"authenticated",user:e.user,token:e.token}:n?.accessToken||n?.refreshToken||t?{state:"init",user:e?.user,token:e?.token}:{state:"guest"}}async init(e={}){this.attach(),await this.decide(e),this.settle()}settle(){("init"===this.state||"initLoading"===this.state)&&this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest","settled")}async decide(e){if(e.skipAuth)return void this.setState("guest","skip-auth");let t=await this.consumeRedirect();if(t)return void(t.ok?(this.adopt(t),await this.handOffToServer(),this.emit({type:"login",token:this.session.token})):this.endSession(t.reason));if(e.user)return void this.adopt({ok:!0,user:e.user,token:e.accessToken?{accessToken:e.accessToken,expiresAt:e.expiresAt??null,refreshToken:null}:this.session.token},!0,"bootstrap");let n=this.store.read(),r=kO(this.hintCookie);if(this.session={user:n?.user,token:n?.token,validatedAt:n?.validatedAt??0},!this.hintCookie||r){if(this.hasLiveToken()&&this.session.user){this.setState("authenticated","restored"),this.scheduleRenewal();let e=this.isFresh()&&"strict"!==this.gate?void 0:this.revalidate(!0);return void("strict"===this.gate&&await e)}this.hasEvidence()?(this.setState("initLoading","no-evidence"),this.hasLiveToken()&&this.capabilities.identity?await this.loadIdentity():this.capabilities.renew?await this.renew():this.capabilities.identity?await this.loadIdentity():this.endSession()):this.endSession(void 0,"no-evidence")}else this.endSession(void 0,"hint-missing")}dispose(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.detachListeners?.(),this.detachListeners=void 0}async login(e){this.epoch+=1,this.setState("authenticating","authenticating");let t=await this.requestLogin(e);if(!t.ok&&"mfa"===t.reason)return this.endSession(),t;if(!t.ok)return this.endSession(t.reason),{ok:!1,reason:t.reason};this.adopt(t);let n=await this.handOffToServer();return n?{ok:!1,reason:n}:(!this.session.user&&this.capabilities.identity&&await this.loadIdentity(),"authenticated"===this.state?(this.emit({type:"login",token:this.session.token}),{ok:!0,...this.session.token??{accessToken:"",expiresAt:null,refreshToken:null}}):{ok:!1,reason:"inactive"})}async handOffToServer(){let e=await this.requestExchange();if(e)return e.ok?void this.adopt(e):"network"===e.reason?void(this.offline=!0):(this.endSession(e.reason),e.reason)}async refresh(){return await this.renew(),this.session.token}async revalidate(e=!1){return this.hasEvidence()?!e&&this.isFresh()&&this.hasLiveToken()?"authenticated"===this.state:this.hasLiveToken()&&this.capabilities.identity?this.loadIdentity():this.capabilities.renew?this.renew():this.capabilities.identity?this.loadIdentity():(this.hasLiveToken()||this.endSession("expired"),"authenticated"===this.state):("guest"!==this.state&&this.endSession(),!1)}invalidate(e="expired"){this.recover(e)}async recover(e){return"network"===e?(this.offline=!0,!1):this.renewable(e)?this.renew():(this.endSession(e),!1)}async logout(){await this.requestLogout(),this.endSession(),this.emit({type:"logout"})}on(e){let t=Array.isArray(e)?e:[e];return t.forEach(e=>this.listeners.add(e)),()=>t.forEach(e=>this.listeners.delete(e))}emit(e){for(let t of this.listeners)t(e)}setState(e,t){this.state!==e&&(this.state=e,this.emit({type:"state",state:e,reason:t}))}async renew(){return this.renewal??=this.performRenewal().finally(()=>{this.renewal=void 0}),this.renewal}async performRenewal(){let e=this.epoch,t=await this.requestRenewal(this.session.token?.refreshToken??void 0);return e===this.epoch?t.ok?(this.adopt(t),!this.session.user&&this.capabilities.identity?this.loadIdentity():"authenticated"===this.state):(this.handleFailure(t.reason),!1):"authenticated"===this.state}async loadIdentity(){let e=this.epoch,t=await this.requestIdentity();return e===this.epoch?t.ok?(this.adopt(t),"authenticated"===this.state):this.renewable(t.reason)&&!this.renewal?this.renew():(this.handleFailure(t.reason),!1):"authenticated"===this.state}handleFailure(e){"network"!==e?this.endSession(e):this.offline=!0}adopt(e,t=!0,n="granted"){this.session={user:e.user??this.session.user,token:e.token??this.session.token,validatedAt:TO()},this.offline=!1,t&&this.store.write(this.session),this.scheduleRenewal(),this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest",n)}endSession(e,t="signed-out"){this.epoch+=1,clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:TO()},this.store.write(this.session),this.setState("guest",t),e&&this.emit({type:"expired",reason:e})}expiresAt(){return CO(this.session.token?.expiresAt)??SO(this.session.token?.accessToken)}renewable(e){if(!this.capabilities.renew)return!1;if("expired"===e)return!0;if("missing"!==e)return!1;if(this.session.token?.refreshToken)return!0;let t=kO(this.hintCookie);return void 0!==t&&(void 0===t.refreshExpiresAt||t.refreshExpiresAt>TO())}hasLiveToken(){if(!this.session.token?.accessToken)return!1;let e=this.expiresAt();return void 0===e||e-60>TO()}isFresh(){return TO()-this.session.validatedAt<this.revalidateSeconds}hasEvidence(){if(this.session.token?.accessToken||this.session.token?.refreshToken)return!0;let e=kO(this.hintCookie);return!(void 0!==e?.refreshExpiresAt&&e.refreshExpiresAt<=TO()||!e)}scheduleRenewal(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0;let e=this.expiresAt();if(void 0===e||typeof window>"u"||"guest"===this.state)return;let t=Math.min(1e3*(e-60-TO()),2147483647);t<=0?this.onRenewalDue():this.renewalTimer=setTimeout(()=>this.onRenewalDue(),t)}onRenewalDue(){this.capabilities.renew?this.renew():this.endSession("expired")}attach(){if(typeof window>"u"||this.detachListeners)return;let e=()=>{"visible"===document.visibilityState&&this.revalidate()},t=()=>{this.offline&&this.revalidate(!0)},n=this.store.subscribe(e=>this.adoptFromStorage(e)),r=(e=>(Sm.add(e),()=>Sm.delete(e)))(({reason:e,url:t})=>{let n=this.endpoints.filter(Boolean);return!(0!==n.length&&!n.some(e=>((e,t)=>{if(!e||!t)return!1;try{let n=typeof window>"u"?void 0:window.location.href;return Am(new URL(e,n).hostname)===Am(new URL(t,n).hostname)}catch{return!1}})(e,t)))&&this.recover(e)});document.addEventListener("visibilitychange",e),window.addEventListener("online",t),this.detachListeners=()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("online",t),n(),r()}}adoptFromStorage(e){if(this.epoch+=1,!e?.token&&!e?.user)return clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:TO()},this.setState("guest","another-tab"),void this.emit({type:"logout"});this.adopt({ok:!0,user:e.user,token:e.token},!1)}},AO=(e,t)=>pr(e,t,void 0),IO=(e,t)=>{let n=AO(e,t);return"string"==typeof n&&""!==n?n:null},OO=(e,t)=>{let n=AO(e,t),r="string"==typeof n?Number(n):n;return"number"==typeof r&&Number.isFinite(r)?r:null},_O=e=>"string"==typeof e?e:"number"==typeof e&&Number.isFinite(e)?String(e):"",NO=class extends EO{name="basic";options;constructor({loginUrl:e="",userUrl:t="",refreshUrl:n="",logoutUrl:r="",sessionExchangeUrl:i="",mfaUrl:o="",detailsPath:a="details",tokenPath:s="access_token",refreshTokenPath:l="refresh_token",expirationTimePath:c="expire_at",refreshExpirationTimePath:u="refresh_expire_at",...d}={}){super(d),this.options={loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r,sessionExchangeUrl:i,mfaUrl:o,detailsPath:a,tokenPath:s,refreshTokenPath:l,expirationTimePath:c,refreshExpirationTimePath:u}}get capabilities(){return{renew:!!this.options.refreshUrl,identity:!!this.options.userUrl}}get endpoints(){let{loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r}=this.options;return[e,t,n,r]}async requestLogin(e){let t=_O(e.token).trim();if("token"===e.mode)return t?this.adoptToken(t):{ok:!1,reason:"missing"};if("mfa"===e.mode){let t=_O(e.mfaToken).trim();return this.options.mfaUrl&&t?this.toResult(await this.request(this.options.mfaUrl,{method:"POST",body:JSON.stringify({mfaToken:t,code:_O(e.code).trim()})})):{ok:!1,reason:"missing"}}if(!this.options.loginUrl)return console.warn('[plitzi] auth.login: the "basic" provider has no loginUrl to post the credentials to. Declare loginUrl in the space settings, or serve the space from createServer({ auth }), which names it for you.'),{ok:!1,reason:"missing"};let n=await this.request(this.options.loginUrl,{method:"POST",body:JSON.stringify({username:_O(e.username),password:_O(e.password)})});return this.challengeOf(n)??this.toResult(n)}async adoptToken(e){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.userUrl,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),n=this.toResult(t);return n.ok?{ok:!0,user:n.user,token:{accessToken:e,expiresAt:null,refreshToken:null}}:n}async requestRenewal(e){if(!this.options.refreshUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.refreshUrl,{method:"POST",body:JSON.stringify(e?{[this.options.refreshTokenPath]:e}:{})});return this.toResult(t)}async requestExchange(){let e=this.token?.accessToken;if(!this.options.sessionExchangeUrl||!e)return;let t=await this.request(this.options.sessionExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",...this.spaceKey?{"x-access-token":this.spaceKey}:{}},body:JSON.stringify({provider:this.name,token:e})});return this.toResult(t)}async requestIdentity(){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let e=await this.request(this.options.userUrl,{method:"GET"});return this.toResult(e)}async requestLogout(){this.options.logoutUrl&&await this.request(this.options.logoutUrl,{method:"POST"})}async request(e,t){let n,r;try{n=await fetch(e,{credentials:"include",headers:{"Content-Type":"application/json"},...t})}catch{return{status:0,reason:"network"}}try{r=await n.json()}catch{r=void 0}return{data:r,status:n.status,reason:n.ok?void 0:Em(n.status,r)??"network"}}challengeOf(e){let t=AO(e.data,"mfaToken");return!e.reason&&!0===AO(e.data,"mfaRequired")&&"string"==typeof t&&t?{ok:!1,reason:"mfa",mfaToken:t}:void 0}toResult(e){if(e.reason)return{ok:!1,reason:e.reason};let t=AO(e.data,this.options.detailsPath);return{ok:!0,user:"object"==typeof t&&t?t:void 0,token:this.tokenFrom(e.data)}}tokenFrom(e){let t=IO(e,this.options.tokenPath);if(!t)return;let n=AO(e,"errors");return{..."object"==typeof n&&n?{errors:n}:{},accessToken:t,expiresAt:OO(e,this.options.expirationTimePath),refreshToken:IO(e,this.options.refreshTokenPath),refreshExpiresAt:OO(e,this.options.refreshExpirationTimePath)}}},MO=class extends EO{name="server";loginUrl;logoutUrl;constructor({loginUrl:e="",logoutUrl:t="",...n}={}){super({...n,tokenStorage:""}),this.loginUrl=e||"/auth/sign-in",this.logoutUrl=t||"/auth/logout"}get capabilities(){return{renew:!1,identity:!1}}requestLogin(){let e=`${window.location.pathname}${window.location.search}`;return window.location.assign(`${this.loginUrl}?return=${encodeURIComponent(e)}`),new Promise(()=>{})}requestRenewal(){return Promise.resolve({ok:!1,reason:"expired"})}requestIdentity(){return Promise.resolve({ok:!1,reason:"missing"})}async requestLogout(){await fetch(this.logoutUrl,{method:"POST",credentials:"same-origin"})}revalidate(){return Promise.resolve("authenticated"===this.getState())}},PO=/* @__PURE__ */new Map([["basic",e=>new NO(e)],["server",e=>new MO(e)]]),LO=class{providerType;provider;settings;listeners;constructor(e,t,n){this.providerType=e,this.settings=n,this.listeners=Array.isArray(t)?t:[t];let r=PO.get(e);r&&(this.provider=r(n),this.provider.on(this.listeners))}getProviderType(){return this.providerType}getProvider(){return this.provider}getState(){return this.provider?.getState()??"guest"}peekState(){return this.peek().state}peek(){return(this.provider??new NO(this.settings)).peek()}can(e){return this.provider?.can(e)??!1}init(e){if(!this.provider){let t=this.peekState(),n=e?.user||"authenticated"===t?"authenticated":"guest";return this.listeners.forEach(e=>e({type:"state",state:n,reason:"no-provider"})),Promise.resolve()}return this.provider.init(e)}login(...e){return this.provider?this.provider.login(...e):(console.warn(this.providerType?`[plitzi] auth.login: no auth provider is registered as "${this.providerType}". Register it with registerAuthProvider before the SDK mounts, or set the userProvider of the space to one that exists ("basic", "server").`:'[plitzi] auth.login: this space has no auth provider to sign in with. Serve it from createServer({ auth }), which needs nothing declared, or declare userProvider in the space settings ("server" on the Plitzi platform, "basic" with loginUrl for your own API).'),Promise.resolve({ok:!1,reason:"missing"}))}refresh(){return this.provider?.refresh()??Promise.resolve(void 0)}revalidate(e){return this.provider?.revalidate(e)??Promise.resolve(!1)}invalidate(e){this.provider?.invalidate(e)}logout(){return this.provider?.logout()??Promise.resolve()}dispose(){this.provider?.dispose()}on(e){return this.provider?.on(e)}},RO=["loginUrl","userUrl","refreshUrl","logoutUrl","detailsPath","tokenPath","refreshTokenPath","expirationTimePath","refreshExpirationTimePath","sessionHintCookie","sessionExchangeUrl","mfaUrl"],jO=({children:e,server:t})=>{let{previewMode:n,isHydrating:r,environment:i}=re(),{webKey:o}=h(Kd),[[a,s]]=Dt(["schema.settings","schema.variables"]),{queryParams:l,hostname:c}=um({server:t}),u=k(()=>({queryParams:l,hostname:c,environment:i}),[l,c,i]),d=k(()=>Array.isArray(s)?s.reduce((e,t)=>{let{name:n,value:r,subValues:i}=t;if(!Array.isArray(i)||0===i.length)return{...e,[n]:r};let o=i.find(e=>Ei(e.when,u));return o?{...e,[n]:o.value}:{...e,[n]:r}},{}):{},[s,u]),p=k(()=>{let e=Object.fromEntries(RO.map(e=>[e,a[e]]));try{return JSON.parse(Vn(JSON.stringify(e),d))}catch{return e}},[a,d]),{provider:m,settings:y}=k(()=>{let e=((e,t,n)=>{if(!n||e&&e!==n.userProvider)return{provider:e??"",settings:t};let r={...t};for(let i of vO)r[i]||(r[i]=n[i]);return{provider:n.userProvider,settings:r}})(a.userProvider,{...p,tokenStorage:a.tokenStorage??"localStorage",sessionGate:a.sessionGate,sessionRevalidateSeconds:a.sessionRevalidateSeconds},t.auth);return{provider:e.provider,settings:{...e.settings,spaceKey:o}}},[p,a,o,t.auth]),{manager:b,loading:v,authenticated:w,state:T,bootstrapUser:C,bootstrapToken:E,peekedUser:A,peekedToken:O}=(({server:e,isHydrating:t=!1,provider:n="",settings:r})=>{let i=e?.authenticated?e.user?.details:void 0,o="string"==typeof e?.user?.accessToken?e.user.accessToken:void 0,[a,s]=S("init"),l=f(e=>{"state"===e.type&&s(e.state)},[]),c=k(()=>new LO(n,l,r),[n,l,r]),u=k(()=>t||i?void 0:c.peek(),[c,t,i]),d="init"!==a&&"initLoading"!==a||!!i||t||"authenticated"===u?.state||"guest"===u?.state;return g(()=>(c.init({user:i,accessToken:o,expiresAt:e?.user?.expiresAt,skipAuth:e?.skipAuth}),()=>c.dispose()),[c,i,o,e?.user?.expiresAt,e?.skipAuth]),k(()=>({manager:c,state:a,bootstrapUser:i,bootstrapToken:o,peekedUser:u?.user,peekedToken:u?.token?.accessToken,loading:"initLoading"===a||!d,authenticated:"authenticated"===a||"init"===a&&(!!i||"authenticated"===u?.state)}),[c,a,i,o,d,u])})({server:t,isHydrating:r,provider:m,settings:y}),_=b.getProvider(),{user:N,accessToken:M}=(e=>{let{state:t,provider:n,bootstrap:r,peeked:i}=e;return n?.user?{user:n.user,accessToken:n.accessToken}:"guest"===t?{}:r?.user?{user:r.user,accessToken:r.accessToken}:i?.user?{user:i.user,accessToken:i.accessToken}:{}})({state:T,provider:{user:_?.user,accessToken:_?.token?.accessToken},bootstrap:{user:C,accessToken:E},peeked:{user:A,accessToken:O}}),P=x(void 0),L=k(()=>{let e=N?{details:N,accessToken:M}:void 0,t=P.current;return t?.accessToken===e?.accessToken&&((e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t;return[.../* @__PURE__ */new Set([...Object.keys(n),...Object.keys(r)])].every(e=>JSON.stringify(n[e])===JSON.stringify(r[e]))})(t?.details,e?.details)||(P.current=e),P.current},[N,M]);(e=>{let t=x(e);Et(()=>{t.current!==e&&(t.current=e,qE.reset({refetch:""!==e}))},[e])})(w?String(L?.details?.id??""):"");let R=k(()=>({login:b.login.bind(b),refresh:b.refresh.bind(b),revalidate:b.revalidate.bind(b),invalidate:b.invalidate.bind(b),can:b.can.bind(b),logout:b.logout.bind(b),provider:b.getProviderType(),state:T,authenticated:w||!n,user:L}),[b,T,w,n,L]);/* @__PURE__ */
131
+ return I(cm,{value:R,children:!v&&e})},zO=(e,t=0,n=/* @__PURE__ */new WeakSet)=>{if("function"==typeof e)return;if("object"!=typeof e||!e)return e;if(n.has(e)||t>12)return"[…]";n.add(e);let r=Array.isArray(e)?e.map(e=>zO(e,t+1,n)):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,zO(r,t+1,n)]).filter(([,e])=>void 0!==e));return n.delete(e),r},DO=(e,...t)=>{let n=e;for(let r of t)n=X(n)?n[r]:void 0;return X(n)?n:{}},$O=e=>Array.isArray(e)?e:[],FO=e=>Object.entries(DO(e,"definition","bindings")).flatMap(([e,t])=>$O(t).flatMap(t=>{let{to:n,source:r,transformers:i}=DO(t),o=$O(i).map(e=>DO(e,"params").template).find(e=>"string"==typeof e);return"string"==typeof n&&"string"==typeof r?[{category:e,to:n,source:r,..."string"==typeof o?{template:o}:{}}]:[]})),qO=(e,t,n)=>{let{element:r,inComponent:i}=((e,t)=>{let n=DO(e,"flat");if(Object.hasOwn(n,t))return{element:n[t]};for(let[r,i]of Object.entries(DO(e,"components"))){let e=DO(i,"flat");if(Object.hasOwn(e,t))return{element:e[t],inComponent:r}}return{}})(DO(e,"schema"),t),o=Array.from(n.querySelectorAll(`[data-id="${t}"]`));if(!X(r)&&0===o.length)return;let a=o.at(0),s=a?.getBoundingClientRect(),l=a?getComputedStyle(a):void 0,c=void 0!==s&&s.width>0&&s.height>0&&"none"!==l?.display&&"hidden"!==l?.visibility,u=DO(r,"definition").type,d=DO(r,"attributes"),p="reference"===u&&"component"===d.referenceType&&"string"==typeof d.referenceId?d.referenceId:void 0,h=DO(e,"runtime","elements")[t];return{id:t,..."string"==typeof u?{type:u}:{},...void 0===i?{}:{inComponent:i},...void 0===p?{}:{instanceOf:p},...X(r)?{attributes:DO(zO(r),"attributes"),bindings:FO(r)}:{},...void 0===h?{}:{state:zO(h)},copies:o.length,visible:c,...s?{box:{x:Math.round(s.x),y:Math.round(s.y),width:Math.round(s.width),height:Math.round(s.height)}}:{}}},BO=(e,t)=>X(e)&&X(t)&&Object.keys(t).some(t=>!Object.hasOwn(e,t)),UO=K("DevToolsContext",{logs:[],providers:{}}),HO="data-plitzi-devtools",WO=e=>{let t=m(kt),n=qt();g(()=>{if(!e||!t)return;let r=[],i=!1,o=$d.addListener(e=>{let t=(e=>{if("interactions"!==e.category||!(e=>"object"==typeof e&&"nodes"in e&&"startTime"in e&&"node"in e)(e.params))return;let{node:t,hostElementId:n,status:r,startTime:i,endTime:o,nodes:a}=e.params,s=Object.values(a).filter(e=>e.node.id!==t.id).toSorted((e,t)=>e.startTime-t.startTime).map(e=>{let t=(e=>{if("failed"===e.status)return e.result instanceof Error?e.result.message:"string"==typeof e.result?e.result:void 0})(e);return{title:e.node.title,action:e.node.action,status:e.status,ms:Math.round(e.endTime-e.startTime),...void 0===t?{}:{error:t}}});return{at:e.time??"",trigger:`${t.title} [${t.action}]`,...void 0===n?{}:{on:n},status:r,ms:Math.round(o-i),steps:s}})(e);t&&(r.push(t),r.length>100&&r.shift())},{replay:!0}),a=(({root:e,writeState:t,stores:n,runs:r,setWatching:i,document:o})=>({help:()=>"window.__plitzi — this page, in text (debug mode only):\n state(key?) runtime.state, or one key of it\n setState(key, value) writes runtime.state.<key>, as a setState step would\n sources(name?) every source's current value by name (apiContainer_site, list_products…), or one\n element(id) an element by its id, in a page or a component: type, attributes, what it reads, its own state,\n the component it places, copies, on screen, box\n flows(limit = 20) the last flows that ran: trigger, element, status, every step with its time and error\n watch(on = true) one console line per flow as it ends",state:t=>{let n=DO(e.getState(),"runtime","state");return zO(void 0===t?n:n[t])},setState:t,sources:t=>{let r={},i={};for(let a of[e,...n()]){let e=DO(a.getState(),"runtime","sources");for(let[t,n]of Object.entries(DO(a.getOwnState(),"runtime","sources")))BO(n,e[t])?i[t]=n:r[t]=n}let o={...i,...r};return zO(void 0===t?o:o[t])},element:t=>qO(e.getState(),t,o),flows:(e=20)=>r().slice(-e),watch:(e=!0)=>(i(e),e?"Each flow is said in the console as it ends.":"Flows are no longer said in the console.")}))({root:t,writeState:(e,t)=>n(`runtime.state.${e}`,t),stores:()=>st().map(e=>e.store),runs:()=>r,setWatching:e=>{i=e},document:document});return window.__plitzi=a,()=>{o(),window.__plitzi===a&&delete window.__plitzi}},[e,t,n])},VO=({children:e})=>{let[t,n]=S([]),[r,i]=S({}),o=x(!1),a=f((e,t,r,i,o)=>{n(n=>[...n,{logType:e,category:t,message:r,time:o,params:i}])},[n]),s=f((e,t)=>i(n=>({...n,[e]:t})),[]),l=f(e=>i(t=>vr(t,[e])),[]),c=f((e,...t)=>{if(e&&"function"==typeof r[e])return r[e](...t)},[r]),u=f(()=>n([]),[]);o.current||=($d.setCallback(a),$d.setCallbackAddProvider(s),$d.setCallbackRemoveProvider(l),!0),g(()=>($d.setCallback(a),$d.setCallbackAddProvider(s),$d.setCallbackRemoveProvider(l),$d.processPendingLogs(),()=>{$d.setCallback(void 0),$d.setCallbackAddProvider(void 0),$d.setCallbackRemoveProvider(void 0),$d.flush()}),[a,s,l]);let d=k(()=>({providers:r,logs:t,setLogs:n,clearLogs:u,getData:c}),[r,t,n,u,c]);/* @__PURE__ */
132
+ return I(UO,{value:d,children:e})},GO={display:"contents"},KO=({children:e})=>{let t=x(null),n=x(void 0),r=x(void 0),i=m(kt),o=h(Ag),a=h(Li),s=h(Wr),l=h(cs);return w(()=>{let e=t.current;if(e)return clearTimeout(r.current),n.current??=C(e),()=>{let e=n.current;r.current=setTimeout(()=>{e?.unmount(),n.current===e&&(n.current=void 0)},0)}},[]),w(()=>{n.current?.render(/* @__PURE__ */I(kt,{value:i,children:/* @__PURE__ */I(cs,{value:l,children:/* @__PURE__ */I(Ag,{value:o,children:/* @__PURE__ */I(Li,{value:a,children:/* @__PURE__ */I(Wr,{value:s,children:e})})})})}))}),/* @__PURE__ */I("div",{ref:t,style:GO})},YO=[],JO=/* @__PURE__ */new Set,XO=[],ZO=()=>{XO=[...YO];for(let e of JO)e()},QO=e=>(JO.add(e),()=>{JO.delete(e)}),e_=()=>XO,t_=()=>mO,n_=e=>{mO!==e&&(mO=e,ZO())},r_=()=>({instanceIds:T(QO,e_,e_),selectedId:T(QO,t_,t_)}),i_=()=>()=>{},o_=(e,t,n)=>{window.dispatchEvent(new CustomEvent("customstorage-changed",{detail:{key:e,oldValue:t,newValue:n}}))},a_=()=>{let e={};if(typeof document>"u"||!document.cookie)return e;for(let t of document.cookie.split(";")){let n=t.indexOf("=");-1!==n&&(e[t.slice(0,n).trim()]=decodeURIComponent(t.slice(n+1).trim()))}return e},s_=e=>new Proxy(e,{get(e,t,n){if("setItem"===t)return(t,n)=>{let r=e.getItem(t);e.setItem.call(e,t,n),r!==n&&o_(t,r,n)};if("removeItem"===t)return t=>{let n=e.getItem(t);e.removeItem.call(e,t),null!==n&&o_(t,n,null)};let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}}),l_=e=>"cookie"===e?typeof document<"u"?s_((()=>{let e={getItem(e){let t=a_();return e in t?t[e]:null},setItem(e,t){typeof document<"u"&&(document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`)},removeItem(e){typeof document<"u"&&(document.cookie=`${e}=; path=/; max-age=0; samesite=lax`)},clear(){for(let t of Object.keys(a_()))e.removeItem(t)},key:e=>Object.keys(a_())[e]??null,get length(){return Object.keys(a_()).length}};return e})()):void 0:"sessionStorage"===e?typeof sessionStorage<"u"?s_(sessionStorage):void 0:typeof localStorage<"u"?s_(localStorage):void 0,c_=function(e,t,n="localStorage",r=!0){let[i,o]=k(()=>{if(e.includes(".")){let t=e.split(".").filter(Boolean);return[t.shift(),t.join(".")]}return[e,""]},[e]),a=x(l_(n));Wl(()=>{a.current=l_(n)},[n]);let[s,l]=S(()=>{try{if(!a.current)return t;let e=a.current.getItem(i);if(!e)return t;let n=JSON.parse(e);return o?pr(n,o,t):n}catch{return t}});g(()=>{try{if(!a.current)return;let e=s;if(o){let t=a.current.getItem(i);e=au(t?JSON.parse(t):{},e=>{hr(e,o,s)})}a.current.setItem(i,JSON.stringify(e))}catch(aM){}},[i,o,s]);let c=f(e=>{if(e.key===i)try{let n=e.newValue?JSON.parse(e.newValue):t;l(o?pr(n,o,t):n)}catch{}},[i,o,t]),u=f(e=>{if(e.detail.key===i)try{let n=e.detail.newValue?JSON.parse(e.detail.newValue):t;l(o?pr(n,o,t):n)}catch{}},[i,o,t]);return g(()=>{if(typeof window<"u"&&r)return window.addEventListener("storage",c),window.addEventListener("customstorage-changed",u),()=>{window.removeEventListener("storage",c),window.removeEventListener("customstorage-changed",u)}},[c,u,n,r]),[s,l]},u_=d(()=>import("./plitzi-sdk-devtools-DFKIflfa.js")),d_="horizontal",p_=0,h_=({children:e,className:t,innerClassName:n,enabled:r=!1,instanceId:i,renderMode:o="default",scroll:s="container",qa:l=!1,devToolsStyle:c="",devToolsStyleLink:u="",devToolsIconsLink:d=""})=>{let{resolvedTheme:p}=Ng(),[h,y]=c_("plitzi-sdk.dev-tools.orientation",d_),[b,v]=c_("plitzi-sdk.dev-tools.collapsed",!0),[w,k]=c_("plitzi-sdk.dev-tools.tab","logs"),[C,E]=S(),A=x(void 0),_=x(null);A.current||="sdk-instance-"+ ++p_;let N=i||A.current,M=T(i_,()=>!0,()=>!1),P=M?h:d_,L=((e,t)=>{g(()=>{if(t)return(e=>(YO.push(e),void 0===mO&&(mO=e),ZO(),()=>{let t=YO.indexOf(e);-1!==t&&YO.splice(t,1),mO===e&&(mO=YO[0]),ZO()}))(e)},[t,e]);let n=T(QO,t_,t_);return t&&n===e})(N,r);(e=>{let t=m(kt);g(()=>{if(e&&!ze&&t)return ot(t)},[e,t])})(r),((e,t)=>{g(()=>{if(e)return ot(qE.store,t,"Queries")},[e,t])})(L,N),WO(L);let R=f(e=>y(e),[y]),j=f(e=>{e&&k("logs"),E(e),v(!1)},[v,k]),z=f(()=>v(!0),[v]),D=f(e=>{E(void 0),k(e)},[k]);if(!r)return e;let $="document"===s&&(!M||b),F=/* @__PURE__ */I(u_,{className:V({dark:"dark"===p}),collapsed:b,orientation:P,tabSelected:w,logTypeFilter:C,onOpen:j,onCollapse:z,onTabSelect:D,onChangeOrientation:R,pageRef:_,qa:l}),q=L&&M&&/* @__PURE__ */I(KO,{children:/* @__PURE__ */I(VO,{children:/* @__PURE__ */O(a,{fallback:null,children:["default"===o&&F,"shadow"===o&&/* @__PURE__ */I("div",{style:{display:"contents"},"data-plitzi-devtools":"",children:/* @__PURE__ */O(lO,{children:[d&&/* @__PURE__ */I(lO.Link,{href:d}),u&&/* @__PURE__ */I(lO.Link,{href:u}),
133
+ /* @__PURE__ */O(lO.Content,{children:[/* @__PURE__ */I("style",{dangerouslySetInnerHTML:{__html:c}}),F]})]})})]})})});/* @__PURE__ */
134
+ return O("div",{className:V("relative flex min-w-0 grow",{"overflow-auto":!$,"flex-col":$||"horizontal"===P,"h-screen":!$&&"vertical"===P},t),children:[/* @__PURE__ */I(wt,{value:N,children:/* @__PURE__ */I("div",{ref:_,className:V("grow",{"basis-0 flex-col overflow-auto":!$},n),children:e})}),$?/* @__PURE__ */I("div",{className:"sticky bottom-0 h-0",children:q}):q]})},f_=({children:e})=>{let[[t,n,r,i,o,a=""]]=Dt(["navigation.routeParams","navigation.queryParams","navigation.origin","navigation.href","navigation.currentPageId","navigation.pendingLocation"]),s=jd(),l=f(()=>Gr(s).map(e=>({path:e,name:`variables.${e}`})),[s]);Pd({id:"global",source:"variables",name:"Variables",fields:l}),$t("runtime.sources.variables",s);let[c={}]=Dt("pageDefinitions"),u=k(()=>Object.values(c).map(e=>({value:e.id,label:pr(e,"attributes.name",e.id)})),[c]),d=k(()=>({routeParams:t,queryParams:n,origin:r,href:i,currentPageId:o,pending:""!==a,pendingLocation:a}),[t,n,r,i,o,a]),p=f(()=>[...Gr({routeParams:t,queryParams:n}).map(e=>({path:e,name:`navigation.${e}`})),{path:"origin",name:"Origin"},{path:"href",name:"This page’s address"},{path:"pending",name:"A navigation is on its way"},{path:"pendingLocation",name:"Where a navigation is going"},u.length>0?{path:"currentPageId",name:"Current Page",inputType:"select",values:u}:{path:"currentPageId",name:"Current Page"}],[t,n,u]);Pd({id:"global",source:"navigation",name:"Navigation",fields:p}),$t("runtime.sources.navigation",d);let m=h(cm),{user:y,authenticated:b,state:v,provider:w}=m,S=k(()=>w?{isAuthenticated:b,...void 0===v?{}:{status:v},accessToken:y?.accessToken??"",details:{username:"",email:"",roles:"",permissions:"",verified:"",...y?.details??{}}}:{},[w,y,b,v]),T=f(()=>Gr(S).map(e=>({path:e,name:`user.${e}`})),[S]);Pd({id:"global",source:"auth",name:"Auth State",fields:T}),$t("runtime.sources.auth",S);let C=(e=>{let{environment:t}=re(),[[n,r,i,o,a]]=Dt(["schema.flags","navigation.routeParams","navigation.queryParams","navigation.hostname","flags.overrides"]),{authenticated:s,user:l}=e,c=k(()=>xm({authenticated:s,user:l}),[s,l]);return Rd(k(()=>Ni(n,{environment:t,hostname:o,routeParams:r,queryParams:i,user:c},a),[n,t,o,r,i,c,a]))})(m),E=k(()=>Mi(C),[C]),A=f(()=>Object.keys(E).map(e=>({path:e,name:`flags.${e}`,inputType:"checkbox"})),[E]);Pd({id:"global",source:"flags",name:"Feature Flags",fields:A}),$t("runtime.sources.flags",E),$t("flags.resolved",C);let[I,O]=Dt(["schema.flags","flags.overrides"])[0],_=Rd(((e,t)=>Oi.flatMap(n=>Object.keys(t[n]??{}).filter(t=>!Object.hasOwn(e??{},t)).map(e=>({layer:n,name:e}))))(I,O??{}));g(()=>{_.forEach(({layer:e,name:t})=>console.warn(`[plitzi] The ${e} sets the feature flag "${t}", which this space does not declare: the override is ignored. Declare the flag in the space, or remove the override.`))},[_]);let[N]=Dt("runtime.state"),M=f(()=>Gr(N).map(e=>({path:e,name:`state.${e}`})),[N]);Pd({id:"global",source:"state",name:"State",fields:M}),$t("runtime.sources.state",N);let[P]=Dt("runtime.host"),L=f(()=>Gr(P).map(e=>({path:e,name:`host.${e}`})),[P]);Pd({id:"global",source:"host",name:"Host",fields:L}),$t("runtime.sources.host",P);let{theme:R,resolvedTheme:j}=Ng(_g),z=k(()=>({mode:R,resolved:j}),[R,j]),D=f(()=>Gr(z).map(e=>({path:e,name:`theme.${e}`})),[z]);Pd({id:"global",source:"theme",name:"Theme",fields:D}),$t("runtime.sources.theme",z);let[$]=Dt("schema.settings.computed"),F=x(void 0),q=k(()=>_d($??{},{variables:s,navigation:d,auth:S,state:N??{},host:P??{},theme:z,flags:E},F.current),[$,s,d,S,N,P,z,E]);F.current=q;let B=f(()=>Gr(q).map(e=>({path:e,name:`computed.${e}`})),[q]);return Pd({id:"global",source:"computed",name:"Computed",fields:B}),$t("runtime.sources.computed",q),e},m_=class{debugMode=!1;events;listeners=/* @__PURE__ */new Map;counts=/* @__PURE__ */new Map;constructor({events:e,debugMode:t=!1}={}){this.events=e??{},this.debugMode=t;for(let[n,r]of Object.entries(this.events))this.counts.set(n,Object.keys(r).length)}has(e,t){if(!e)throw Error("Module name is required");return this.events[e]&&this.events[e][t]}on(e,t,n,r={}){let{filter:i,override:o=!1}=r;if(!e)throw Error("Module name is required");if(!n||"function"!=typeof n)throw Error("Callback must be a function");this.events[e]||(this.events[e]={}),this.events[e][t]||this.counts.set(e,(this.counts.get(e)??0)+1),(!this.events[e][t]||o&&this.events[e][t].length>0)&&(this.events[e][t]=[]),this.events[e][t].push({callback:n,filter:i})}get(e,t){return this.has(e,t)?this.events[e]?.[t]:[]}off(e,t,n){if(this.has(e,t)&&this.events[e]&&(this.events[e][t]=n?this.events[e][t]?.filter(e=>e.callback!==n):[],0===this.events[e][t]?.length)){delete this.events[e][t];let n=(this.counts.get(e)??1)-1;n>0?this.counts.set(e,n):(this.counts.delete(e),delete this.events[e])}}async emit(e,t=[],...n){let r;this.debugMode&&$d.info("eventBridge","Event Triggered",{module:e,events:t,data:n}),r=Array.isArray(t)?t:[t];let i=[];r.forEach(t=>{if(!this.has(e,t))return;let r=this.get(e,t);r&&r.forEach(e=>{let{callback:t,filter:r}=e;(!r||"function"!=typeof r||r(...n))&&i.push(t(...n))})});let o=await Promise.all(i);return this.touch(r.reduce((e,t)=>({...e,[t]:n}),{})),o}async emitWithResponse(e,t,...n){if(!this.has(e,t))return;let r=this.get(e,t);if(!r)return;let i=await Promise.all(r.filter(e=>!e.filter||e.filter(...n)).map(e=>e.callback(...n)));return 1===i.length?i[0]:i}once(e,t,n,r){if(!e)throw Error("Module name is required");let i=async r=>{await n(r),this.off(e,t,i)};this.on(e,t,i,{filter:r})}clear(e){if(!e)return this.events={},void this.counts.clear();this.events[e]&&(delete this.events[e],this.counts.delete(e))}getEvents(e){return e?this.events[e]?this.events[e]:{}:this.events}getModuleEventsNames(e){return e&&this.events[e]?Object.keys(this.events[e]):[]}getModuleEventsCount(e){return this.getModuleEventsNames(e).length}listen(e,t){let n=Array.isArray(e)?e:[e];return n.forEach(e=>{this.listeners.has(e)||this.listeners.set(e,/* @__PURE__ */new Set),this.listeners.get(e)?.add(t)}),()=>{n.forEach(e=>{let n=this.listeners.get(e);n&&(n.delete(t),0===n.size&&this.listeners.delete(e))})}}touch(e){for(let t in e){let n=this.listeners.get(t);if(n)for(let t of n)t(e)}}},g_=({children:e,debugMode:t,onInit:n})=>{let r=k(()=>new m_({debugMode:t}),[t]);g(()=>()=>{r.clear()},[r]);let i=k(()=>({eventBridge:r}),[r]);return g(()=>{n?.(i)},[n,i]),/* @__PURE__ */I(mu,{value:i,children:e})},y_=({id:e,interactions:t,triggers:n,callbacks:r,getAdditionalParams:i})=>{let{interactionsManager:o}=h(Id);g(()=>{if(e)return o.subscribe(e),()=>{o.unsubscribe(e)}},[e,o]),g(()=>{e&&o.update(e,t,n,r,i)},[e,t,n,r,i,o])},b_=(e,t)=>"function"==typeof e.type?e.type(t):e.type,v_=(e,t)=>{if("string"!=typeof t)return t;if("number"===e){let e=t.trim();if(""===e)return;let n=Number(e);return Number.isFinite(n)?n:t}return"boolean"!==e||"true"!==t&&"false"!==t?t:"true"===t},w_=(e,t)=>{if(!e)return t;let n="function"==typeof e?e(t):e,r={...t};for(let[i,o]of Object.entries(n))Object.hasOwn(t,i)&&(r[i]=v_(b_(o,t),t[i]));return r},k_=nd("copyToClipboard",{title:"Copy To Clipboard",type:"utility",strictParams:!0,params:{text:{type:"text",description:"The words to copy — a template reads the page: {{ navigation.href }} is its address.",default:"",label:"Text",required:!0}}},async({text:e})=>{let t=lv();if(!t)throw Error("This page has no clipboard to write to: the browser offers none here (a page not on https?)");await t(e)}),x_={action:"delayTime",title:"Delay Time",type:"utility",params:{time:{label:"Time (Milliseconds)",type:"number"}},preview:{},callback:({time:e},t)=>new Promise(n=>{let r=t?.signal;if(r?.aborted)return void n(void 0);let i=()=>{clearTimeout(o),r?.removeEventListener("abort",i),n(void 0)},o=setTimeout(i,e);r?.addEventListener("abort",i,{once:!0})})},S_={action:"twigTemplate",title:"Twig Template",type:"utility",params:{returnMode:{label:"Mode",canBind:!1,type:"select",defaultValue:"text",options:[{label:"Text",value:"text"},{label:"Json Text",value:"json"},{label:"Json Object",value:"jsonObject"}]},template:{label:"Template",canBind:!1,defaultValue:"",type:e=>{let{returnMode:t}=e;return"text"===t?"codemirror-text":"codemirror-json"}}},preview:e=>{let{template:t,returnMode:n}=e;if("jsonObject"===n)try{let n=JSON.parse(Vn(t,e));if(n&&"object"==typeof n)return{template:"",content:Gr(n).reduce((e,t)=>({...e,[t]:""}),{})}}catch{}return{template:"",content:""}},callback:e=>{let{template:t,returnMode:n}=e,r="";try{r=Vn(t,e)}catch(aM){console.error(aM)}if("jsonObject"===n)try{return{content:JSON.parse(r)}}catch(aM){console.error(aM)}else if("json"===n)try{return JSON.parse(r),{content:r}}catch{return{content:""}}return{content:r}}},T_={origin:"Requests to the same site",all:"All cached requests",elements:"Only these containers",none:"None — this only reads"},C_=(e,t=()=>!0)=>({invalidateQueries:{type:"select",description:"What to refresh once the write succeeded, so the page shows the new data: the requests to the same site, every provider on the page, only the api containers named in `invalidateElements`, or none for a step that only reads. Server-driven containers are refreshed too, asking the server past its cache. Containers on screen ask again at once; the rest when they are shown.",default:e[0],options:[...e],optionLabels:Object.fromEntries(e.map(e=>[e,T_[e]])),label:"Refresh cached requests",canBind:!1,when:t},invalidateElements:{type:"elementIds",elementType:"apiContainer",description:"The api containers to refresh, by element id.",default:[],label:"Containers (ids)",when:e=>t(e)&&"elements"===e.invalidateQueries}}),E_=e=>{let t="string"==typeof e.method?e.method.toLowerCase():"get";return"get"===t||"head"===t},A_={title:"Webhook",type:"utility",strictParams:!0,params:{url:{type:"text",description:"The URL to call.",default:"",label:"Url"},method:{type:"select",description:"HTTP method.",default:"get",options:["get","post","put","delete","patch","head"],canBind:!1},body:{type:"json",description:'Request body: an object of fields (sent as JSON, or as form data when one of them is a file). Pass a real object, with templates for its values — `{ email: "{{ submitted.values.email }}" }`.',default:"",builderType:"textarea"},authorizationToken:{type:"text",description:"Value sent as the Authorization header.",default:""},headers:{type:"json",description:'Headers of the request, as an object of name to value, with templates for the values like the body: `{ "x-api-key": "{{ apiKey }}" }`. Authorization is set by `authorizationToken` and the content type follows the body, so neither is set here.',default:"",builderType:"textarea"},credentials:{type:"select",description:"fetch credentials mode.",default:"same-origin",options:["include","omit","same-origin"],optionLabels:{"same-origin":"Same Origin"}},cache:{type:"boolean",description:"Serve a GET from the page’s query cache while it is fresh, and keep the answer there — shared with any api container asking the same thing.",default:!1,label:"Cache response",when:E_},staleTime:{type:"number",description:"With `cache`: seconds the answer is served without asking again.",default:30,label:"Fresh for (s)",when:e=>E_(e)&&(!0===e.cache||"true"===e.cache)},...C_(["origin","all","elements","none"],e=>!E_(e))},preview:{response:{status:"",data:""}}},I_=/* @__PURE__ */new Set(["GET","HEAD"]),O_=/* @__PURE__ */new Set(["GET","HEAD","DELETE"]),__=e=>{let t=Number(e);return 1e3*(Number.isFinite(t)&&t>=0?t:Number(A_.params.staleTime.default))},N_=e=>e?{Authorization:`Bearer ${e}`}:{},M_=/* @__PURE__ */new Set(["authorization","content-type"]),P_=e=>"object"==typeof e&&e?Object.fromEntries(Object.entries(e).flatMap(([e,t])=>"string"!=typeof t&&"number"!=typeof t||""===t||M_.has(e.toLowerCase())?[]:[[e,String(t)]])):{},L_=async({url:e,authorizationToken:t,headers:n,body:r,credentials:i},o,a)=>{let s=(e=>"object"==typeof e&&e?e:{})(r),l=Object.values(s).some(e=>e instanceof Blob),c={method:o,headers:{...P_(n),...l?{}:{"Content-Type":"application/json"},...N_(t)},credentials:i,...a?{signal:a}:{}};if(!O_.has(o))if(l){let e=new FormData;Object.entries(s).forEach(([t,n])=>{e.append(t,n)}),c.body=e}else c.body=JSON.stringify(s);let u=await fetch(e,c).catch(t=>{throw Error(`${o} ${e} got no answer: ${t instanceof Error?t.message:String(t)}`)}),d="";try{d=await u.json()}catch{}return{status:u.status,data:d}},R_=nd("webHook",A_,async(e,t)=>{let n=(e.method||"get").toUpperCase();if(I_.has(n)){if(!0!==e.cache&&"true"!==e.cache)return{response:await L_(e,n,t?.signal)};let r=XE({method:n,url:e.url,credentials:e.credentials,headers:{...P_(e.headers),...N_(e.authorizationToken)}});return{response:await qE.fetchQuery(r,{meta:{url:e.url},fetcher:()=>L_(e,n),staleTime:__(e.staleTime),isCacheable:e=>e.status<400})}}let r=await L_(e,n,t?.signal);return r.status>=200&&r.status<300&&ZE({mode:e.invalidateQueries,fallback:"origin",elements:e.invalidateElements,url:e.url}),{response:r}}),j_={copyToClipboard:k_,delayTime:x_,twigTemplate:S_,webHook:R_},z_=(e,t,n,r,i)=>{if("utility"===e&&"twigTemplate"===i)return t;let o={...n,...r},a=(e,t,n)=>{if("string"==typeof e){let{value:n,unresolved:r}=((e,t)=>{let n=e,r=5;for((e=>"string"==typeof e&&/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/.test(e))(n)&&!or(e)&&(n=Xn(e,t),r--);"string"==typeof n&&or(n)&&r>0;)n=Xn(n,t),r--;return{value:n,unresolved:"string"==typeof n&&or(n)}})(e,o);return r&&$d.warning("interactions",/* @__PURE__ */O("span",{children:["Twig token resolution exceeded ",5," passes for ",
135
+ /* @__PURE__ */I("b",{children:t}),", leaving unresolved tokens"]}),{param:t,value:n}),n}return n>=5||"object"!=typeof e||!e?e:Array.isArray(e)?e.map(e=>a(e,t,n+1)):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,a(r,t,n+1)]))};return Object.keys(t).reduce((n,r)=>{let i="trigger"===e?t[r]:a(t[r],r,0);return{...n,[r]:i}},{})},D_=e=>Object.fromEntries(Object.entries(e).filter(e=>(e=>"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e)(e[1]))),$_=e=>"object"==typeof e&&!!e&&"then"in e&&"function"==typeof e.then,F_=(e,t={},n={},r={},i={})=>{let o=[],{id:a,action:s,enabled:l,params:c,elementId:u,type:d,when:p}=e;if(!s||!l)return{status:"disabled",result:{},postCallbacks:o};let h=D_({...r,...n,[a]:c});if(p&&!Ei(p,h))return{status:"skipped",result:{},postCallbacks:o,whenParams:h};let f,m=t=>($d.danger("interactions",/* @__PURE__ */O("span",{children:["Interaction node failed ",/* @__PURE__ */I("b",{children:s})]}),{error:t instanceof Error?t.message:String(t),node:e}),{status:"failed",result:{},postCallbacks:o,whenParams:h});switch(d){case"callback":case"globalCallback":if(!u)return $d.warning("interactions",/* @__PURE__ */O("span",{children:["Step ",
136
136
  /* @__PURE__ */I("b",{children:s})," names no element, so there is nothing to run it on"]}),{node:e}),{status:"failed",result:{},postCallbacks:o,whenParams:h};if(f=pr(t,`${u}.${s}`),!f)return $d.warning("interactions",/* @__PURE__ */O("span",{children:["Nothing is registered as ",
137
- /* @__PURE__ */I("b",{children:`${u}.${s}`}),", so this step did nothing"]}),{node:e,available:Object.keys(pr(t,u,{}))}),{status:"failed",result:{},postCallbacks:o,whenParams:h};break;case"utility":f=pr(__,s,{});break;default:return{status:"success",result:{},postCallbacks:o,whenParams:h}}try{let e={...n,...r,...f_(f.params,N_(d,c,n,r,s))},{callback:t,postCallback:l}=f,u=t=>(l&&o.push({id:a,callback:l,params:{...e,[a]:t}}),{status:"success",result:t,postCallbacks:o,whenParams:h}),p=t?t(e,i):{};return P_(p)?Promise.resolve(p).then(u,m):u(p)}catch(XN){return m(XN)}},R_=async(e=[])=>{let t={};return await Promise.all(e.reverse().map(async({id:e,callback:n,params:r})=>{t[e]=await(n?.(vr(r,[e]),r[e]))})),t},j_=()=>({}),z_=(e,t,n={},r,i)=>{let o=$d.getTime().valueOf(),a="skipped"===r?"skipped":"success",s=/* @__PURE__ */O("span",{children:["Interaction triggered ",
138
- /* @__PURE__ */I("b",{children:`${e.title} [${e.action}]`}),i?/* @__PURE__ */O(A,{children:[" on ",/* @__PURE__ */I("b",{children:i})]}):null]}),l={status:r,node:e,elementId:e.elementId,hostElementId:i,nodes:{...n,[e.id]:{node:e,status:a,result:void 0,postCallbacks:[],startTime:t,endTime:o}},startTime:t,endTime:o};"failed"!==r?$d.info("interactions",s,l):$d.danger("interactions",s,l)},D_=c_,$_=class e{eventBridge;parentManager;childManagers;interactionsData;subscriptors;callbacksAvailables;flowsRunning=/* @__PURE__ */new Map;latestRuns=/* @__PURE__ */new Map;lastUpdate;listeners=/* @__PURE__ */new Set;constructor(e="",t={},n={}){this.eventBridge=new D_,this.parentManager=void 0,this.childManagers=[],this.subscriptors={},this.callbacksAvailables={},this.interactionsData={currentPageId:e,...t,...n},this.lastUpdate=Date.now()}eventBridgeCallback=e=>async(t,n,r)=>{if(!e||!n||!t)return;let i=this.subscriptors[t];if(await Promise.resolve(),!i||this.subscriptors[t]!==i)return;let o=pr(this.subscriptors,`${t}.getAdditionalParams`,void 0),a=()=>({...this.interactionsData,..."function"==typeof o?o().dataSource:void 0}),s=Object.values(e).filter(e=>"trigger"===e.type&&e.action===n&&e.enabled&&((e,t)=>{if("onKey"===e.action){let{shortcuts:n}=t;return Array.isArray(n)&&n.includes(e.params.keys)}return"onInterval"!==e.action||md(e.params.interval)===t.interval})(e,r));await Promise.all(s.map(n=>this.runFlow(`${t}.${n.id}`,n.whileRunning??"skip",i=>(async(e,t={},n={},r={},i=j_,o,a,s=[])=>{let l=$d.getTime().valueOf(),{action:c,enabled:u,when:d}=e;if(!c||!u||d&&!Ei(d,M_({...i(),...r})))return void z_(e,l,{},"skipped",o);let p=await(async(e,t={},n={},r={},i=j_,o=[],a={},s={})=>{let l=e,c=r;for(;l;){if(s.signal?.aborted)return a;let e=pr(t,l.afterNode);if(!e)return o.length>0&&await R_(o),a;let r=$d.getTime().valueOf(),u=L_(e,n,c,i(),s),d=P_(u)?await u:u,{result:p,postCallbacks:h,whenParams:f}=d,m="failed"===d.status&&s.signal?.aborted?"skipped":d.status;a[e.id]={node:e,status:m,result:p,postCallbacks:h,whenParams:f,startTime:r,endTime:$d.getTime().valueOf()},o.push(...h),c={...c,[e.id]:p},l=e}return a})(e,t,n,r,i,s,{},{hostElementId:o,...a?{signal:a}:{}});z_(e,l,p,(e=>Object.values(e).some(({status:e})=>"failed"===e)?"failed":"completed")(p),o)})(n,e,this.getCallbacksAvailables(),{[n.id]:r},a,t,i))))};runFlow(e,t,n){if("latest"===t){this.latestRuns.get(e)?.abort();let t=new AbortController;return this.latestRuns.set(e,t),n(t.signal).finally(()=>{this.latestRuns.get(e)===t&&this.latestRuns.delete(e)})}let r=this.flowsRunning.get(e);if("parallel"===t)return n();if(r&&"skip"===t)return Promise.resolve();let i=(r?r.then(()=>n(),()=>n()):n()).finally(()=>{this.flowsRunning.get(e)===i&&this.flowsRunning.delete(e)});return this.flowsRunning.set(e,i),i}subscribe(e,t={},n={},r={},i){return!(!e||this.subscriptors[e]||(hr(this.subscriptors,e,{id:e,triggers:n,getAdditionalParams:i}),this.wire(e,t,n,r),this.touch(),0))}update(e,t={},n={},r={},i){let o=this.subscriptors[e];return!!o&&(o.triggers=n,o.getAdditionalParams=i,this.wire(e,t,n,r),this.touch(),!0)}wire(e,t,n,r){let i=Object.keys(r);i.length>0?this.callbacksAvailables[e]=i.reduce((t,n)=>{let{title:i,callback:o,postCallback:a,params:s,preview:l,type:c}=r[n];return"function"==typeof o?{...t,[n]:{elementId:e,title:i,action:n,type:c,callback:o,postCallback:a,params:s,preview:l}}:t},{}):delete this.callbacksAvailables[e],Object.keys(n).length>0?this.eventBridge.on("interaction",e,this.eventBridgeCallback(t),{override:!0}):this.eventBridge.off("interaction",e)}unsubscribe(e){return!!this.subscriptors[e]&&(this.eventBridge.off("interaction",e),delete this.subscriptors[e],this.callbacksAvailables[e]&&delete this.callbacksAvailables[e],this.touch(),!0)}getRootManager(){return this.parentManager?this.parentManager.getRootManager():this}getSubscriptorInternal(e){let t=pr(this.subscriptors,e);if(!t&&this.childManagers.length>0)for(let n of this.childManagers)if(t=n.getSubscriptorInternal(e),t)break;return t}getSubscriptor(e){return this.parentManager?this.getRootManager()?.getSubscriptorInternal(e):this.getSubscriptorInternal(e)}getCallbacksAvailablesInternal(){let e={};if(this.childManagers.length>0)for(let t of this.childManagers)e={...e,...t.getCallbacksAvailablesInternal()};return{...e,...this.callbacksAvailables}}getCallbacksAvailables(){if(!this.parentManager)return this.getCallbacksAvailablesInternal();let e=[];for(let n=this.parentManager;n;n=n.parentManager)e.unshift(n);let t=this.getRootManager()?.getCallbacksAvailablesInternal()??{};for(let n of e)t={...t,...n.callbacksAvailables};return{...t,...this.getCallbacksAvailablesInternal()}}interactionTrigger(e,t,n={}){if(e)return this.eventBridge.emit("interaction",e,e,t,n)}createChildManager=(t={},n={})=>{let r=new e(this.interactionsData.currentPageId,t,n);return r.parentManager=this,this.childManagers.push(r),r};removeChildManager=e=>{this.childManagers=this.childManagers.filter(t=>t!==e)};onUpdate(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}touch(){let e=Date.now();this.lastUpdate=e;for(let t of this.listeners)t(e)}},F_=({children:e,currentPageId:t,routeParams:n,queryParams:r})=>{let[i]=S(()=>new $_(t,n,r));i.interactionsData=k(()=>({currentPageId:t,...n,...r}),[t,n,r]);let o=k(()=>({interactionsManager:i,useInteractions:d_}),[i]);/* @__PURE__ */
139
- return I(Id,{value:o,children:e})},q_={runServerAction:{source:"actions",title:"Run Server Action",strictParams:!0,params:{actionId:{type:"text",description:"Identifier of the server action to run, as the space publishes it.",default:"",required:!0,label:"Action"},input:{type:"json",description:"The values passed to the action, as a JSON object. The server drops every key the action did not declare. Authoring in code, pass a real object rather than a line of JSON text — an interpolated value containing a quote or a newline makes the text unparseable, and unparseable input posts nothing.",default:"{}",label:"Input"},mode:{type:"select",description:"await waits and puts the result in the flow scope; detached carries on immediately and leaves nothing to read; stream reports progress as it goes.",default:"await",options:["await","detached","stream"],optionLabels:{await:"Wait for the result",detached:"Send and continue",stream:"Stream progress"}},idempotencyKey:{type:"text",description:"Makes a repeat of the same intent answer with the first run instead of running again.",default:"",when:e=>"detached"!==e.mode},...v_(["all","elements","none"])},preview:{runId:"",status:"",output:{},reason:"",error:""}},cancelServerAction:{source:"actions",title:"Cancel Server Action",strictParams:!0,params:{runId:{type:"text",description:"The run to cancel — normally `{{ <step>.output.runId }}` from the step that started it.",default:""}},preview:{cancelled:""}}},B_=e=>Array.isArray(e)?e:void 0,U_={status:"failed",reason:"failed",runId:"",output:{}},H_=(e,t)=>e.signal.aborted?{status:"aborted",error:"Cancelled"}:{status:"failed",error:t instanceof Error?t.message:String(t)},W_=(e,t,n)=>{if(401!==e)return;let r=Em(e,t);r&&Tm({reason:r,url:n})},V_=e=>({status:"failed",...e.runId?{runId:e.runId}:{},...e.reason?{reason:e.reason}:{},...e.error?{error:e.error}:{},...e.steps?{steps:e.steps}:{},...e.trace?{trace:e.trace}:{}}),G_=(e,t)=>({actionId:e,runId:t.runId??"",error:t.error??"",reason:t.reason??"failed"}),K_=({children:e})=>{let{useInteractions:t,interactionsManager:n}=h(Id),[r]=Dt("actions.endpoint"),[[i,o]]=Dt(["actions.catalog","actions.available"]),a=f((e,t,r)=>{e&&n.interactionTrigger(e,t,r)},[n]),s=f(async(e,t)=>{let{actionId:n,mode:i="await",idempotencyKey:o}=e;if(!r)return $d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
137
+ /* @__PURE__ */I("b",{children:`${u}.${s}`}),", so this step did nothing"]}),{node:e,available:Object.keys(pr(t,u,{}))}),{status:"failed",result:{},postCallbacks:o,whenParams:h};break;case"utility":f=pr(j_,s,{});break;default:return{status:"success",result:{},postCallbacks:o,whenParams:h}}try{let e={...n,...r,...w_(f.params,z_(d,c,n,r,s))},{callback:t,postCallback:l}=f,u=t=>(l&&o.push({id:a,callback:l,params:{...e,[a]:t}}),{status:"success",result:t,postCallbacks:o,whenParams:h}),p=t?t(e,i):{};return $_(p)?Promise.resolve(p).then(u,m):u(p)}catch(aM){return m(aM)}},q_=async(e=[])=>{let t={};return await Promise.all(e.reverse().map(async({id:e,callback:n,params:r})=>{t[e]=await(n?.(vr(r,[e]),r[e]))})),t},B_=()=>({}),U_=(e,t,n={},r,i)=>{let o=$d.getTime().valueOf(),a="skipped"===r?"skipped":"success",s=/* @__PURE__ */O("span",{children:["Interaction triggered ",
138
+ /* @__PURE__ */I("b",{children:`${e.title} [${e.action}]`}),i?/* @__PURE__ */O(A,{children:[" on ",/* @__PURE__ */I("b",{children:i})]}):null]}),l={status:r,node:e,elementId:e.elementId,hostElementId:i,nodes:{...n,[e.id]:{node:e,status:a,result:void 0,postCallbacks:[],startTime:t,endTime:o}},startTime:t,endTime:o};"failed"!==r?$d.info("interactions",s,l):$d.danger("interactions",s,l)},H_=m_,W_=class e{eventBridge;parentManager;childManagers;interactionsData;subscriptors;callbacksAvailables;flowsRunning=/* @__PURE__ */new Map;latestRuns=/* @__PURE__ */new Map;lastUpdate;listeners=/* @__PURE__ */new Set;constructor(e="",t={},n={}){this.eventBridge=new H_,this.parentManager=void 0,this.childManagers=[],this.subscriptors={},this.callbacksAvailables={},this.interactionsData={currentPageId:e,...t,...n},this.lastUpdate=Date.now()}eventBridgeCallback=e=>async(t,n,r)=>{if(!e||!n||!t)return;let i=this.subscriptors[t];if(await Promise.resolve(),!i||this.subscriptors[t]!==i)return;let o=pr(this.subscriptors,`${t}.getAdditionalParams`,void 0),a=()=>({...this.interactionsData,..."function"==typeof o?o().dataSource:void 0}),s=Object.values(e).filter(e=>"trigger"===e.type&&e.action===n&&e.enabled&&((e,t)=>{if("onKey"===e.action){let{shortcuts:n}=t;return Array.isArray(n)&&n.includes(e.params.keys)}return"onInterval"!==e.action||md(e.params.interval)===t.interval})(e,r));await Promise.all(s.map(n=>this.runFlow(`${t}.${n.id}`,n.whileRunning??"skip",i=>(async(e,t={},n={},r={},i=B_,o,a,s=[])=>{let l=$d.getTime().valueOf(),{action:c,enabled:u,when:d}=e;if(!c||!u||d&&!Ei(d,D_({...i(),...r})))return void U_(e,l,{},"skipped",o);let p=await(async(e,t={},n={},r={},i=B_,o=[],a={},s={})=>{let l=e,c=r;for(;l;){if(s.signal?.aborted)return a;let e=pr(t,l.afterNode);if(!e)return o.length>0&&await q_(o),a;let r=$d.getTime().valueOf(),u=F_(e,n,c,i(),s),d=$_(u)?await u:u,{result:p,postCallbacks:h,whenParams:f}=d,m="failed"===d.status&&s.signal?.aborted?"skipped":d.status;a[e.id]={node:e,status:m,result:p,postCallbacks:h,whenParams:f,startTime:r,endTime:$d.getTime().valueOf()},o.push(...h),c={...c,[e.id]:p},l=e}return a})(e,t,n,r,i,s,{},{hostElementId:o,...a?{signal:a}:{}});U_(e,l,p,(e=>Object.values(e).some(({status:e})=>"failed"===e)?"failed":"completed")(p),o)})(n,e,this.getCallbacksAvailables(),{[n.id]:r},a,t,i))))};runFlow(e,t,n){if("latest"===t){this.latestRuns.get(e)?.abort();let t=new AbortController;return this.latestRuns.set(e,t),n(t.signal).finally(()=>{this.latestRuns.get(e)===t&&this.latestRuns.delete(e)})}let r=this.flowsRunning.get(e);if("parallel"===t)return n();if(r&&"skip"===t)return Promise.resolve();let i=(r?r.then(()=>n(),()=>n()):n()).finally(()=>{this.flowsRunning.get(e)===i&&this.flowsRunning.delete(e)});return this.flowsRunning.set(e,i),i}subscribe(e,t={},n={},r={},i){return!(!e||this.subscriptors[e]||(hr(this.subscriptors,e,{id:e,triggers:n,getAdditionalParams:i}),this.wire(e,t,n,r),this.touch(),0))}update(e,t={},n={},r={},i){let o=this.subscriptors[e];return!!o&&(o.triggers=n,o.getAdditionalParams=i,this.wire(e,t,n,r),this.touch(),!0)}wire(e,t,n,r){let i=Object.keys(r);i.length>0?this.callbacksAvailables[e]=i.reduce((t,n)=>{let{title:i,callback:o,postCallback:a,params:s,preview:l,type:c}=r[n];return"function"==typeof o?{...t,[n]:{elementId:e,title:i,action:n,type:c,callback:o,postCallback:a,params:s,preview:l}}:t},{}):delete this.callbacksAvailables[e],Object.keys(n).length>0?this.eventBridge.on("interaction",e,this.eventBridgeCallback(t),{override:!0}):this.eventBridge.off("interaction",e)}unsubscribe(e){return!!this.subscriptors[e]&&(this.eventBridge.off("interaction",e),delete this.subscriptors[e],this.callbacksAvailables[e]&&delete this.callbacksAvailables[e],this.touch(),!0)}getRootManager(){return this.parentManager?this.parentManager.getRootManager():this}getSubscriptorInternal(e){let t=pr(this.subscriptors,e);if(!t&&this.childManagers.length>0)for(let n of this.childManagers)if(t=n.getSubscriptorInternal(e),t)break;return t}getSubscriptor(e){return this.parentManager?this.getRootManager()?.getSubscriptorInternal(e):this.getSubscriptorInternal(e)}getCallbacksAvailablesInternal(){let e={};if(this.childManagers.length>0)for(let t of this.childManagers)e={...e,...t.getCallbacksAvailablesInternal()};return{...e,...this.callbacksAvailables}}getCallbacksAvailables(){if(!this.parentManager)return this.getCallbacksAvailablesInternal();let e=[];for(let n=this.parentManager;n;n=n.parentManager)e.unshift(n);let t=this.getRootManager()?.getCallbacksAvailablesInternal()??{};for(let n of e)t={...t,...n.callbacksAvailables};return{...t,...this.getCallbacksAvailablesInternal()}}interactionTrigger(e,t,n={}){if(e)return this.eventBridge.emit("interaction",e,e,t,n)}createChildManager=(t={},n={})=>{let r=new e(this.interactionsData.currentPageId,t,n);return r.parentManager=this,this.childManagers.push(r),r};removeChildManager=e=>{this.childManagers=this.childManagers.filter(t=>t!==e)};onUpdate(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}touch(){let e=Date.now();this.lastUpdate=e;for(let t of this.listeners)t(e)}},V_=({children:e,currentPageId:t,routeParams:n,queryParams:r})=>{let[i]=S(()=>new W_(t,n,r));i.interactionsData=k(()=>({currentPageId:t,...n,...r}),[t,n,r]);let o=k(()=>({interactionsManager:i,useInteractions:y_}),[i]);/* @__PURE__ */
139
+ return I(Id,{value:o,children:e})},G_={runServerAction:{source:"actions",title:"Run Server Action",strictParams:!0,params:{actionId:{type:"text",description:"Identifier of the server action to run, as the space publishes it.",default:"",required:!0,label:"Action"},input:{type:"json",description:"The values passed to the action, as a JSON object. The server drops every key the action did not declare. Authoring in code, pass a real object rather than a line of JSON text — an interpolated value containing a quote or a newline makes the text unparseable, and unparseable input posts nothing.",default:"{}",label:"Input"},mode:{type:"select",description:"await waits and puts the result in the flow scope; detached carries on immediately and leaves nothing to read; stream reports progress as it goes.",default:"await",options:["await","detached","stream"],optionLabels:{await:"Wait for the result",detached:"Send and continue",stream:"Stream progress"}},idempotencyKey:{type:"text",description:"Makes a repeat of the same intent answer with the first run instead of running again.",default:"",when:e=>"detached"!==e.mode},...C_(["all","elements","none"])},preview:{runId:"",status:"",output:{},reason:"",error:""}},cancelServerAction:{source:"actions",title:"Cancel Server Action",strictParams:!0,params:{runId:{type:"text",description:"The run to cancel — normally `{{ <step>.output.runId }}` from the step that started it.",default:""}},preview:{cancelled:""}}},K_=["completed","failed","skipped","aborted"],Y_=e=>void 0===e?"completed":K_.find(t=>t===e)??"failed",J_=K("ServerActionContext",void 0),X_=e=>Array.isArray(e)?e:void 0,Z_={status:"failed",reason:"failed",runId:"",output:{}},Q_=(e,t)=>e.signal.aborted?{status:"aborted",error:"Cancelled"}:{status:"failed",error:t instanceof Error?t.message:String(t)},eN=(e,t,n)=>{if(401!==e)return;let r=Em(e,t);r&&Tm({reason:r,url:n})},tN=e=>({status:"failed",...e.runId?{runId:e.runId}:{},...e.reason?{reason:e.reason}:{},...e.error?{error:e.error}:{},...e.steps?{steps:e.steps}:{},...e.trace?{trace:e.trace}:{}}),nN=(e,t)=>({actionId:e,runId:t.runId??"",error:t.error??"",reason:t.reason??"failed"}),rN=({children:e})=>{let{useInteractions:t,interactionsManager:n}=h(Id),[r]=Dt("actions.endpoint"),[[i,o]]=Dt(["actions.catalog","actions.available"]),a=f((e,t,r)=>{e&&n.interactionTrigger(e,t,r)},[n]),s=f(async(e,t)=>{let{actionId:n,mode:i="await",idempotencyKey:o}=e;if(!r)return $d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
140
140
  /* @__PURE__ */I("b",{children:n})," was skipped: this page is served without a Plitzi server"]}),{actionId:n,status:"skipped"}),{status:"skipped",runId:"",output:{}};if(!n)return{status:"skipped",runId:"",output:{}};let s=(e=>{if(!e)return{};if("object"==typeof e)return e;try{let t=JSON.parse(e);return"object"==typeof t&&t?t:{}}catch{return{}}})(e.input),l=JSON.stringify({actionId:n,input:s,...o?{idempotencyKey:o}:{}}),c=(e=>{let t=`run-${ct+=1}`;return ut([{...e,id:t,status:"running",startedAt:Date.now(),progress:[],cancellable:!0},...lt.getState().runs].slice(0,100)),t})({actionId:n,mode:i,input:s}),u=new AbortController,d="",p=()=>{u.abort(),mt(c,{status:"aborted",endedAt:Date.now(),cancellable:!1}),d&&fetch(`${r}/run/${d}`,{method:"DELETE",credentials:"same-origin"}).catch(()=>{})};((e,t)=>{dt.set(e,t)})(c,p);let h=t?.signal;h?.addEventListener("abort",p,{once:!0});let f,m=t=>{h?.removeEventListener("abort",p),(e=>{dt.delete(e)})(c),mt(c,{endedAt:Date.now(),cancellable:!1,...t}),"completed"===t.status&&ZE({mode:e.invalidateQueries,fallback:"all",elements:e.invalidateElements})};if("detached"===i)return $d.info("actions",/* @__PURE__ */O("span",{children:["Server action ",
141
- /* @__PURE__ */I("b",{children:n})," sent"]}),{actionId:n,mode:i,status:"accepted"}),fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",keepalive:!0,signal:u.signal,body:l}).then(async e=>{let o=await e.json().catch(()=>({}));return e.ok?"failed"===o.status?(m(V_(o)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
142
- /* @__PURE__ */I("b",{children:n})," failed"]}),{actionId:n,mode:i,runId:o.runId,reason:o.reason,error:o.error}),void a(t?.hostElementId,"onFlowError",G_(n,o))):(m({status:"completed"===o.status?"completed":"accepted",...o.runId?{runId:o.runId}:{},...o.output?{output:o.output}:{},...o.steps?{steps:o.steps}:{},...o.trace?{trace:o.trace}:{}}),$d.success("actions",/* @__PURE__ */O("span",{children:["Server action ",
143
- /* @__PURE__ */I("b",{children:n})," finished"]}),{actionId:n,mode:i,runId:o.runId,status:o.status,output:o.output}),void a(t?.hostElementId,"onFlowEnd",{actionId:n,runId:o.runId??"",status:o.status??"completed",output:o.output??{}})):(W_(e.status,o,r),m(V_(o)),void a(t?.hostElementId,"onFlowError",G_(n,o)))}).catch(e=>{m(H_(u,e)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
141
+ /* @__PURE__ */I("b",{children:n})," sent"]}),{actionId:n,mode:i,status:"accepted"}),fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",keepalive:!0,signal:u.signal,body:l}).then(async e=>{let o=await e.json().catch(()=>({}));return e.ok?"failed"===o.status?(m(tN(o)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
142
+ /* @__PURE__ */I("b",{children:n})," failed"]}),{actionId:n,mode:i,runId:o.runId,reason:o.reason,error:o.error}),void a(t?.hostElementId,"onFlowError",nN(n,o))):(m({status:"completed"===o.status?"completed":"accepted",...o.runId?{runId:o.runId}:{},...o.output?{output:o.output}:{},...o.steps?{steps:o.steps}:{},...o.trace?{trace:o.trace}:{}}),$d.success("actions",/* @__PURE__ */O("span",{children:["Server action ",
143
+ /* @__PURE__ */I("b",{children:n})," finished"]}),{actionId:n,mode:i,runId:o.runId,status:o.status,output:o.output}),void a(t?.hostElementId,"onFlowEnd",{actionId:n,runId:o.runId??"",status:o.status??"completed",output:o.output??{}})):(eN(e.status,o,r),m(tN(o)),void a(t?.hostElementId,"onFlowError",nN(n,o)))}).catch(e=>{m(Q_(u,e)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
144
144
  /* @__PURE__ */I("b",{children:n})," could not be sent"]}),{actionId:n,mode:i,error:e instanceof Error?e.message:String(e)}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:"",error:"",reason:"failed"})}),{accepted:!0,status:"accepted",runId:"",output:{}};if("stream"===i){let o;$d.info("actions",/* @__PURE__ */O("span",{children:["Server action ",
145
- /* @__PURE__ */I("b",{children:n})," streaming"]}),{actionId:n,mode:i,status:"streaming"});try{o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"same-origin",signal:u.signal,body:l})}catch(e){return m(H_(u,e)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
146
- /* @__PURE__ */I("b",{children:n})," could not be reached"]}),{actionId:n,mode:i,error:e instanceof Error?e.message:String(e)}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:"",error:"",reason:"failed"}),U_}if(!o.ok||!o.body){let e=await o.json().catch(()=>({}));return W_(o.status,e,r),m(V_(e)),a(t?.hostElementId,"onFlowError",G_(n,e)),{status:"failed",reason:e.reason??"failed",runId:"",output:{},...e.error?{error:e.error}:{}}}let s=o.headers.get("X-Plitzi-Run-Id")??"";return d=s,mt(c,{status:"streaming",...s?{runId:s}:{}}),(async(e,t)=>{let n=e.getReader(),r=new TextDecoder,i="";for(;;){let{done:e,value:o}=await n.read();if(e)return;i+=r.decode(o,{stream:!0});let a=i.split("\n\n");i=a.pop()??"";for(let n of a){let e=/event: (\w+)/.exec(n)?.[1];if(!e)continue;let r=n.split("\n").filter(e=>e.startsWith("data:")).map(e=>e.slice(5).trimStart()).join("\n");try{t({event:e,data:r?JSON.parse(r):{}})}catch{}}}})(o.body,e=>{if("data"===e.event)return((e,t)=>{let{runs:n}=lt.getState();ut(n.map(n=>n.id===e?{...n,progress:[...n.progress,t].slice(-500)}:n))})(c,e.data.chunk??e.data),void a(t?.hostElementId,"onFlowProgress",{actionId:n,runId:s,...e.data});if("error"===e.event){let r=B_(e.data.steps);return m({status:"failed",..."string"==typeof e.data.reason?{reason:e.data.reason}:{},..."string"==typeof e.data.error?{error:e.data.error}:{},...r?{steps:r}:{}}),void a(t?.hostElementId,"onFlowError",{actionId:n,runId:s,...e.data})}if("done"===e.event){let r=B_(e.data.steps);m({status:"completed"===e.data.status?"completed":"failed",...e.data.output?{output:e.data.output}:{},..."string"==typeof e.data.error?{error:e.data.error}:{},...r?{steps:r}:{}}),a(t?.hostElementId,"onFlowEnd",{actionId:n,runId:s,...e.data})}}).catch(e=>{if(u.signal.aborted)return;let r=e instanceof Error?e.message:String(e);m({status:"failed",error:r}),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
147
- /* @__PURE__ */I("b",{children:n})," stopped mid-stream"]}),{actionId:n,mode:i,runId:s,error:r}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:s,error:r,reason:"failed"})}),{accepted:!0,status:"streaming",runId:s,output:{}}}try{f=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",signal:u.signal,body:l})}catch(e){return m(H_(u,e)),$d.warning("interactions",/* @__PURE__ */O("span",{children:["Server action ",
148
- /* @__PURE__ */I("b",{children:n})," could not be reached"]}),{actionId:n,error:e instanceof Error?e.message:String(e)}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:"",error:"",reason:"failed"}),U_}let g=await f.json().catch(()=>({}));return f.ok?(m({status:"completed"===g.status?"completed":"failed",...g.runId?{runId:g.runId}:{},...g.output?{output:g.output}:{},...g.error?{error:g.error}:{},...g.steps?{steps:g.steps}:{},...g.trace?{trace:g.trace}:{}}),"failed"===g.status&&a(t?.hostElementId,"onFlowError",G_(n,g)),{status:g.status??"completed",runId:g.runId??"",output:g.output??{},...g.error?{error:g.error}:{}}):(W_(f.status,g,r),m(V_(g)),a(t?.hostElementId,"onFlowError",G_(n,g)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
145
+ /* @__PURE__ */I("b",{children:n})," streaming"]}),{actionId:n,mode:i,status:"streaming"});try{o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"same-origin",signal:u.signal,body:l})}catch(e){return m(Q_(u,e)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
146
+ /* @__PURE__ */I("b",{children:n})," could not be reached"]}),{actionId:n,mode:i,error:e instanceof Error?e.message:String(e)}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:"",error:"",reason:"failed"}),Z_}if(!o.ok||!o.body){let e=await o.json().catch(()=>({}));return eN(o.status,e,r),m(tN(e)),a(t?.hostElementId,"onFlowError",nN(n,e)),{status:"failed",reason:e.reason??"failed",runId:"",output:{},...e.error?{error:e.error}:{}}}let s=o.headers.get("X-Plitzi-Run-Id")??"";return d=s,mt(c,{status:"streaming",...s?{runId:s}:{}}),(async(e,t)=>{let n=e.getReader(),r=new TextDecoder,i="";for(;;){let{done:e,value:o}=await n.read();if(e)return;i+=r.decode(o,{stream:!0});let a=i.split("\n\n");i=a.pop()??"";for(let n of a){let e=/event: (\w+)/.exec(n)?.[1];if(!e)continue;let r=n.split("\n").filter(e=>e.startsWith("data:")).map(e=>e.slice(5).trimStart()).join("\n");try{t({event:e,data:r?JSON.parse(r):{}})}catch{}}}})(o.body,e=>{if("data"===e.event)return((e,t)=>{let{runs:n}=lt.getState();ut(n.map(n=>n.id===e?{...n,progress:[...n.progress,t].slice(-500)}:n))})(c,e.data.chunk??e.data),void a(t?.hostElementId,"onFlowProgress",{actionId:n,runId:s,...e.data});if("error"===e.event){let r=X_(e.data.steps);return m({status:"failed",..."string"==typeof e.data.reason?{reason:e.data.reason}:{},..."string"==typeof e.data.error?{error:e.data.error}:{},...r?{steps:r}:{}}),void a(t?.hostElementId,"onFlowError",{actionId:n,runId:s,...e.data})}if("done"===e.event){let r=X_(e.data.steps);m({status:"completed"===e.data.status?"completed":"failed",...e.data.output?{output:e.data.output}:{},..."string"==typeof e.data.error?{error:e.data.error}:{},...r?{steps:r}:{}}),a(t?.hostElementId,"onFlowEnd",{actionId:n,runId:s,...e.data})}}).catch(e=>{if(u.signal.aborted)return;let r=e instanceof Error?e.message:String(e);m({status:"failed",error:r}),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
147
+ /* @__PURE__ */I("b",{children:n})," stopped mid-stream"]}),{actionId:n,mode:i,runId:s,error:r}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:s,error:r,reason:"failed"})}),{accepted:!0,status:"streaming",runId:s,output:{}}}try{f=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",signal:u.signal,body:l})}catch(e){return m(Q_(u,e)),$d.warning("interactions",/* @__PURE__ */O("span",{children:["Server action ",
148
+ /* @__PURE__ */I("b",{children:n})," could not be reached"]}),{actionId:n,error:e instanceof Error?e.message:String(e)}),a(t?.hostElementId,"onFlowError",{actionId:n,runId:"",error:"",reason:"failed"}),Z_}let g=await f.json().catch(()=>({}));return f.ok?(m({status:"completed"===g.status?"completed":"failed",...g.runId?{runId:g.runId}:{},...g.output?{output:g.output}:{},...g.error?{error:g.error}:{},...g.steps?{steps:g.steps}:{},...g.trace?{trace:g.trace}:{}}),"failed"===g.status&&a(t?.hostElementId,"onFlowError",nN(n,g)),{status:Y_(g.status),runId:g.runId??"",output:g.output??{},...g.error?{error:g.error}:{}}):(eN(f.status,g,r),m(tN(g)),a(t?.hostElementId,"onFlowError",nN(n,g)),$d.warning("actions",/* @__PURE__ */O("span",{children:["Server action ",
149
149
  /* @__PURE__ */I("b",{children:n})," was refused"]}),{actionId:n,mode:i,runId:g.runId,reason:g.reason,error:g.error,status:String(f.status)}),{status:"failed",reason:g.reason??"failed",runId:g.runId??"",output:{},...g.error?{error:g.error}:{}})},[r,a]),l=f(async e=>{if(!r||!e.runId)return{cancelled:!1};try{let t=204===(await fetch(`${r}/run/${e.runId}`,{method:"DELETE",credentials:"same-origin"})).status;return $d.info("actions",/* @__PURE__ */O("span",{children:["Server action run ",
150
- /* @__PURE__ */I("b",{children:e.runId})," ",t?"cancelled":"was not cancelled"]}),{actionId:"",mode:"cancel",runId:e.runId,status:t?"aborted":"failed"}),{cancelled:t}}catch{return{cancelled:!1}}},[r]),c=k(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);return t({id:"actions",callbacks:k(()=>rd(q_,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=td(q_.runServerAction.params),n=(i??[]).find(t=>t.identifier===e.actionId),r=Object.entries(n?.input??{});return{...t,actionId:{...t.actionId,type:()=>c.length>0?"select":"text",canBind:!0,label:!1===o?"Action — this space has no server to run it":"Action",options:c},input:{...t.input,canBind:!0,label:r.length>0?`Input — ${r.map(([e,t])=>`${e}${t.required?"*":""}: ${t.type}`).join(", ")}`:"Input"}}}}}),[s,l,c,i,o])}),e},Y_={login:{source:"auth",title:"Auth Login",strictParams:!0,params:{mode:{type:"select",description:"Credentials to sign in with: a username and password, or a token obtained elsewhere.",default:"normal",options:["normal","token","mfa"],optionLabels:{normal:"User and Password",token:"Token",mfa:"Second factor"},canBind:!1},username:{type:"text",description:"Username.",default:"",when:e=>"normal"===e.mode},password:{type:"text",description:"Password.",default:"",when:e=>"normal"===e.mode},token:{type:"text",description:"A token to exchange for a session.",default:"",when:e=>"token"===e.mode},mfaToken:{type:"text",description:"The challenge a sign-in answered with when it owed a second factor: `{{ login.mfaToken }}`.",default:"",when:e=>"mfa"===e.mode},code:{type:"text",description:"The code from the authenticator app, or a recovery code.",default:"",when:e=>"mfa"===e.mode}},preview:{ok:"",reason:"",mfaToken:"",errors:{username:"",password:"",token:""},accessToken:"",expiresAt:"",refreshToken:""}},refreshDetails:{source:"auth",title:"Auth Refresh Details",strictParams:!0,params:{},preview:{errors:"",accessToken:"",expiresAt:"",refreshToken:""}},logout:{source:"auth",title:"Auth Logout",strictParams:!0,params:{}}},J_=({children:e})=>{let{login:t,refresh:n,logout:r,provider:i}=h(cm),{useInteractions:o}=h(Id);return o({id:"auth",callbacks:k(()=>i&&t&&n&&r?rd(Y_,{login:e=>t(e),refreshDetails:e=>n(e),logout:()=>r()}):{},[t,r,n,i])}),e},X_={hostAction:{source:"host",title:"Host Action",strictParams:!0,params:{action:{type:"text",description:"The name the host registered the handler under — `openSpace`, `signOut`, whatever it offers.",default:""},value:{type:"scalar",description:"What the action is about: the space to open, the workspace to switch to. Optional.",default:""}}}},Z_=({children:e,actions:t})=>{let{useInteractions:n}=h(Id),r=f(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:k(()=>rd(X_,{hostAction:r}),[r])}),e},Q_={navigate:{source:"navigation",title:"Navigate",strictParams:!0,params:{urlType:{type:"select",description:"Target kind: a space page, an internal space path, or an external URL.",options:["page","internal","external"],optionLabels:{page:"Space Page",internal:"Inside Space",external:"Outside Space"}},url:{type:"text",description:'Destination — a page id when urlType is "page", otherwise a URL/path.',when:e=>!!e.urlType,builderType:e=>"page"===e.urlType?"select":"text"}}}},eN=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=h(Id),[[r,i,o]]=Bt(["schema.pages","pageDefinitions","navigation.navigate"]),a=k(()=>{let e=fr(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:pr(r,"attributes.name",n),defaultPage:pr(r,"attributes.default",!1)}]},[])},[i,r]),s=f(e=>{if(!t)return;let{url:n,urlType:r}=e;"page"===r||"internal"===r?o(n):o(n,!0)},[o,t]);return n({id:"navigation",callbacks:k(()=>{let{urlType:e,url:t}=td(Q_.navigate.params);return rd(Q_,{navigate:s},{navigate:{params:{urlType:e,url:{...t,defaultValue:a.find(e=>e.defaultPage)?.key??"",options:a.map(e=>({value:e.key,label:e.label}))}}}})},[s,a])}),e},tN={invalidateQueries:{source:"queries",title:"Invalidate Queries",strictParams:!0,params:{elements:{type:"elementIds",elementType:"apiContainer",description:"The api containers to refresh, by element id — the way to name a request whose URL is a template. Leave both this and `url` empty to refresh every cached request on the page.",default:[],label:"Containers (ids)"},url:{type:"text",description:"Only the requests whose URL starts with this — `/api/orders` covers `/api/orders?page=2`. With `elements` too, a request must match both.",default:"",label:"URL prefix"}},preview:{}}},nN=({children:e})=>{let{useInteractions:t}=h(Id),n=f(e=>JE({url:e.url??"",elements:KE(e.elements)}),[]);return t({id:"queries",callbacks:k(()=>rd(tN,{invalidateQueries:n}),[n])}),e},rN={setState:{source:"state",title:"Set State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to set. Stored under `runtime.state.<key>`.",default:""},type:{type:"select",description:'The value type. What is stored is coerced to it — a boolean is a real boolean, not "true"; `json` stores an object or a list (a template naming one, or JSON text).',options:["boolean","number","text","json"],optionLabels:{boolean:"True / False",number:"Numeric",text:"Text",json:"Object / List (JSON)"}},value:{type:"json",description:"The value to store — its type follows the `type` param (a real boolean/number, text, or an object/list).",when:e=>!!e.type,builderType:e=>"boolean"===e.type?"select":"text",options:["true","false"]}}},toggleState:{source:"state",title:"Toggle State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to flip, under `runtime.state.<key>`. Anything not already true is treated as false, so a key that has never been set toggles to true.",default:""}}},appendState:{source:"state",title:"Append To State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`. Created if it is not there.",default:""},value:{type:"scalar",description:"What to add to the end of the list.",default:""},unique:{type:"boolean",description:"Skip the append when the list already holds this value. For a list whose entries are their own identity — anything referring to one refers to it by value, so a second copy is indistinguishable.",default:!1},withId:{type:"boolean",description:"Store the entry as `{ id, value }` with an id of its own, so two entries that read the same are still two entries. Anything reading one back names `.value`; anything referring to one names `.id`.",default:!1}}},removeState:{source:"state",title:"Remove From State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry to drop, by value — every copy of it. Prefer this wherever the list can change under the person: a position is only true until something before it moves.",default:""},by:{type:"text",description:"The FIELD carrying the identity, for a list of records rather than of scalars — `id` for entries appended with `withId`. Without it the whole entry is compared, which never matches a record.",default:""},index:{type:"text",description:"Which entry to drop, by position, when there is no value to go on. Inside a controlled list, `{{ <listSource>.index }}` is the row own position. An index that resolves to nothing removes nothing.",default:""}}},moveState:{source:"state",title:"Move Between Lists",strictParams:!0,params:{from:{type:"text",description:"The list to take it out of, under `runtime.state.<key>`.",default:""},to:{type:"text",description:"The list to put it into. It is not added twice.",default:""},value:{type:"scalar",description:"The entry to move. Absent from `from` means nothing happens.",default:""}}},toggleInState:{source:"state",title:"Toggle In List",strictParams:!0,params:{key:{type:"text",description:"The list to add to or drop from, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry the box stands for.",default:""}}},clearState:{source:"state",title:"Clear State",strictParams:!0,params:{key:{type:"text",description:"The list to empty, under `runtime.state.<key>`. Left blank it empties EVERYTHING the space is keeping — which on a page that holds notes beside a list means losing the notes to clear the list.",default:""}}}},iN=0,oN=({children:e})=>{let{useInteractions:t}=h(Id),n=qt(),r=f(e=>{let{key:t,type:r}=e,i=e.value;if("boolean"===r)i=!0===i||"true"===i;else if("number"===r)i="number"==typeof i?i:parseFloat(String(i));else if("json"===r)return void n(`runtime.state.${t}`,((e,t)=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch{throw Error(`setState "${e}" is typed json, and its value is not JSON: ${t.slice(0,80)}`)}})(t,i));n(`runtime.state.${t}`,i)},[n]),i=f(e=>{let{key:t}=e;t&&n(`runtime.state.${t}`,e=>!0!==e&&"true"!==e)},[n]),o=e=>!0===e||"true"===e,a=f(e=>{let{key:t,value:r,unique:i,withId:a}=e;t&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return o(a)?[...t,{id:typeof crypto<"u"&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`e${++iN}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,value:r}]:o(i)&&t.includes(r)?t:[...t,r]})},[n]),s=f(e=>{let{key:t,index:r,value:i,by:o}=e;if(!t)return;if(void 0!==i&&""!==i)return void n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter(e=>o?e?.[o]!==i:e!==i):[]);let a="number"==typeof r?r:parseInt(r??"",10);Number.isNaN(a)||n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter((e,t)=>t!==a):[])},[n]),l=f(e=>{let{from:t,to:r,value:i}=e;if(!t||!r||void 0===i||""===i)return;let o={moved:!1};n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return o.moved=t.includes(i),o.moved?t.filter(e=>e!==i):t}),o.moved&&n(`runtime.state.${r}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(i)?t:[...t,i]})},[n]),c=f(e=>{let{key:t,value:r}=e;t&&void 0!==r&&""!==r&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(r)?t.filter(e=>e!==r):[...t,r]})},[n]),u=f(e=>{let{key:t}=e;n(t?`runtime.state.${t}`:"runtime.state",t?[]:{})},[n]);return t({id:"state",callbacks:k(()=>rd(rN,{setState:r,toggleState:i,appendState:a,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,a,s,l,c,u])}),e},aN=({children:e,hostActions:t})=>{let[[n,r,i]]=Bt(["navigation.routeParams","navigation.queryParams","navigation.currentPageId"]),{previewMode:o}=re();/* @__PURE__ */
151
- return I(F_,{currentPageId:i,routeParams:n,queryParams:r,children:/* @__PURE__ */I(J_,{children:/* @__PURE__ */I(oN,{children:/* @__PURE__ */I(K_,{children:/* @__PURE__ */I(nN,{children:/* @__PURE__ */I(eN,{previewMode:o,children:/* @__PURE__ */I(Z_,{actions:t,children:e})})})})})})})},sN=K("StyleContext",{}),lN=({children:e,style:t})=>{let{style:n}=h(Jm),r=k(()=>({}),[]);return Gt("style",t??(n||su)),/* @__PURE__ */I(sN,{value:r,children:e})},cN="/plitzi-sdk.css",uN=({revision:e,webKey:t="",webId:n,environment:r="main",currentPageId:i,server:o,isHydrating:a=!1,offlineMode:s=!1,offlineData:l,offlineDataType:c="json",instanceId:u,renderMode:d=ne.renderMode,sdkStylePath:p="./plitzi-sdk.css",sdkDevToolsStylePath:f,sdkIconsStylePath:m="/plitzi-sdk-icons.css",previewMode:y=!0,debugMode:b=!1,overQuota:v=!1,analytics:w,onInitEventBridge:x,hostData:T,hostActions:C,flags:E,serverFlags:A,forcedFlags:_,onInitStateManager:N,...M})=>{const P=h(kt),[L,R]=S(!a);g(()=>R(!0),[]),Ut(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota"],[y,b,d,r,a,L,v]),Ut(["runtime.host"],[T]),Ut(["flags.overrides.server","flags.overrides.sdk","flags.overrides.qa"],[Rd(A),Rd(E),_]);const j=k(()=>P?.withBase("runtime.state"),[P]),z=k(()=>({get state(){return j?.getState()??{}},setState:e=>j?.setState(void 0,e),setStateByKey:(e,t)=>j?.setState(e,t),clearState:()=>j?.setState(void 0,{}),subscribe:e=>j?j.subscribe(()=>e(j.getState()??{})):()=>{}}),[j]);return g(()=>{N?.(z)},[N,z]),/* @__PURE__ */I(tg,{webKey:t,webId:n,instanceId:u,server:o,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */I(rg,{children:/* @__PURE__ */I(ng,{sdkStylePath:cN,sdkIconsPath:m,children:/* @__PURE__ */I(lN,{children:/* @__PURE__ */I(u_,{onInit:x,debugMode:b,children:/* @__PURE__ */I(_O,{server:o,children:/* @__PURE__ */O(Hm,{currentPageId:i,children:[/* @__PURE__ */I(lm,{analytics:w}),/* @__PURE__ */I(l_,{children:/* @__PURE__ */I(aN,{hostActions:C,children:/* @__PURE__ */I(s_,{enabled:b,instanceId:u,devToolsStyleLink:f||"/plitzi-sdk-devtools.css",devToolsIconsLink:m,renderMode:"shadow",scroll:"document",qa:!0,innerClassName:V({flex:"iframe"===d}),children:/* @__PURE__ */I(pO,{sdkStylePath:cN,server:o,...M})})})})]})})})})})})})},dN="theme",pN=["dark","light"],hN=[...pN,"system"],fN="(prefers-color-scheme: dark)",mN=({store:e})=>{let t=Og(e);return $t(["theme.mode","theme.resolved","theme.areas"],[t.mode,Tg(t.mode,t.scheme),t.areas]),null},gN=({defaultTheme:e="system",theme:t,scope:n="document",cookieName:r=dN,children:i})=>{let o="container"===n,a=b(),[s]=S(()=>o?xg(`theme${a}`):void 0),l=s??Sg,c=x({mode:e,remembered:!1});Et(()=>{let n=o?void 0:((e=dN)=>{try{return((e,t=dN)=>{let n=ai(e,t);return(e=>hN.includes(e))(n)?n:void 0})(document.cookie,e)}catch{return}})(r),i=t??n??e;c.current={mode:i,remembered:void 0!==n},l.batch(()=>{Eg(window.matchMedia(fN).matches?"dark":"light",l),Cg(i,l)})},[e,t,r,o,l]);let u=t??e,d=void 0!==h(kt);g(()=>{let e=window.matchMedia(fN),t=()=>Eg(e.matches?"dark":"light",l);return e.addEventListener("change",t),t(),()=>e.removeEventListener("change",t)},[l]),g(()=>{if(o)return;let e=()=>{let{mode:e}=l.getState();(c.current.remembered||e!==c.current.mode)&&(((e,t=dN)=>{try{document.cookie=`${t}=${encodeURIComponent(e)};path=/;max-age=31536000;SameSite=Lax`}catch{}})(e,r),c.current.remembered=!0),((e,t)=>{for(let n of pN)t.classList.toggle(n,e===n)})(e,document.documentElement)};return e(),l.subscribe(e)},[r,o,l]);let p=d?/* @__PURE__ */I(mN,{store:l}):null;return o?/* @__PURE__ */I(Ag,{value:s,children:/* @__PURE__ */O(Ig,{value:u,children:[p,i]})}):/* @__PURE__ */O(Ig,{value:u,children:[p,i]})},yN=e=>new Set(Array.isArray(e?.paintedState)?e.paintedState.filter(e=>"string"==typeof e&&""!==e):[]),bN=(e,t)=>X(e)?Object.fromEntries(Object.entries(e).filter(([e,n])=>t.has(e)&&void 0!==n)):{},vN=e=>{try{document.cookie=`${e}=;path=/;max-age=0;SameSite=Lax`}catch{}},wN=/* @__PURE__ */new Set(["init","initLoading","authenticating"]),kN=e=>{let t=e.runtime?.sources.auth;if(t){if(void 0===t.status)return{kind:"browser"};if(!wN.has(t.status))return t.isAuthenticated&&void 0!==t.details?.id?{kind:"account",id:String(t.details.id)}:{kind:"guest"}}},xN=e=>{switch(e.kind){case"account":return`user:${e.id}`;case"guest":return"guest";case"browser":return""}},SN=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e))),TN=(e,t)=>X(e)?Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e))):{},CN=e=>e.schema?.settings,EN=e=>new Set((e?.transientState??[]).filter(e=>"string"==typeof e&&""!==e)),AN=(e,t)=>{let n,r=((e,t)=>{let n=t?.split(":")[1];return n?`plitzi_${e}_painted_${n}`:`plitzi_${e}_painted`})(t,typeof window>"u"?void 0:window.location.host),i=!1;return()=>{let t=e.getState();if(typeof document>"u"||t.render?.isHydrating&&!t.render.hydrated)return;let o=CN(t),a=yN(o),s=kN(t);if(!o?.keepState||0===a.size||void 0===s)return;let l=xN(s),c=t.runtime?.state;if(!i){i=!0;let t=(e=>((e,t)=>{let n=ai(e,t);if(void 0!==n)try{let e=JSON.parse(n);return X(e)&&"string"==typeof e.owner&&X(e.values)?{owner:e.owner,values:e.values}:void 0}catch{return}})(si(),e))(r);if(t&&t.owner!==l&&(vN(r),X(c)&&[...a].some(e=>e in c)))return void e.setState("runtime.state",SN(c,a));n=t?.owner===l?JSON.stringify(bN(t.values,a)):void 0}let u=bN(c,a),d=JSON.stringify(u);if(d!==n){if(n=d,0===Object.keys(u).length)return void vN(r);"too-large"===((e,t)=>{let n=encodeURIComponent(JSON.stringify(t));if(n.length>3072)return vN(e),"too-large";try{return document.cookie=`${e}=${n};path=/;max-age=31536000;SameSite=Lax`,"written"}catch{return"unavailable"}})(r,{owner:l,values:u})&&$d.warning("store",`settings.paintedState holds more than a cookie can carry — the first paint uses the space's defaults for ${[...a].join(", ")}. Declare only what the first paint shows.`,{storeName:"runtime",path:"runtime.state",prev:void 0,next:u})}}},IN=e=>{let t=(e=>{let{key:t,storage:n,paths:r,partialize:i,partializePath:o,version:a=0,migrate:s,merge:l,mergePath:c,enabled:u}=e,d="function"==typeof n?n:void 0,p="function"==typeof n?void 0:xe(n);if(!d&&!p)return()=>{};let h=e=>{if(!d)return p;let t=d(e);return t?xe(t):void 0},f=e=>{if(r){let t={};for(let n of r){let r=pe(e,n);t[n]=o?o(n,r,e):r}return t}return i?i(e):e};return e=>{if(ae(u,e.getState()))return;let n=!1,i=()=>{if(n)return;let i=h(e.getState());i&&(n=!0,function(e,t,n,{version:r,paths:i,migrate:o,merge:a,mergePath:s}){let l=n?.getItem(t);if(l)try{let t=JSON.parse(l),n=t.version!==r;if(n&&!o)return;let c=n&&o?o(t.state,t.version):t.state;if(i){let t=c;return void e.batch(()=>{for(let n of i)if(n in t){let r=s?s(n,t[n],pe(e.getState(),n),e.getState()):t[n];e.setState(n,r)}})}let u=c;e.setState(void 0,a?a(u,e.getState()):u)}catch{n?.removeItem(t)}}(e,t,i,{version:a,paths:r,migrate:s,merge:l,mergePath:c}))};return{hydrate:i,onChange:n=>{i(),(e=>!r||r.some(t=>he(e,t)))(n.path)&&(e=>{let n=e.getState(),r=h(n);if(!r)return;let i={version:a,state:f(n)};r.setItem(t,JSON.stringify(i))})(e)}}}})({key:`plitzi_${e}_state`,paths:["runtime.state"],partializePath:(e,t,n)=>X(t)?SN(t,EN(CN(n))):t,mergePath:(e,t,n,r)=>{let i=EN(CN(r));return i.size>0&&X(t)?{...SN(t,i),...TN(n,i)}:t},storage:e=>{let{render:t}=e;if(t?.isHydrating&&!t.hydrated)return!1;let n=CN(e),r=kN(e);if(!n?.keepState||void 0===r)return!1;let i=(e=>{try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}})("sessionStorage"===n.stateStorage?"session":"local");return!!i&&((e,t)=>({getItem:n=>{let r=e.getItem(n);if(null===r)return null;try{let e=JSON.parse(r);if(e.owner===t&&"string"==typeof e.payload)return e.payload}catch{}return e.removeItem(n),null},setItem:(n,r)=>e.setItem(n,JSON.stringify({owner:t,payload:r})),removeItem:t=>e.removeItem(t)}))(i,xN(r))}});return n=>{let r=t(n),i=n.getState().runtime?.state,o=kN(n.getState()),a=AN(n,e);return{...r,onChange:e=>{let t=o,s=kN(n.getState());if(void 0!==s&&(o=s),"account"===t?.kind&&void 0!==s&&xN(s)!==xN(t)){let e=X(i)?SN(i,yN(CN(n.getState()))):i;n.setState("runtime.state",e)}r?.onChange?.(e),a()}}}},ON=({scope:e,theme:t,children:n})=>{const[[r="system"]]=Bt(["style.theme.default"]),{enclosed:i}=re(),{resolvedTheme:o}=Ng(_g);/* @__PURE__ */
152
- return I(gN,{defaultTheme:i&&"system"===r?o:r,scope:e,theme:t,children:n})},_N=`[data-motion-on="view"]:not([${Wd}])`,NN=()=>{const{rootRef:e}=h(ig);return g(()=>{const t=e.current;if(t)return(e=>{let t=e=>e.setAttribute(Wd,""),n=e=>[...e.matches(_N)?[e]:[],...Array.from(e.querySelectorAll(_N))];if("function"!=typeof Reflect.get(globalThis,"IntersectionObserver"))return n(e).forEach(t),()=>{};let r=new IntersectionObserver(e=>{for(let n of e)n.isIntersecting&&(t(n.target),r.unobserve(n.target))}),i=e=>n(e).forEach(e=>r.observe(e)),o=new MutationObserver(e=>{for(let t of e)"attributes"===t.type&&t.target instanceof Element&&i(t.target),t.addedNodes.forEach(e=>{e instanceof Element&&i(e)})});return i(e),o.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-motion-on"]}),()=>{r.disconnect(),o.disconnect()}})(t)},[e]),null},MN=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ng(),[[i=!1]]=Bt(["render.hydrated"]);/* @__PURE__ */
153
- return O(og,{className:V(e,t&&"system"!==r&&r),"data-hydrated":i?"":void 0,children:[/* @__PURE__ */I(NN,{}),n]})},PN=/* @__PURE__ */$({ComponentHelper_exports:()=>LN,getPlugins:()=>RN,nestedInject:()=>$N,processLocalCustomPlugins:()=>FN,processLocalPlugins:()=>jN}),LN=/* @__PURE__ */$g({getPlugins:()=>RN,nestedInject:()=>$N,processLocalCustomPlugins:()=>FN,processLocalPlugins:()=>jN}),RN=e=>{let t={};if(!e)return t;t[e.type]=e;let{plugins:n}=e;return n&&Object.keys(n).length>0&&Object.keys(n).forEach(e=>{Object.assign(t,RN(n[e]))}),t},jN=e=>{let t={};return e&&Object.values(e).forEach(e=>{e.type&&Object.assign(t,RN(e))}),t},zN={local:/* @__PURE__ */new WeakMap,"local-custom":/* @__PURE__ */new WeakMap,remote:/* @__PURE__ */new WeakMap},DN=(e,t)=>{let n=zN[t].get(e);if(n)return n;let r=Ku(e);return zN[t].set(e,r),r},$N=(e,t)=>{if(!e)return{};let n={};return Object.keys(e).forEach(r=>{let i=e[r],{version:o,pluginSettings:a,initialItems:s,plugins:l,extraProps:c}=i;n[r]=DN(i,t),n[r].origin=t,n[r].version=o,n[r].type=r,n[r].initialItems=s,n[r].pluginSettings=a,n[r].extraProps=c,n[r].plugins=$N(l,t)}),n},FN=e=>{let t={};return e&&Object.values(e).forEach(e=>{if(!e.type)return;let{type:n,pluginSettings:r,version:i,initialItems:o,plugins:a,assets:s,content:l,extraProps:c}=e,u=DN(e,"local-custom");u.version=i,u.type=n,u.assets=s,u.initialItems=o,u.pluginSettings=r,u.origin="local-custom",u.content=l,u.extraProps=c,u.plugins=$N(a,"local-custom"),Object.assign(t,RN(u))}),t},qN=p(({plitziJsxSkipHOC:e=!0,as:t="",internalProps:n,children:r,...i})=>{let{components:o}=h(Wr),{plugins:a}=h(Li),s=t?o.current[t]:void 0,l=k(()=>s?void 0:Yr({type:t,plugins:a}),[s,a,t]);return t?!s&&l?/* @__PURE__ */I(Kr,{internalProps:n,url:l.url,type:t,plitziJsxSkipHOC:e,plitziJsxProps:i}):(s||=cE,/* @__PURE__ */I(s,{plitziJsxSkipHOC:e,...i,internalProps:n,children:r})):null}),BN=e=>{let[t]=Dt(`runtime.sources.flags.${e}`);return!0===t},UN={dropdown:hy,notFound:uE,loading:aE,custom:Wg,reference:ny,blockHtml:qg,nodeHtml:Gg,blockJsx:Ug,page:mE,container:jA,layoutContainer:iE,dialogContainer:FA,modalContainer:KA,tabContainer:aI,carousel:LA,heading:yy,image:CE,video:PE,embed:yE,svg:NE,fontAwesome:vE,button:ay,paragraph:hC,text:AC,themeToggle:LC,list:VA,link:wy,markdown:dC,richText:CC,pagination:JA,form:zC,formControl:ZC,apiContainer:oA,channel:vA},HN=({localComponents:e,localCustomComponents:t,children:n})=>{let r=k(()=>({...jN(UN),...jN(e),...FN(t)}),[e,t]),i=x({}),o=k(()=>({current:{...i.current,...r}}),[r]),a=f((e=[],t=!1)=>{if("string"==typeof e&&!t)return o.current[e];if("string"==typeof e&&t){let t=o.current[e];return t?{[e]:t,...vr(RN(t),[e])}:{}}let n={};return e.forEach(e=>{let r=o.current[e];r&&(t?n={...n,...vr(RN(r),[e])}:n[e]=r)}),n},[o]),s=f((e=[])=>{let t={};return Array.isArray(e)||(e=[e]),e.forEach(e=>{e.type&&!o.current[e.type]&&(t={...t,[e.type]:e,...RN(e)})}),0===Object.keys(t).length||(o.current={...i.current,...t,...r},i.current={...i.current,...t}),t},[o,r]),l=f(e=>{if(!e)return[];Array.isArray(e)||(e=[e]);let t=e;return e.forEach(e=>{let n=a([e],!0);Object.keys(n).length>0&&(t=[...t,...Object.keys(vr(n,e))])}),o.current={...vr(i.current,t),...r},i.current=vr(i.current,t),t},[o,a,r]),c=x(Object.keys(o.current).reduce((e,t)=>{let n=pr(o.current,t,void 0);return n&&n.content?{...e,[t]:{...n.content,initialItems:n.initialItems}}:e},{})),u=f(e=>{c.current={...c.current,...e}},[]),d=f(e=>{let t=pr(c.current,`${e}.builder.pluginChildren`,[]);c.current=vr(c.current,[e,...t])},[]),p=k(()=>({components:o,componentDefinitions:c,getComponent:a,register:s,unregister:l,unregisterDefinition:d,registerDefinition:u}),[o,s,l,u,d,a]);/* @__PURE__ */
154
- return I(Wr,{value:p,children:n})},WN=K("EnclosingSpaceContext",!1),VN=e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}),GN={Button:$l,ContentEditable:Kp,Input:Gl,Heading:Jp,ContainerResizable:$p,ContainerCollapsable:zp,Text:Qp,ContainerTabs:Vp},KN=({className:e,children:t,webKey:r="",server:o,renderMode:a=ne.renderMode,routing:s="browser",debugMode:l=!1,themeScope:c,theme:d,state:p,forcedFlags:m,...y})=>{const b=k(()=>function(e){if(!e)return 0;let t={};try{let n=e.split(".")[1],r=typeof window<"u"?window.atob(n):Buffer.from(n,"base64").toString();t=JSON.parse(r)}catch{return 0}let n=Number(pr(t,"sub",0));return Number.isInteger(n)&&n>0?n:0}(r),[r]),v=h(WN),w=c??(v?"container":"document"),T=v&&"raw"===a?"widget":a,C=e??(v?void 0:"min-h-screen"),E=x(p).current,A=k(()=>({runtime:{sources:{},state:E??{}},render:{...ne,ownsHead:!v,enclosed:v}}),[E,v]),O=k(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[_,N]=S(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(O)),M=l&&_,[P]=S(()=>m||!l||"undefined"==typeof window?m:((e,t)=>(e=>e?Object.fromEntries(e.split(",").map(e=>e.split(":")).filter(([e,t])=>oi(e)&&("1"===t||"0"===t)).map(([e,t])=>[e,"1"===t])):{})(ai(e,li(t))))(si(),window.location.host)),L=k(()=>VN(o),[o]);g(()=>{},[]);const R=f(()=>{const e=!_;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(O,e),N(e)},[O,_]);(({authorized:e,onToggle:t})=>{const n=f(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);g(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:l,onToggle:R}),g(()=>{},[l,_,O]),g(()=>{if(M)return window.plitziTracing={lastCommitId:Vu.lastCommitId,commitsSince:Vu.commitsSince},()=>{delete window.plitziTracing}},[M]),g(()=>{y.isHydrating&&Vu.setHydrated()},[y.isHydrating]);const j=k(()=>{const e={};return n.forEach(t,t=>{if(!u(t))return;if(t.type!==iO)return;const{renderType:n,component:r,assets:i=[],...o}=t.props;if(!n||!r)return;const a=r;a.type=n,a.assets=i,a.extraProps=o,e[n]=a}),e},[t]);"undefined"==typeof window&&L.requestUrl;const z="widget"===T?i:"undefined"==typeof window?Qf:"memory"===s?xf:Vf,D="widget"===T?{}:{..."memory"===s&&"undefined"!=typeof window?{}:{basename:pr(L,"basePath","/"),location:"undefined"==typeof window?L.requestUrl??"":void 0}};/* @__PURE__ */
155
- return I(WN,{value:!0,children:/* @__PURE__ */I(Mt,{value:A,middlewares:[ke(Fd("sdk")),IN(b),...M?[()=>({onChange:e=>Vu.recordStoreChange(e)}),be({shouldRecord:e=>!(e?.startsWith("runtime.elements")||e?.startsWith("rsc")||e?.startsWith("theme")||e?.startsWith("flags"))})]:[]],children:/* @__PURE__ */I(ON,{scope:w,theme:d,children:/* @__PURE__ */I(Zp,{components:GN,applyColorModeClass:!1,children:/* @__PURE__ */I(MN,{scoped:"container"===w,className:V("plitzi-sdk","flex",C,{"sdk-debug-mode":M}),children:/* @__PURE__ */I(Ip,{children:/* @__PURE__ */I(z,{...D,children:/* @__PURE__ */I(HN,{localCustomComponents:j,localComponents:JN,children:/* @__PURE__ */I(uN,{server:L,webKey:r,renderMode:T,debugMode:M,webId:b,forcedFlags:P,...y})})})})})})})})})},YN=Ku(({ref:e,className:t,spaceKey:n,environment:r="main",offlineData:i})=>{const{settings:{previewMode:o}}=vu(),{server:a}=h(Kd),s=k(()=>void 0===i?void 0:(e=>{if(!X(e))return{problem:"The documents cannot be drawn: they are not an object with `schema` and `style`."};const t=["schema","style"].filter(t=>void 0===e[t]);return t.length>0?{waiting:t}:(e=>void 0===Yd(e.schema,e.style))(e)?{documents:e}:{problem:`The documents cannot be drawn: ${Yd(e.schema,e.style)??"their shape is unknown"}.`}})(i),[i]),l=s&&"problem"in s?s.problem:void 0,c=s&&"waiting"in s?s.waiting:void 0,u=s&&"documents"in s?s.documents:void 0,d=void 0!==s&&!!n;return g(()=>{l&&console.error(`[plitziSdk] ${l}`)},[l]),g(()=>{d&&console.warn("[plitziSdk] Both `offlineData` and `spaceKey` are set: the documents are drawn, the key is not.")},[d]),/* @__PURE__ */O(Gd,{ref:e,className:V("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!o}),children:[u&&/* @__PURE__ */I(KN,{offlineMode:!0,offlineData:u,environment:r,renderMode:"widget",className:"h-full w-full"}),!s&&n&&/* @__PURE__ */I(KN,{webKey:n,environment:r,server:a,renderMode:"widget",className:"h-full w-full"}),l&&!o&&/* @__PURE__ */I("p",{className:"plitzi-sdk__problem",children:l}),c&&!o&&/* @__PURE__ */O("p",{className:"plitzi-sdk__waiting",children:["Waiting for ",c.map(e=>`\`${e}\``).join(" and ")," to be bound."]})]})}),JN={plitziSdk:Object.assign(YN,{...H,content:{...H.content,market:{...H.content.market,icon:/* @__PURE__ */I(q,{})}}})},XN=class extends Error{stage;log;constructor(e,t){super(`${"link"===e?"program failed to link":`${e} shader failed`}: ${t.trim()||"no log given"}`),this.name="ShaderError",this.stage=e,this.log=t}},ZN=(e,t,n)=>{let r=e.createShader("vertex"===t?e.VERTEX_SHADER:e.FRAGMENT_SHADER);if(!r)throw new XN(t,"the context made no shader (it is lost)");if(e.shaderSource(r,n),e.compileShader(r),!0!==e.getShaderParameter(r,e.COMPILE_STATUS)){let n=e.getShaderInfoLog(r)??"";throw e.deleteShader(r),new XN(t,n)}return r},QN=(e,{vertex:t,fragment:n})=>{let r=ZN(e,"vertex",t),i=ZN(e,"fragment",n),o=e.createProgram();if(e.attachShader(o,r),e.attachShader(o,i),e.linkProgram(o),e.deleteShader(r),e.deleteShader(i),!0!==e.getProgramParameter(o,e.LINK_STATUS)){let t=e.getProgramInfoLog(o)??"";throw e.deleteProgram(o),new XN("link",t)}return o},eM="(prefers-reduced-motion: reduce)",tM=()=>"function"==typeof window.matchMedia&&window.matchMedia(eM).matches||document.documentElement.classList.contains("plitzi-reduced-motion"),nM=e=>{let t="function"==typeof window.matchMedia?window.matchMedia(eM):void 0;t?.addEventListener("change",e);let n=new MutationObserver(e);return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{t?.removeEventListener("change",e),n.disconnect()}},rM=()=>T(nM,tM,()=>!1),iM=e=>(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),oM=()=>"hidden"!==document.visibilityState,aM=(e,{paused:t=!1,fps:n,target:r}={})=>{let i=vu().settings.previewMode??!0,o=rM(),a=T(iM,oM,()=>!1),s=(e=>{let[t,n]=S(!0);return g(()=>{let t=e?.current;if(!t||typeof IntersectionObserver>"u")return;let r=new IntersectionObserver(e=>n(e.some(e=>e.isIntersecting)));return r.observe(t),()=>r.disconnect()},[e]),t})(r),l=i&&!o&&!t&&a&&s,c=x(e);g(()=>{c.current=e},[e]);let u=x({time:0,frame:0});return g(()=>{if(!l)return;let e,t=n&&n>0?1e3/n:0,r=0,i=0,o=n=>{let a=void 0===e?0:n-e;if(e=n,i+=a,i>=t){let e=t>0?i:a;i=t>0?i%t:0,u.current={time:u.current.time+e,frame:u.current.frame+1},c.current({...u.current,delta:e})}r=requestAnimationFrame(o)};return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)},[l,n]),{running:l}},sM=(e,{setup:t,draw:n,maxPixelRatio:r=2,paused:i,fps:o})=>{let a=(e=>`[plugin ${e?.definition?.type??"canvas"}${e?.id?` "${e.id}"`:""}]`)(h(Y)),s=x(null),[l,c]=S(null),[u,d]=S({width:0,height:0,pixelRatio:1}),[p,m]=S(),[y,b]=S(!1),[v,w]=S(0),k=x(null),T=x({acquire:e,setup:t,draw:n});g(()=>{T.current={acquire:e,setup:t,draw:n}},[e,t,n]);let C=f(e=>{let t=e instanceof Error?e.message:String(e);console.error(`${a} ${t}`),m(t)},[a]),E=f(e=>{s.current=e,c(e)},[]);g(()=>{if(!l)return;let e=()=>{let e=l.getBoundingClientRect(),t=Math.min(window.devicePixelRatio||1,r);l.width=Math.max(1,Math.round(e.width*t)),l.height=Math.max(1,Math.round(e.height*t)),d({width:e.width,height:e.height,pixelRatio:t})};if(e(),typeof ResizeObserver>"u")return;let t=new ResizeObserver(e);return t.observe(l),()=>t.disconnect()},[l,r]),g(()=>{if(!l)return;let e=e=>{e.preventDefault(),k.current=null,b(!1)},t=()=>w(e=>e+1);return l.addEventListener("webglcontextlost",e),l.addEventListener("webglcontextrestored",t),()=>{l.removeEventListener("webglcontextlost",e),l.removeEventListener("webglcontextrestored",t)}},[l]),g(()=>{if(l&&0!==u.width&&void 0===p)try{let e=T.current.acquire(l);if(!e)return void C(/* @__PURE__ */Error("the browser gave no drawing context (WebGL may be off)"));e.prepare(u);let t=T.current.setup?T.current.setup(e.context,u):void 0;k.current={handle:e,state:t}}catch(XN){C(XN)}},[l,u,v,p,C]);let A=f(e=>{let t=k.current;if(t&&void 0===p)try{t.handle.prepare(u),T.current.draw(t.handle.context,{...e,...u,state:t.state}),b(!0)}catch(e){k.current=null,C(e)}},[u,p,C]),{running:I}=aM(A,{paused:i||void 0!==p,fps:o,target:s});return g(()=>{!I&&u.width>0&&A({time:0,delta:0,frame:0})},[I,u,v,A]),{ref:E,ready:y,error:p,running:I}},lM=({attributes:e,...t})=>sM(f(t=>{let n=t.getContext("2d",e);return n&&{context:n,prepare:({pixelRatio:e})=>n.setTransform(e,0,0,e,0,0)}},[e]),t),cM=({attributes:e,...t})=>sM(f(t=>{let n=t.getContext("webgl",e);return n&&{context:n,prepare:()=>n.viewport(0,0,t.width,t.height)}},[e]),t),uM=({attributes:e,...t})=>sM(f(t=>{let n=t.getContext("webgl2",e);return n&&{context:n,prepare:()=>n.viewport(0,0,t.width,t.height)}},[e]),t),dM=e=>"string"==typeof e&&e?e:void 0,pM=e=>n.toArray(e).flatMap(e=>{if(!u(e))return[];let t=(e=>{let t=e.props;return e.type===ti?dM(t.id):dM(t.internalProps?.id)})(e);return void 0===t?[]:[{id:t,node:e}]}),hM=e=>"function"==typeof e.checkVisibility?e.checkVisibility():e.getClientRects().length>0,fM=e=>{let{utils:{rootRef:t}}=vu(),[n,r]=S(void 0);return g(()=>{let n=t.current,i=n?.ownerDocument.defaultView;if(!n||!i||!e)return;let o=`[data-plitzi-el="${i.CSS.escape(e)}"]`,a=()=>r([...n.querySelectorAll(o)].some(hM)),s=0,l=new i.MutationObserver(()=>{s||=i.requestAnimationFrame(()=>{s=0,a()})});return l.observe(n,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class","style"]}),i.addEventListener("resize",a),a(),()=>{l.disconnect(),i.removeEventListener("resize",a),i.cancelAnimationFrame(s)}},[e,t]),n},mM=e=>{let{id:t}=Yu(),{settings:{previewMode:n=!0}}=vu(),{interactionsManager:r}=h(Id);return f((i,o)=>{n&&r.interactionTrigger(t,e.triggers[i].action,o)},[e,t,r,n])},gM=e=>{let[t]=Dt("actions.endpoint");return f((n="/")=>{if(!t)return;let r=((e,t="/")=>`/fn/plugins/${encodeURIComponent(e)}${t.startsWith("/")?t:`/${t}`}`)(e,n);return typeof window>"u"?r:new URL(r,new URL(t,window.location.href)).href},[t,e])},yM={mobile:`(max-width: ${sg("tablet")})`,tablet:`(max-width: ${sg("desktop")})`},bM=e=>typeof window>"u"||"function"!=typeof window.matchMedia?void 0:window.matchMedia(e),vM=()=>bM(yM.mobile)?.matches?"mobile":bM(yM.tablet)?.matches?"tablet":"desktop",wM=e=>{let t=[bM(yM.mobile),bM(yM.tablet)].filter(e=>void 0!==e);return t.forEach(t=>{t.addEventListener("change",e)}),()=>{t.forEach(t=>{t.removeEventListener("change",e)})}},kM=()=>"desktop",xM=()=>T(wM,vM,kM),SM=e=>{let[t,n]=S(void 0);return g(()=>{let t=e.current;if(!t||typeof ResizeObserver>"u")return;let r=(e,t)=>n(n=>n?.width===e&&n.height===t?n:{width:e,height:t}),i=t.getBoundingClientRect();r(i.width,i.height);let o=new ResizeObserver(e=>{e.slice(-1).forEach(e=>r(e.contentRect.width,e.contentRect.height))});return o.observe(t),()=>o.disconnect()},[e]),t},TM=(e,t)=>new Promise(n=>{const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.dataset.plitziPlugin=t,r.onload=()=>n(),r.onerror=()=>n(),document.head.append(r)}),CM=(e,{load:t,css:n,declaration:r})=>{let i;const o=(r,{content:s,version:l,initialItems:c,plugins:u})=>{const p=d(async()=>({default:r.reduce((t,n)=>{const r=t.plugins?.[n];if(!r)throw new Error(`[plitzi] plugin "${e}" was loaded without the "${n}" it declared`);return r},await(i??=Promise.all([t(),n?TM(n,e):void 0]).then(([e])=>e.default)))})),h=e=>/* @__PURE__ */I(a,{fallback:null,children:/* @__PURE__ */I(p,{...e})});return h.displayName=`Deferred(${r.at(-1)??e})`,Object.assign(h,{content:s,version:l,initialItems:c,plugins:u?Object.fromEntries(Object.entries(u).map(([e,t])=>[e,o([...r,e],t)])):void 0})};return o([],r)},EM=e=>{try{return JSON.stringify({...e},(e,t)=>"function"==typeof t?void 0:t)}catch{return}},AM=e=>{const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;return{plugins:Object.fromEntries(Object.entries(e).map(([e,i])=>{t.set(e,i.component);const o=((e,r)=>{const i=(e=>t=>{const r=n.get(e)??/* @__PURE__ */new Set;return r.add(t),n.set(e,r),()=>{r.delete(t)}})(e),o=()=>t.get(e)??r,a=e=>{const t=T(i,o,o);/* @__PURE__ */
156
- return I(t,{...e})};return a.displayName=`Hot(${r.displayName??r.name})`,Object.assign(a,r)})(e,i.component);return r.set(e,o),[e,{...i,component:o}]})),replace:(e,i)=>{const o=t.get(e),a=r.get(e);return!(!o||!a||EM(o)!==EM(i)||(t.set(e,i),n.get(e)?.forEach(e=>{e()}),0))}}};Promise.resolve({ });function IM(e,t={},n={},r=!1,i=!1,{hotPlugins:o=!1}={}){const a=Object.fromEntries(Object.entries(n).map(([e,t])=>{if("component"in t)return[e,t];const{load:n,css:r,declaration:i,...o}=t;return[e,{...o,component:CM(e,{load:n,css:r,declaration:i})}]})),s=o?AM(a):void 0,l=s?.plugins??a,{actionRuns:c,styleCacheInDocument:u,...d}=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=VN(e.server);return t?{...e,analytics:{endpoint:`${t.replace(/\/+$/,"")}/v1/collect`,key:e.webKey}}:e})(t),p="undefined"!=typeof document?document.getElementById(e):void 0,h=u?((e,t)=>{const{offlineData:n}=e;if(!n||!t)return e;const r=(e=>{let t=e.querySelector('style[data-id="plitzi-runtime-style"]')?.textContent??"",n=t.indexOf(wg),r=t.indexOf(kg,n);if(!(n<0||r<0))return t.slice(n+22,r)})(t);return void 0===r?(console.error("[plitzi] The server-rendered stylesheet is missing from the page: it renders without its styles."),e):{...e,offlineData:{...n,style:{...n.style,cache:r}}}})(d,p):d,m=h.debugMode??r;m&&c?.length&&ft(c);const y=({isHydrating:e=!1})=>{const[t,n]=S(!e);g(()=>n(!0),[]);const r=Object.keys(l).filter(e=>t||!l[e].clientOnly);m||(()=>{if(typeof window>"u")return;let e=()=>{},t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;"object"==typeof t&&Object.keys(t).forEach(n=>{let r=t[n];t[n]="function"==typeof r?e:null})})();const i=f(e=>{uO=e},[]),o=f(e=>{dO=e},[]);/* @__PURE__ */
157
- return I(KN,{...h,debugMode:m,isHydrating:e,onInitStateManager:i,onInitEventBridge:o,children:r.filter(e=>!!l[e].component).map(e=>/* @__PURE__ */I(pO.Plugin,{renderType:e,component:l[e].component,...l[e].props},e))})};if(!p)return;const b=i?E(p,/* @__PURE__ */I(y,{isHydrating:!0})):C(p);return i||b.render(/* @__PURE__ */I(y,{})),{unmount:()=>b.unmount(),replacePlugin:(e,t)=>s?.replace(e,t)??!1}}var OM=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:o=ne.renderMode,...a})=>/* @__PURE__ */I(KN,{...a,isHydrating:t,renderMode:o,debugMode:e,webKey:r,environment:i,children:n});OM.Plugin=pO.Plugin;var _M="0.38.14",NM=()=>uO,MM=()=>dO;export{Br as A,je as B,ts as C,Wr as ComponentContext,HN as ComponentProvider,ci as D,di as E,kt as F,V as H,yt as I,qN as JsxManager,pt as L,pr as M,Dt as N,ui as O,Ct as P,wu as PlitziProvider,Kg as PluginManager,Kr as PluginRemote,Li as PluginsContext,at as R,Yg as ReplicaProvider,Gd as RootElement,Fl as S,XN as ShaderError,Ii as T,ge as V,Dp as _,zO as a,Tu as b,uv as c,QN as createShaderProgram,xy as d,OM as default,pM as elementChildren,Ng as f,qp as g,MM as getEventBridge,NM as getStateManager,Gp as h,DO as i,kr as j,Vr as k,cv as l,Om as m,JO as n,RO as o,lg as p,XO as r,IM as render,qE as s,JN as sdkComponents,r_ as t,sm as track,Ay as u,aM as useAnimationFrame,lM as useCanvas2d,mA as useChannel,xM as useDisplayMode,Yu as useElement,SM as useElementSize,fM as useElementVisible,BN as useFlag,vu as usePlitzi,gM as usePluginRoute,mM as usePluginTrigger,rM as useReducedMotion,RE as useRscData,LE as useRscRefresh,Bt as useStore,cM as useWebGL,uM as useWebGL2,Vd as v,_M as version,es as w,Ku as withElement,Kl as x,Vu as y,st as z};
150
+ /* @__PURE__ */I("b",{children:e.runId})," ",t?"cancelled":"was not cancelled"]}),{actionId:"",mode:"cancel",runId:e.runId,status:t?"aborted":"failed"}),{cancelled:t}}catch{return{cancelled:!1}}},[r]),c=k(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);t({id:"actions",callbacks:k(()=>rd(G_,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=td(G_.runServerAction.params),n=(i??[]).find(t=>t.identifier===e.actionId),r=Object.entries(n?.input??{});return{...t,actionId:{...t.actionId,type:()=>c.length>0?"select":"text",canBind:!0,label:!1===o?"Action — this space has no server to run it":"Action",options:c},input:{...t.input,canBind:!0,label:r.length>0?`Input — ${r.map(([e,t])=>`${e}${t.required?"*":""}: ${t.type}`).join(", ")}`:"Input"}}}}}),[s,l,c,i,o])});let u=f(({actionId:e,input:t,idempotencyKey:n="",invalidateQueries:r})=>s({actionId:e,input:t,mode:"await",idempotencyKey:n,invalidateQueries:r}),[s]);/* @__PURE__ */
151
+ return I(J_,{value:u,children:e})},iN={login:{source:"auth",title:"Auth Login",strictParams:!0,params:{mode:{type:"select",description:"Credentials to sign in with: a username and password, or a token obtained elsewhere.",default:"normal",options:["normal","token","mfa"],optionLabels:{normal:"User and Password",token:"Token",mfa:"Second factor"},canBind:!1},username:{type:"text",description:"Username.",default:"",when:e=>"normal"===e.mode},password:{type:"text",description:"Password.",default:"",when:e=>"normal"===e.mode},token:{type:"text",description:"A token to exchange for a session.",default:"",when:e=>"token"===e.mode},mfaToken:{type:"text",description:"The challenge a sign-in answered with when it owed a second factor: `{{ login.mfaToken }}`.",default:"",when:e=>"mfa"===e.mode},code:{type:"text",description:"The code from the authenticator app, or a recovery code.",default:"",when:e=>"mfa"===e.mode}},preview:{ok:"",reason:"",mfaToken:"",errors:{username:"",password:"",token:""},accessToken:"",expiresAt:"",refreshToken:""}},refreshDetails:{source:"auth",title:"Auth Refresh Details",strictParams:!0,params:{},preview:{errors:"",accessToken:"",expiresAt:"",refreshToken:""}},logout:{source:"auth",title:"Auth Logout",strictParams:!0,params:{}}},oN=({children:e})=>{let{login:t,refresh:n,logout:r,provider:i}=h(cm),{useInteractions:o}=h(Id);return o({id:"auth",callbacks:k(()=>i&&t&&n&&r?rd(iN,{login:e=>t(e),refreshDetails:e=>n(e),logout:()=>r()}):{},[t,r,n,i])}),e},aN={hostAction:{source:"host",title:"Host Action",strictParams:!0,params:{action:{type:"text",description:"The name the host registered the handler under — `openSpace`, `signOut`, whatever it offers.",default:""},value:{type:"scalar",description:"What the action is about: the space to open, the workspace to switch to. Optional.",default:""}}}},sN=({children:e,actions:t})=>{let{useInteractions:n}=h(Id),r=f(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:k(()=>rd(aN,{hostAction:r}),[r])}),e},lN={navigate:{source:"navigation",title:"Navigate",strictParams:!0,params:{urlType:{type:"select",description:"Target kind: a space page, an internal space path, or an external URL.",options:["page","internal","external"],optionLabels:{page:"Space Page",internal:"Inside Space",external:"Outside Space"}},url:{type:"text",description:'Destination — a page id when urlType is "page", otherwise a URL/path.',when:e=>!!e.urlType,builderType:e=>"page"===e.urlType?"select":"text"}}}},cN=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=h(Id),[[r,i,o]]=Bt(["schema.pages","pageDefinitions","navigation.navigate"]),a=k(()=>{let e=fr(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:pr(r,"attributes.name",n),defaultPage:pr(r,"attributes.default",!1)}]},[])},[i,r]),s=f(e=>{if(!t)return;let{url:n,urlType:r}=e;"page"===r||"internal"===r?o(n):o(n,!0)},[o,t]);return n({id:"navigation",callbacks:k(()=>{let{urlType:e,url:t}=td(lN.navigate.params);return rd(lN,{navigate:s},{navigate:{params:{urlType:e,url:{...t,defaultValue:a.find(e=>e.defaultPage)?.key??"",options:a.map(e=>({value:e.key,label:e.label}))}}}})},[s,a])}),e},uN={invalidateQueries:{source:"queries",title:"Invalidate Queries",strictParams:!0,params:{elements:{type:"elementIds",elementType:"apiContainer",description:"The api containers to refresh, by element id — the way to name a request whose URL is a template. Leave both this and `url` empty to refresh every cached request on the page.",default:[],label:"Containers (ids)"},url:{type:"text",description:"Only the requests whose URL starts with this — `/api/orders` covers `/api/orders?page=2`. With `elements` too, a request must match both.",default:"",label:"URL prefix"}},preview:{}}},dN=({children:e})=>{let{useInteractions:t}=h(Id),n=f(e=>JE({url:e.url??"",elements:KE(e.elements)}),[]);return t({id:"queries",callbacks:k(()=>rd(uN,{invalidateQueries:n}),[n])}),e},pN={setState:{source:"state",title:"Set State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to set. Stored under `runtime.state.<key>`.",default:""},type:{type:"select",description:'The value type. What is stored is coerced to it — a boolean is a real boolean, not "true"; `json` stores an object or a list (a template naming one, or JSON text).',options:["boolean","number","text","json"],optionLabels:{boolean:"True / False",number:"Numeric",text:"Text",json:"Object / List (JSON)"}},value:{type:"json",description:"The value to store — its type follows the `type` param (a real boolean/number, text, or an object/list).",when:e=>!!e.type,builderType:e=>"boolean"===e.type?"select":"text",options:["true","false"]}}},toggleState:{source:"state",title:"Toggle State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to flip, under `runtime.state.<key>`. Anything not already true is treated as false, so a key that has never been set toggles to true.",default:""}}},appendState:{source:"state",title:"Append To State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`. Created if it is not there.",default:""},value:{type:"scalar",description:"What to add to the end of the list.",default:""},unique:{type:"boolean",description:"Skip the append when the list already holds this value. For a list whose entries are their own identity — anything referring to one refers to it by value, so a second copy is indistinguishable.",default:!1},withId:{type:"boolean",description:"Store the entry as `{ id, value }` with an id of its own, so two entries that read the same are still two entries. Anything reading one back names `.value`; anything referring to one names `.id`.",default:!1}}},removeState:{source:"state",title:"Remove From State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry to drop, by value — every copy of it. Prefer this wherever the list can change under the person: a position is only true until something before it moves.",default:""},by:{type:"text",description:"The FIELD carrying the identity, for a list of records rather than of scalars — `id` for entries appended with `withId`. Without it the whole entry is compared, which never matches a record.",default:""},index:{type:"text",description:"Which entry to drop, by position, when there is no value to go on. Inside a controlled list, `{{ <listSource>.index }}` is the row own position. An index that resolves to nothing removes nothing.",default:""}}},moveState:{source:"state",title:"Move Between Lists",strictParams:!0,params:{from:{type:"text",description:"The list to take it out of, under `runtime.state.<key>`.",default:""},to:{type:"text",description:"The list to put it into. It is not added twice.",default:""},value:{type:"scalar",description:"The entry to move. Absent from `from` means nothing happens.",default:""}}},toggleInState:{source:"state",title:"Toggle In List",strictParams:!0,params:{key:{type:"text",description:"The list to add to or drop from, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry the box stands for.",default:""}}},clearState:{source:"state",title:"Clear State",strictParams:!0,params:{key:{type:"text",description:"The list to empty, under `runtime.state.<key>`. Left blank it empties EVERYTHING the space is keeping — which on a page that holds notes beside a list means losing the notes to clear the list.",default:""}}}},hN=0,fN=({children:e})=>{let{useInteractions:t}=h(Id),n=qt(),r=f(e=>{let{key:t,type:r}=e,i=e.value;if("boolean"===r)i=!0===i||"true"===i;else if("number"===r)i="number"==typeof i?i:parseFloat(String(i));else if("json"===r)return void n(`runtime.state.${t}`,((e,t)=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch{throw Error(`setState "${e}" is typed json, and its value is not JSON: ${t.slice(0,80)}`)}})(t,i));n(`runtime.state.${t}`,i)},[n]),i=f(e=>{let{key:t}=e;t&&n(`runtime.state.${t}`,e=>!0!==e&&"true"!==e)},[n]),o=e=>!0===e||"true"===e,a=f(e=>{let{key:t,value:r,unique:i,withId:a}=e;t&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return o(a)?[...t,{id:typeof crypto<"u"&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`e${++hN}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,value:r}]:o(i)&&t.includes(r)?t:[...t,r]})},[n]),s=f(e=>{let{key:t,index:r,value:i,by:o}=e;if(!t)return;if(void 0!==i&&""!==i)return void n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter(e=>o?e?.[o]!==i:e!==i):[]);let a="number"==typeof r?r:parseInt(r??"",10);Number.isNaN(a)||n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter((e,t)=>t!==a):[])},[n]),l=f(e=>{let{from:t,to:r,value:i}=e;if(!t||!r||void 0===i||""===i)return;let o={moved:!1};n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return o.moved=t.includes(i),o.moved?t.filter(e=>e!==i):t}),o.moved&&n(`runtime.state.${r}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(i)?t:[...t,i]})},[n]),c=f(e=>{let{key:t,value:r}=e;t&&void 0!==r&&""!==r&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(r)?t.filter(e=>e!==r):[...t,r]})},[n]),u=f(e=>{let{key:t}=e;n(t?`runtime.state.${t}`:"runtime.state",t?[]:{})},[n]);return t({id:"state",callbacks:k(()=>rd(pN,{setState:r,toggleState:i,appendState:a,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,a,s,l,c,u])}),e},mN=({children:e,hostActions:t})=>{let[[n,r,i]]=Bt(["navigation.routeParams","navigation.queryParams","navigation.currentPageId"]),{previewMode:o}=re();/* @__PURE__ */
152
+ return I(V_,{currentPageId:i,routeParams:n,queryParams:r,children:/* @__PURE__ */I(oN,{children:/* @__PURE__ */I(fN,{children:/* @__PURE__ */I(rN,{children:/* @__PURE__ */I(dN,{children:/* @__PURE__ */I(cN,{previewMode:o,children:/* @__PURE__ */I(sN,{actions:t,children:e})})})})})})})},gN=K("StyleContext",{}),yN=({children:e,style:t})=>{let{style:n}=h(Jm),r=k(()=>({}),[]);return Gt("style",t??(n||su)),/* @__PURE__ */I(gN,{value:r,children:e})},bN="/plitzi-sdk.css",vN=({revision:e,webKey:t="",webId:n,environment:r="main",currentPageId:i,server:o,isHydrating:a=!1,offlineMode:s=!1,offlineData:l,offlineDataType:c="json",instanceId:u,renderMode:d=ne.renderMode,sdkStylePath:p="./plitzi-sdk.css",sdkDevToolsStylePath:f,sdkIconsStylePath:m="/plitzi-sdk-icons.css",previewMode:y=!0,debugMode:b=!1,overQuota:v=!1,analytics:w,onInitEventBridge:x,hostData:T,hostActions:C,flags:E,serverFlags:A,forcedFlags:_,onInitStateManager:N,...M})=>{const P=h(kt),[L,R]=S(!a);g(()=>R(!0),[]),Ut(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota"],[y,b,d,r,a,L,v]),Ut(["runtime.host"],[T]),Ut(["flags.overrides.server","flags.overrides.sdk","flags.overrides.qa"],[Rd(A),Rd(E),_]);const j=k(()=>P?.withBase("runtime.state"),[P]),z=k(()=>({get state(){return j?.getState()??{}},setState:e=>j?.setState(void 0,e),setStateByKey:(e,t)=>j?.setState(e,t),clearState:()=>j?.setState(void 0,{}),subscribe:e=>j?j.subscribe(()=>e(j.getState()??{})):()=>{}}),[j]);return g(()=>{N?.(z)},[N,z]),/* @__PURE__ */I(tg,{webKey:t,webId:n,instanceId:u,server:o,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */I(rg,{children:/* @__PURE__ */I(ng,{sdkStylePath:bN,sdkIconsPath:m,children:/* @__PURE__ */I(yN,{children:/* @__PURE__ */I(g_,{onInit:x,debugMode:b,children:/* @__PURE__ */I(jO,{server:o,children:/* @__PURE__ */O(Hm,{currentPageId:i,children:[/* @__PURE__ */I(lm,{analytics:w}),/* @__PURE__ */I(f_,{children:/* @__PURE__ */I(mN,{hostActions:C,children:/* @__PURE__ */I(h_,{enabled:b,instanceId:u,devToolsStyleLink:f||"/plitzi-sdk-devtools.css",devToolsIconsLink:m,renderMode:"shadow",scroll:"document",qa:!0,innerClassName:V({flex:"iframe"===d}),children:/* @__PURE__ */I(bO,{sdkStylePath:bN,server:o,...M})})})})]})})})})})})})},wN="theme",kN=["dark","light"],xN=[...kN,"system"],SN="(prefers-color-scheme: dark)",TN=({store:e})=>{let t=Og(e);return $t(["theme.mode","theme.resolved","theme.areas"],[t.mode,Tg(t.mode,t.scheme),t.areas]),null},CN=({defaultTheme:e="system",theme:t,scope:n="document",cookieName:r=wN,children:i})=>{let o="container"===n,a=b(),[s]=S(()=>o?xg(`theme${a}`):void 0),l=s??Sg,c=x({mode:e,remembered:!1});Et(()=>{let n=o?void 0:((e=wN)=>{try{return((e,t=wN)=>{let n=ai(e,t);return(e=>xN.includes(e))(n)?n:void 0})(document.cookie,e)}catch{return}})(r),i=t??n??e;c.current={mode:i,remembered:void 0!==n},l.batch(()=>{Eg(window.matchMedia(SN).matches?"dark":"light",l),Cg(i,l)})},[e,t,r,o,l]);let u=t??e,d=void 0!==h(kt);g(()=>{let e=window.matchMedia(SN),t=()=>Eg(e.matches?"dark":"light",l);return e.addEventListener("change",t),t(),()=>e.removeEventListener("change",t)},[l]),g(()=>{if(o)return;let e=()=>{let{mode:e}=l.getState();(c.current.remembered||e!==c.current.mode)&&(((e,t=wN)=>{try{document.cookie=`${t}=${encodeURIComponent(e)};path=/;max-age=31536000;SameSite=Lax`}catch{}})(e,r),c.current.remembered=!0),((e,t)=>{for(let n of kN)t.classList.toggle(n,e===n)})(e,document.documentElement)};return e(),l.subscribe(e)},[r,o,l]);let p=d?/* @__PURE__ */I(TN,{store:l}):null;return o?/* @__PURE__ */I(Ag,{value:s,children:/* @__PURE__ */O(Ig,{value:u,children:[p,i]})}):/* @__PURE__ */O(Ig,{value:u,children:[p,i]})},EN=e=>new Set(Array.isArray(e?.paintedState)?e.paintedState.filter(e=>"string"==typeof e&&""!==e):[]),AN=(e,t)=>X(e)?Object.fromEntries(Object.entries(e).filter(([e,n])=>t.has(e)&&void 0!==n)):{},IN=e=>{try{document.cookie=`${e}=;path=/;max-age=0;SameSite=Lax`}catch{}},ON=/* @__PURE__ */new Set(["init","initLoading","authenticating"]),_N=e=>{let t=e.runtime?.sources.auth;if(t){if(void 0===t.status)return{kind:"browser"};if(!ON.has(t.status))return t.isAuthenticated&&void 0!==t.details?.id?{kind:"account",id:String(t.details.id)}:{kind:"guest"}}},NN=e=>{switch(e.kind){case"account":return`user:${e.id}`;case"guest":return"guest";case"browser":return""}},MN=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e))),PN=(e,t)=>X(e)?Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e))):{},LN=e=>e.schema?.settings,RN=e=>new Set((e?.transientState??[]).filter(e=>"string"==typeof e&&""!==e)),jN=(e,t)=>{let n,r=((e,t)=>{let n=t?.split(":")[1];return n?`plitzi_${e}_painted_${n}`:`plitzi_${e}_painted`})(t,typeof window>"u"?void 0:window.location.host),i=!1;return()=>{let t=e.getState();if(typeof document>"u"||t.render?.isHydrating&&!t.render.hydrated)return;let o=LN(t),a=EN(o),s=_N(t);if(!o?.keepState||0===a.size||void 0===s)return;let l=NN(s),c=t.runtime?.state;if(!i){i=!0;let t=(e=>((e,t)=>{let n=ai(e,t);if(void 0!==n)try{let e=JSON.parse(n);return X(e)&&"string"==typeof e.owner&&X(e.values)?{owner:e.owner,values:e.values}:void 0}catch{return}})(si(),e))(r);if(t&&t.owner!==l&&(IN(r),X(c)&&[...a].some(e=>e in c)))return void e.setState("runtime.state",MN(c,a));n=t?.owner===l?JSON.stringify(AN(t.values,a)):void 0}let u=AN(c,a),d=JSON.stringify(u);if(d!==n){if(n=d,0===Object.keys(u).length)return void IN(r);"too-large"===((e,t)=>{let n=encodeURIComponent(JSON.stringify(t));if(n.length>3072)return IN(e),"too-large";try{return document.cookie=`${e}=${n};path=/;max-age=31536000;SameSite=Lax`,"written"}catch{return"unavailable"}})(r,{owner:l,values:u})&&$d.warning("store",`settings.paintedState holds more than a cookie can carry — the first paint uses the space's defaults for ${[...a].join(", ")}. Declare only what the first paint shows.`,{storeName:"runtime",path:"runtime.state",prev:void 0,next:u})}}},zN=e=>{let t=(e=>{let{key:t,storage:n,paths:r,partialize:i,partializePath:o,version:a=0,migrate:s,merge:l,mergePath:c,enabled:u}=e,d="function"==typeof n?n:void 0,p="function"==typeof n?void 0:xe(n);if(!d&&!p)return()=>{};let h=e=>{if(!d)return p;let t=d(e);return t?xe(t):void 0},f=e=>{if(r){let t={};for(let n of r){let r=pe(e,n);t[n]=o?o(n,r,e):r}return t}return i?i(e):e};return e=>{if(ae(u,e.getState()))return;let n=!1,i=()=>{if(n)return;let i=h(e.getState());i&&(n=!0,function(e,t,n,{version:r,paths:i,migrate:o,merge:a,mergePath:s}){let l=n?.getItem(t);if(l)try{let t=JSON.parse(l),n=t.version!==r;if(n&&!o)return;let c=n&&o?o(t.state,t.version):t.state;if(i){let t=c;return void e.batch(()=>{for(let n of i)if(n in t){let r=s?s(n,t[n],pe(e.getState(),n),e.getState()):t[n];e.setState(n,r)}})}let u=c;e.setState(void 0,a?a(u,e.getState()):u)}catch{n?.removeItem(t)}}(e,t,i,{version:a,paths:r,migrate:s,merge:l,mergePath:c}))};return{hydrate:i,onChange:n=>{i(),(e=>!r||r.some(t=>he(e,t)))(n.path)&&(e=>{let n=e.getState(),r=h(n);if(!r)return;let i={version:a,state:f(n)};r.setItem(t,JSON.stringify(i))})(e)}}}})({key:`plitzi_${e}_state`,paths:["runtime.state"],partializePath:(e,t,n)=>X(t)?MN(t,RN(LN(n))):t,mergePath:(e,t,n,r)=>{let i=RN(LN(r));return i.size>0&&X(t)?{...MN(t,i),...PN(n,i)}:t},storage:e=>{let{render:t}=e;if(t?.isHydrating&&!t.hydrated)return!1;let n=LN(e),r=_N(e);if(!n?.keepState||void 0===r)return!1;let i=(e=>{try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}})("sessionStorage"===n.stateStorage?"session":"local");return!!i&&((e,t)=>({getItem:n=>{let r=e.getItem(n);if(null===r)return null;try{let e=JSON.parse(r);if(e.owner===t&&"string"==typeof e.payload)return e.payload}catch{}return e.removeItem(n),null},setItem:(n,r)=>e.setItem(n,JSON.stringify({owner:t,payload:r})),removeItem:t=>e.removeItem(t)}))(i,NN(r))}});return n=>{let r=t(n),i=n.getState().runtime?.state,o=_N(n.getState()),a=jN(n,e);return{...r,onChange:e=>{let t=o,s=_N(n.getState());if(void 0!==s&&(o=s),"account"===t?.kind&&void 0!==s&&NN(s)!==NN(t)){let e=X(i)?MN(i,EN(LN(n.getState()))):i;n.setState("runtime.state",e)}r?.onChange?.(e),a()}}}},DN=({scope:e,theme:t,children:n})=>{const[[r="system"]]=Bt(["style.theme.default"]),{enclosed:i}=re(),{resolvedTheme:o}=Ng(_g);/* @__PURE__ */
153
+ return I(CN,{defaultTheme:i&&"system"===r?o:r,scope:e,theme:t,children:n})},$N=`[data-motion-on="view"]:not([${Wd}])`,FN=()=>{const{rootRef:e}=h(ig);return g(()=>{const t=e.current;if(t)return(e=>{let t=e=>e.setAttribute(Wd,""),n=e=>[...e.matches($N)?[e]:[],...Array.from(e.querySelectorAll($N))];if("function"!=typeof Reflect.get(globalThis,"IntersectionObserver"))return n(e).forEach(t),()=>{};let r=new IntersectionObserver(e=>{for(let n of e)n.isIntersecting&&(t(n.target),r.unobserve(n.target))}),i=e=>n(e).forEach(e=>r.observe(e)),o=new MutationObserver(e=>{for(let t of e)"attributes"===t.type&&t.target instanceof Element&&i(t.target),t.addedNodes.forEach(e=>{e instanceof Element&&i(e)})});return i(e),o.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-motion-on"]}),()=>{r.disconnect(),o.disconnect()}})(t)},[e]),null},qN=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ng(),[[i=!1]]=Bt(["render.hydrated"]);/* @__PURE__ */
154
+ return O(og,{className:V(e,t&&"system"!==r&&r),"data-hydrated":i?"":void 0,children:[/* @__PURE__ */I(FN,{}),n]})},BN=/* @__PURE__ */$({ComponentHelper_exports:()=>UN,getPlugins:()=>HN,nestedInject:()=>KN,processLocalCustomPlugins:()=>YN,processLocalPlugins:()=>WN}),UN=/* @__PURE__ */$g({getPlugins:()=>HN,nestedInject:()=>KN,processLocalCustomPlugins:()=>YN,processLocalPlugins:()=>WN}),HN=e=>{let t={};if(!e)return t;t[e.type]=e;let{plugins:n}=e;return n&&Object.keys(n).length>0&&Object.keys(n).forEach(e=>{Object.assign(t,HN(n[e]))}),t},WN=e=>{let t={};return e&&Object.values(e).forEach(e=>{e.type&&Object.assign(t,HN(e))}),t},VN={local:/* @__PURE__ */new WeakMap,"local-custom":/* @__PURE__ */new WeakMap,remote:/* @__PURE__ */new WeakMap},GN=(e,t)=>{let n=VN[t].get(e);if(n)return n;let r=Ku(e);return VN[t].set(e,r),r},KN=(e,t)=>{if(!e)return{};let n={};return Object.keys(e).forEach(r=>{let i=e[r],{version:o,pluginSettings:a,initialItems:s,plugins:l,extraProps:c}=i;n[r]=GN(i,t),n[r].origin=t,n[r].version=o,n[r].type=r,n[r].initialItems=s,n[r].pluginSettings=a,n[r].extraProps=c,n[r].plugins=KN(l,t)}),n},YN=e=>{let t={};return e&&Object.values(e).forEach(e=>{if(!e.type)return;let{type:n,pluginSettings:r,version:i,initialItems:o,plugins:a,assets:s,content:l,extraProps:c}=e,u=GN(e,"local-custom");u.version=i,u.type=n,u.assets=s,u.initialItems=o,u.pluginSettings=r,u.origin="local-custom",u.content=l,u.extraProps=c,u.plugins=KN(a,"local-custom"),Object.assign(t,HN(u))}),t},JN=p(({plitziJsxSkipHOC:e=!0,as:t="",internalProps:n,children:r,...i})=>{let{components:o}=h(Wr),{plugins:a}=h(Li),s=t?o.current[t]:void 0,l=k(()=>s?void 0:Yr({type:t,plugins:a}),[s,a,t]);return t?!s&&l?/* @__PURE__ */I(Kr,{internalProps:n,url:l.url,type:t,plitziJsxSkipHOC:e,plitziJsxProps:i}):(s||=cE,/* @__PURE__ */I(s,{plitziJsxSkipHOC:e,...i,internalProps:n,children:r})):null}),XN=e=>{let[t]=Dt(`runtime.sources.flags.${e}`);return!0===t},ZN={dropdown:hy,notFound:uE,loading:aE,custom:Wg,reference:ny,blockHtml:qg,nodeHtml:Gg,blockJsx:Ug,page:mE,container:jA,layoutContainer:iE,dialogContainer:FA,modalContainer:KA,tabContainer:aI,carousel:LA,heading:yy,image:CE,video:PE,embed:yE,svg:NE,fontAwesome:vE,button:ay,paragraph:hC,text:AC,themeToggle:LC,list:VA,link:wy,markdown:dC,richText:CC,pagination:JA,form:zC,formControl:ZC,apiContainer:oA,channel:vA},QN=({localComponents:e,localCustomComponents:t,children:n})=>{let r=k(()=>({...WN(ZN),...WN(e),...YN(t)}),[e,t]),i=x({}),o=k(()=>({current:{...i.current,...r}}),[r]),a=f((e=[],t=!1)=>{if("string"==typeof e&&!t)return o.current[e];if("string"==typeof e&&t){let t=o.current[e];return t?{[e]:t,...vr(HN(t),[e])}:{}}let n={};return e.forEach(e=>{let r=o.current[e];r&&(t?n={...n,...vr(HN(r),[e])}:n[e]=r)}),n},[o]),s=f((e=[])=>{let t={};return Array.isArray(e)||(e=[e]),e.forEach(e=>{e.type&&!o.current[e.type]&&(t={...t,[e.type]:e,...HN(e)})}),0===Object.keys(t).length||(o.current={...i.current,...t,...r},i.current={...i.current,...t}),t},[o,r]),l=f(e=>{if(!e)return[];Array.isArray(e)||(e=[e]);let t=e;return e.forEach(e=>{let n=a([e],!0);Object.keys(n).length>0&&(t=[...t,...Object.keys(vr(n,e))])}),o.current={...vr(i.current,t),...r},i.current=vr(i.current,t),t},[o,a,r]),c=x(Object.keys(o.current).reduce((e,t)=>{let n=pr(o.current,t,void 0);return n&&n.content?{...e,[t]:{...n.content,initialItems:n.initialItems}}:e},{})),u=f(e=>{c.current={...c.current,...e}},[]),d=f(e=>{let t=pr(c.current,`${e}.builder.pluginChildren`,[]);c.current=vr(c.current,[e,...t])},[]),p=k(()=>({components:o,componentDefinitions:c,getComponent:a,register:s,unregister:l,unregisterDefinition:d,registerDefinition:u}),[o,s,l,u,d,a]);/* @__PURE__ */
155
+ return I(Wr,{value:p,children:n})},eM=K("EnclosingSpaceContext",!1),tM=e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}),nM={Button:$l,ContentEditable:Kp,Input:Gl,Heading:Jp,ContainerResizable:$p,ContainerCollapsable:zp,Text:Qp,ContainerTabs:Vp},rM=({className:e,children:t,webKey:r="",server:o,renderMode:a=ne.renderMode,routing:s="browser",debugMode:l=!1,themeScope:c,theme:d,state:p,forcedFlags:m,...y})=>{const b=k(()=>function(e){if(!e)return 0;let t={};try{let n=e.split(".")[1],r=typeof window<"u"?window.atob(n):Buffer.from(n,"base64").toString();t=JSON.parse(r)}catch{return 0}let n=Number(pr(t,"sub",0));return Number.isInteger(n)&&n>0?n:0}(r),[r]),v=h(eM),w=c??(v?"container":"document"),T=v&&"raw"===a?"widget":a,C=e??(v?void 0:"min-h-screen"),E=x(p).current,A=k(()=>({runtime:{sources:{},state:E??{}},render:{...ne,ownsHead:!v,enclosed:v}}),[E,v]),O=k(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[_,N]=S(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(O)),M=l&&_,[P]=S(()=>m||!l||"undefined"==typeof window?m:((e,t)=>(e=>e?Object.fromEntries(e.split(",").map(e=>e.split(":")).filter(([e,t])=>oi(e)&&("1"===t||"0"===t)).map(([e,t])=>[e,"1"===t])):{})(ai(e,li(t))))(si(),window.location.host)),L=k(()=>tM(o),[o]);g(()=>{},[]);const R=f(()=>{const e=!_;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(O,e),N(e)},[O,_]);(({authorized:e,onToggle:t})=>{const n=f(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);g(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:l,onToggle:R}),g(()=>{},[l,_,O]),g(()=>{if(M)return window.plitziTracing={lastCommitId:Vu.lastCommitId,commitsSince:Vu.commitsSince},()=>{delete window.plitziTracing}},[M]),g(()=>{y.isHydrating&&Vu.setHydrated()},[y.isHydrating]);const j=k(()=>{const e={};return n.forEach(t,t=>{if(!u(t))return;if(t.type!==uO)return;const{renderType:n,component:r,assets:i=[],...o}=t.props;if(!n||!r)return;const a=r;a.type=n,a.assets=i,a.extraProps=o,e[n]=a}),e},[t]);"undefined"==typeof window&&L.requestUrl;const z="widget"===T?i:"undefined"==typeof window?Qf:"memory"===s?xf:Vf,D="widget"===T?{}:{..."memory"===s&&"undefined"!=typeof window?{}:{basename:pr(L,"basePath","/"),location:"undefined"==typeof window?L.requestUrl??"":void 0}};/* @__PURE__ */
156
+ return I(eM,{value:!0,children:/* @__PURE__ */I(Mt,{value:A,middlewares:[ke(Fd("sdk")),zN(b),...M?[()=>({onChange:e=>Vu.recordStoreChange(e)}),be({shouldRecord:e=>!(e?.startsWith("runtime.elements")||e?.startsWith("rsc")||e?.startsWith("theme")||e?.startsWith("flags"))})]:[]],children:/* @__PURE__ */I(DN,{scope:w,theme:d,children:/* @__PURE__ */I(Zp,{components:nM,applyColorModeClass:!1,children:/* @__PURE__ */I(qN,{scoped:"container"===w,className:V("plitzi-sdk","flex",C,{"sdk-debug-mode":M}),children:/* @__PURE__ */I(Ip,{children:/* @__PURE__ */I(z,{...D,children:/* @__PURE__ */I(QN,{localCustomComponents:j,localComponents:oM,children:/* @__PURE__ */I(vN,{server:L,webKey:r,renderMode:T,debugMode:M,webId:b,forcedFlags:P,...y})})})})})})})})})},iM=Ku(({ref:e,className:t,spaceKey:n,environment:r="main",offlineData:i})=>{const{settings:{previewMode:o}}=vu(),{server:a}=h(Kd),s=k(()=>void 0===i?void 0:(e=>{if(!X(e))return{problem:"The documents cannot be drawn: they are not an object with `schema` and `style`."};const t=["schema","style"].filter(t=>void 0===e[t]);return t.length>0?{waiting:t}:(e=>void 0===Yd(e.schema,e.style))(e)?{documents:e}:{problem:`The documents cannot be drawn: ${Yd(e.schema,e.style)??"their shape is unknown"}.`}})(i),[i]),l=s&&"problem"in s?s.problem:void 0,c=s&&"waiting"in s?s.waiting:void 0,u=s&&"documents"in s?s.documents:void 0,d=void 0!==s&&!!n;return g(()=>{l&&console.error(`[plitziSdk] ${l}`)},[l]),g(()=>{d&&console.warn("[plitziSdk] Both `offlineData` and `spaceKey` are set: the documents are drawn, the key is not.")},[d]),/* @__PURE__ */O(Gd,{ref:e,className:V("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!o}),children:[u&&/* @__PURE__ */I(rM,{offlineMode:!0,offlineData:u,environment:r,renderMode:"widget",className:"h-full w-full"}),!s&&n&&/* @__PURE__ */I(rM,{webKey:n,environment:r,server:a,renderMode:"widget",className:"h-full w-full"}),l&&!o&&/* @__PURE__ */I("p",{className:"plitzi-sdk__problem",children:l}),c&&!o&&/* @__PURE__ */O("p",{className:"plitzi-sdk__waiting",children:["Waiting for ",c.map(e=>`\`${e}\``).join(" and ")," to be bound."]})]})}),oM={plitziSdk:Object.assign(iM,{...H,content:{...H.content,market:{...H.content.market,icon:/* @__PURE__ */I(q,{})}}})},aM=class extends Error{stage;log;constructor(e,t){super(`${"link"===e?"program failed to link":`${e} shader failed`}: ${t.trim()||"no log given"}`),this.name="ShaderError",this.stage=e,this.log=t}},sM=(e,t,n)=>{let r=e.createShader("vertex"===t?e.VERTEX_SHADER:e.FRAGMENT_SHADER);if(!r)throw new aM(t,"the context made no shader (it is lost)");if(e.shaderSource(r,n),e.compileShader(r),!0!==e.getShaderParameter(r,e.COMPILE_STATUS)){let n=e.getShaderInfoLog(r)??"";throw e.deleteShader(r),new aM(t,n)}return r},lM=(e,{vertex:t,fragment:n})=>{let r=sM(e,"vertex",t),i=sM(e,"fragment",n),o=e.createProgram();if(e.attachShader(o,r),e.attachShader(o,i),e.linkProgram(o),e.deleteShader(r),e.deleteShader(i),!0!==e.getProgramParameter(o,e.LINK_STATUS)){let t=e.getProgramInfoLog(o)??"";throw e.deleteProgram(o),new aM("link",t)}return o},cM="(prefers-reduced-motion: reduce)",uM=()=>"function"==typeof window.matchMedia&&window.matchMedia(cM).matches||document.documentElement.classList.contains("plitzi-reduced-motion"),dM=e=>{let t="function"==typeof window.matchMedia?window.matchMedia(cM):void 0;t?.addEventListener("change",e);let n=new MutationObserver(e);return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{t?.removeEventListener("change",e),n.disconnect()}},pM=()=>T(dM,uM,()=>!1),hM=e=>(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),fM=()=>"hidden"!==document.visibilityState,mM=(e,{paused:t=!1,fps:n,target:r}={})=>{let i=vu().settings.previewMode??!0,o=pM(),a=T(hM,fM,()=>!1),s=(e=>{let[t,n]=S(!0);return g(()=>{let t=e?.current;if(!t||typeof IntersectionObserver>"u")return;let r=new IntersectionObserver(e=>n(e.some(e=>e.isIntersecting)));return r.observe(t),()=>r.disconnect()},[e]),t})(r),l=i&&!o&&!t&&a&&s,c=x(e);g(()=>{c.current=e},[e]);let u=x({time:0,frame:0});return g(()=>{if(!l)return;let e,t=n&&n>0?1e3/n:0,r=0,i=0,o=n=>{let a=void 0===e?0:n-e;if(e=n,i+=a,i>=t){let e=t>0?i:a;i=t>0?i%t:0,u.current={time:u.current.time+e,frame:u.current.frame+1},c.current({...u.current,delta:e})}r=requestAnimationFrame(o)};return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)},[l,n]),{running:l}},gM=(e,{setup:t,draw:n,maxPixelRatio:r=2,paused:i,fps:o})=>{let a=(e=>`[plugin ${e?.definition?.type??"canvas"}${e?.id?` "${e.id}"`:""}]`)(h(Y)),s=x(null),[l,c]=S(null),[u,d]=S({width:0,height:0,pixelRatio:1}),[p,m]=S(),[y,b]=S(!1),[v,w]=S(0),k=x(null),T=x({acquire:e,setup:t,draw:n});g(()=>{T.current={acquire:e,setup:t,draw:n}},[e,t,n]);let C=f(e=>{let t=e instanceof Error?e.message:String(e);console.error(`${a} ${t}`),m(t)},[a]),E=f(e=>{s.current=e,c(e)},[]);g(()=>{if(!l)return;let e=()=>{let e=l.getBoundingClientRect(),t=Math.min(window.devicePixelRatio||1,r);l.width=Math.max(1,Math.round(e.width*t)),l.height=Math.max(1,Math.round(e.height*t)),d({width:e.width,height:e.height,pixelRatio:t})};if(e(),typeof ResizeObserver>"u")return;let t=new ResizeObserver(e);return t.observe(l),()=>t.disconnect()},[l,r]),g(()=>{if(!l)return;let e=e=>{e.preventDefault(),k.current=null,b(!1)},t=()=>w(e=>e+1);return l.addEventListener("webglcontextlost",e),l.addEventListener("webglcontextrestored",t),()=>{l.removeEventListener("webglcontextlost",e),l.removeEventListener("webglcontextrestored",t)}},[l]),g(()=>{if(l&&0!==u.width&&void 0===p)try{let e=T.current.acquire(l);if(!e)return void C(/* @__PURE__ */Error("the browser gave no drawing context (WebGL may be off)"));e.prepare(u);let t=T.current.setup?T.current.setup(e.context,u):void 0;k.current={handle:e,state:t}}catch(aM){C(aM)}},[l,u,v,p,C]);let A=f(e=>{let t=k.current;if(t&&void 0===p)try{t.handle.prepare(u),T.current.draw(t.handle.context,{...e,...u,state:t.state}),b(!0)}catch(e){k.current=null,C(e)}},[u,p,C]),{running:I}=mM(A,{paused:i||void 0!==p,fps:o,target:s});return g(()=>{!I&&u.width>0&&A({time:0,delta:0,frame:0})},[I,u,v,A]),{ref:E,ready:y,error:p,running:I}},yM=({attributes:e,...t})=>gM(f(t=>{let n=t.getContext("2d",e);return n&&{context:n,prepare:({pixelRatio:e})=>n.setTransform(e,0,0,e,0,0)}},[e]),t),bM=({attributes:e,...t})=>gM(f(t=>{let n=t.getContext("webgl",e);return n&&{context:n,prepare:()=>n.viewport(0,0,t.width,t.height)}},[e]),t),vM=({attributes:e,...t})=>gM(f(t=>{let n=t.getContext("webgl2",e);return n&&{context:n,prepare:()=>n.viewport(0,0,t.width,t.height)}},[e]),t),wM=e=>"string"==typeof e&&e?e:void 0,kM=e=>n.toArray(e).flatMap(e=>{if(!u(e))return[];let t=(e=>{let t=e.props;return e.type===ti?wM(t.id):wM(t.internalProps?.id)})(e);return void 0===t?[]:[{id:t,node:e}]}),xM=e=>"function"==typeof e.checkVisibility?e.checkVisibility():e.getClientRects().length>0,SM=e=>{let{utils:{rootRef:t}}=vu(),[n,r]=S(void 0);return g(()=>{let n=t.current,i=n?.ownerDocument.defaultView;if(!n||!i||!e)return;let o=`[data-plitzi-el="${i.CSS.escape(e)}"]`,a=()=>r([...n.querySelectorAll(o)].some(xM)),s=0,l=new i.MutationObserver(()=>{s||=i.requestAnimationFrame(()=>{s=0,a()})});return l.observe(n,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class","style"]}),i.addEventListener("resize",a),a(),()=>{l.disconnect(),i.removeEventListener("resize",a),i.cancelAnimationFrame(s)}},[e,t]),n},TM=e=>{let{id:t}=Yu(),{settings:{previewMode:n=!0}}=vu(),{interactionsManager:r}=h(Id);return f((i,o)=>{n&&r.interactionTrigger(t,e.triggers[i].action,o)},[e,t,r,n])},CM=e=>{let[t]=Dt("actions.endpoint");return f((n="/")=>{if(!t)return;let r=((e,t="/")=>`/fn/plugins/${encodeURIComponent(e)}${t.startsWith("/")?t:`/${t}`}`)(e,n);return typeof window>"u"?r:new URL(r,new URL(t,window.location.href)).href},[t,e])},EM={mobile:`(max-width: ${sg("tablet")})`,tablet:`(max-width: ${sg("desktop")})`},AM=e=>typeof window>"u"||"function"!=typeof window.matchMedia?void 0:window.matchMedia(e),IM=()=>AM(EM.mobile)?.matches?"mobile":AM(EM.tablet)?.matches?"tablet":"desktop",OM=e=>{let t=[AM(EM.mobile),AM(EM.tablet)].filter(e=>void 0!==e);return t.forEach(t=>{t.addEventListener("change",e)}),()=>{t.forEach(t=>{t.removeEventListener("change",e)})}},_M=()=>"desktop",NM=()=>T(OM,IM,_M),MM=e=>{let[t,n]=S(void 0);return g(()=>{let t=e.current;if(!t||typeof ResizeObserver>"u")return;let r=(e,t)=>n(n=>n?.width===e&&n.height===t?n:{width:e,height:t}),i=t.getBoundingClientRect();r(i.width,i.height);let o=new ResizeObserver(e=>{e.slice(-1).forEach(e=>r(e.contentRect.width,e.contentRect.height))});return o.observe(t),()=>o.disconnect()},[e]),t},PM=e=>{const t=h(J_);return f(async(n,r={})=>{if(!t)return console.warn(`[plitzi] useServerAction: nothing on this page runs server actions, so "${e}" was skipped`),{ok:!1,runId:"",reason:"skipped"};const i=await t({actionId:e,input:n,...r});return"completed"!==i.status?{ok:!1,runId:i.runId,reason:i.reason??i.status,...i.error?{error:i.error}:{}}:{ok:!0,runId:i.runId,output:i.output}},[e,t])},LM=(e,t)=>new Promise(n=>{const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.dataset.plitziPlugin=t,r.onload=()=>n(),r.onerror=()=>n(),document.head.append(r)}),RM=(e,{load:t,css:n,declaration:r})=>{let i;const o=(r,{content:s,version:l,initialItems:c,plugins:u})=>{const p=d(async()=>({default:r.reduce((t,n)=>{const r=t.plugins?.[n];if(!r)throw new Error(`[plitzi] plugin "${e}" was loaded without the "${n}" it declared`);return r},await(i??=Promise.all([t(),n?LM(n,e):void 0]).then(([e])=>e.default)))})),h=e=>/* @__PURE__ */I(a,{fallback:null,children:/* @__PURE__ */I(p,{...e})});return h.displayName=`Deferred(${r.at(-1)??e})`,Object.assign(h,{content:s,version:l,initialItems:c,plugins:u?Object.fromEntries(Object.entries(u).map(([e,t])=>[e,o([...r,e],t)])):void 0})};return o([],r)},jM=e=>{try{return JSON.stringify({...e},(e,t)=>"function"==typeof t?void 0:t)}catch{return}},zM=e=>{const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;return{plugins:Object.fromEntries(Object.entries(e).map(([e,i])=>{t.set(e,i.component);const o=((e,r)=>{const i=(e=>t=>{const r=n.get(e)??/* @__PURE__ */new Set;return r.add(t),n.set(e,r),()=>{r.delete(t)}})(e),o=()=>t.get(e)??r,a=e=>{const t=T(i,o,o);/* @__PURE__ */
157
+ return I(t,{...e})};return a.displayName=`Hot(${r.displayName??r.name})`,Object.assign(a,r)})(e,i.component);return r.set(e,o),[e,{...i,component:o}]})),replace:(e,i)=>{const o=t.get(e),a=r.get(e);return!(!o||!a||jM(o)!==jM(i)||(t.set(e,i),n.get(e)?.forEach(e=>{e()}),0))}}};Promise.resolve({ });function DM(e,t={},n={},r=!1,i=!1,{hotPlugins:o=!1}={}){const a=Object.fromEntries(Object.entries(n).map(([e,t])=>{if("component"in t)return[e,t];const{load:n,css:r,declaration:i,...o}=t;return[e,{...o,component:RM(e,{load:n,css:r,declaration:i})}]})),s=o?zM(a):void 0,l=s?.plugins??a,{actionRuns:c,styleCacheInDocument:u,...d}=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=tM(e.server);return t?{...e,analytics:{endpoint:`${t.replace(/\/+$/,"")}/v1/collect`,key:e.webKey}}:e})(t),p="undefined"!=typeof document?document.getElementById(e):void 0,h=u?((e,t)=>{const{offlineData:n}=e;if(!n||!t)return e;const r=(e=>{let t=e.querySelector('style[data-id="plitzi-runtime-style"]')?.textContent??"",n=t.indexOf(wg),r=t.indexOf(kg,n);if(!(n<0||r<0))return t.slice(n+22,r)})(t);return void 0===r?(console.error("[plitzi] The server-rendered stylesheet is missing from the page: it renders without its styles."),e):{...e,offlineData:{...n,style:{...n.style,cache:r}}}})(d,p):d,m=h.debugMode??r;m&&c?.length&&ft(c);const y=({isHydrating:e=!1})=>{const[t,n]=S(!e);g(()=>n(!0),[]);const r=Object.keys(l).filter(e=>t||!l[e].clientOnly);m||(()=>{if(typeof window>"u")return;let e=()=>{},t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;"object"==typeof t&&Object.keys(t).forEach(n=>{let r=t[n];t[n]="function"==typeof r?e:null})})();const i=f(e=>{gO=e},[]),o=f(e=>{yO=e},[]);/* @__PURE__ */
158
+ return I(rM,{...h,debugMode:m,isHydrating:e,onInitStateManager:i,onInitEventBridge:o,children:r.filter(e=>!!l[e].component).map(e=>/* @__PURE__ */I(bO.Plugin,{renderType:e,component:l[e].component,...l[e].props},e))})};if(!p)return;const b=i?E(p,/* @__PURE__ */I(y,{isHydrating:!0})):C(p);return i||b.render(/* @__PURE__ */I(y,{})),{unmount:()=>b.unmount(),replacePlugin:(e,t)=>s?.replace(e,t)??!1}}var $M=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:o=ne.renderMode,...a})=>/* @__PURE__ */I(rM,{...a,isHydrating:t,renderMode:o,debugMode:e,webKey:r,environment:i,children:n});$M.Plugin=bO.Plugin;var FM="0.38.16",qM=()=>gO,BM=()=>yO;export{Br as A,je as B,ts as C,Wr as ComponentContext,QN as ComponentProvider,ci as D,di as E,kt as F,V as H,yt as I,JN as JsxManager,pt as L,pr as M,Dt as N,ui as O,Ct as P,wu as PlitziProvider,Kg as PluginManager,Kr as PluginRemote,Li as PluginsContext,at as R,Yg as ReplicaProvider,Gd as RootElement,Fl as S,aM as ShaderError,Ii as T,ge as V,Dp as _,UO as a,Tu as b,uv as c,lM as createShaderProgram,xy as d,$M as default,kM as elementChildren,Ng as f,qp as g,BM as getEventBridge,qM as getStateManager,Gp as h,HO as i,kr as j,Vr as k,cv as l,Om as m,n_ as n,qO as o,lg as p,r_ as r,DM as render,qE as s,oM as sdkComponents,c_ as t,sm as track,Ay as u,mM as useAnimationFrame,yM as useCanvas2d,mA as useChannel,NM as useDisplayMode,Yu as useElement,MM as useElementSize,SM as useElementVisible,XN as useFlag,JI as useNotify,vu as usePlitzi,CM as usePluginRoute,TM as usePluginTrigger,pM as useReducedMotion,RE as useRscData,LE as useRscRefresh,PM as useServerAction,Bt as useStore,bM as useWebGL,vM as useWebGL2,Vd as v,FM as version,es as w,Ku as withElement,Kl as x,Vu as y,st as z};