@shwfed/config 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp.mjs +5 -3
- package/dist/module.json +1 -1
- package/dist/preview/assets/{badge-Ddz0ExD-.js → badge-BfeJsmpt.js} +1 -1
- package/dist/preview/assets/{config-CUeBTyLb.js → config-0PaXoAiK.js} +1 -1
- package/dist/preview/assets/{config-5qIYVWZh.js → config-3Dav11rw.js} +1 -1
- package/dist/preview/assets/{config-DN_3WauN.js → config-BlpdrD6d.js} +1 -1
- package/dist/preview/assets/{config-vePqHFvZ.js → config-CHRzxGVx.js} +1 -1
- package/dist/preview/assets/{config-B8zbFg3y.js → config-CS-NMWcV.js} +1 -1
- package/dist/preview/assets/{config-q5VV9rp7.js → config-CTA1p6um.js} +1 -1
- package/dist/preview/assets/{config-Bn619USg.js → config-Cb6kwkJ7.js} +1 -1
- package/dist/preview/assets/{config---5_lEKG.js → config-CtENh936.js} +1 -1
- package/dist/preview/assets/{config-U-3fWb-2.js → config-zybwxOyV.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-fQa65UMX.js → definition.vue_vue_type_script_setup_true_lang-ClY17iVd.js} +1 -1
- package/dist/preview/assets/{index-CzWhSvDG.js → index-BZ2cMq0s.js} +1 -1
- package/dist/preview/assets/{index-BKaqQGb-.js → index-Bjjy6l1m.js} +9 -11
- package/dist/preview/assets/index-Cw2peSCr.js +1 -0
- package/dist/preview/assets/{item-DHarupON.js → item-BTENoFeS.js} +1 -1
- package/dist/preview/assets/{runtime-C2rQ3L3-.js → runtime-B3kAucV_.js} +1 -1
- package/dist/preview/assets/{runtime-DQHb9t0r.js → runtime-BWeksK7X.js} +1 -1
- package/dist/preview/assets/{runtime-CMsaNery.js → runtime-ByvaY-sA.js} +1 -1
- package/dist/preview/assets/{runtime-aLgWVLET.js → runtime-D8qWgTCC.js} +1 -1
- package/dist/preview/assets/{runtime-DOM_La4X.js → runtime-D9EdrQs6.js} +1 -1
- package/dist/preview/assets/{runtime-CKghL8I_.js → runtime-DCftiZTY.js} +1 -1
- package/dist/preview/assets/{runtime-Dgl3wVfD.js → runtime-DNEDM9BZ.js} +1 -1
- package/dist/preview/assets/{runtime-CMuCGJZm.js → runtime-Dpy_UDRy.js} +1 -1
- package/dist/preview/assets/{runtime-560tuaHv.js → runtime-yP47ki_o.js} +1 -1
- package/dist/preview/index.html +1 -1
- package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/config.vue +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +4 -4
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +4 -4
- package/dist/runtime/components/form/utils/common.js +1 -3
- package/dist/runtime/components/form/utils/derived.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -0
- package/dist/runtime/vendor/cel-js/PROMPT.md +8 -0
- package/dist/runtime/vendor/cel-js/lib/functions.js +4 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-Bj8xIK5h.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./runtime-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./runtime-ByvaY-sA.js","./definition.vue_vue_type_script_setup_true_lang-ClY17iVd.js","./runtime-Dpy_UDRy.js","./runtime-DCftiZTY.js","./runtime-D9EdrQs6.js","./runtime-B3kAucV_.js","./runtime-DNEDM9BZ.js","./runtime-yP47ki_o.js","./runtime-D8qWgTCC.js","./item-BTENoFeS.js","./index-BZ2cMq0s.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(r){if(r.ep)return;r.ep=!0;const l=n(r);fetch(r.href,l)}})();function KR(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Uo={},i0=[],xd=()=>{},QG=()=>!1,ZT=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),e8=t=>t.startsWith("onUpdate:"),Ui=Object.assign,GR=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},wbe=Object.prototype.hasOwnProperty,cr=(t,e)=>wbe.call(t,e),Sn=Array.isArray,a0=t=>rw(t)==="[object Map]",ZG=t=>rw(t)==="[object Set]",oB=t=>rw(t)==="[object Date]",qn=t=>typeof t=="function",Gr=t=>typeof t=="string",Ts=t=>typeof t=="symbol",hr=t=>t!==null&&typeof t=="object",eY=t=>(hr(t)||qn(t))&&qn(t.then)&&qn(t.catch),tY=Object.prototype.toString,rw=t=>tY.call(t),kbe=t=>rw(t).slice(8,-1),nY=t=>rw(t)==="[object Object]",t8=t=>Gr(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,nx=KR(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),n8=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},Sbe=/-\w/g,Hl=n8(t=>t.replace(Sbe,e=>e.slice(1).toUpperCase())),Cbe=/\B([A-Z])/g,pp=n8(t=>t.replace(Cbe,"-$1").toLowerCase()),o8=n8(t=>t.charAt(0).toUpperCase()+t.slice(1)),s0=n8(t=>t?`on${o8(t)}`:""),Qi=(t,e)=>!Object.is(t,e),cS=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},oY=(t,e,n,o=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:o,value:n})},YR=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let rB;const r8=()=>rB||(rB=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vn(t){if(Sn(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],r=Gr(o)?Abe(o):vn(o);if(r)for(const l in r)e[l]=r[l]}return e}else if(Gr(t)||hr(t))return t}const $be=/;(?![^(]*\))/g,Tbe=/:([^]+)/,Ebe=/\/\*[^]*?\*\//g;function Abe(t){const e={};return t.replace(Ebe,"").split($be).forEach(n=>{if(n){const o=n.split(Tbe);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e}function nt(t){let e="";if(Gr(t))e=t;else if(Sn(t))for(let n=0;n<t.length;n++){const o=nt(t[n]);o&&(e+=o+" ")}else if(hr(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function tn(t){if(!t)return null;let{class:e,style:n}=t;return e&&!Gr(e)&&(t.class=nt(e)),n&&(t.style=vn(n)),t}const Dbe="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",zbe=KR(Dbe);function rY(t){return!!t||t===""}function Obe(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=JR(t[o],e[o]);return n}function JR(t,e){if(t===e)return!0;let n=oB(t),o=oB(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=Ts(t),o=Ts(e),n||o)return t===e;if(n=Sn(t),o=Sn(e),n||o)return n&&o?Obe(t,e):!1;if(n=hr(t),o=hr(e),n||o){if(!n||!o)return!1;const r=Object.keys(t).length,l=Object.keys(e).length;if(r!==l)return!1;for(const a in t){const u=t.hasOwnProperty(a),c=e.hasOwnProperty(a);if(u&&!c||!u&&c||!JR(t[a],e[a]))return!1}}return String(t)===String(e)}const lY=t=>!!(t&&t.__v_isRef===!0),A=t=>Gr(t)?t:t==null?"":Sn(t)||hr(t)&&(t.toString===tY||!qn(t.toString))?lY(t)?A(t.value):JSON.stringify(t,iY,2):String(t),iY=(t,e)=>lY(e)?iY(t,e.value):a0(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[o,r],l)=>(n[SA(o,l)+" =>"]=r,n),{})}:ZG(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>SA(n))}:Ts(e)?SA(e):hr(e)&&!Sn(e)&&!nY(e)?String(e):e,SA=(t,e="")=>{var n;return Ts(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let di;class aY{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&di&&(di.active?(this.parent=di,this.index=(di.scopes||(di.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=di;try{return di=this,e()}finally{di=n}}}on(){++this._on===1&&(this.prevScope=di,di=this)}off(){if(this._on>0&&--this._on===0){if(di===this)di=this.prevScope;else{let e=di;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Ly(t){return new aY(t)}function Jv(){return di}function Um(t,e=!1){di&&di.cleanups.push(t)}let Lr;const CA=new WeakSet;class sY{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,di&&(di.active?di.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,CA.has(this)&&(CA.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||cY(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,lB(this),dY(this);const e=Lr,n=tc;Lr=this,tc=!0;try{return this.fn()}finally{fY(this),Lr=e,tc=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ZR(e);this.deps=this.depsTail=void 0,lB(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?CA.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){uO(this)&&this.run()}get dirty(){return uO(this)}}let uY=0,ox,rx;function cY(t,e=!1){if(t.flags|=8,e){t.next=rx,rx=t;return}t.next=ox,ox=t}function XR(){uY++}function QR(){if(--uY>0)return;if(rx){let e=rx;for(rx=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;ox;){let e=ox;for(ox=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(o){t||(t=o)}e=n}}if(t)throw t}function dY(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function fY(t){let e,n=t.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),ZR(o),Mbe(o)):e=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}t.deps=e,t.depsTail=n}function uO(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(pY(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function pY(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ux)||(t.globalVersion=Ux,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!uO(t))))return;t.flags|=2;const e=t.dep,n=Lr,o=tc;Lr=t,tc=!0;try{dY(t);const r=t.fn(t._value);(e.version===0||Qi(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Lr=n,tc=o,fY(t),t.flags&=-3}}function ZR(t,e=!1){const{dep:n,prevSub:o,nextSub:r}=t;if(o&&(o.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=o,t.nextSub=void 0),n.subs===t&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)ZR(l,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Mbe(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let tc=!0;const mY=[];function Hf(){mY.push(tc),tc=!1}function Wf(){const t=mY.pop();tc=t===void 0?!0:t}function lB(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Lr;Lr=void 0;try{e()}finally{Lr=n}}}let Ux=0;class Ibe{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class l8{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Lr||!tc||Lr===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Lr)n=this.activeLink=new Ibe(Lr,this),Lr.deps?(n.prevDep=Lr.depsTail,Lr.depsTail.nextDep=n,Lr.depsTail=n):Lr.deps=Lr.depsTail=n,hY(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Lr.depsTail,n.nextDep=void 0,Lr.depsTail.nextDep=n,Lr.depsTail=n,Lr.deps===n&&(Lr.deps=o)}return n}trigger(e){this.version++,Ux++,this.notify(e)}notify(e){XR();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{QR()}}}function hY(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let o=e.deps;o;o=o.nextDep)hY(o)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const fC=new WeakMap,tv=Symbol(""),cO=Symbol(""),qx=Symbol("");function ya(t,e,n){if(tc&&Lr){let o=fC.get(t);o||fC.set(t,o=new Map);let r=o.get(n);r||(o.set(n,r=new l8),r.map=o,r.key=n),r.track()}}function bf(t,e,n,o,r,l){const a=fC.get(t);if(!a){Ux++;return}const u=c=>{c&&c.trigger()};if(XR(),e==="clear")a.forEach(u);else{const c=Sn(t),f=c&&t8(n);if(c&&n==="length"){const p=Number(o);a.forEach((m,h)=>{(h==="length"||h===qx||!Ts(h)&&h>=p)&&u(m)})}else switch((n!==void 0||a.has(void 0))&&u(a.get(n)),f&&u(a.get(qx)),e){case"add":c?f&&u(a.get("length")):(u(a.get(tv)),a0(t)&&u(a.get(cO)));break;case"delete":c||(u(a.get(tv)),a0(t)&&u(a.get(cO)));break;case"set":a0(t)&&u(a.get(tv));break}}QR()}function Rbe(t,e){const n=fC.get(t);return n&&n.get(e)}function $g(t){const e=bo(t);return e===t?e:(ya(e,"iterate",qx),ws(t)?e:e.map(ic))}function i8(t){return ya(t=bo(t),"iterate",qx),t}function Xc(t,e){return Kf(t)?N0(nv(t)?ic(e):e):ic(e)}const Vbe={__proto__:null,[Symbol.iterator](){return $A(this,Symbol.iterator,t=>Xc(this,t))},concat(...t){return $g(this).concat(...t.map(e=>Sn(e)?$g(e):e))},entries(){return $A(this,"entries",t=>(t[1]=Xc(this,t[1]),t))},every(t,e){return lf(this,"every",t,e,void 0,arguments)},filter(t,e){return lf(this,"filter",t,e,n=>n.map(o=>Xc(this,o)),arguments)},find(t,e){return lf(this,"find",t,e,n=>Xc(this,n),arguments)},findIndex(t,e){return lf(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return lf(this,"findLast",t,e,n=>Xc(this,n),arguments)},findLastIndex(t,e){return lf(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return lf(this,"forEach",t,e,void 0,arguments)},includes(...t){return TA(this,"includes",t)},indexOf(...t){return TA(this,"indexOf",t)},join(t){return $g(this).join(t)},lastIndexOf(...t){return TA(this,"lastIndexOf",t)},map(t,e){return lf(this,"map",t,e,void 0,arguments)},pop(){return Bb(this,"pop")},push(...t){return Bb(this,"push",t)},reduce(t,...e){return iB(this,"reduce",t,e)},reduceRight(t,...e){return iB(this,"reduceRight",t,e)},shift(){return Bb(this,"shift")},some(t,e){return lf(this,"some",t,e,void 0,arguments)},splice(...t){return Bb(this,"splice",t)},toReversed(){return $g(this).toReversed()},toSorted(t){return $g(this).toSorted(t)},toSpliced(...t){return $g(this).toSpliced(...t)},unshift(...t){return Bb(this,"unshift",t)},values(){return $A(this,"values",t=>Xc(this,t))}};function $A(t,e,n){const o=i8(t),r=o[e]();return o!==t&&!ws(t)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=n(l.value)),l}),r}const Pbe=Array.prototype;function lf(t,e,n,o,r,l){const a=i8(t),u=a!==t&&!ws(t),c=a[e];if(c!==Pbe[e]){const m=c.apply(t,l);return u?ic(m):m}let f=n;a!==t&&(u?f=function(m,h){return n.call(this,Xc(t,m),h,t)}:n.length>2&&(f=function(m,h){return n.call(this,m,h,t)}));const p=c.call(a,f,o);return u&&r?r(p):p}function iB(t,e,n,o){const r=i8(t),l=r!==t&&!ws(t);let a=n,u=!1;r!==t&&(l?(u=o.length===0,a=function(f,p,m){return u&&(u=!1,f=Xc(t,f)),n.call(this,f,Xc(t,p),m,t)}):n.length>3&&(a=function(f,p,m){return n.call(this,f,p,m,t)}));const c=r[e](a,...o);return u?Xc(t,c):c}function TA(t,e,n){const o=bo(t);ya(o,"iterate",qx);const r=o[e](...n);return(r===-1||r===!1)&&u8(n[0])?(n[0]=bo(n[0]),o[e](...n)):r}function Bb(t,e,n=[]){Hf(),XR();const o=bo(t)[e].apply(t,n);return QR(),Wf(),o}const Fbe=KR("__proto__,__v_isRef,__isVue"),vY=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ts));function Nbe(t){Ts(t)||(t=String(t));const e=bo(this);return ya(e,"has",t),e.hasOwnProperty(t)}class gY{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,o){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,l=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return l;if(n==="__v_raw")return o===(r?l?kY:wY:l?_Y:xY).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(o)?e:void 0;const a=Sn(e);if(!r){let c;if(a&&(c=Vbe[n]))return c;if(n==="hasOwnProperty")return Nbe}const u=Reflect.get(e,n,Kt(e)?e:o);if((Ts(n)?vY.has(n):Fbe(n))||(r||ya(e,"get",n),l))return u;if(Kt(u)){const c=a&&t8(n)?u:u.value;return r&&hr(c)?F0(c):c}return hr(u)?r?F0(u):ta(u):u}}class yY extends gY{constructor(e=!1){super(!1,e)}set(e,n,o,r){let l=e[n];const a=Sn(e)&&t8(n);if(!this._isShallow){const f=Kf(l);if(!ws(o)&&!Kf(o)&&(l=bo(l),o=bo(o)),!a&&Kt(l)&&!Kt(o))return f||(l.value=o),!0}const u=a?Number(n)<e.length:cr(e,n),c=Reflect.set(e,n,o,Kt(e)?e:r);return e===bo(r)&&(u?Qi(o,l)&&bf(e,"set",n,o):bf(e,"add",n,o)),c}deleteProperty(e,n){const o=cr(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&o&&bf(e,"delete",n,void 0),r}has(e,n){const o=Reflect.has(e,n);return(!Ts(n)||!vY.has(n))&&ya(e,"has",n),o}ownKeys(e){return ya(e,"iterate",Sn(e)?"length":tv),Reflect.ownKeys(e)}}class bY extends gY{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const Lbe=new yY,Bbe=new bY,Ube=new yY(!0),qbe=new bY(!0),dO=t=>t,O2=t=>Reflect.getPrototypeOf(t);function jbe(t,e,n){return function(...o){const r=this.__v_raw,l=bo(r),a=a0(l),u=t==="entries"||t===Symbol.iterator&&a,c=t==="keys"&&a,f=r[t](...o),p=n?dO:e?N0:ic;return!e&&ya(l,"iterate",c?cO:tv),Ui(Object.create(f),{next(){const{value:m,done:h}=f.next();return h?{value:m,done:h}:{value:u?[p(m[0]),p(m[1])]:p(m),done:h}}})}}function M2(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function Hbe(t,e){const n={get(r){const l=this.__v_raw,a=bo(l),u=bo(r);t||(Qi(r,u)&&ya(a,"get",r),ya(a,"get",u));const{has:c}=O2(a),f=e?dO:t?N0:ic;if(c.call(a,r))return f(l.get(r));if(c.call(a,u))return f(l.get(u));l!==a&&l.get(r)},get size(){const r=this.__v_raw;return!t&&ya(bo(r),"iterate",tv),r.size},has(r){const l=this.__v_raw,a=bo(l),u=bo(r);return t||(Qi(r,u)&&ya(a,"has",r),ya(a,"has",u)),r===u?l.has(r):l.has(r)||l.has(u)},forEach(r,l){const a=this,u=a.__v_raw,c=bo(u),f=e?dO:t?N0:ic;return!t&&ya(c,"iterate",tv),u.forEach((p,m)=>r.call(l,f(p),f(m),a))}};return Ui(n,t?{add:M2("add"),set:M2("set"),delete:M2("delete"),clear:M2("clear")}:{add(r){const l=bo(this),a=O2(l),u=bo(r),c=!e&&!ws(r)&&!Kf(r)?u:r;return a.has.call(l,c)||Qi(r,c)&&a.has.call(l,r)||Qi(u,c)&&a.has.call(l,u)||(l.add(c),bf(l,"add",c,c)),this},set(r,l){!e&&!ws(l)&&!Kf(l)&&(l=bo(l));const a=bo(this),{has:u,get:c}=O2(a);let f=u.call(a,r);f||(r=bo(r),f=u.call(a,r));const p=c.call(a,r);return a.set(r,l),f?Qi(l,p)&&bf(a,"set",r,l):bf(a,"add",r,l),this},delete(r){const l=bo(this),{has:a,get:u}=O2(l);let c=a.call(l,r);c||(r=bo(r),c=a.call(l,r)),u&&u.call(l,r);const f=l.delete(r);return c&&bf(l,"delete",r,void 0),f},clear(){const r=bo(this),l=r.size!==0,a=r.clear();return l&&bf(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=jbe(r,t,e)}),n}function a8(t,e){const n=Hbe(t,e);return(o,r,l)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?o:Reflect.get(cr(n,r)&&r in o?n:o,r,l)}const Wbe={get:a8(!1,!1)},Kbe={get:a8(!1,!0)},Gbe={get:a8(!0,!1)},Ybe={get:a8(!0,!0)},xY=new WeakMap,_Y=new WeakMap,wY=new WeakMap,kY=new WeakMap;function Jbe(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Xbe(t){return t.__v_skip||!Object.isExtensible(t)?0:Jbe(kbe(t))}function ta(t){return Kf(t)?t:s8(t,!1,Lbe,Wbe,xY)}function Qbe(t){return s8(t,!1,Ube,Kbe,_Y)}function F0(t){return s8(t,!0,Bbe,Gbe,wY)}function hf(t){return s8(t,!0,qbe,Ybe,kY)}function s8(t,e,n,o,r){if(!hr(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const l=Xbe(t);if(l===0)return t;const a=r.get(t);if(a)return a;const u=new Proxy(t,l===2?o:n);return r.set(t,u),u}function nv(t){return Kf(t)?nv(t.__v_raw):!!(t&&t.__v_isReactive)}function Kf(t){return!!(t&&t.__v_isReadonly)}function ws(t){return!!(t&&t.__v_isShallow)}function u8(t){return t?!!t.__v_raw:!1}function bo(t){const e=t&&t.__v_raw;return e?bo(e):t}function e5(t){return!cr(t,"__v_skip")&&Object.isExtensible(t)&&oY(t,"__v_skip",!0),t}const ic=t=>hr(t)?ta(t):t,N0=t=>hr(t)?F0(t):t;function Kt(t){return t?t.__v_isRef===!0:!1}function ue(t){return SY(t,!1)}function $n(t){return SY(t,!0)}function SY(t,e){return Kt(t)?t:new Zbe(t,e)}let Zbe=class{constructor(e,n){this.dep=new l8,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:bo(e),this._value=n?e:ic(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,o=this.__v_isShallow||ws(e)||Kf(e);e=o?e:bo(e),Qi(e,n)&&(this._rawValue=e,this._value=o?e:ic(e),this.dep.trigger())}};function pC(t){t.dep&&t.dep.trigger()}function i(t){return Kt(t)?t.value:t}function fo(t){return qn(t)?t():i(t)}const e1e={get:(t,e,n)=>e==="__v_raw"?t:i(Reflect.get(t,e,n)),set:(t,e,n,o)=>{const r=t[e];return Kt(r)&&!Kt(n)?(r.value=n,!0):Reflect.set(t,e,n,o)}};function CY(t){return nv(t)?t:new Proxy(t,e1e)}class t1e{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new l8,{get:o,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function lw(t){return new t1e(t)}function wo(t){const e=Sn(t)?new Array(t.length):{};for(const n in t)e[n]=$Y(t,n);return e}class n1e{constructor(e,n,o){this._object=e,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Ts(n)?n:String(n),this._raw=bo(e);let r=!0,l=e;if(!Sn(e)||Ts(this._key)||!t8(this._key))do r=!u8(l)||ws(l);while(r&&(l=l.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=i(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Kt(this._raw[this._key])){const n=this._object[this._key];if(Kt(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return Rbe(this._raw,this._key)}}class o1e{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function nm(t,e,n){return Kt(t)?t:qn(t)?new o1e(t):hr(t)&&arguments.length>1?$Y(t,e,n):ue(t)}function $Y(t,e,n){return new n1e(t,e,n)}class r1e{constructor(e,n,o){this.fn=e,this.setter=n,this._value=void 0,this.dep=new l8(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ux-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Lr!==this)return cY(this,!0),!0}get value(){const e=this.dep.track();return pY(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function l1e(t,e,n=!1){let o,r;return qn(t)?o=t:(o=t.get,r=t.set),new r1e(o,r,n)}const I2={},mC=new WeakMap;let Dh;function i1e(t,e=!1,n=Dh){if(n){let o=mC.get(n);o||mC.set(n,o=[]),o.push(t)}}function a1e(t,e,n=Uo){const{immediate:o,deep:r,once:l,scheduler:a,augmentJob:u,call:c}=n,f=w=>r?w:ws(w)||r===!1||r===0?xf(w,1):xf(w);let p,m,h,v,g=!1,b=!1;if(Kt(t)?(m=()=>t.value,g=ws(t)):nv(t)?(m=()=>f(t),g=!0):Sn(t)?(b=!0,g=t.some(w=>nv(w)||ws(w)),m=()=>t.map(w=>{if(Kt(w))return w.value;if(nv(w))return f(w);if(qn(w))return c?c(w,2):w()})):qn(t)?e?m=c?()=>c(t,2):t:m=()=>{if(h){Hf();try{h()}finally{Wf()}}const w=Dh;Dh=p;try{return c?c(t,3,[v]):t(v)}finally{Dh=w}}:m=xd,e&&r){const w=m,$=r===!0?1/0:r;m=()=>xf(w(),$)}const x=Jv(),y=()=>{p.stop(),x&&x.active&&GR(x.effects,p)};if(l&&e){const w=e;e=(...$)=>{w(...$),y()}}let _=b?new Array(t.length).fill(I2):I2;const k=w=>{if(!(!(p.flags&1)||!p.dirty&&!w))if(e){const $=p.run();if(r||g||(b?$.some((C,E)=>Qi(C,_[E])):Qi($,_))){h&&h();const C=Dh;Dh=p;try{const E=[$,_===I2?void 0:b&&_[0]===I2?[]:_,v];_=$,c?c(e,3,E):e(...E)}finally{Dh=C}}}else p.run()};return u&&u(k),p=new sY(m),p.scheduler=a?()=>a(k,!1):k,v=w=>i1e(w,!1,p),h=p.onStop=()=>{const w=mC.get(p);if(w){if(c)c(w,4);else for(const $ of w)$();mC.delete(p)}},e?o?k(!0):_=p.run():a?a(k.bind(null,!0),!0):p.run(),y.pause=p.pause.bind(p),y.resume=p.resume.bind(p),y.stop=y,y}function xf(t,e=1/0,n){if(e<=0||!hr(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Kt(t))xf(t.value,e,n);else if(Sn(t))for(let o=0;o<t.length;o++)xf(t[o],e,n);else if(ZG(t)||a0(t))t.forEach(o=>{xf(o,e,n)});else if(nY(t)){for(const o in t)xf(t[o],e,n);for(const o of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,o)&&xf(t[o],e,n)}return t}function iw(t,e,n,o){try{return o?t(...o):t()}catch(r){aw(r,e,n)}}function Od(t,e,n,o){if(qn(t)){const r=iw(t,e,n,o);return r&&eY(r)&&r.catch(l=>{aw(l,e,n)}),r}if(Sn(t)){const r=[];for(let l=0;l<t.length;l++)r.push(Od(t[l],e,n,o));return r}}function aw(t,e,n,o=!0){const r=e?e.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Uo;if(e){let u=e.parent;const c=e.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const p=u.ec;if(p){for(let m=0;m<p.length;m++)if(p[m](t,c,f)===!1)return}u=u.parent}if(l){Hf(),iw(l,null,10,[t,c,f]),Wf();return}}s1e(t,n,r,o,a)}function s1e(t,e,n,o=!0,r=!1){if(r)throw t;console.error(t)}const Ma=[];let Gc=-1;const u0=[];let Kp=null,Bg=0;const TY=Promise.resolve();let hC=null;function Vt(t){const e=hC||TY;return t?e.then(this?t.bind(this):t):e}function u1e(t){let e=Gc+1,n=Ma.length;for(;e<n;){const o=e+n>>>1,r=Ma[o],l=jx(r);l<t||l===t&&r.flags&2?e=o+1:n=o}return e}function t5(t){if(!(t.flags&1)){const e=jx(t),n=Ma[Ma.length-1];!n||!(t.flags&2)&&e>=jx(n)?Ma.push(t):Ma.splice(u1e(e),0,t),t.flags|=1,EY()}}function EY(){hC||(hC=TY.then(DY))}function c1e(t){Sn(t)?u0.push(...t):Kp&&t.id===-1?Kp.splice(Bg+1,0,t):t.flags&1||(u0.push(t),t.flags|=1),EY()}function aB(t,e,n=Gc+1){for(;n<Ma.length;n++){const o=Ma[n];if(o&&o.flags&2){if(t&&o.id!==t.uid)continue;Ma.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function AY(t){if(u0.length){const e=[...new Set(u0)].sort((n,o)=>jx(n)-jx(o));if(u0.length=0,Kp){Kp.push(...e);return}for(Kp=e,Bg=0;Bg<Kp.length;Bg++){const n=Kp[Bg];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Kp=null,Bg=0}}const jx=t=>t.id==null?t.flags&2?-1:1/0:t.id;function DY(t){try{for(Gc=0;Gc<Ma.length;Gc++){const e=Ma[Gc];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),iw(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Gc<Ma.length;Gc++){const e=Ma[Gc];e&&(e.flags&=-2)}Gc=-1,Ma.length=0,AY(),hC=null,(Ma.length||u0.length)&&DY()}}let na=null,zY=null;function vC(t){const e=na;return na=t,zY=t&&t.type.__scopeId||null,e}function d(t,e=na,n){if(!e||t._n)return t;const o=(...r)=>{o._d&&bC(-1);const l=vC(e);let a;try{a=t(...r)}finally{vC(l),o._d&&bC(1)}return a};return o._n=!0,o._c=!0,o._d=!0,o}function Ba(t,e){if(na===null)return t;const n=m8(na),o=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[l,a,u,c=Uo]=e[r];l&&(qn(l)&&(l={mounted:l,updated:l}),l.deep&&xf(a),o.push({dir:l,instance:n,value:a,oldValue:void 0,arg:u,modifiers:c}))}return t}function gh(t,e,n,o){const r=t.dirs,l=e&&e.dirs;for(let a=0;a<r.length;a++){const u=r[a];l&&(u.oldValue=l[a].value);let c=u.dir[o];c&&(Hf(),Od(c,n,8,[t.el,u,t,e]),Wf())}}function Tr(t,e){if(ea){let n=ea.provides;const o=ea.parent&&ea.parent.provides;o===n&&(n=ea.provides=Object.create(o)),n[t]=e}}function Yn(t,e,n=!1){const o=Yr();if(o||ov){let r=ov?ov._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&qn(e)?e.call(o&&o.proxy):e}}function OY(){return!!(Yr()||ov)}const d1e=Symbol.for("v-scx"),f1e=()=>Yn(d1e);function Hn(t,e){return sw(t,null,e)}function MY(t,e){return sw(t,null,{flush:"post"})}function IY(t,e){return sw(t,null,{flush:"sync"})}function Qe(t,e,n){return sw(t,e,n)}function sw(t,e,n=Uo){const{immediate:o,deep:r,flush:l,once:a}=n,u=Ui({},n),c=e&&o||!e&&l!=="post";let f;if(B0){if(l==="sync"){const v=f1e();f=v.__watcherHandles||(v.__watcherHandles=[])}else if(!c){const v=()=>{};return v.stop=xd,v.resume=xd,v.pause=xd,v}}const p=ea;u.call=(v,g,b)=>Od(v,p,g,b);let m=!1;l==="post"?u.scheduler=v=>{za(v,p&&p.suspense)}:l!=="sync"&&(m=!0,u.scheduler=(v,g)=>{g?v():t5(v)}),u.augmentJob=v=>{e&&(v.flags|=4),m&&(v.flags|=2,p&&(v.id=p.uid,v.i=p))};const h=a1e(t,e,u);return B0&&(f?f.push(h):c&&h()),h}function p1e(t,e,n){const o=this.proxy,r=Gr(t)?t.includes(".")?RY(o,t):()=>o[t]:t.bind(o,o);let l;qn(e)?l=e:(l=e.handler,n=e);const a=dw(this),u=sw(r,l.bind(o),n);return a(),u}function RY(t,e){const n=e.split(".");return()=>{let o=t;for(let r=0;r<n.length&&o;r++)o=o[n[r]];return o}}const qp=new WeakMap,VY=Symbol("_vte"),m1e=t=>t.__isTeleport,Lh=t=>t&&(t.disabled||t.disabled===""),h1e=t=>t&&(t.defer||t.defer===""),sB=t=>typeof SVGElement<"u"&&t instanceof SVGElement,uB=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,fO=(t,e)=>{const n=t&&t.to;return Gr(n)?e?e(n):null:n},v1e={name:"Teleport",__isTeleport:!0,process(t,e,n,o,r,l,a,u,c,f){const{mc:p,pc:m,pbc:h,o:{insert:v,querySelector:g,createText:b,createComment:x,parentNode:y}}=f,_=Lh(e.props);let{dynamicChildren:k}=e;const w=(E,z,N)=>{E.shapeFlag&16&&p(E.children,z,N,r,l,a,u,c)},$=(E=e)=>{const z=Lh(E.props),N=E.target=fO(E.props,g),P=pO(N,E,b,v);N&&(a!=="svg"&&sB(N)?a="svg":a!=="mathml"&&uB(N)&&(a="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(N),z||(w(E,N,P),E1(E,!1)))},C=E=>{const z=()=>{if(qp.get(E)===z){if(qp.delete(E),Lh(E.props)){const N=y(E.el)||n;w(E,N,E.anchor),E1(E,!0)}$(E)}};qp.set(E,z),za(z,l)};if(t==null){const E=e.el=b(""),z=e.anchor=b("");if(v(E,n,o),v(z,n,o),h1e(e.props)||l&&l.pendingBranch){C(e);return}_&&(w(e,n,z),E1(e,!0)),$()}else{e.el=t.el;const E=e.anchor=t.anchor,z=qp.get(t);if(z){z.flags|=8,qp.delete(t),C(e);return}e.targetStart=t.targetStart;const N=e.target=t.target,P=e.targetAnchor=t.targetAnchor,Q=Lh(t.props),W=Q?n:N,Z=Q?E:P;if(a==="svg"||sB(N)?a="svg":(a==="mathml"||uB(N))&&(a="mathml"),k?(h(t.dynamicChildren,k,W,r,l,a,u),s5(t,e,!0)):c||m(t,e,W,Z,r,l,a,u,!1),_)Q?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):R2(e,n,E,f,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const L=e.target=fO(e.props,g);L&&R2(e,L,null,f,0)}else Q&&R2(e,N,P,f,1);E1(e,_)}},remove(t,e,n,{um:o,o:{remove:r}},l){const{shapeFlag:a,children:u,anchor:c,targetStart:f,targetAnchor:p,target:m,props:h}=t;let v=l||!Lh(h);const g=qp.get(t);if(g&&(g.flags|=8,qp.delete(t),v=!1),m&&(r(f),r(p)),l&&r(c),a&16)for(let b=0;b<u.length;b++){const x=u[b];o(x,e,n,v,!!x.dynamicChildren)}},move:R2,hydrate:g1e};function R2(t,e,n,{o:{insert:o},m:r},l=2){l===0&&o(t.targetAnchor,e,n);const{el:a,anchor:u,shapeFlag:c,children:f,props:p}=t,m=l===2;if(m&&o(a,e,n),!qp.has(t)&&(!m||Lh(p))&&c&16)for(let h=0;h<f.length;h++)r(f[h],e,n,2);m&&o(u,e,n)}function g1e(t,e,n,o,r,l,{o:{nextSibling:a,parentNode:u,querySelector:c,insert:f,createText:p}},m){function h(x,y){let _=y;for(;_;){if(_&&_.nodeType===8){if(_.data==="teleport start anchor")e.targetStart=_;else if(_.data==="teleport anchor"){e.targetAnchor=_,x._lpa=e.targetAnchor&&a(e.targetAnchor);break}}_=a(_)}}function v(x,y){y.anchor=m(a(x),y,u(x),n,o,r,l)}const g=e.target=fO(e.props,c),b=Lh(e.props);if(g){const x=g._lpa||g.firstChild;e.shapeFlag&16&&(b?(v(t,e),h(g,x),e.targetAnchor||pO(g,e,p,f,u(t)===g?t:null)):(e.anchor=a(t),h(g,x),e.targetAnchor||pO(g,e,p,f),m(x&&a(x),e,g,n,o,r,l))),E1(e,b)}else b&&e.shapeFlag&16&&(v(t,e),e.targetStart=t,e.targetAnchor=a(t));return e.anchor&&a(e.anchor)}const uw=v1e;function E1(t,e){const n=t.ctx;if(n&&n.ut){let o,r;for(e?(o=t.el,r=t.anchor):(o=t.targetStart,r=t.targetAnchor);o&&o!==r;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function pO(t,e,n,o,r=null){const l=e.targetStart=n(""),a=e.targetAnchor=n("");return l[VY]=a,t&&(o(l,t,r),o(a,t,r)),a}const y1e=Symbol("_leaveCb");function n5(t,e){t.shapeFlag&6&&t.component?(t.transition=e,n5(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function ae(t,e){return qn(t)?Ui({name:t.name},e,{setup:t}):t}function PY(){const t=Yr();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function o5(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Xv(t){const e=Yr(),n=$n(null);if(e){const r=e.refs===Uo?e.refs={}:e.refs;Object.defineProperty(r,t,{enumerable:!0,get:()=>n.value,set:l=>n.value=l})}return n}function cB(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const gC=new WeakMap;function lx(t,e,n,o,r=!1){if(Sn(t)){t.forEach((b,x)=>lx(b,e&&(Sn(e)?e[x]:e),n,o,r));return}if(c0(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&lx(t,e,n,o.component.subTree);return}const l=o.shapeFlag&4?m8(o.component):o.el,a=r?null:l,{i:u,r:c}=t,f=e&&e.r,p=u.refs===Uo?u.refs={}:u.refs,m=u.setupState,h=bo(m),v=m===Uo?QG:b=>cB(p,b)?!1:cr(h,b),g=(b,x)=>!(x&&cB(p,x));if(f!=null&&f!==c){if(dB(e),Gr(f))p[f]=null,v(f)&&(m[f]=null);else if(Kt(f)){const b=e;g(f,b.k)&&(f.value=null),b.k&&(p[b.k]=null)}}if(qn(c))iw(c,u,12,[a,p]);else{const b=Gr(c),x=Kt(c);if(b||x){const y=()=>{if(t.f){const _=b?v(c)?m[c]:p[c]:g()||!t.k?c.value:p[t.k];if(r)Sn(_)&&GR(_,l);else if(Sn(_))_.includes(l)||_.push(l);else if(b)p[c]=[l],v(c)&&(m[c]=p[c]);else{const k=[l];g(c,t.k)&&(c.value=k),t.k&&(p[t.k]=k)}}else b?(p[c]=a,v(c)&&(m[c]=a)):x&&(g(c,t.k)&&(c.value=a),t.k&&(p[t.k]=a))};if(a){const _=()=>{y(),gC.delete(t)};_.id=-1,gC.set(t,_),za(_,n)}else dB(t),y()}}}function dB(t){const e=gC.get(t);e&&(e.flags|=8,gC.delete(t))}const fB=t=>t.nodeType===8;r8().requestIdleCallback;r8().cancelIdleCallback;function b1e(t,e){if(fB(t)&&t.data==="["){let n=1,o=t.nextSibling;for(;o;){if(o.nodeType===1){if(e(o)===!1)break}else if(fB(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else e(t)}const c0=t=>!!t.type.__asyncLoader;function Gf(t){qn(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,hydrate:l,timeout:a,suspensible:u=!0,onError:c}=t;let f=null,p,m=0;const h=()=>(m++,f=null,v()),v=()=>{let g;return f||(g=f=e().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),c)return new Promise((x,y)=>{c(b,()=>x(h()),()=>y(b),m+1)});throw b}).then(b=>g!==f&&f?f:(b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),p=b,b)))};return ae({name:"AsyncComponentWrapper",__asyncLoader:v,__asyncHydrate(g,b,x){let y=!1;(b.bu||(b.bu=[])).push(()=>y=!0);const _=()=>{y||x()},k=l?()=>{const w=l(_,$=>b1e(g,$));w&&(b.bum||(b.bum=[])).push(w)}:_;p?k():v().then(()=>!b.isUnmounted&&k())},get __asyncResolved(){return p},setup(){const g=ea;if(o5(g),p)return()=>V2(p,g);const b=k=>{f=null,aw(k,g,13,!o)};if(u&&g.suspense||B0)return v().then(k=>()=>V2(k,g)).catch(k=>(b(k),()=>o?s(o,{error:k}):null));const x=ue(!1),y=ue(),_=ue(!!r);return r&&setTimeout(()=>{_.value=!1},r),a!=null&&setTimeout(()=>{if(!x.value&&!y.value){const k=new Error(`Async component timed out after ${a}ms.`);b(k),y.value=k}},a),v().then(()=>{x.value=!0,g.parent&&r5(g.parent.vnode)&&g.parent.update()}).catch(k=>{b(k),y.value=k}),()=>{if(x.value&&p)return V2(p,g);if(y.value&&o)return s(o,{error:y.value});if(n&&!_.value)return V2(n,g)}}})}function V2(t,e){const{ref:n,props:o,children:r,ce:l}=e.vnode,a=s(t,o,r);return a.ref=n,a.ce=l,delete e.vnode.ce,a}const r5=t=>t.type.__isKeepAlive;function x1e(t,e){FY(t,"a",e)}function _1e(t,e){FY(t,"da",e)}function FY(t,e,n=ea){const o=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(c8(e,o,n),n){let r=n.parent;for(;r&&r.parent;)r5(r.parent.vnode)&&w1e(o,e,n,r),r=r.parent}}function w1e(t,e,n,o){const r=c8(e,t,o,!0);Xo(()=>{GR(o[e],r)},n)}function c8(t,e,n=ea,o=!1){if(n){const r=n[t]||(n[t]=[]),l=e.__weh||(e.__weh=(...a)=>{Hf();const u=dw(n),c=Od(e,n,t,a);return u(),Wf(),c});return o?r.unshift(l):r.push(l),l}}const mp=t=>(e,n=ea)=>{(!B0||t==="sp")&&c8(t,(...o)=>e(...o),n)},l5=mp("bm"),Ht=mp("m"),k1e=mp("bu"),d8=mp("u"),_r=mp("bum"),Xo=mp("um"),S1e=mp("sp"),C1e=mp("rtg"),$1e=mp("rtc");function T1e(t,e=ea){c8("ec",t,e)}const NY="components";function Md(t,e){return BY(NY,t,!0,e)||t}const LY=Symbol.for("v-ndc");function qo(t){return Gr(t)?BY(NY,t,!1)||t:t||LY}function BY(t,e,n=!0,o=!1){const r=na||ea;if(r){const l=r.type;{const u=axe(l,!1);if(u&&(u===e||u===Hl(e)||u===o8(Hl(e))))return l}const a=pB(r[t]||l[t],e)||pB(r.appContext[t],e);return!a&&o?l:a}}function pB(t,e){return t&&(t[e]||t[Hl(e)]||t[o8(Hl(e))])}function Ze(t,e,n,o){let r;const l=n&&n[o],a=Sn(t);if(a||Gr(t)){const u=a&&nv(t);let c=!1,f=!1;u&&(c=!ws(t),f=Kf(t),t=i8(t)),r=new Array(t.length);for(let p=0,m=t.length;p<m;p++)r[p]=e(c?f?N0(ic(t[p])):ic(t[p]):t[p],p,void 0,l&&l[p])}else if(typeof t=="number"){r=new Array(t);for(let u=0;u<t;u++)r[u]=e(u+1,u,void 0,l&&l[u])}else if(hr(t))if(t[Symbol.iterator])r=Array.from(t,(u,c)=>e(u,c,void 0,l&&l[c]));else{const u=Object.keys(t);r=new Array(u.length);for(let c=0,f=u.length;c<f;c++){const p=u[c];r[c]=e(t[p],p,c,l&&l[c])}}else r=[];return n&&(n[o]=r),r}function G(t,e){for(let n=0;n<e.length;n++){const o=e[n];if(Sn(o))for(let r=0;r<o.length;r++)t[o[r].name]=o[r].fn;else o&&(t[o.name]=o.key?(...r)=>{const l=o.fn(...r);return l&&(l.key=o.key),l}:o.fn)}return t}function we(t,e,n={},o,r){if(na.ce||na.parent&&c0(na.parent)&&na.parent.ce){const f=Object.keys(n).length>0;return e!=="default"&&(n.name=e),S(),B(Me,null,[s("slot",n,o&&o())],f?-2:64)}let l=t[e];l&&l._c&&(l._d=!1),S();const a=l&&UY(l(n)),u=n.key||a&&a.key,c=B(Me,{key:(u&&!Ts(u)?u:`_${e}`)+(!a&&o?"_fb":"")},a||(o?o():[]),a&&t._===1?64:-2);return!r&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),l&&l._c&&(l._d=!0),c}function UY(t){return t.some(e=>td(e)?!(e.type===ac||e.type===Me&&!UY(e.children)):!0)?t:null}function qY(t,e){const n={};for(const o in t)n[e&&/[A-Z]/.test(o)?`on:${o}`:s0(o)]=t[o];return n}const mO=t=>t?fJ(t)?m8(t):mO(t.parent):null,ix=Ui(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>mO(t.parent),$root:t=>mO(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>GY(t),$forceUpdate:t=>t.f||(t.f=()=>{t5(t.update)}),$nextTick:t=>t.n||(t.n=Vt.bind(t.proxy)),$watch:t=>p1e.bind(t)}),EA=(t,e)=>t!==Uo&&!t.__isScriptSetup&&cr(t,e),E1e={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:l,accessCache:a,type:u,appContext:c}=t;if(e[0]!=="$"){const h=a[e];if(h!==void 0)switch(h){case 1:return o[e];case 2:return r[e];case 4:return n[e];case 3:return l[e]}else{if(EA(o,e))return a[e]=1,o[e];if(r!==Uo&&cr(r,e))return a[e]=2,r[e];if(cr(l,e))return a[e]=3,l[e];if(n!==Uo&&cr(n,e))return a[e]=4,n[e];hO&&(a[e]=0)}}const f=ix[e];let p,m;if(f)return e==="$attrs"&&ya(t.attrs,"get",""),f(t);if((p=u.__cssModules)&&(p=p[e]))return p;if(n!==Uo&&cr(n,e))return a[e]=4,n[e];if(m=c.config.globalProperties,cr(m,e))return m[e]},set({_:t},e,n){const{data:o,setupState:r,ctx:l}=t;return EA(r,e)?(r[e]=n,!0):o!==Uo&&cr(o,e)?(o[e]=n,!0):cr(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(l[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,props:l,type:a}},u){let c;return!!(n[u]||t!==Uo&&u[0]!=="$"&&cr(t,u)||EA(e,u)||cr(l,u)||cr(o,u)||cr(ix,u)||cr(r.config.globalProperties,u)||(c=a.__cssModules)&&c[u])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:cr(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function f8(){return HY().slots}function jY(){return HY().attrs}function HY(t){const e=Yr();return e.setupContext||(e.setupContext=mJ(e))}function Hx(t){return Sn(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function WY(t,e){const n=Hx(t);for(const o in e){if(o.startsWith("__skip"))continue;let r=n[o];r?Sn(r)||qn(r)?r=n[o]={type:r,default:e[o]}:r.default=e[o]:r===null&&(r=n[o]={default:e[o]}),r&&e[`__skip_${o}`]&&(r.skipFactory=!0)}return n}function ml(t,e){return!t||!e?t||e:Sn(t)&&Sn(e)?t.concat(e):Ui({},Hx(t),Hx(e))}let hO=!0;function A1e(t){const e=GY(t),n=t.proxy,o=t.ctx;hO=!1,e.beforeCreate&&mB(e.beforeCreate,t,"bc");const{data:r,computed:l,methods:a,watch:u,provide:c,inject:f,created:p,beforeMount:m,mounted:h,beforeUpdate:v,updated:g,activated:b,deactivated:x,beforeDestroy:y,beforeUnmount:_,destroyed:k,unmounted:w,render:$,renderTracked:C,renderTriggered:E,errorCaptured:z,serverPrefetch:N,expose:P,inheritAttrs:Q,components:W,directives:Z,filters:L}=e;if(f&&D1e(f,o,null),a)for(const te in a){const ie=a[te];qn(ie)&&(o[te]=ie.bind(n))}if(r){const te=r.call(n,n);hr(te)&&(t.data=ta(te))}if(hO=!0,l)for(const te in l){const ie=l[te],ve=qn(ie)?ie.bind(n,n):qn(ie.get)?ie.get.bind(n,n):xd,ge=!qn(ie)&&qn(ie.set)?ie.set.bind(n):xd,$e=T({get:ve,set:ge});Object.defineProperty(o,te,{enumerable:!0,configurable:!0,get:()=>$e.value,set:le=>$e.value=le})}if(u)for(const te in u)KY(u[te],o,n,te);if(c){const te=qn(c)?c.call(n):c;Reflect.ownKeys(te).forEach(ie=>{Tr(ie,te[ie])})}p&&mB(p,t,"c");function j(te,ie){Sn(ie)?ie.forEach(ve=>te(ve.bind(n))):ie&&te(ie.bind(n))}if(j(l5,m),j(Ht,h),j(k1e,v),j(d8,g),j(x1e,b),j(_1e,x),j(T1e,z),j($1e,C),j(C1e,E),j(_r,_),j(Xo,w),j(S1e,N),Sn(P))if(P.length){const te=t.exposed||(t.exposed={});P.forEach(ie=>{Object.defineProperty(te,ie,{get:()=>n[ie],set:ve=>n[ie]=ve,enumerable:!0})})}else t.exposed||(t.exposed={});$&&t.render===xd&&(t.render=$),Q!=null&&(t.inheritAttrs=Q),W&&(t.components=W),Z&&(t.directives=Z),N&&o5(t)}function D1e(t,e,n=xd){Sn(t)&&(t=vO(t));for(const o in t){const r=t[o];let l;hr(r)?"default"in r?l=Yn(r.from||o,r.default,!0):l=Yn(r.from||o):l=Yn(r),Kt(l)?Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):e[o]=l}}function mB(t,e,n){Od(Sn(t)?t.map(o=>o.bind(e.proxy)):t.bind(e.proxy),e,n)}function KY(t,e,n,o){let r=o.includes(".")?RY(n,o):()=>n[o];if(Gr(t)){const l=e[t];qn(l)&&Qe(r,l)}else if(qn(t))Qe(r,t.bind(n));else if(hr(t))if(Sn(t))t.forEach(l=>KY(l,e,n,o));else{const l=qn(t.handler)?t.handler.bind(n):e[t.handler];qn(l)&&Qe(r,l,t)}}function GY(t){const e=t.type,{mixins:n,extends:o}=e,{mixins:r,optionsCache:l,config:{optionMergeStrategies:a}}=t.appContext,u=l.get(e);let c;return u?c=u:!r.length&&!n&&!o?c=e:(c={},r.length&&r.forEach(f=>yC(c,f,a,!0)),yC(c,e,a)),hr(e)&&l.set(e,c),c}function yC(t,e,n,o=!1){const{mixins:r,extends:l}=e;l&&yC(t,l,n,!0),r&&r.forEach(a=>yC(t,a,n,!0));for(const a in e)if(!(o&&a==="expose")){const u=z1e[a]||n&&n[a];t[a]=u?u(t[a],e[a]):e[a]}return t}const z1e={data:hB,props:vB,emits:vB,methods:A1,computed:A1,beforeCreate:Da,created:Da,beforeMount:Da,mounted:Da,beforeUpdate:Da,updated:Da,beforeDestroy:Da,beforeUnmount:Da,destroyed:Da,unmounted:Da,activated:Da,deactivated:Da,errorCaptured:Da,serverPrefetch:Da,components:A1,directives:A1,watch:M1e,provide:hB,inject:O1e};function hB(t,e){return e?t?function(){return Ui(qn(t)?t.call(this,this):t,qn(e)?e.call(this,this):e)}:e:t}function O1e(t,e){return A1(vO(t),vO(e))}function vO(t){if(Sn(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Da(t,e){return t?[...new Set([].concat(t,e))]:e}function A1(t,e){return t?Ui(Object.create(null),t,e):e}function vB(t,e){return t?Sn(t)&&Sn(e)?[...new Set([...t,...e])]:Ui(Object.create(null),Hx(t),Hx(e??{})):e}function M1e(t,e){if(!t)return e;if(!e)return t;const n=Ui(Object.create(null),t);for(const o in e)n[o]=Da(t[o],e[o]);return n}function YY(){return{app:null,config:{isNativeTag:QG,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let I1e=0;function R1e(t,e){return function(o,r=null){qn(o)||(o=Ui({},o)),r!=null&&!hr(r)&&(r=null);const l=YY(),a=new WeakSet,u=[];let c=!1;const f=l.app={_uid:I1e++,_component:o,_props:r,_container:null,_context:l,_instance:null,version:dxe,get config(){return l.config},set config(p){},use(p,...m){return a.has(p)||(p&&qn(p.install)?(a.add(p),p.install(f,...m)):qn(p)&&(a.add(p),p(f,...m))),f},mixin(p){return l.mixins.includes(p)||l.mixins.push(p),f},component(p,m){return m?(l.components[p]=m,f):l.components[p]},directive(p,m){return m?(l.directives[p]=m,f):l.directives[p]},mount(p,m,h){if(!c){const v=f._ceVNode||s(o,r);return v.appContext=l,h===!0?h="svg":h===!1&&(h=void 0),t(v,p,h),c=!0,f._container=p,p.__vue_app__=f,m8(v.component)}},onUnmount(p){u.push(p)},unmount(){c&&(Od(u,f._instance,16),t(null,f._container),delete f._container.__vue_app__)},provide(p,m){return l.provides[p]=m,f},runWithContext(p){const m=ov;ov=f;try{return p()}finally{ov=m}}};return f}}let ov=null;function xt(t,e,n=Uo){const o=Yr(),r=Hl(e),l=pp(e),a=JY(t,r),u=lw((c,f)=>{let p,m=Uo,h;return IY(()=>{const v=t[r];Qi(p,v)&&(p=v,f())}),{get(){return c(),n.get?n.get(p):p},set(v){const g=n.set?n.set(v):v;if(!Qi(g,p)&&!(m!==Uo&&Qi(v,m)))return;const b=o.vnode.props;b&&(e in b||r in b||l in b)&&(`onUpdate:${e}`in b||`onUpdate:${r}`in b||`onUpdate:${l}`in b)||(p=v,f()),o.emit(`update:${e}`,g),Qi(v,g)&&Qi(v,m)&&!Qi(g,h)&&f(),m=v,h=g}}});return u[Symbol.iterator]=()=>{let c=0;return{next(){return c<2?{value:c++?a||Uo:u,done:!1}:{done:!0}}}},u}const JY=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Hl(e)}Modifiers`]||t[`${pp(e)}Modifiers`];function V1e(t,e,...n){if(t.isUnmounted)return;const o=t.vnode.props||Uo;let r=n;const l=e.startsWith("update:"),a=l&&JY(o,e.slice(7));a&&(a.trim&&(r=n.map(p=>Gr(p)?p.trim():p)),a.number&&(r=n.map(YR)));let u,c=o[u=s0(e)]||o[u=s0(Hl(e))];!c&&l&&(c=o[u=s0(pp(e))]),c&&Od(c,t,6,r);const f=o[u+"Once"];if(f){if(!t.emitted)t.emitted={};else if(t.emitted[u])return;t.emitted[u]=!0,Od(f,t,6,r)}}const P1e=new WeakMap;function XY(t,e,n=!1){const o=n?P1e:e.emitsCache,r=o.get(t);if(r!==void 0)return r;const l=t.emits;let a={},u=!1;if(!qn(t)){const c=f=>{const p=XY(f,e,!0);p&&(u=!0,Ui(a,p))};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!l&&!u?(hr(t)&&o.set(t,null),null):(Sn(l)?l.forEach(c=>a[c]=null):Ui(a,l),hr(t)&&o.set(t,a),a)}function p8(t,e){return!t||!ZT(e)?!1:(e=e.slice(2).replace(/Once$/,""),cr(t,e[0].toLowerCase()+e.slice(1))||cr(t,pp(e))||cr(t,e))}function gB(t){const{type:e,vnode:n,proxy:o,withProxy:r,propsOptions:[l],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:m,data:h,setupState:v,ctx:g,inheritAttrs:b}=t,x=vC(t);let y,_;try{if(n.shapeFlag&4){const w=r||o,$=w;y=Qc(f.call($,w,p,m,v,h,g)),_=u}else{const w=e;y=Qc(w.length>1?w(m,{attrs:u,slots:a,emit:c}):w(m,null)),_=e.props?u:F1e(u)}}catch(w){ax.length=0,aw(w,t,1),y=s(ac)}let k=y;if(_&&b!==!1){const w=Object.keys(_),{shapeFlag:$}=k;w.length&&$&7&&(l&&w.some(e8)&&(_=N1e(_,l)),k=xm(k,_,!1,!0))}return n.dirs&&(k=xm(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition&&n5(k,n.transition),y=k,vC(x),y}const F1e=t=>{let e;for(const n in t)(n==="class"||n==="style"||ZT(n))&&((e||(e={}))[n]=t[n]);return e},N1e=(t,e)=>{const n={};for(const o in t)(!e8(o)||!(o.slice(9)in e))&&(n[o]=t[o]);return n};function L1e(t,e,n){const{props:o,children:r,component:l}=t,{props:a,children:u,patchFlag:c}=e,f=l.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return o?yB(o,a,f):!!a;if(c&8){const p=e.dynamicProps;for(let m=0;m<p.length;m++){const h=p[m];if(QY(a,o,h)&&!p8(f,h))return!0}}}else return(r||u)&&(!u||!u.$stable)?!0:o===a?!1:o?a?yB(o,a,f):!0:!!a;return!1}function yB(t,e,n){const o=Object.keys(e);if(o.length!==Object.keys(t).length)return!0;for(let r=0;r<o.length;r++){const l=o[r];if(QY(e,t,l)&&!p8(n,l))return!0}return!1}function QY(t,e,n){const o=t[n],r=e[n];return n==="style"&&hr(o)&&hr(r)?!JR(o,r):o!==r}function B1e({vnode:t,parent:e,suspense:n},o){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.suspense.vnode.el=r.el=o,t=r),r===t)(t=e.vnode).el=o,e=e.parent;else break}n&&n.activeBranch===t&&(n.vnode.el=o)}const ZY={},eJ=()=>Object.create(ZY),tJ=t=>Object.getPrototypeOf(t)===ZY;function U1e(t,e,n,o=!1){const r={},l=eJ();t.propsDefaults=Object.create(null),nJ(t,e,r,l);for(const a in t.propsOptions[0])a in r||(r[a]=void 0);n?t.props=o?r:Qbe(r):t.type.props?t.props=r:t.props=l,t.attrs=l}function q1e(t,e,n,o){const{props:r,attrs:l,vnode:{patchFlag:a}}=t,u=bo(r),[c]=t.propsOptions;let f=!1;if((o||a>0)&&!(a&16)){if(a&8){const p=t.vnode.dynamicProps;for(let m=0;m<p.length;m++){let h=p[m];if(p8(t.emitsOptions,h))continue;const v=e[h];if(c)if(cr(l,h))v!==l[h]&&(l[h]=v,f=!0);else{const g=Hl(h);r[g]=gO(c,u,g,v,t,!1)}else v!==l[h]&&(l[h]=v,f=!0)}}}else{nJ(t,e,r,l)&&(f=!0);let p;for(const m in u)(!e||!cr(e,m)&&((p=pp(m))===m||!cr(e,p)))&&(c?n&&(n[m]!==void 0||n[p]!==void 0)&&(r[m]=gO(c,u,m,void 0,t,!0)):delete r[m]);if(l!==u)for(const m in l)(!e||!cr(e,m))&&(delete l[m],f=!0)}f&&bf(t.attrs,"set","")}function nJ(t,e,n,o){const[r,l]=t.propsOptions;let a=!1,u;if(e)for(let c in e){if(nx(c))continue;const f=e[c];let p;r&&cr(r,p=Hl(c))?!l||!l.includes(p)?n[p]=f:(u||(u={}))[p]=f:p8(t.emitsOptions,c)||(!(c in o)||f!==o[c])&&(o[c]=f,a=!0)}if(l){const c=bo(n),f=u||Uo;for(let p=0;p<l.length;p++){const m=l[p];n[m]=gO(r,c,m,f[m],t,!cr(f,m))}}return a}function gO(t,e,n,o,r,l){const a=t[n];if(a!=null){const u=cr(a,"default");if(u&&o===void 0){const c=a.default;if(a.type!==Function&&!a.skipFactory&&qn(c)){const{propsDefaults:f}=r;if(n in f)o=f[n];else{const p=dw(r);o=f[n]=c.call(null,e),p()}}else o=c;r.ce&&r.ce._setProp(n,o)}a[0]&&(l&&!u?o=!1:a[1]&&(o===""||o===pp(n))&&(o=!0))}return o}const j1e=new WeakMap;function oJ(t,e,n=!1){const o=n?j1e:e.propsCache,r=o.get(t);if(r)return r;const l=t.props,a={},u=[];let c=!1;if(!qn(t)){const p=m=>{c=!0;const[h,v]=oJ(m,e,!0);Ui(a,h),v&&u.push(...v)};!n&&e.mixins.length&&e.mixins.forEach(p),t.extends&&p(t.extends),t.mixins&&t.mixins.forEach(p)}if(!l&&!c)return hr(t)&&o.set(t,i0),i0;if(Sn(l))for(let p=0;p<l.length;p++){const m=Hl(l[p]);bB(m)&&(a[m]=Uo)}else if(l)for(const p in l){const m=Hl(p);if(bB(m)){const h=l[p],v=a[m]=Sn(h)||qn(h)?{type:h}:Ui({},h),g=v.type;let b=!1,x=!0;if(Sn(g))for(let y=0;y<g.length;++y){const _=g[y],k=qn(_)&&_.name;if(k==="Boolean"){b=!0;break}else k==="String"&&(x=!1)}else b=qn(g)&&g.name==="Boolean";v[0]=b,v[1]=x,(b||cr(v,"default"))&&u.push(m)}}const f=[a,u];return hr(t)&&o.set(t,f),f}function bB(t){return t[0]!=="$"&&!nx(t)}const i5=t=>t==="_"||t==="_ctx"||t==="$stable",a5=t=>Sn(t)?t.map(Qc):[Qc(t)],H1e=(t,e,n)=>{if(e._n)return e;const o=d((...r)=>a5(e(...r)),n);return o._c=!1,o},rJ=(t,e,n)=>{const o=t._ctx;for(const r in t){if(i5(r))continue;const l=t[r];if(qn(l))e[r]=H1e(r,l,o);else if(l!=null){const a=a5(l);e[r]=()=>a}}},lJ=(t,e)=>{const n=a5(e);t.slots.default=()=>n},iJ=(t,e,n)=>{for(const o in e)(n||!i5(o))&&(t[o]=e[o])},W1e=(t,e,n)=>{const o=t.slots=eJ();if(t.vnode.shapeFlag&32){const r=e._;r?(iJ(o,e,n),n&&oY(o,"_",r,!0)):rJ(e,o)}else e&&lJ(t,e)},K1e=(t,e,n)=>{const{vnode:o,slots:r}=t;let l=!0,a=Uo;if(o.shapeFlag&32){const u=e._;u?n&&u===1?l=!1:iJ(r,e,n):(l=!e.$stable,rJ(e,r)),a=e}else e&&(lJ(t,e),a={default:1});if(l)for(const u in r)!i5(u)&&a[u]==null&&delete r[u]},za=Q1e;function G1e(t){return Y1e(t)}function Y1e(t,e){const n=r8();n.__VUE__=!0;const{insert:o,remove:r,patchProp:l,createElement:a,createText:u,createComment:c,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:v=xd,insertStaticContent:g}=t,b=(X,fe,ye,ce=null,pe=null,ke=null,se=void 0,me=null,ze=!!fe.dynamicChildren)=>{if(X===fe)return;X&&!Ub(X,fe)&&(ce=R(X),le(X,pe,ke,!0),X=null),fe.patchFlag===-2&&(ze=!1,fe.dynamicChildren=null);const{type:Ae,ref:Ee,shapeFlag:Ce}=fe;switch(Ae){case cw:x(X,fe,ye,ce);break;case ac:y(X,fe,ye,ce);break;case DA:X==null&&_(fe,ye,ce,se);break;case Me:W(X,fe,ye,ce,pe,ke,se,me,ze);break;default:Ce&1?$(X,fe,ye,ce,pe,ke,se,me,ze):Ce&6?Z(X,fe,ye,ce,pe,ke,se,me,ze):(Ce&64||Ce&128)&&Ae.process(X,fe,ye,ce,pe,ke,se,me,ze,q)}Ee!=null&&pe?lx(Ee,X&&X.ref,ke,fe||X,!fe):Ee==null&&X&&X.ref!=null&&lx(X.ref,null,ke,X,!0)},x=(X,fe,ye,ce)=>{if(X==null)o(fe.el=u(fe.children),ye,ce);else{const pe=fe.el=X.el;fe.children!==X.children&&f(pe,fe.children)}},y=(X,fe,ye,ce)=>{X==null?o(fe.el=c(fe.children||""),ye,ce):fe.el=X.el},_=(X,fe,ye,ce)=>{[X.el,X.anchor]=g(X.children,fe,ye,ce,X.el,X.anchor)},k=({el:X,anchor:fe},ye,ce)=>{let pe;for(;X&&X!==fe;)pe=h(X),o(X,ye,ce),X=pe;o(fe,ye,ce)},w=({el:X,anchor:fe})=>{let ye;for(;X&&X!==fe;)ye=h(X),r(X),X=ye;r(fe)},$=(X,fe,ye,ce,pe,ke,se,me,ze)=>{if(fe.type==="svg"?se="svg":fe.type==="math"&&(se="mathml"),X==null)C(fe,ye,ce,pe,ke,se,me,ze);else{const Ae=X.el&&X.el._isVueCE?X.el:null;try{Ae&&Ae._beginPatch(),N(X,fe,pe,ke,se,me,ze)}finally{Ae&&Ae._endPatch()}}},C=(X,fe,ye,ce,pe,ke,se,me)=>{let ze,Ae;const{props:Ee,shapeFlag:Ce,transition:xe,dirs:He}=X;if(ze=X.el=a(X.type,ke,Ee&&Ee.is,Ee),Ce&8?p(ze,X.children):Ce&16&&z(X.children,ze,null,ce,pe,AA(X,ke),se,me),He&&gh(X,null,ce,"created"),E(ze,X,X.scopeId,se,ce),Ee){for(const Ct in Ee)Ct!=="value"&&!nx(Ct)&&l(ze,Ct,null,Ee[Ct],ke,ce);"value"in Ee&&l(ze,"value",null,Ee.value,ke),(Ae=Ee.onVnodeBeforeMount)&&Mc(Ae,ce,X)}He&&gh(X,null,ce,"beforeMount");const ft=J1e(pe,xe);ft&&xe.beforeEnter(ze),o(ze,fe,ye),((Ae=Ee&&Ee.onVnodeMounted)||ft||He)&&za(()=>{Ae&&Mc(Ae,ce,X),ft&&xe.enter(ze),He&&gh(X,null,ce,"mounted")},pe)},E=(X,fe,ye,ce,pe)=>{if(ye&&v(X,ye),ce)for(let ke=0;ke<ce.length;ke++)v(X,ce[ke]);if(pe){let ke=pe.subTree;if(fe===ke||uJ(ke.type)&&(ke.ssContent===fe||ke.ssFallback===fe)){const se=pe.vnode;E(X,se,se.scopeId,se.slotScopeIds,pe.parent)}}},z=(X,fe,ye,ce,pe,ke,se,me,ze=0)=>{for(let Ae=ze;Ae<X.length;Ae++){const Ee=X[Ae]=me?vf(X[Ae]):Qc(X[Ae]);b(null,Ee,fe,ye,ce,pe,ke,se,me)}},N=(X,fe,ye,ce,pe,ke,se)=>{const me=fe.el=X.el;let{patchFlag:ze,dynamicChildren:Ae,dirs:Ee}=fe;ze|=X.patchFlag&16;const Ce=X.props||Uo,xe=fe.props||Uo;let He;if(ye&&yh(ye,!1),(He=xe.onVnodeBeforeUpdate)&&Mc(He,ye,fe,X),Ee&&gh(fe,X,ye,"beforeUpdate"),ye&&yh(ye,!0),(Ce.innerHTML&&xe.innerHTML==null||Ce.textContent&&xe.textContent==null)&&p(me,""),Ae?P(X.dynamicChildren,Ae,me,ye,ce,AA(fe,pe),ke):se||ie(X,fe,me,null,ye,ce,AA(fe,pe),ke,!1),ze>0){if(ze&16)Q(me,Ce,xe,ye,pe);else if(ze&2&&Ce.class!==xe.class&&l(me,"class",null,xe.class,pe),ze&4&&l(me,"style",Ce.style,xe.style,pe),ze&8){const ft=fe.dynamicProps;for(let Ct=0;Ct<ft.length;Ct++){const rn=ft[Ct],In=Ce[rn],Ue=xe[rn];(Ue!==In||rn==="value")&&l(me,rn,In,Ue,pe,ye)}}ze&1&&X.children!==fe.children&&p(me,fe.children)}else!se&&Ae==null&&Q(me,Ce,xe,ye,pe);((He=xe.onVnodeUpdated)||Ee)&&za(()=>{He&&Mc(He,ye,fe,X),Ee&&gh(fe,X,ye,"updated")},ce)},P=(X,fe,ye,ce,pe,ke,se)=>{for(let me=0;me<fe.length;me++){const ze=X[me],Ae=fe[me],Ee=ze.el&&(ze.type===Me||!Ub(ze,Ae)||ze.shapeFlag&198)?m(ze.el):ye;b(ze,Ae,Ee,null,ce,pe,ke,se,!0)}},Q=(X,fe,ye,ce,pe)=>{if(fe!==ye){if(fe!==Uo)for(const ke in fe)!nx(ke)&&!(ke in ye)&&l(X,ke,fe[ke],null,pe,ce);for(const ke in ye){if(nx(ke))continue;const se=ye[ke],me=fe[ke];se!==me&&ke!=="value"&&l(X,ke,me,se,pe,ce)}"value"in ye&&l(X,"value",fe.value,ye.value,pe)}},W=(X,fe,ye,ce,pe,ke,se,me,ze)=>{const Ae=fe.el=X?X.el:u(""),Ee=fe.anchor=X?X.anchor:u("");let{patchFlag:Ce,dynamicChildren:xe,slotScopeIds:He}=fe;He&&(me=me?me.concat(He):He),X==null?(o(Ae,ye,ce),o(Ee,ye,ce),z(fe.children||[],ye,Ee,pe,ke,se,me,ze)):Ce>0&&Ce&64&&xe&&X.dynamicChildren&&X.dynamicChildren.length===xe.length?(P(X.dynamicChildren,xe,ye,pe,ke,se,me),(fe.key!=null||pe&&fe===pe.subTree)&&s5(X,fe,!0)):ie(X,fe,ye,Ee,pe,ke,se,me,ze)},Z=(X,fe,ye,ce,pe,ke,se,me,ze)=>{fe.slotScopeIds=me,X==null?fe.shapeFlag&512?pe.ctx.activate(fe,ye,ce,se,ze):L(fe,ye,ce,pe,ke,se,ze):F(X,fe,ze)},L=(X,fe,ye,ce,pe,ke,se)=>{const me=X.component=oxe(X,ce,pe);if(r5(X)&&(me.ctx.renderer=q),rxe(me,!1,se),me.asyncDep){if(pe&&pe.registerDep(me,j,se),!X.el){const ze=me.subTree=s(ac);y(null,ze,fe,ye),X.placeholder=ze.el}}else j(me,X,fe,ye,pe,ke,se)},F=(X,fe,ye)=>{const ce=fe.component=X.component;if(L1e(X,fe,ye))if(ce.asyncDep&&!ce.asyncResolved){te(ce,fe,ye);return}else ce.next=fe,ce.update();else fe.el=X.el,ce.vnode=fe},j=(X,fe,ye,ce,pe,ke,se)=>{const me=()=>{if(X.isMounted){let{next:Ce,bu:xe,u:He,parent:ft,vnode:Ct}=X;{const Mt=aJ(X);if(Mt){Ce&&(Ce.el=Ct.el,te(X,Ce,se)),Mt.asyncDep.then(()=>{za(()=>{X.isUnmounted||Ae()},pe)});return}}let rn=Ce,In;yh(X,!1),Ce?(Ce.el=Ct.el,te(X,Ce,se)):Ce=Ct,xe&&cS(xe),(In=Ce.props&&Ce.props.onVnodeBeforeUpdate)&&Mc(In,ft,Ce,Ct),yh(X,!0);const Ue=gB(X),it=X.subTree;X.subTree=Ue,b(it,Ue,m(it.el),R(it),X,pe,ke),Ce.el=Ue.el,rn===null&&B1e(X,Ue.el),He&&za(He,pe),(In=Ce.props&&Ce.props.onVnodeUpdated)&&za(()=>Mc(In,ft,Ce,Ct),pe)}else{let Ce;const{el:xe,props:He}=fe,{bm:ft,m:Ct,parent:rn,root:In,type:Ue}=X,it=c0(fe);yh(X,!1),ft&&cS(ft),!it&&(Ce=He&&He.onVnodeBeforeMount)&&Mc(Ce,rn,fe),yh(X,!0);{In.ce&&In.ce._hasShadowRoot()&&In.ce._injectChildStyle(Ue,X.parent?X.parent.type:void 0);const Mt=X.subTree=gB(X);b(null,Mt,ye,ce,X,pe,ke),fe.el=Mt.el}if(Ct&&za(Ct,pe),!it&&(Ce=He&&He.onVnodeMounted)){const Mt=fe;za(()=>Mc(Ce,rn,Mt),pe)}(fe.shapeFlag&256||rn&&c0(rn.vnode)&&rn.vnode.shapeFlag&256)&&X.a&&za(X.a,pe),X.isMounted=!0,fe=ye=ce=null}};X.scope.on();const ze=X.effect=new sY(me);X.scope.off();const Ae=X.update=ze.run.bind(ze),Ee=X.job=ze.runIfDirty.bind(ze);Ee.i=X,Ee.id=X.uid,ze.scheduler=()=>t5(Ee),yh(X,!0),Ae()},te=(X,fe,ye)=>{fe.component=X;const ce=X.vnode.props;X.vnode=fe,X.next=null,q1e(X,fe.props,ce,ye),K1e(X,fe.children,ye),Hf(),aB(X),Wf()},ie=(X,fe,ye,ce,pe,ke,se,me,ze=!1)=>{const Ae=X&&X.children,Ee=X?X.shapeFlag:0,Ce=fe.children,{patchFlag:xe,shapeFlag:He}=fe;if(xe>0){if(xe&128){ge(Ae,Ce,ye,ce,pe,ke,se,me,ze);return}else if(xe&256){ve(Ae,Ce,ye,ce,pe,ke,se,me,ze);return}}He&8?(Ee&16&&Y(Ae,pe,ke),Ce!==Ae&&p(ye,Ce)):Ee&16?He&16?ge(Ae,Ce,ye,ce,pe,ke,se,me,ze):Y(Ae,pe,ke,!0):(Ee&8&&p(ye,""),He&16&&z(Ce,ye,ce,pe,ke,se,me,ze))},ve=(X,fe,ye,ce,pe,ke,se,me,ze)=>{X=X||i0,fe=fe||i0;const Ae=X.length,Ee=fe.length,Ce=Math.min(Ae,Ee);let xe;for(xe=0;xe<Ce;xe++){const He=fe[xe]=ze?vf(fe[xe]):Qc(fe[xe]);b(X[xe],He,ye,null,pe,ke,se,me,ze)}Ae>Ee?Y(X,pe,ke,!0,!1,Ce):z(fe,ye,ce,pe,ke,se,me,ze,Ce)},ge=(X,fe,ye,ce,pe,ke,se,me,ze)=>{let Ae=0;const Ee=fe.length;let Ce=X.length-1,xe=Ee-1;for(;Ae<=Ce&&Ae<=xe;){const He=X[Ae],ft=fe[Ae]=ze?vf(fe[Ae]):Qc(fe[Ae]);if(Ub(He,ft))b(He,ft,ye,null,pe,ke,se,me,ze);else break;Ae++}for(;Ae<=Ce&&Ae<=xe;){const He=X[Ce],ft=fe[xe]=ze?vf(fe[xe]):Qc(fe[xe]);if(Ub(He,ft))b(He,ft,ye,null,pe,ke,se,me,ze);else break;Ce--,xe--}if(Ae>Ce){if(Ae<=xe){const He=xe+1,ft=He<Ee?fe[He].el:ce;for(;Ae<=xe;)b(null,fe[Ae]=ze?vf(fe[Ae]):Qc(fe[Ae]),ye,ft,pe,ke,se,me,ze),Ae++}}else if(Ae>xe)for(;Ae<=Ce;)le(X[Ae],pe,ke,!0),Ae++;else{const He=Ae,ft=Ae,Ct=new Map;for(Ae=ft;Ae<=xe;Ae++){const dn=fe[Ae]=ze?vf(fe[Ae]):Qc(fe[Ae]);dn.key!=null&&Ct.set(dn.key,Ae)}let rn,In=0;const Ue=xe-ft+1;let it=!1,Mt=0;const zt=new Array(Ue);for(Ae=0;Ae<Ue;Ae++)zt[Ae]=0;for(Ae=He;Ae<=Ce;Ae++){const dn=X[Ae];if(In>=Ue){le(dn,pe,ke,!0);continue}let An;if(dn.key!=null)An=Ct.get(dn.key);else for(rn=ft;rn<=xe;rn++)if(zt[rn-ft]===0&&Ub(dn,fe[rn])){An=rn;break}An===void 0?le(dn,pe,ke,!0):(zt[An-ft]=Ae+1,An>=Mt?Mt=An:it=!0,b(dn,fe[An],ye,null,pe,ke,se,me,ze),In++)}const mt=it?X1e(zt):i0;for(rn=mt.length-1,Ae=Ue-1;Ae>=0;Ae--){const dn=ft+Ae,An=fe[dn],Sr=fe[dn+1],Ea=dn+1<Ee?Sr.el||sJ(Sr):ce;zt[Ae]===0?b(null,An,ye,Ea,pe,ke,se,me,ze):it&&(rn<0||Ae!==mt[rn]?$e(An,ye,Ea,2):rn--)}}},$e=(X,fe,ye,ce,pe=null)=>{const{el:ke,type:se,transition:me,children:ze,shapeFlag:Ae}=X;if(Ae&6){$e(X.component.subTree,fe,ye,ce);return}if(Ae&128){X.suspense.move(fe,ye,ce);return}if(Ae&64){se.move(X,fe,ye,q);return}if(se===Me){o(ke,fe,ye);for(let Ce=0;Ce<ze.length;Ce++)$e(ze[Ce],fe,ye,ce);o(X.anchor,fe,ye);return}if(se===DA){k(X,fe,ye);return}if(ce!==2&&Ae&1&&me)if(ce===0)me.beforeEnter(ke),o(ke,fe,ye),za(()=>me.enter(ke),pe);else{const{leave:Ce,delayLeave:xe,afterLeave:He}=me,ft=()=>{X.ctx.isUnmounted?r(ke):o(ke,fe,ye)},Ct=()=>{ke._isLeaving&&ke[y1e](!0),Ce(ke,()=>{ft(),He&&He()})};xe?xe(ke,ft,Ct):Ct()}else o(ke,fe,ye)},le=(X,fe,ye,ce=!1,pe=!1)=>{const{type:ke,props:se,ref:me,children:ze,dynamicChildren:Ae,shapeFlag:Ee,patchFlag:Ce,dirs:xe,cacheIndex:He,memo:ft}=X;if(Ce===-2&&(pe=!1),me!=null&&(Hf(),lx(me,null,ye,X,!0),Wf()),He!=null&&(fe.renderCache[He]=void 0),Ee&256){fe.ctx.deactivate(X);return}const Ct=Ee&1&&xe,rn=!c0(X);let In;if(rn&&(In=se&&se.onVnodeBeforeUnmount)&&Mc(In,fe,X),Ee&6)K(X.component,ye,ce);else{if(Ee&128){X.suspense.unmount(ye,ce);return}Ct&&gh(X,null,fe,"beforeUnmount"),Ee&64?X.type.remove(X,fe,ye,q,ce):Ae&&!Ae.hasOnce&&(ke!==Me||Ce>0&&Ce&64)?Y(Ae,fe,ye,!1,!0):(ke===Me&&Ce&384||!pe&&Ee&16)&&Y(ze,fe,ye),ce&&ee(X)}const Ue=ft!=null&&He==null;(rn&&(In=se&&se.onVnodeUnmounted)||Ct||Ue)&&za(()=>{In&&Mc(In,fe,X),Ct&&gh(X,null,fe,"unmounted"),Ue&&(X.el=null)},ye)},ee=X=>{const{type:fe,el:ye,anchor:ce,transition:pe}=X;if(fe===Me){oe(ye,ce);return}if(fe===DA){w(X);return}const ke=()=>{r(ye),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(X.shapeFlag&1&&pe&&!pe.persisted){const{leave:se,delayLeave:me}=pe,ze=()=>se(ye,ke);me?me(X.el,ke,ze):ze()}else ke()},oe=(X,fe)=>{let ye;for(;X!==fe;)ye=h(X),r(X),X=ye;r(fe)},K=(X,fe,ye)=>{const{bum:ce,scope:pe,job:ke,subTree:se,um:me,m:ze,a:Ae}=X;xB(ze),xB(Ae),ce&&cS(ce),pe.stop(),ke&&(ke.flags|=8,le(se,X,fe,ye)),me&&za(me,fe),za(()=>{X.isUnmounted=!0},fe)},Y=(X,fe,ye,ce=!1,pe=!1,ke=0)=>{for(let se=ke;se<X.length;se++)le(X[se],fe,ye,ce,pe)},R=X=>{if(X.shapeFlag&6)return R(X.component.subTree);if(X.shapeFlag&128)return X.suspense.next();const fe=h(X.anchor||X.el),ye=fe&&fe[VY];return ye?h(ye):fe};let U=!1;const V=(X,fe,ye)=>{let ce;X==null?fe._vnode&&(le(fe._vnode,null,null,!0),ce=fe._vnode.component):b(fe._vnode||null,X,fe,null,null,null,ye),fe._vnode=X,U||(U=!0,aB(ce),AY(),U=!1)},q={p:b,um:le,m:$e,r:ee,mt:L,mc:z,pc:ie,pbc:P,n:R,o:t};return{render:V,hydrate:void 0,createApp:R1e(V)}}function AA({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function yh({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function J1e(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function s5(t,e,n=!1){const o=t.children,r=e.children;if(Sn(o)&&Sn(r))for(let l=0;l<o.length;l++){const a=o[l];let u=r[l];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=r[l]=vf(r[l]),u.el=a.el),!n&&u.patchFlag!==-2&&s5(a,u)),u.type===cw&&(u.patchFlag===-1&&(u=r[l]=vf(u)),u.el=a.el),u.type===ac&&!u.el&&(u.el=a.el)}}function X1e(t){const e=t.slice(),n=[0];let o,r,l,a,u;const c=t.length;for(o=0;o<c;o++){const f=t[o];if(f!==0){if(r=n[n.length-1],t[r]<f){e[o]=r,n.push(o);continue}for(l=0,a=n.length-1;l<a;)u=l+a>>1,t[n[u]]<f?l=u+1:a=u;f<t[n[l]]&&(l>0&&(e[o]=n[l-1]),n[l]=o)}}for(l=n.length,a=n[l-1];l-- >0;)n[l]=a,a=e[a];return n}function aJ(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:aJ(e)}function xB(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function sJ(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?sJ(e.subTree):null}const uJ=t=>t.__isSuspense;function Q1e(t,e){e&&e.pendingBranch?Sn(t)?e.effects.push(...t):e.effects.push(t):c1e(t)}const Me=Symbol.for("v-fgt"),cw=Symbol.for("v-txt"),ac=Symbol.for("v-cmt"),DA=Symbol.for("v-stc"),ax=[];let Ra=null;function S(t=!1){ax.push(Ra=t?null:[])}function Z1e(){ax.pop(),Ra=ax[ax.length-1]||null}let L0=1;function bC(t,e=!1){L0+=t,t<0&&Ra&&e&&(Ra.hasOnce=!0)}function cJ(t){return t.dynamicChildren=L0>0?Ra||i0:null,Z1e(),L0>0&&Ra&&Ra.push(t),t}function J(t,e,n,o,r,l){return cJ(H(t,e,n,o,r,l,!0))}function B(t,e,n,o,r){return cJ(s(t,e,n,o,r,!0))}function td(t){return t?t.__v_isVNode===!0:!1}function Ub(t,e){return t.type===e.type&&t.key===e.key}const dJ=({key:t})=>t??null,dS=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Gr(t)||Kt(t)||qn(t)?{i:na,r:t,k:e,f:!!n}:t:null);function H(t,e=null,n=null,o=0,r=null,l=t===Me?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&dJ(e),ref:e&&dS(e),scopeId:zY,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:na};return u?(u5(c,n),l&128&&t.normalize(c)):n&&(c.shapeFlag|=Gr(n)?8:16),L0>0&&!a&&Ra&&(c.patchFlag>0||l&6)&&c.patchFlag!==32&&Ra.push(c),c}const s=exe;function exe(t,e=null,n=null,o=0,r=null,l=!1){if((!t||t===LY)&&(t=ac),td(t)){const u=xm(t,e,!0);return n&&u5(u,n),L0>0&&!l&&Ra&&(u.shapeFlag&6?Ra[Ra.indexOf(t)]=u:Ra.push(u)),u.patchFlag=-2,u}if(sxe(t)&&(t=t.__vccOpts),e){e=un(e);let{class:u,style:c}=e;u&&!Gr(u)&&(e.class=nt(u)),hr(c)&&(u8(c)&&!Sn(c)&&(c=Ui({},c)),e.style=vn(c))}const a=Gr(t)?1:uJ(t)?128:m1e(t)?64:hr(t)?4:qn(t)?2:0;return H(t,e,n,o,r,a,l,!0)}function un(t){return t?u8(t)||tJ(t)?Ui({},t):t:null}function xm(t,e,n=!1,o=!1){const{props:r,ref:l,patchFlag:a,children:u,transition:c}=t,f=e?Be(r||{},e):r,p={__v_isVNode:!0,__v_skip:!0,type:t.type,props:f,key:f&&dJ(f),ref:e&&e.ref?n&&l?Sn(l)?l.concat(dS(e)):[l,dS(e)]:dS(e):l,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:u,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Me?a===-1?16:a|16:a,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&xm(t.ssContent),ssFallback:t.ssFallback&&xm(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&o&&n5(p,c.clone(p)),p}function D(t=" ",e=0){return s(cw,null,t,e)}function be(t="",e=!1){return e?(S(),B(ac,null,t)):s(ac,null,t)}function Qc(t){return t==null||typeof t=="boolean"?s(ac):Sn(t)?s(Me,null,t.slice()):td(t)?vf(t):s(cw,null,String(t))}function vf(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:xm(t)}function u5(t,e){let n=0;const{shapeFlag:o}=t;if(e==null)e=null;else if(Sn(e))n=16;else if(typeof e=="object")if(o&65){const r=e.default;r&&(r._c&&(r._d=!1),u5(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!tJ(e)?e._ctx=na:r===3&&na&&(na.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else qn(e)?(e={default:e,_ctx:na},n=32):(e=String(e),o&64?(n=16,e=[D(e)]):n=8);t.children=e,t.shapeFlag|=n}function Be(...t){const e={};for(let n=0;n<t.length;n++){const o=t[n];for(const r in o)if(r==="class")e.class!==o.class&&(e.class=nt([e.class,o.class]));else if(r==="style")e.style=vn([e.style,o.style]);else if(ZT(r)){const l=e[r],a=o[r];a&&l!==a&&!(Sn(l)&&l.includes(a))?e[r]=l?[].concat(l,a):a:a==null&&l==null&&!e8(r)&&(e[r]=a)}else r!==""&&(e[r]=o[r])}return e}function Mc(t,e,n,o=null){Od(t,e,7,[n,o])}const txe=YY();let nxe=0;function oxe(t,e,n){const o=t.type,r=(e?e.appContext:t.appContext)||txe,l={uid:nxe++,vnode:t,type:o,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new aY(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:oJ(o,r),emitsOptions:XY(o,r),emit:null,emitted:null,propsDefaults:Uo,inheritAttrs:o.inheritAttrs,ctx:Uo,data:Uo,props:Uo,attrs:Uo,slots:Uo,refs:Uo,setupState:Uo,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=e?e.root:l,l.emit=V1e.bind(null,l),t.ce&&t.ce(l),l}let ea=null;const Yr=()=>ea||na;let xC,yO;{const t=r8(),e=(n,o)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(o),l=>{r.length>1?r.forEach(a=>a(l)):r[0](l)}};xC=e("__VUE_INSTANCE_SETTERS__",n=>ea=n),yO=e("__VUE_SSR_SETTERS__",n=>B0=n)}const dw=t=>{const e=ea;return xC(t),t.scope.on(),()=>{t.scope.off(),xC(e)}},_B=()=>{ea&&ea.scope.off(),xC(null)};function fJ(t){return t.vnode.shapeFlag&4}let B0=!1;function rxe(t,e=!1,n=!1){e&&yO(e);const{props:o,children:r}=t.vnode,l=fJ(t);U1e(t,o,l,e),W1e(t,r,n||e);const a=l?lxe(t,e):void 0;return e&&yO(!1),a}function lxe(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,E1e);const{setup:o}=n;if(o){Hf();const r=t.setupContext=o.length>1?mJ(t):null,l=dw(t),a=iw(o,t,0,[t.props,r]),u=eY(a);if(Wf(),l(),(u||t.sp)&&!c0(t)&&o5(t),u){if(a.then(_B,_B),e)return a.then(c=>{wB(t,c)}).catch(c=>{aw(c,t,0)});t.asyncDep=a}else wB(t,a)}else pJ(t)}function wB(t,e,n){qn(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:hr(e)&&(t.setupState=CY(e)),pJ(t)}function pJ(t,e,n){const o=t.type;t.render||(t.render=o.render||xd);{const r=dw(t);Hf();try{A1e(t)}finally{Wf(),r()}}}const ixe={get(t,e){return ya(t,"get",""),t[e]}};function mJ(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,ixe),slots:t.slots,emit:t.emit,expose:e}}function m8(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(CY(e5(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in ix)return ix[n](t)},has(e,n){return n in e||n in ix}})):t.proxy}function axe(t,e=!0){return qn(t)?t.displayName||t.name:t.name||e&&t.__name}function sxe(t){return qn(t)&&"__vccOpts"in t}const T=(t,e)=>l1e(t,e,B0);function jo(t,e,n){try{bC(-1);const o=arguments.length;return o===2?hr(e)&&!Sn(e)?td(e)?s(t,null,[e]):s(t,e):s(t,null,e):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&td(n)&&(n=[n]),s(t,e,n))}finally{bC(1)}}function uxe(t,e,n,o){const r=n[o];if(r&&cxe(r,t))return r;const l=e();return l.memo=t.slice(),l.cacheIndex=o,n[o]=l}function cxe(t,e){const n=t.memo;if(n.length!=e.length)return!1;for(let o=0;o<n.length;o++)if(Qi(n[o],e[o]))return!1;return L0>0&&Ra&&Ra.push(t),!0}const dxe="3.5.34";let bO;const kB=typeof window<"u"&&window.trustedTypes;if(kB)try{bO=kB.createPolicy("vue",{createHTML:t=>t})}catch{}const hJ=bO?t=>bO.createHTML(t):t=>t,fxe="http://www.w3.org/2000/svg",pxe="http://www.w3.org/1998/Math/MathML",pf=typeof document<"u"?document:null,SB=pf&&pf.createElement("template"),mxe={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,o)=>{const r=e==="svg"?pf.createElementNS(fxe,t):e==="mathml"?pf.createElementNS(pxe,t):n?pf.createElement(t,{is:n}):pf.createElement(t);return t==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:t=>pf.createTextNode(t),createComment:t=>pf.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>pf.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,o,r,l){const a=n?n.previousSibling:e.lastChild;if(r&&(r===l||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===l||!(r=r.nextSibling)););else{SB.innerHTML=hJ(o==="svg"?`<svg>${t}</svg>`:o==="mathml"?`<math>${t}</math>`:t);const u=SB.content;if(o==="svg"||o==="mathml"){const c=u.firstChild;for(;c.firstChild;)u.appendChild(c.firstChild);u.removeChild(c)}e.insertBefore(u,n)}return[a?a.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},hxe=Symbol("_vtc");function vxe(t,e,n){const o=t[hxe];o&&(e=(e?[e,...o]:[...o]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const _C=Symbol("_vod"),vJ=Symbol("_vsh"),c5={name:"show",beforeMount(t,{value:e},{transition:n}){t[_C]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):qb(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:o}){!e!=!n&&(o?e?(o.beforeEnter(t),qb(t,!0),o.enter(t)):o.leave(t,()=>{qb(t,!1)}):qb(t,e))},beforeUnmount(t,{value:e}){qb(t,e)}};function qb(t,e){t.style.display=e?t[_C]:"none",t[vJ]=!e}const gxe=Symbol(""),yxe=/(?:^|;)\s*display\s*:/;function bxe(t,e,n){const o=t.style,r=Gr(n);let l=!1;if(n&&!r){if(e)if(Gr(e))for(const a of e.split(";")){const u=a.slice(0,a.indexOf(":")).trim();n[u]==null&&D1(o,u,"")}else for(const a in e)n[a]==null&&D1(o,a,"");for(const a in n){a==="display"&&(l=!0);const u=n[a];u!=null?_xe(t,a,!Gr(e)&&e?e[a]:void 0,u)||D1(o,a,u):D1(o,a,"")}}else if(r){if(e!==n){const a=o[gxe];a&&(n+=";"+a),o.cssText=n,l=yxe.test(n)}}else e&&t.removeAttribute("style");_C in t&&(t[_C]=l?o.display:"",t[vJ]&&(o.display="none"))}const CB=/\s*!important$/;function D1(t,e,n){if(Sn(n))n.forEach(o=>D1(t,e,o));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const o=xxe(t,e);CB.test(n)?t.setProperty(pp(o),n.replace(CB,""),"important"):t[o]=n}}const $B=["Webkit","Moz","ms"],zA={};function xxe(t,e){const n=zA[e];if(n)return n;let o=Hl(e);if(o!=="filter"&&o in t)return zA[e]=o;o=o8(o);for(let r=0;r<$B.length;r++){const l=$B[r]+o;if(l in t)return zA[e]=l}return e}function _xe(t,e,n,o){return t.tagName==="TEXTAREA"&&(e==="width"||e==="height")&&Gr(o)&&n===o}const TB="http://www.w3.org/1999/xlink";function EB(t,e,n,o,r,l=zbe(e)){o&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(TB,e.slice(6,e.length)):t.setAttributeNS(TB,e,n):n==null||l&&!rY(n)?t.removeAttribute(e):t.setAttribute(e,l?"":Ts(n)?String(n):n)}function AB(t,e,n,o,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?hJ(n):n);return}const l=t.tagName;if(e==="value"&&l!=="PROGRESS"&&!l.includes("-")){const u=l==="OPTION"?t.getAttribute("value")||"":t.value,c=n==null?t.type==="checkbox"?"on":"":String(n);(u!==c||!("_value"in t))&&(t.value=c),n==null&&t.removeAttribute(e),t._value=n;return}let a=!1;if(n===""||n==null){const u=typeof t[e];u==="boolean"?n=rY(n):n==null&&u==="string"?(n="",a=!0):u==="number"&&(n=0,a=!0)}try{t[e]=n}catch{}a&&t.removeAttribute(r||e)}function Ug(t,e,n,o){t.addEventListener(e,n,o)}function wxe(t,e,n,o){t.removeEventListener(e,n,o)}const DB=Symbol("_vei");function kxe(t,e,n,o,r=null){const l=t[DB]||(t[DB]={}),a=l[e];if(o&&a)a.value=o;else{const[u,c]=Sxe(e);if(o){const f=l[e]=Txe(o,r);Ug(t,u,f,c)}else a&&(wxe(t,u,a,c),l[e]=void 0)}}const zB=/(?:Once|Passive|Capture)$/;function Sxe(t){let e;if(zB.test(t)){e={};let o;for(;o=t.match(zB);)t=t.slice(0,t.length-o[0].length),e[o[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):pp(t.slice(2)),e]}let OA=0;const Cxe=Promise.resolve(),$xe=()=>OA||(Cxe.then(()=>OA=0),OA=Date.now());function Txe(t,e){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;Od(Exe(o,n.value),e,5,[o])};return n.value=t,n.attached=$xe(),n}function Exe(t,e){if(Sn(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(o=>r=>!r._stopped&&o&&o(r))}else return e}const OB=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Axe=(t,e,n,o,r,l)=>{const a=r==="svg";e==="class"?vxe(t,o,a):e==="style"?bxe(t,n,o):ZT(e)?e8(e)||kxe(t,e,n,o,l):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Dxe(t,e,o,a))?(AB(t,e,o),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&EB(t,e,o,a,l,e!=="value")):t._isVueCE&&(zxe(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!Gr(o)))?AB(t,Hl(e),o,l,e):(e==="true-value"?t._trueValue=o:e==="false-value"&&(t._falseValue=o),EB(t,e,o,a))};function Dxe(t,e,n,o){if(o)return!!(e==="innerHTML"||e==="textContent"||e in t&&OB(e)&&qn(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return OB(e)&&Gr(n)?!1:e in t}function zxe(t,e){const n=t._def.props;if(!n)return!1;const o=Hl(e);return Array.isArray(n)?n.some(r=>Hl(r)===o):Object.keys(n).some(r=>Hl(r)===o)}const MB=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Sn(e)?n=>cS(e,n):e};function Oxe(t){t.target.composing=!0}function IB(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const MA=Symbol("_assign");function RB(t,e,n){return e&&(t=t.trim()),n&&(t=YR(t)),t}const mu={created(t,{modifiers:{lazy:e,trim:n,number:o}},r){t[MA]=MB(r);const l=o||r.props&&r.props.type==="number";Ug(t,e?"change":"input",a=>{a.target.composing||t[MA](RB(t.value,n,l))}),(n||l)&&Ug(t,"change",()=>{t.value=RB(t.value,n,l)}),e||(Ug(t,"compositionstart",Oxe),Ug(t,"compositionend",IB),Ug(t,"change",IB))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:o,trim:r,number:l}},a){if(t[MA]=MB(a),t.composing)return;const u=(l||t.type==="number")&&!/^0\d/.test(t.value)?YR(t.value):t.value,c=e??"";if(u===c)return;const f=t.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===t&&t.type!=="range"&&(o&&e===n||r&&t.value.trim()===c)||(t.value=c)}},Mxe=["ctrl","shift","alt","meta"],Ixe={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Mxe.some(n=>t[`${n}Key`]&&!e.includes(n))},lt=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),o=e.join(".");return n[o]||(n[o]=((r,...l)=>{for(let a=0;a<e.length;a++){const u=Ixe[e[a]];if(u&&u(r,e))return}return t(r,...l)}))},Rxe={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},fr=(t,e)=>{const n=t._withKeys||(t._withKeys={}),o=e.join(".");return n[o]||(n[o]=(r=>{if(!("key"in r))return;const l=pp(r.key);if(e.some(a=>a===l||Rxe[a]===l))return t(r)}))},Vxe=Ui({patchProp:Axe},mxe);let VB;function Pxe(){return VB||(VB=G1e(Vxe))}const Fxe=((...t)=>{const e=Pxe().createApp(...t),{mount:n}=e;return e.mount=o=>{const r=Lxe(o);if(!r)return;const l=e._component;!qn(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=n(r,!1,Nxe(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},e});function Nxe(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Lxe(t){return Gr(t)?document.querySelector(t):t}function Bxe(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const wC=typeof window<"u",qm=(t,e=!1)=>e?Symbol.for(t):Symbol(t),Uxe=(t,e,n)=>qxe({l:t,k:e,s:n}),qxe=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Zl=t=>typeof t=="number"&&isFinite(t),gJ=t=>p5(t)==="[object Date]",kC=t=>p5(t)==="[object RegExp]",h8=t=>rr(t)&&Object.keys(t).length===0,xi=Object.assign,jxe=Object.create,Ar=(t=null)=>jxe(t);let PB;const d5=()=>PB||(PB=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Ar());function FB(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Hxe(t){return t.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const Wxe=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,Kxe=/^(?:href|src|action|formaction)$/i;function f5(t){return Wxe.test(t)}function Gxe(t){const e=/url\s*\(/gi;let n="",o=0,r;for(;(r=e.exec(t))!==null;){const l=r.index,a=e.lastIndex-1;let u=a+1,c=1,f=null;for(;u<t.length;u++){const h=t[u];if(f){h===f&&(f=null);continue}if(h==='"'||h==="'")f=h;else if(h==="(")c++;else if(h===")"&&(c--,c===0))break}if(c!==0)break;const p=t.slice(a+1,u).trim(),m=p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'")?p.slice(1,-1).trim():p;n+=t.slice(o,l),n+=f5(m)?"url(about:blank)":t.slice(l,u+1),o=u+1}return n+t.slice(o)}function NB(t,e){if(Kxe.test(t)&&f5(e))return"about:blank";const n=t.toLowerCase()==="style"?Gxe(e):e;return Hxe(n)}function Yxe(t){return t=t.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,r)=>`${o}="${NB(o,r)}"`),t=t.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,r)=>`${o}='${NB(o,r)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t)&&(t=t.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),t=t.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,r)=>f5(r)?`${o}about:blank`:n),t}const Jxe=Object.prototype.hasOwnProperty;function eu(t,e){return Jxe.call(t,e)}const Rl=Array.isArray,xl=t=>typeof t=="function",Xt=t=>typeof t=="string",cl=t=>typeof t=="boolean",Ho=t=>t!==null&&typeof t=="object",Xxe=t=>Ho(t)&&xl(t.then)&&xl(t.catch),yJ=Object.prototype.toString,p5=t=>yJ.call(t),rr=t=>p5(t)==="[object Object]",Qxe=t=>t==null?"":Rl(t)||rr(t)&&t.toString===yJ?JSON.stringify(t,null,2):String(t);function m5(t,e=""){return t.reduce((n,o,r)=>r===0?n+o:n+e+o,"")}const P2=t=>!Ho(t)||Rl(t);function fS(t,e){if(P2(t)||P2(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:o,des:r}=n.pop();Object.keys(o).forEach(l=>{l!=="__proto__"&&(Ho(o[l])&&!Ho(r[l])&&(r[l]=Array.isArray(o[l])?[]:Ar()),P2(r[l])||P2(o[l])?r[l]=o[l]:n.push({src:o[l],des:r[l]}))})}}function Zxe(t,e,n){return{line:t,column:e,offset:n}}function xO(t,e,n){return{start:t,end:e}}const ur={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},e_e=17;function v8(t,e,n={}){const{domain:o,messages:r,args:l}=n,a=t,u=new SyntaxError(String(a));return u.code=t,e&&(u.location=e),u.domain=o,u}function t_e(t){throw t}const Ic=" ",n_e="\r",pa=`
|
|
3
3
|
`,o_e="\u2028",r_e="\u2029";function l_e(t){const e=t;let n=0,o=1,r=1,l=0;const a=E=>e[E]===n_e&&e[E+1]===pa,u=E=>e[E]===pa,c=E=>e[E]===r_e,f=E=>e[E]===o_e,p=E=>a(E)||u(E)||c(E)||f(E),m=()=>n,h=()=>o,v=()=>r,g=()=>l,b=E=>a(E)||c(E)||f(E)?pa:e[E],x=()=>b(n),y=()=>b(n+l);function _(){return l=0,p(n)&&(o++,r=0),a(n)&&n++,n++,r++,e[n]}function k(){return a(n+l)&&l++,l++,e[n+l]}function w(){n=0,o=1,r=1,l=0}function $(E=0){l=E}function C(){const E=n+l;for(;E!==n;)_();l=0}return{index:m,line:h,column:v,peekOffset:g,charAt:b,currentChar:x,currentPeek:y,next:_,peek:k,reset:w,resetPeek:$,skipToPeek:C}}const af=void 0,i_e=".",LB="'",a_e="tokenizer";function s_e(t,e={}){const n=e.location!==!1,o=l_e(t),r=()=>o.index(),l=()=>Zxe(o.line(),o.column(),o.index()),a=l(),u=r(),c={currentType:13,offset:u,startLoc:a,endLoc:a,lastType:13,lastOffset:u,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},f=()=>c,{onError:p}=e;function m(se,me,ze,...Ae){const Ee=f();if(me.column+=ze,me.offset+=ze,p){const Ce=n?xO(Ee.startLoc,me):null,xe=v8(se,Ce,{domain:a_e,args:Ae});p(xe)}}function h(se,me,ze){se.endLoc=l(),se.currentType=me;const Ae={type:me};return n&&(Ae.loc=xO(se.startLoc,se.endLoc)),ze!=null&&(Ae.value=ze),Ae}const v=se=>h(se,13);function g(se,me){return se.currentChar()===me?(se.next(),me):(m(ur.EXPECTED_TOKEN,l(),0,me),"")}function b(se){let me="";for(;se.currentPeek()===Ic||se.currentPeek()===pa;)me+=se.currentPeek(),se.peek();return me}function x(se){const me=b(se);return se.skipToPeek(),me}function y(se){if(se===af)return!1;const me=se.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me===95}function _(se){if(se===af)return!1;const me=se.charCodeAt(0);return me>=48&&me<=57}function k(se,me){const{currentType:ze}=me;if(ze!==2)return!1;b(se);const Ae=y(se.currentPeek());return se.resetPeek(),Ae}function w(se,me){const{currentType:ze}=me;if(ze!==2)return!1;b(se);const Ae=se.currentPeek()==="-"?se.peek():se.currentPeek(),Ee=_(Ae);return se.resetPeek(),Ee}function $(se,me){const{currentType:ze}=me;if(ze!==2)return!1;b(se);const Ae=se.currentPeek()===LB;return se.resetPeek(),Ae}function C(se,me){const{currentType:ze}=me;if(ze!==7)return!1;b(se);const Ae=se.currentPeek()===".";return se.resetPeek(),Ae}function E(se,me){const{currentType:ze}=me;if(ze!==8)return!1;b(se);const Ae=y(se.currentPeek());return se.resetPeek(),Ae}function z(se,me){const{currentType:ze}=me;if(!(ze===7||ze===11))return!1;b(se);const Ae=se.currentPeek()===":";return se.resetPeek(),Ae}function N(se,me){const{currentType:ze}=me;if(ze!==9)return!1;const Ae=()=>{const Ce=se.currentPeek();return Ce==="{"?y(se.peek()):Ce==="@"||Ce==="|"||Ce===":"||Ce==="."||Ce===Ic||!Ce?!1:Ce===pa?(se.peek(),Ae()):Q(se,!1)},Ee=Ae();return se.resetPeek(),Ee}function P(se){b(se);const me=se.currentPeek()==="|";return se.resetPeek(),me}function Q(se,me=!0){const ze=(Ee=!1,Ce="")=>{const xe=se.currentPeek();return xe==="{"||xe==="@"||!xe?Ee:xe==="|"?!(Ce===Ic||Ce===pa):xe===Ic?(se.peek(),ze(!0,Ic)):xe===pa?(se.peek(),ze(!0,pa)):!0},Ae=ze();return me&&se.resetPeek(),Ae}function W(se,me){const ze=se.currentChar();return ze===af?af:me(ze)?(se.next(),ze):null}function Z(se){const me=se.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95||me===36}function L(se){return W(se,Z)}function F(se){const me=se.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95||me===36||me===45}function j(se){return W(se,F)}function te(se){const me=se.charCodeAt(0);return me>=48&&me<=57}function ie(se){return W(se,te)}function ve(se){const me=se.charCodeAt(0);return me>=48&&me<=57||me>=65&&me<=70||me>=97&&me<=102}function ge(se){return W(se,ve)}function $e(se){let me="",ze="";for(;me=ie(se);)ze+=me;return ze}function le(se){let me="";for(;;){const ze=se.currentChar();if(ze==="\\"){const Ae=se.peek();Ae==="{"||Ae==="}"||Ae==="@"||Ae==="|"||Ae==="\\"?(me+=ze+Ae,se.next(),se.next()):(se.resetPeek(),me+=ze,se.next())}else{if(ze==="{"||ze==="}"||ze==="@"||ze==="|"||!ze)break;if(ze===Ic||ze===pa)if(Q(se))me+=ze,se.next();else{if(P(se))break;me+=ze,se.next()}else me+=ze,se.next()}}return me}function ee(se){x(se);let me="",ze="";for(;me=j(se);)ze+=me;const Ae=se.currentChar();if(Ae&&Ae!=="}"&&Ae!==af&&Ae!==Ic&&Ae!==pa&&Ae!==" "){const Ee=q(se);return m(ur.INVALID_TOKEN_IN_PLACEHOLDER,l(),0,ze+Ee),ze+Ee}return se.currentChar()===af&&m(ur.UNTERMINATED_CLOSING_BRACE,l(),0),ze}function oe(se){x(se);let me="";return se.currentChar()==="-"?(se.next(),me+=`-${$e(se)}`):me+=$e(se),se.currentChar()===af&&m(ur.UNTERMINATED_CLOSING_BRACE,l(),0),me}function K(se){return se!==LB&&se!==pa}function Y(se){x(se),g(se,"'");let me="",ze="";for(;me=W(se,K);)me==="\\"?ze+=R(se):ze+=me;const Ae=se.currentChar();return Ae===pa||Ae===af?(m(ur.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,l(),0),Ae===pa&&(se.next(),g(se,"'")),ze):(g(se,"'"),ze)}function R(se){const me=se.currentChar();switch(me){case"\\":case"'":return se.next(),`\\${me}`;case"u":return U(se,me,4);case"U":return U(se,me,6);default:return m(ur.UNKNOWN_ESCAPE_SEQUENCE,l(),0,me),""}}function U(se,me,ze){g(se,me);let Ae="";for(let Ee=0;Ee<ze;Ee++){const Ce=ge(se);if(!Ce){m(ur.INVALID_UNICODE_ESCAPE_SEQUENCE,l(),0,`\\${me}${Ae}${se.currentChar()}`);break}Ae+=Ce}return`\\${me}${Ae}`}function V(se){return se!=="{"&&se!=="}"&&se!==Ic&&se!==pa}function q(se){x(se);let me="",ze="";for(;me=W(se,V);)ze+=me;return ze}function ne(se){let me="",ze="";for(;me=L(se);)ze+=me;return ze}function X(se){const me=ze=>{const Ae=se.currentChar();return Ae==="{"||Ae==="@"||Ae==="|"||Ae==="("||Ae===")"||!Ae||Ae===Ic?ze:(ze+=Ae,se.next(),me(ze))};return me("")}function fe(se){x(se);const me=g(se,"|");return x(se),me}function ye(se,me){let ze=null;switch(se.currentChar()){case"{":return me.braceNest>=1&&m(ur.NOT_ALLOW_NEST_PLACEHOLDER,l(),0),se.next(),ze=h(me,2,"{"),x(se),me.braceNest++,ze;case"}":return me.braceNest>0&&me.currentType===2&&m(ur.EMPTY_PLACEHOLDER,l(),0),se.next(),ze=h(me,3,"}"),me.braceNest--,me.braceNest>0&&x(se),me.inLinked&&me.braceNest===0&&(me.inLinked=!1),ze;case"@":return me.braceNest>0&&m(ur.UNTERMINATED_CLOSING_BRACE,l(),0),ze=ce(se,me)||v(me),me.braceNest=0,ze;default:{let Ee=!0,Ce=!0,xe=!0;if(P(se))return me.braceNest>0&&m(ur.UNTERMINATED_CLOSING_BRACE,l(),0),ze=h(me,1,fe(se)),me.braceNest=0,me.inLinked=!1,ze;if(me.braceNest>0&&(me.currentType===4||me.currentType===5||me.currentType===6))return m(ur.UNTERMINATED_CLOSING_BRACE,l(),0),me.braceNest=0,pe(se,me);if(Ee=k(se,me))return ze=h(me,4,ee(se)),x(se),ze;if(Ce=w(se,me))return ze=h(me,5,oe(se)),x(se),ze;if(xe=$(se,me))return ze=h(me,6,Y(se)),x(se),ze;if(!Ee&&!Ce&&!xe)return ze=h(me,12,q(se)),m(ur.INVALID_TOKEN_IN_PLACEHOLDER,l(),0,ze.value),x(se),ze;break}}return ze}function ce(se,me){const{currentType:ze}=me;let Ae=null;const Ee=se.currentChar();switch((ze===7||ze===8||ze===11||ze===9)&&(Ee===pa||Ee===Ic)&&m(ur.INVALID_LINKED_FORMAT,l(),0),Ee){case"@":return se.next(),Ae=h(me,7,"@"),me.inLinked=!0,Ae;case".":return x(se),se.next(),h(me,8,".");case":":return x(se),se.next(),h(me,9,":");default:return P(se)?(Ae=h(me,1,fe(se)),me.braceNest=0,me.inLinked=!1,Ae):C(se,me)||z(se,me)?(x(se),ce(se,me)):E(se,me)?(x(se),h(me,11,ne(se))):N(se,me)?(x(se),Ee==="{"?ye(se,me)||Ae:h(me,10,X(se))):(ze===7&&m(ur.INVALID_LINKED_FORMAT,l(),0),me.braceNest=0,me.inLinked=!1,pe(se,me))}}function pe(se,me){let ze={type:13};if(me.braceNest>0)return ye(se,me)||v(me);if(me.inLinked)return ce(se,me)||v(me);switch(se.currentChar()){case"{":return ye(se,me)||v(me);case"}":return m(ur.UNBALANCED_CLOSING_BRACE,l(),0),se.next(),h(me,3,"}");case"@":return ce(se,me)||v(me);default:{if(P(se))return ze=h(me,1,fe(se)),me.braceNest=0,me.inLinked=!1,ze;if(Q(se))return h(me,0,le(se));break}}return ze}function ke(){const{currentType:se,offset:me,startLoc:ze,endLoc:Ae}=c;return c.lastType=se,c.lastOffset=me,c.lastStartLoc=ze,c.lastEndLoc=Ae,c.offset=r(),c.startLoc=l(),o.currentChar()===af?h(c,13):pe(o,c)}return{nextToken:ke,currentOffset:r,currentPosition:l,context:f}}const u_e="parser",c_e=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,d_e=/\\([\\@{}|])/g;function f_e(t,e){return e}function p_e(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(e||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function m_e(t={}){const e=t.location!==!1,{onError:n}=t;function o(y,_,k,w,...$){const C=y.currentPosition();if(C.offset+=w,C.column+=w,n){const E=e?xO(k,C):null,z=v8(_,E,{domain:u_e,args:$});n(z)}}function r(y,_,k){const w={type:y};return e&&(w.start=_,w.end=_,w.loc={start:k,end:k}),w}function l(y,_,k,w){e&&(y.end=_,y.loc&&(y.loc.end=k))}function a(y,_){const k=y.context(),w=r(3,k.offset,k.startLoc);return w.value=_.replace(d_e,f_e),l(w,y.currentOffset(),y.currentPosition()),w}function u(y,_){const k=y.context(),{lastOffset:w,lastStartLoc:$}=k,C=r(5,w,$);return C.index=parseInt(_,10),y.nextToken(),l(C,y.currentOffset(),y.currentPosition()),C}function c(y,_){const k=y.context(),{lastOffset:w,lastStartLoc:$}=k,C=r(4,w,$);return C.key=_,y.nextToken(),l(C,y.currentOffset(),y.currentPosition()),C}function f(y,_){const k=y.context(),{lastOffset:w,lastStartLoc:$}=k,C=r(9,w,$);return C.value=_.replace(c_e,p_e),y.nextToken(),l(C,y.currentOffset(),y.currentPosition()),C}function p(y){const _=y.nextToken(),k=y.context(),{lastOffset:w,lastStartLoc:$}=k,C=r(8,w,$);return _.type!==11?(o(y,ur.UNEXPECTED_EMPTY_LINKED_MODIFIER,k.lastStartLoc,0),C.value="",l(C,w,$),{nextConsumeToken:_,node:C}):(_.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Rc(_)),C.value=_.value||"",l(C,y.currentOffset(),y.currentPosition()),{node:C})}function m(y,_){const k=y.context(),w=r(7,k.offset,k.startLoc);return w.value=_,l(w,y.currentOffset(),y.currentPosition()),w}function h(y){const _=y.context(),k=r(6,_.offset,_.startLoc);let w=y.nextToken();if(w.type===8){const $=p(y);k.modifier=$.node,w=$.nextConsumeToken||y.nextToken()}switch(w.type!==9&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(w)),w=y.nextToken(),w.type===2&&(w=y.nextToken()),w.type){case 10:w.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(w)),k.key=m(y,w.value||"");break;case 4:w.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(w)),k.key=c(y,w.value||"");break;case 5:w.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(w)),k.key=u(y,w.value||"");break;case 6:w.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(w)),k.key=f(y,w.value||"");break;default:{o(y,ur.UNEXPECTED_EMPTY_LINKED_KEY,_.lastStartLoc,0);const $=y.context(),C=r(7,$.offset,$.startLoc);return C.value="",l(C,$.offset,$.startLoc),k.key=C,l(k,$.offset,$.startLoc),{nextConsumeToken:w,node:k}}}return l(k,y.currentOffset(),y.currentPosition()),{node:k}}function v(y){const _=y.context(),k=_.currentType===1?y.currentOffset():_.offset,w=_.currentType===1?_.endLoc:_.startLoc,$=r(2,k,w);$.items=[];let C=null;do{const N=C||y.nextToken();switch(C=null,N.type){case 0:N.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(N)),$.items.push(a(y,N.value||""));break;case 5:N.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(N)),$.items.push(u(y,N.value||""));break;case 4:N.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(N)),$.items.push(c(y,N.value||""));break;case 6:N.value==null&&o(y,ur.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Rc(N)),$.items.push(f(y,N.value||""));break;case 7:{const P=h(y);$.items.push(P.node),C=P.nextConsumeToken||null;break}}}while(_.currentType!==13&&_.currentType!==1);const E=_.currentType===1?_.lastOffset:y.currentOffset(),z=_.currentType===1?_.lastEndLoc:y.currentPosition();return l($,E,z),$}function g(y,_,k,w){const $=y.context();let C=w.items.length===0;const E=r(1,_,k);E.cases=[],E.cases.push(w);do{const z=v(y);C||(C=z.items.length===0),E.cases.push(z)}while($.currentType!==13);return C&&o(y,ur.MUST_HAVE_MESSAGES_IN_PLURAL,k,0),l(E,y.currentOffset(),y.currentPosition()),E}function b(y){const _=y.context(),{offset:k,startLoc:w}=_,$=v(y);return _.currentType===13?$:g(y,k,w,$)}function x(y){const _=s_e(y,xi({},t)),k=_.context(),w=r(0,k.offset,k.startLoc);return e&&w.loc&&(w.loc.source=y),w.body=b(_),t.onCacheKey&&(w.cacheKey=t.onCacheKey(y)),k.currentType!==13&&o(_,ur.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,y[k.offset]||""),l(w,_.currentOffset(),_.currentPosition()),w}return{parse:x}}function Rc(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function h_e(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:l=>(n.helpers.add(l),l)}}function BB(t,e){for(let n=0;n<t.length;n++)h5(t[n],e)}function h5(t,e){switch(t.type){case 1:BB(t.cases,e),e.helper("plural");break;case 2:BB(t.items,e);break;case 6:{h5(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function v_e(t,e={}){const n=h_e(t);n.helper("normalize"),t.body&&h5(t.body,n);const o=n.context();t.helpers=Array.from(o.helpers)}function g_e(t){const e=t.body;return e.type===2?UB(e):e.cases.forEach(n=>UB(n)),t}function UB(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const o=t.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;e.push(o.value)}if(e.length===t.items.length){t.static=m5(e);for(let n=0;n<t.items.length;n++){const o=t.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function qg(t){switch(t.t=t.type,t.type){case 0:{const e=t;qg(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let o=0;o<n.length;o++)qg(n[o]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let o=0;o<n.length;o++)qg(n[o]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;qg(e.key),e.k=e.key,delete e.key,e.modifier&&(qg(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}}delete t.type}function y_e(t,e){const{filename:n,breakLineCode:o,needIndent:r}=e,l=e.location!==!1,a={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:r,indentLevel:0};l&&t.loc&&(a.source=t.loc.source);const u=()=>a;function c(b,x){a.code+=b}function f(b,x=!0){const y=x?o:"";c(r?y+" ".repeat(b):y)}function p(b=!0){const x=++a.indentLevel;b&&f(x)}function m(b=!0){const x=--a.indentLevel;b&&f(x)}function h(){f(a.indentLevel)}return{context:u,push:c,indent:p,deindent:m,newline:h,helper:b=>`_${b}`,needIndent:()=>a.needIndent}}function b_e(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),U0(t,e.key),e.modifier?(t.push(", "),U0(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function x_e(t,e){const{helper:n,needIndent:o}=t;t.push(`${n("normalize")}([`),t.indent(o());const r=e.items.length;for(let l=0;l<r&&(U0(t,e.items[l]),l!==r-1);l++)t.push(", ");t.deindent(o()),t.push("])")}function __e(t,e){const{helper:n,needIndent:o}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(o());const r=e.cases.length;for(let l=0;l<r&&(U0(t,e.cases[l]),l!==r-1);l++)t.push(", ");t.deindent(o()),t.push("])")}}function w_e(t,e){e.body?U0(t,e.body):t.push("null")}function U0(t,e){const{helper:n}=t;switch(e.type){case 0:w_e(t,e);break;case 1:__e(t,e);break;case 2:x_e(t,e);break;case 6:b_e(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break}}const k_e=(t,e={})=>{const n=Xt(e.mode)?e.mode:"normal",o=Xt(e.filename)?e.filename:"message.intl";e.sourceMap;const r=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
4
4
|
`,l=e.needIndent?e.needIndent:n!=="arrow",a=t.helpers||[],u=y_e(t,{filename:o,breakLineCode:r,needIndent:l});u.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),u.indent(l),a.length>0&&(u.push(`const { ${m5(a.map(p=>`${p}: _${p}`),", ")} } = ctx`),u.newline()),u.push("return "),U0(u,t),u.deindent(l),u.push("}"),delete t.helpers;const{code:c,map:f}=u.context();return{ast:t,code:c,map:f?f.toJSON():void 0}};function S_e(t,e={}){const n=xi({},e),o=!!n.jit,r=!!n.minify,l=n.optimize==null?!0:n.optimize,u=m_e(n).parse(t);return o?(l&&g_e(u),r&&qg(u),{ast:u,code:""}):(v_e(u,n),k_e(u,n))}function C_e(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(d5().__INTLIFY_PROD_DEVTOOLS__=!1)}function _d(t){return Ho(t)&&v5(t)===0&&(eu(t,"b")||eu(t,"body"))}const bJ=["b","body"];function $_e(t){return jm(t,bJ)}const xJ=["c","cases"];function T_e(t){return jm(t,xJ,[])}const _J=["s","static"];function E_e(t){return jm(t,_J)}const wJ=["i","items"];function A_e(t){return jm(t,wJ,[])}const kJ=["t","type"];function v5(t){return jm(t,kJ)}const SJ=["v","value"];function F2(t,e){const n=jm(t,SJ);if(n!=null)return n;throw Wx(e)}const CJ=["m","modifier"];function D_e(t){return jm(t,CJ)}const $J=["k","key"];function z_e(t){const e=jm(t,$J);if(e)return e;throw Wx(6)}function jm(t,e,n){for(let o=0;o<e.length;o++){const r=e[o];if(eu(t,r)&&t[r]!=null)return t[r]}return n}const TJ=[...bJ,...xJ,..._J,...wJ,...$J,...CJ,...SJ,...kJ];function Wx(t){return new Error(`unhandled node type: ${t}`)}function IA(t){return n=>O_e(n,t)}function O_e(t,e){const n=$_e(e);if(n==null)throw Wx(0);if(v5(n)===1){const l=T_e(n);return t.plural(l.reduce((a,u)=>[...a,qB(t,u)],[]))}else return qB(t,n)}function qB(t,e){const n=E_e(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const o=A_e(e).reduce((r,l)=>[...r,_O(t,l)],[]);return t.normalize(o)}}function _O(t,e){const n=v5(e);switch(n){case 3:return F2(e,n);case 9:return F2(e,n);case 4:{const o=e;if(eu(o,"k")&&o.k)return t.interpolate(t.named(o.k));if(eu(o,"key")&&o.key)return t.interpolate(t.named(o.key));throw Wx(n)}case 5:{const o=e;if(eu(o,"i")&&Zl(o.i))return t.interpolate(t.list(o.i));if(eu(o,"index")&&Zl(o.index))return t.interpolate(t.list(o.index));throw Wx(n)}case 6:{const o=e,r=D_e(o),l=z_e(o);return t.linked(_O(t,l),r?_O(t,r):void 0,t.type)}case 7:return F2(e,n);case 8:return F2(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const M_e=t=>t;let N2=Ar();function I_e(t,e={}){let n=!1;const o=e.onError||t_e;return e.onError=r=>{n=!0,o(r)},{...S_e(t,e),detectError:n}}function R_e(t,e){if(Xt(t)){cl(e.warnHtmlMessage)&&e.warnHtmlMessage;const o=(e.onCacheKey||M_e)(t),r=N2[o];if(r)return r;const{ast:l,detectError:a}=I_e(t,{...e,location:!1,jit:!0}),u=IA(l);return a?u:N2[o]=u}else{const n=t.cacheKey;if(n){const o=N2[n];return o||(N2[n]=IA(t))}else return IA(t)}}let Kx=null;function V_e(t){Kx=t}function P_e(t,e,n){Kx&&Kx.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const F_e=N_e("function:translate");function N_e(t){return e=>Kx&&Kx.emit(t,e)}const Tf={INVALID_ARGUMENT:e_e,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},L_e=24;function Ef(t){return v8(t,null,void 0)}function g5(t,e){return e.locale!=null?jB(e.locale):jB(t.locale)}let RA;function jB(t){if(Xt(t))return t;if(xl(t)){if(t.resolvedOnce&&RA!=null)return RA;if(t.constructor.name==="Function"){const e=t();if(Xxe(e))throw Ef(Tf.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return RA=e}else throw Ef(Tf.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ef(Tf.NOT_SUPPORT_LOCALE_TYPE)}function B_e(t,e,n){return[...new Set([n,...Rl(e)?e:Ho(e)?Object.keys(e):Xt(e)?[e]:[n]])]}function wO(t,e,n){const o=Xt(n)?n:SC,r=t;r.__localeChainCache||(r.__localeChainCache=new Map);let l=r.__localeChainCache.get(o);if(!l){l=[];let a=[n];for(;Rl(a);)a=HB(l,a,e);const u=Rl(e)||!rr(e)?e:e.default?e.default:null;a=Xt(u)?[u]:u,Rl(a)&&HB(l,a,!1),r.__localeChainCache.set(o,l)}return l}function HB(t,e,n){let o=!0;for(let r=0;r<e.length&&cl(o);r++){const l=e[r];Xt(l)&&(o=U_e(t,e[r],n))}return o}function U_e(t,e,n){let o;const r=e.split("-");do{const l=r.join("-");o=q_e(t,l,n),r.splice(-1,1)}while(r.length&&o===!0);return o}function q_e(t,e,n){let o=!1;if(!t.includes(e)&&(o=!0,e)){o=e[e.length-1]!=="!";const r=e.replace(/!/g,"");t.push(r),(Rl(n)||rr(n))&&n[r]&&(o=n[r])}return o}const Hm=[];Hm[0]={w:[0],i:[3,0],"[":[4],o:[7]};Hm[1]={w:[1],".":[2],"[":[4],o:[7]};Hm[2]={w:[2],i:[3,0],0:[3,0]};Hm[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Hm[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Hm[5]={"'":[4,0],o:8,l:[5,0]};Hm[6]={'"':[4,0],o:8,l:[6,0]};const j_e=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function H_e(t){return j_e.test(t)}function W_e(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function K_e(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function G_e(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:H_e(e)?W_e(e):"*"+e}function Y_e(t){const e=[];let n=-1,o=0,r=0,l,a,u,c,f,p,m;const h=[];h[0]=()=>{a===void 0?a=u:a+=u},h[1]=()=>{a!==void 0&&(e.push(a),a=void 0)},h[2]=()=>{h[0](),r++},h[3]=()=>{if(r>0)r--,o=4,h[0]();else{if(r=0,a===void 0||(a=G_e(a),a===!1))return!1;h[1]()}};function v(){const g=t[n+1];if(o===5&&g==="'"||o===6&&g==='"')return n++,u="\\"+g,h[0](),!0}for(;o!==null;)if(n++,l=t[n],!(l==="\\"&&v())){if(c=K_e(l),m=Hm[o],f=m[c]||m.l||8,f===8||(o=f[0],f[1]!==void 0&&(p=h[f[1]],p&&(u=l,p()===!1))))return;if(o===7)return e}}const WB=new Map;function J_e(t,e){return Ho(t)?t[e]:null}function X_e(t,e){if(!Ho(t))return null;let n=WB.get(e);if(n||(n=Y_e(e),n&&WB.set(e,n)),!n)return null;const o=n.length;let r=t,l=0;for(;l<o;){const a=n[l];if(TJ.includes(a)&&_d(r)||!Ho(r)||!eu(r,a))return null;const u=r[a];if(u===void 0||xl(r))return null;r=u,l++}return r}const Q_e="11.4.4",g8=-1,SC="en-US",CC="",KB=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Z_e(){return{upper:(t,e)=>e==="text"&&Xt(t)?t.toUpperCase():e==="vnode"&&Ho(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&Xt(t)?t.toLowerCase():e==="vnode"&&Ho(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&Xt(t)?KB(t):e==="vnode"&&Ho(t)&&"__v_isVNode"in t?KB(t.children):t}}let EJ;function ewe(t){EJ=t}let AJ;function twe(t){AJ=t}let DJ;function nwe(t){DJ=t}let zJ=null;const owe=t=>{zJ=t},rwe=()=>zJ;let OJ=null;const GB=t=>{OJ=t},lwe=()=>OJ;let YB=0;function iwe(t={}){const e=xl(t.onWarn)?t.onWarn:Bxe,n=Xt(t.version)?t.version:Q_e,o=Xt(t.locale)||xl(t.locale)?t.locale:SC,r=xl(o)?SC:o,l=Rl(t.fallbackLocale)||rr(t.fallbackLocale)||Xt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:r,a=rr(t.messages)?t.messages:VA(r),u=rr(t.datetimeFormats)?t.datetimeFormats:VA(r),c=rr(t.numberFormats)?t.numberFormats:VA(r),f=xi(Ar(),t.modifiers,Z_e()),p=t.pluralRules||Ar(),m=xl(t.missing)?t.missing:null,h=cl(t.missingWarn)||kC(t.missingWarn)?t.missingWarn:!0,v=cl(t.fallbackWarn)||kC(t.fallbackWarn)?t.fallbackWarn:!0,g=!!t.fallbackFormat,b=!!t.unresolving,x=xl(t.postTranslation)?t.postTranslation:null,y=rr(t.processor)?t.processor:null,_=cl(t.warnHtmlMessage)?t.warnHtmlMessage:!0,k=!!t.escapeParameter,w=xl(t.messageCompiler)?t.messageCompiler:EJ,$=xl(t.messageResolver)?t.messageResolver:AJ||J_e,C=xl(t.localeFallbacker)?t.localeFallbacker:DJ||B_e,E=Ho(t.fallbackContext)?t.fallbackContext:void 0,z=t,N=Ho(z.__datetimeFormatters)?z.__datetimeFormatters:new Map,P=Ho(z.__numberFormatters)?z.__numberFormatters:new Map,Q=Ho(z.__meta)?z.__meta:{};YB++;const W={version:n,cid:YB,locale:o,fallbackLocale:l,messages:a,modifiers:f,pluralRules:p,missing:m,missingWarn:h,fallbackWarn:v,fallbackFormat:g,unresolving:b,postTranslation:x,processor:y,warnHtmlMessage:_,escapeParameter:k,messageCompiler:w,messageResolver:$,localeFallbacker:C,fallbackContext:E,onWarn:e,__meta:Q};return W.datetimeFormats=u,W.numberFormats=c,W.__datetimeFormatters=N,W.__numberFormatters=P,__INTLIFY_PROD_DEVTOOLS__&&P_e(W,n,Q),W}const VA=t=>({[t]:Ar()});function y5(t,e,n,o,r){const{missing:l,onWarn:a}=t;if(l!==null){const u=l(t,n,e,r);return Xt(u)?u:e}else return e}function jb(t,e,n){const o=t;o.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function awe(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function swe(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let o=n+1;o<e.length;o++)if(awe(t,e[o]))return!0;return!1}function JB(t,...e){const{datetimeFormats:n,unresolving:o,fallbackLocale:r,onWarn:l,localeFallbacker:a}=t,{__datetimeFormatters:u}=t;if(!Xt(e[0])&&!gJ(e[0])&&!Zl(e[0]))return CC;const[c,f,p,m]=kO(...e),h=cl(p.missingWarn)?p.missingWarn:t.missingWarn;cl(p.fallbackWarn)?p.fallbackWarn:t.fallbackWarn;const v=!!p.part,g=g5(t,p),b=a(t,r,g);if(!Xt(c)||c==="")return new Intl.DateTimeFormat(g.replace(/!/g,""),m).format(f);let x={},y,_=null;const k="datetime format";for(let C=0;C<b.length&&(y=b[C],x=n[y]||{},_=x[c],!rr(_));C++)y5(t,c,y,h,k);if(!rr(_)||!Xt(y))return o?g8:c;let w=`${y}__${c}`;h8(m)||(w=`${w}__${JSON.stringify(m)}`);let $=u.get(w);return $||($=new Intl.DateTimeFormat(y,xi({},_,m)),u.set(w,$)),v?$.formatToParts(f):$.format(f)}const MJ=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function kO(...t){const[e,n,o,r]=t,l=Ar();let a=Ar(),u;if(Xt(e)){const c=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw Ef(Tf.INVALID_ISO_DATE_ARGUMENT);const f=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();u=new Date(f);try{u.toISOString()}catch{throw Ef(Tf.INVALID_ISO_DATE_ARGUMENT)}}else if(gJ(e)){if(isNaN(e.getTime()))throw Ef(Tf.INVALID_DATE_ARGUMENT);u=e}else if(Zl(e))u=e;else throw Ef(Tf.INVALID_ARGUMENT);return Xt(n)?l.key=n:rr(n)&&Object.keys(n).forEach(c=>{MJ.includes(c)?a[c]=n[c]:l[c]=n[c]}),Xt(o)?l.locale=o:rr(o)&&(a=o),rr(r)&&(a=r),[l.key||"",u,l,a]}function XB(t,e,n){const o=t;for(const r in n){const l=`${e}__${r}`;o.__datetimeFormatters.has(l)&&o.__datetimeFormatters.delete(l)}}function QB(t,...e){const{numberFormats:n,unresolving:o,fallbackLocale:r,onWarn:l,localeFallbacker:a}=t,{__numberFormatters:u}=t;if(!Zl(e[0]))return CC;const[c,f,p,m]=SO(...e),h=cl(p.missingWarn)?p.missingWarn:t.missingWarn;cl(p.fallbackWarn)?p.fallbackWarn:t.fallbackWarn;const v=!!p.part,g=g5(t,p),b=a(t,r,g);if(!Xt(c)||c==="")return new Intl.NumberFormat(g.replace(/!/g,""),m).format(f);let x={},y,_=null;const k="number format";for(let C=0;C<b.length&&(y=b[C],x=n[y]||{},_=x[c],!rr(_));C++)y5(t,c,y,h,k);if(!rr(_)||!Xt(y))return o?g8:c;let w=`${y}__${c}`;h8(m)||(w=`${w}__${JSON.stringify(m)}`);let $=u.get(w);return $||($=new Intl.NumberFormat(y,xi({},_,m)),u.set(w,$)),v?$.formatToParts(f):$.format(f)}const IJ=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function SO(...t){const[e,n,o,r]=t,l=Ar();let a=Ar();if(!Zl(e))throw Ef(Tf.INVALID_ARGUMENT);const u=e;return Xt(n)?l.key=n:rr(n)&&Object.keys(n).forEach(c=>{IJ.includes(c)?a[c]=n[c]:l[c]=n[c]}),Xt(o)?l.locale=o:rr(o)&&(a=o),rr(r)&&(a=r),[l.key||"",u,l,a]}function ZB(t,e,n){const o=t;for(const r in n){const l=`${e}__${r}`;o.__numberFormatters.has(l)&&o.__numberFormatters.delete(l)}}const uwe=t=>t,cwe=t=>"",dwe="text",fwe=t=>t.length===0?"":m5(t),pwe=Qxe;function PA(t,e){return t=Math.abs(t),e===2?t===1?0:1:Math.min(t,2)}function mwe(t){const e=Zl(t.pluralIndex)?t.pluralIndex:-1;return Zl(t.named?.count)?t.named.count:Zl(t.named?.n)?t.named.n:e}function hwe(t={}){const e=t.locale,n=mwe(t),o=Xt(e)&&xl(t.pluralRules?.[e])?t.pluralRules[e]:PA,r=o===PA?void 0:PA,l=y=>y[o(n,y.length,r)],a=t.list||[],u=y=>a[y],c=t.named||Ar();Zl(t.pluralIndex)&&(c.count||=t.pluralIndex,c.n||=t.pluralIndex);const f=y=>c[y];function p(y,_){const k=xl(t.messages)?t.messages(y,!!_):Ho(t.messages)?t.messages[y]:!1;return k||(t.parent?t.parent.message(y):cwe)}const m=y=>t.modifiers?t.modifiers[y]:uwe,h=xl(t.processor?.normalize)?t.processor.normalize:fwe,v=xl(t.processor?.interpolate)?t.processor.interpolate:pwe,g=Xt(t.processor?.type)?t.processor.type:dwe,x={list:u,named:f,plural:l,linked:(y,..._)=>{const[k,w]=_;let $="text",C="";_.length===1?Ho(k)?(C=k.modifier||C,$=k.type||$):Xt(k)&&(C=k||C):_.length===2&&(Xt(k)&&(C=k||C),Xt(w)&&($=w||$));const E=p(y,!0)(x),z=E===""||E===void 0?y:E,N=$==="vnode"&&Rl(z)&&C?z[0]:z;return C?m(C)(N,$):N},message:p,type:g,interpolate:v,normalize:h,values:xi(Ar(),a,c)};return x}const eU=()=>"",Js=t=>xl(t);function tU(t,...e){const{fallbackFormat:n,postTranslation:o,unresolving:r,messageCompiler:l,fallbackLocale:a,messages:u}=t,[c,f]=CO(...e),p=cl(f.missingWarn)?f.missingWarn:t.missingWarn,m=cl(f.fallbackWarn)?f.fallbackWarn:t.fallbackWarn,h=cl(f.escapeParameter)?f.escapeParameter:t.escapeParameter,v=!!f.resolvedMessage,g=Xt(f.default)||cl(f.default)?cl(f.default)?l?c:()=>c:f.default:n?l?c:()=>c:null,b=n||g!=null&&(Xt(g)||xl(g)),x=g5(t,f);h&&vwe(f);let[y,_,k]=v?[c,x,u[x]||Ar()]:RJ(t,c,x,a,m,p),w=y,$=c;if(!v&&!(Xt(w)||_d(w)||Js(w))&&b&&(w=g,$=w),!v&&(!(Xt(w)||_d(w)||Js(w))||!Xt(_)))return r?g8:c;let C=!1;const E=()=>{C=!0},z=Js(w)?w:VJ(t,c,_,w,$,E);if(C)return w;const N=bwe(t,_,k,f),P=hwe(N),Q=gwe(t,z,P);let W=o?o(Q,c):Q;if(h&&Xt(W)&&(W=Yxe(W)),__INTLIFY_PROD_DEVTOOLS__){const Z={timestamp:Date.now(),key:Xt(c)?c:Js(w)?w.key:"",locale:_||(Js(w)?w.locale:""),format:Xt(w)?w:Js(w)?w.source:"",message:W};Z.meta=xi({},t.__meta,rwe()||{}),F_e(Z)}return W}function vwe(t){Rl(t.list)?t.list=t.list.map(e=>Xt(e)?FB(e):e):Ho(t.named)&&Object.keys(t.named).forEach(e=>{Xt(t.named[e])&&(t.named[e]=FB(t.named[e]))})}function RJ(t,e,n,o,r,l){const{messages:a,onWarn:u,messageResolver:c,localeFallbacker:f}=t,p=f(t,o,n);let m=Ar(),h,v=null;const g="translate";for(let b=0;b<p.length&&(h=p[b],m=a[h]||Ar(),(v=c(m,e))===null&&(v=m[e]),!(Xt(v)||_d(v)||Js(v)));b++)if(!swe(h,p)){const x=y5(t,e,h,l,g);x!==e&&(v=x)}return[v,h,m]}function VJ(t,e,n,o,r,l){const{messageCompiler:a,warnHtmlMessage:u}=t;if(Js(o)){const f=o;return f.locale=f.locale||n,f.key=f.key||e,f}if(a==null){const f=(()=>o);return f.locale=n,f.key=e,f}const c=a(o,ywe(t,n,r,o,u,l));return c.locale=n,c.key=e,c.source=o,c}function gwe(t,e,n){return e(n)}function CO(...t){const[e,n,o]=t,r=Ar();if(!Xt(e)&&!Zl(e)&&!Js(e)&&!_d(e))throw Ef(Tf.INVALID_ARGUMENT);const l=Zl(e)?String(e):(Js(e),e);return Zl(n)?r.plural=n:Xt(n)?r.default=n:rr(n)&&!h8(n)?r.named=n:Rl(n)&&(r.list=n),Zl(o)?r.plural=o:Xt(o)?r.default=o:rr(o)&&xi(r,o),[l,r]}function ywe(t,e,n,o,r,l){return{locale:e,key:n,warnHtmlMessage:r,onError:a=>{throw l&&l(a),a},onCacheKey:a=>Uxe(e,n,a)}}function bwe(t,e,n,o){const{modifiers:r,pluralRules:l,messageResolver:a,fallbackLocale:u,fallbackWarn:c,missingWarn:f,fallbackContext:p}=t,h={locale:e,modifiers:r,pluralRules:l,messages:(v,g)=>{let b=a(n,v);if(b==null&&(p||g)){const[x,,y]=RJ(p||t,v,e,u,c,f);b=x??a(y,v)}if(Xt(b)||_d(b)){let x=!1;const _=VJ(t,v,e,b,v,()=>{x=!0});return x?eU:_}else return Js(b)?b:eU}};return t.processor&&(h.processor=t.processor),o.list&&(h.list=o.list),o.named&&(h.named=o.named),Zl(o.plural)&&(h.pluralIndex=o.plural),h}C_e();const xwe="11.4.4";function _we(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(d5().__INTLIFY_PROD_DEVTOOLS__=!1)}const ks={UNEXPECTED_RETURN_TYPE:L_e,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function au(t,...e){return v8(t,null,void 0)}const $O=qm("__translateVNode"),TO=qm("__datetimeParts"),EO=qm("__numberParts"),wwe=qm("__setPluralRules"),kwe=qm("__injectWithOption"),Xg=qm("__dispose");function Gx(t){if(!Ho(t)||_d(t))return t;for(const e in t)if(eu(t,e))if(!e.includes("."))Ho(t[e])&&Gx(t[e]);else{const n=e.split("."),o=n.length-1;let r=t,l=!1;for(let a=0;a<o;a++){if(n[a]==="__proto__")throw new Error(`unsafe key: ${n[a]}`);if(n[a]in r||(r[n[a]]=Ar()),!Ho(r[n[a]])){l=!0;break}r=r[n[a]]}if(l||(_d(r)?TJ.includes(n[o])||delete t[e]:(r[n[o]]=t[e],delete t[e])),!_d(r)){const a=r[n[o]];Ho(a)&&Gx(a)}}return t}function PJ(t,e){const{messages:n,__i18n:o,messageResolver:r,flatJson:l}=e,a=rr(n)?n:Rl(o)?Ar():{[t]:Ar()};if(Rl(o)&&o.forEach(u=>{if("locale"in u&&"resource"in u){const{locale:c,resource:f}=u;c?(a[c]=a[c]||Ar(),fS(f,a[c])):fS(f,a)}else Xt(u)&&fS(JSON.parse(u),a)}),r==null&&l)for(const u in a)eu(a,u)&&Gx(a[u]);return a}function FJ(t){return t.type}function Swe(t,e,n){let o=Ho(e.messages)?e.messages:Ar();"__i18nGlobal"in n&&(o=PJ(t.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const r=Object.keys(o);r.length&&r.forEach(l=>{t.mergeLocaleMessage(l,o[l])});{if(Ho(e.datetimeFormats)){const l=Object.keys(e.datetimeFormats);l.length&&l.forEach(a=>{t.mergeDateTimeFormat(a,e.datetimeFormats[a])})}if(Ho(e.numberFormats)){const l=Object.keys(e.numberFormats);l.length&&l.forEach(a=>{t.mergeNumberFormat(a,e.numberFormats[a])})}}}function nU(t){return s(cw,null,t,0)}function b5(){return Yr()}const oU="__INTLIFY_META__",rU=()=>[],Cwe=()=>!1;let lU=0;function iU(t){return((e,n,o,r)=>t(n,o,b5()||void 0,r))}const $we=()=>{const t=b5();let e=null;return t&&(e=FJ(t)[oU])?{[oU]:e}:null};function AO(t={}){const{__root:e,__injectWithOption:n}=t,o=e===void 0,r=t.flatJson,l=wC?ue:$n;let a=cl(t.inheritLocale)?t.inheritLocale:!0;const u=l(e&&a?e.locale.value:Xt(t.locale)?t.locale:SC),c=l(e&&a?e.fallbackLocale.value:Xt(t.fallbackLocale)||Rl(t.fallbackLocale)||rr(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:u.value),f=l(PJ(u.value,t)),p=l(rr(t.datetimeFormats)?t.datetimeFormats:{[u.value]:{}}),m=l(rr(t.numberFormats)?t.numberFormats:{[u.value]:{}});let h=e?e.missingWarn:cl(t.missingWarn)||kC(t.missingWarn)?t.missingWarn:!0,v=e?e.fallbackWarn:cl(t.fallbackWarn)||kC(t.fallbackWarn)?t.fallbackWarn:!0,g=e?e.fallbackRoot:cl(t.fallbackRoot)?t.fallbackRoot:!0,b=!!t.fallbackFormat,x=xl(t.missing)?t.missing:null,y=xl(t.missing)?iU(t.missing):null,_=xl(t.postTranslation)?t.postTranslation:null,k=e?e.warnHtmlMessage:cl(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const $=e?e.modifiers:rr(t.modifiers)?t.modifiers:{};let C=t.pluralRules||e&&e.pluralRules,E;E=(()=>{o&&GB(null);const xe={version:xwe,locale:u.value,fallbackLocale:c.value,messages:f.value,modifiers:$,pluralRules:C,missing:y===null?void 0:y,missingWarn:h,fallbackWarn:v,fallbackFormat:b,unresolving:!0,postTranslation:_===null?void 0:_,warnHtmlMessage:k,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};xe.datetimeFormats=p.value,xe.numberFormats=m.value,xe.__datetimeFormatters=rr(E)?E.__datetimeFormatters:void 0,xe.__numberFormatters=rr(E)?E.__numberFormatters:void 0;const He=iwe(xe);return o&&GB(He),He})(),jb(E,u.value,c.value);function N(){return[u.value,c.value,f.value,p.value,m.value]}const P=T({get:()=>u.value,set:xe=>{E.locale=xe,u.value=xe}}),Q=T({get:()=>c.value,set:xe=>{E.fallbackLocale=xe,c.value=xe,jb(E,u.value,xe)}}),W=T(()=>f.value),Z=T(()=>p.value),L=T(()=>m.value);function F(){return xl(_)?_:null}function j(xe){_=xe,E.postTranslation=xe}function te(){return x}function ie(xe){xe!==null&&(y=iU(xe)),x=xe,E.missing=y}const ve=(xe,He,ft,Ct,rn,In)=>{N();let Ue;try{__INTLIFY_PROD_DEVTOOLS__,o||(E.fallbackContext=e?lwe():void 0),Ue=xe(E)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(E.fallbackContext=void 0)}if(ft!=="translate exists"&&Zl(Ue)&&Ue===g8||ft==="translate exists"&&!Ue){const[it,Mt]=He();return e&&g?Ct(e):rn(it)}else{if(In(Ue))return Ue;throw au(ks.UNEXPECTED_RETURN_TYPE)}};function ge(...xe){return ve(He=>Reflect.apply(tU,null,[He,...xe]),()=>CO(...xe),"translate",He=>Reflect.apply(He.t,He,[...xe]),He=>He,He=>Xt(He))}function $e(...xe){const[He,ft,Ct]=xe;if(Ct&&!Ho(Ct))throw au(ks.INVALID_ARGUMENT);return ge(He,ft,xi({resolvedMessage:!0},Ct||{}))}function le(...xe){return ve(He=>Reflect.apply(JB,null,[He,...xe]),()=>kO(...xe),"datetime format",He=>Reflect.apply(He.d,He,[...xe]),()=>CC,He=>Xt(He)||Rl(He))}function ee(...xe){return ve(He=>Reflect.apply(QB,null,[He,...xe]),()=>SO(...xe),"number format",He=>Reflect.apply(He.n,He,[...xe]),()=>CC,He=>Xt(He)||Rl(He))}function oe(xe){return xe.map(He=>Xt(He)||Zl(He)||cl(He)?nU(String(He)):He)}const Y={normalize:oe,interpolate:xe=>xe,type:"vnode"};function R(...xe){return ve(He=>{let ft;const Ct=He;try{Ct.processor=Y,ft=Reflect.apply(tU,null,[Ct,...xe])}finally{Ct.processor=null}return ft},()=>CO(...xe),"translate",He=>He[$O](...xe),He=>[nU(He)],He=>Rl(He))}function U(...xe){return ve(He=>Reflect.apply(QB,null,[He,...xe]),()=>SO(...xe),"number format",He=>He[EO](...xe),rU,He=>Xt(He)||Rl(He))}function V(...xe){return ve(He=>Reflect.apply(JB,null,[He,...xe]),()=>kO(...xe),"datetime format",He=>He[TO](...xe),rU,He=>Xt(He)||Rl(He))}function q(xe){C=xe,E.pluralRules=C}function ne(xe,He){return ve(()=>{if(!xe)return!1;const ft=Xt(He)?He:u.value,Ct=Xt(He)?[ft]:wO(E,c.value,ft);for(let rn=0;rn<Ct.length;rn++){const In=ye(Ct[rn]);let Ue=E.messageResolver(In,xe);if(Ue===null&&(Ue=In[xe]),_d(Ue)||Js(Ue)||Xt(Ue))return!0}return!1},()=>[xe],"translate exists",ft=>Reflect.apply(ft.te,ft,[xe,He]),Cwe,ft=>cl(ft))}function X(xe){let He=null;const ft=wO(E,c.value,u.value);for(let Ct=0;Ct<ft.length;Ct++){const rn=f.value[ft[Ct]]||{},In=E.messageResolver(rn,xe);if(In!=null){He=In;break}}return He}function fe(xe){const He=X(xe);return He??(e?e.tm(xe)||{}:{})}function ye(xe){return f.value[xe]||{}}function ce(xe,He){if(r){const ft={[xe]:He};for(const Ct in ft)eu(ft,Ct)&&Gx(ft[Ct]);He=ft[xe]}f.value[xe]=He,E.messages=f.value}function pe(xe,He){f.value[xe]=f.value[xe]||{};const ft={[xe]:He};if(r)for(const Ct in ft)eu(ft,Ct)&&Gx(ft[Ct]);He=ft[xe],fS(He,f.value[xe]),E.messages=f.value}function ke(xe){return p.value[xe]||{}}function se(xe,He){p.value[xe]=He,E.datetimeFormats=p.value,XB(E,xe,He)}function me(xe,He){p.value[xe]=xi(p.value[xe]||{},He),E.datetimeFormats=p.value,XB(E,xe,He)}function ze(xe){return m.value[xe]||{}}function Ae(xe,He){m.value[xe]=He,E.numberFormats=m.value,ZB(E,xe,He)}function Ee(xe,He){m.value[xe]=xi(m.value[xe]||{},He),E.numberFormats=m.value,ZB(E,xe,He)}lU++,e&&wC&&(Qe(e.locale,xe=>{a&&(u.value=xe,E.locale=xe,jb(E,u.value,c.value))}),Qe(e.fallbackLocale,xe=>{a&&(c.value=xe,E.fallbackLocale=xe,jb(E,u.value,c.value))}));const Ce={id:lU,locale:P,fallbackLocale:Q,get inheritLocale(){return a},set inheritLocale(xe){a=xe,xe&&e&&(u.value=e.locale.value,c.value=e.fallbackLocale.value,jb(E,u.value,c.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:W,get modifiers(){return $},get pluralRules(){return C||{}},get isGlobal(){return o},get missingWarn(){return h},set missingWarn(xe){h=xe,E.missingWarn=h},get fallbackWarn(){return v},set fallbackWarn(xe){v=xe,E.fallbackWarn=v},get fallbackRoot(){return g},set fallbackRoot(xe){g=xe},get fallbackFormat(){return b},set fallbackFormat(xe){b=xe,E.fallbackFormat=b},get warnHtmlMessage(){return k},set warnHtmlMessage(xe){k=xe,E.warnHtmlMessage=xe},get escapeParameter(){return w},set escapeParameter(xe){w=xe,E.escapeParameter=xe},t:ge,getLocaleMessage:ye,setLocaleMessage:ce,mergeLocaleMessage:pe,getPostTranslationHandler:F,setPostTranslationHandler:j,getMissingHandler:te,setMissingHandler:ie,[wwe]:q};return Ce.datetimeFormats=Z,Ce.numberFormats=L,Ce.rt=$e,Ce.te=ne,Ce.tm=fe,Ce.d=le,Ce.n=ee,Ce.getDateTimeFormat=ke,Ce.setDateTimeFormat=se,Ce.mergeDateTimeFormat=me,Ce.getNumberFormat=ze,Ce.setNumberFormat=Ae,Ce.mergeNumberFormat=Ee,Ce[kwe]=n,Ce[$O]=R,Ce[TO]=V,Ce[EO]=U,Ce}const x5={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function Twe({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((o,r)=>[...o,...r.type===Me?r.children:[r]],[]):e.reduce((n,o)=>{const r=t[o];return r&&(n[o]=r()),n},Ar())}function NJ(){return Me}const Ewe=ae({name:"i18n-t",props:xi({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Zl(t)||!isNaN(t)}},x5),setup(t,e){const{slots:n,attrs:o}=e,r=t.i18n||Bt({useScope:t.scope,__useComponent:!0});return()=>{const l=()=>{const c=Object.keys(n).filter(m=>m[0]!=="_"),f=Ar();t.locale&&(f.locale=t.locale),t.plural!==void 0&&(f.plural=Xt(t.plural)?+t.plural:t.plural);const p=Twe(e,c);return r[$O](t.keypath,p,f)},a=xi(Ar(),o),u=Xt(t.tag)||Ho(t.tag)?t.tag:NJ();return Ho(u)?jo(u,a,{default:l}):jo(u,a,l())}}}),aU=Ewe;function Awe(t){return Rl(t)&&!Xt(t[0])}function LJ(t,e,n,o){const{slots:r,attrs:l}=e;return()=>{const a=()=>{const f={part:!0};let p=Ar();t.locale&&(f.locale=t.locale),Xt(t.format)?f.key=t.format:Ho(t.format)&&(Xt(t.format.key)&&(f.key=t.format.key),p=Object.keys(t.format).reduce((v,g)=>n.includes(g)?xi(Ar(),v,{[g]:t.format[g]}):v,Ar()));const m=o(t.value,f,p);let h=[f.key];return Rl(m)?h=m.map((v,g)=>{const b=r[v.type],x=b?b({[v.type]:v.value,index:g,parts:m}):[v.value];return Awe(x)&&(x[0].key=`${v.type}-${g}`),x}):Xt(m)&&(h=[m]),h},u=xi(Ar(),l),c=Xt(t.tag)||Ho(t.tag)?t.tag:NJ();return Ho(c)?jo(c,u,{default:a}):jo(c,u,a())}}const Dwe=ae({name:"i18n-n",props:xi({value:{type:Number,required:!0},format:{type:[String,Object]}},x5),setup(t,e){const n=t.i18n||Bt({useScope:t.scope,__useComponent:!0});return LJ(t,e,IJ,(...o)=>n[EO](...o))}}),sU=Dwe;function zwe(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const o=n.__getInstance(e);return o!=null?o.__composer:t.global.__composer}}function Owe(t){const e=a=>{const{instance:u,value:c}=a;if(!u||!u.$)throw au(ks.UNEXPECTED_ERROR);const f=zwe(t,u.$),p=uU(c);return[Reflect.apply(f.t,f,[...cU(p)]),f]};return{created:(a,u)=>{const[c,f]=e(u);wC&&(a.__i18nWatcher=Qe(f.locale,()=>{u.instance&&u.instance.$forceUpdate()})),a.__composer=f,a.textContent=c},unmounted:a=>{wC&&a.__i18nWatcher&&(a.__i18nWatcher(),a.__i18nWatcher=void 0,delete a.__i18nWatcher),a.__composer&&(a.__composer=void 0,delete a.__composer)},beforeUpdate:(a,{value:u})=>{if(a.__composer){const c=a.__composer,f=uU(u);a.textContent=Reflect.apply(c.t,c,[...cU(f)])}},getSSRProps:a=>{const[u]=e(a);return{textContent:u}}}}function uU(t){if(Xt(t))return{path:t};if(rr(t)){if(!("path"in t))throw au(ks.REQUIRED_VALUE,"path");return t}else throw au(ks.INVALID_VALUE)}function cU(t){const{path:e,locale:n,args:o,choice:r,plural:l}=t,a={},u=o||{};return Xt(n)&&(a.locale=n),Zl(r)&&(a.plural=r),Zl(l)&&(a.plural=l),[e,u,a]}function Mwe(t,e,...n){const o=rr(n[0])?n[0]:{};(!cl(o.globalInstall)||o.globalInstall)&&([aU.name,"I18nT"].forEach(l=>t.component(l,aU)),[sU.name,"I18nN"].forEach(l=>t.component(l,sU)),[pU.name,"I18nD"].forEach(l=>t.component(l,pU))),t.directive("t",Owe(e))}const Iwe=qm("global-vue-i18n");function Rwe(t={}){const e=cl(t.globalInjection)?t.globalInjection:!0,n=new Map,[o,r]=Vwe(t),l=qm("");function a(p){return n.get(p)||null}function u(p,m){n.set(p,m)}function c(p){n.delete(p)}const f={get mode(){return"composition"},async install(p,...m){if(p.__VUE_I18N_SYMBOL__=l,p.provide(p.__VUE_I18N_SYMBOL__,f),rr(m[0])){const g=m[0];f.__composerExtend=g.__composerExtend,f.__vueI18nExtend=g.__vueI18nExtend}let h=null;e&&(h=qwe(p,f.global)),Mwe(p,f,...m);const v=p.unmount;p.unmount=()=>{h&&h(),f.dispose(),v()}},get global(){return r},dispose(){o.stop()},__instances:n,__getInstance:a,__setInstance:u,__deleteInstance:c};return f}function Bt(t={}){const e=b5();if(e==null)throw au(ks.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw au(ks.NOT_INSTALLED);const n=Pwe(e),o=Nwe(n),r=FJ(e),l=Fwe(t,r);if(l==="global")return Swe(o,t,r),o;if(l==="parent"){let c=dU(n,e,t.__useComponent);return c==null&&(c=o),c}if(l==="isolated"){if(n.mode!=="composition")throw au(ks.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const c=n,f=xi({},t),p=dU(n,e);f.__root=p||o;const m=AO(f);return c.__composerExtend&&(m[Xg]=c.__composerExtend(m)),Jv()&&Um(()=>{const v=m[Xg];v&&(v(),delete m[Xg])}),m}const a=n;let u=a.__getInstance(e);if(u==null){const c=xi({},t);"__i18n"in r&&(c.__i18n=r.__i18n),o&&(c.__root=o),u=AO(c),a.__composerExtend&&(u[Xg]=a.__composerExtend(u)),Bwe(a,e,u),a.__setInstance(e,u)}return u}function Vwe(t,e){const n=Ly(),o=n.run(()=>AO(t));if(o==null)throw au(ks.UNEXPECTED_ERROR);return[n,o]}function Pwe(t){const e=Yn(t.isCE?Iwe:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw au(t.isCE?ks.NOT_INSTALLED_WITH_PROVIDE:ks.UNEXPECTED_ERROR);return e}function Fwe(t,e){return h8(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function Nwe(t){return t.mode==="composition"?t.global:t.global.__composer}function dU(t,e,n=!1){let o=null;const r=e.root;let l=Lwe(e,n);for(;l!=null;){const a=t;if(t.mode==="composition"&&(o=a.__getInstance(l)),o!=null||r===l)break;l=l.parent}return o}function Lwe(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function Bwe(t,e,n){Ht(()=>{},e),Xo(()=>{const o=n;t.__deleteInstance(e);const r=o[Xg];r&&(r(),delete o[Xg])},e)}const Uwe=["locale","fallbackLocale","availableLocales"],fU=["t","rt","d","n","tm","te"];function qwe(t,e){const n=Object.create(null);return Uwe.forEach(r=>{const l=Object.getOwnPropertyDescriptor(e,r);if(!l)throw au(ks.UNEXPECTED_ERROR);const a=Kt(l.value)?{get(){return l.value.value},set(u){l.value.value=u}}:{get(){return l.get&&l.get()}};Object.defineProperty(n,r,a)}),t.config.globalProperties.$i18n=n,fU.forEach(r=>{const l=Object.getOwnPropertyDescriptor(e,r);if(!l||!l.value)throw au(ks.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,l)}),()=>{delete t.config.globalProperties.$i18n,fU.forEach(r=>{delete t.config.globalProperties[`$${r}`]})}}const jwe=ae({name:"i18n-d",props:xi({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},x5),setup(t,e){const n=t.i18n||Bt({useScope:t.scope,__useComponent:!0});return LJ(t,e,MJ,(...o)=>n[TO](...o))}}),pU=jwe;_we();ewe(R_e);twe(X_e);nwe(wO);if(__INTLIFY_PROD_DEVTOOLS__){const t=d5();t.__INTLIFY__=!0,V_e(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Hwe=t=>typeof t=="function",he=function(t,e){if(typeof t=="function")return function(){return t(arguments)?e.apply(this,arguments):n=>e(n,...arguments)};switch(t){case 0:case 1:throw new RangeError(`Invalid arity ${t}`);case 2:return function(n,o){return arguments.length>=2?e(n,o):function(r){return e(r,n)}};case 3:return function(n,o,r){return arguments.length>=3?e(n,o,r):function(l){return e(l,n,o)}};case 4:return function(n,o,r,l){return arguments.length>=4?e(n,o,r,l):function(a){return e(a,n,o,r)}};case 5:return function(n,o,r,l,a){return arguments.length>=5?e(n,o,r,l,a):function(u){return e(u,n,o,r,l)}};default:return function(){if(arguments.length>=t)return e.apply(this,arguments);const n=arguments;return function(o){return e(o,...n)}}}},Un=t=>t,fw=t=>()=>t,$C=fw(!0),q0=fw(!1),Wwe=fw(null),BJ=fw(void 0),Yx=BJ,_5=t=>{throw new Error("Called `absurd` function which should be uncallable")};function Ie(t,e,n,o,r,l,a,u,c){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return n(e(t));case 4:return o(n(e(t)));case 5:return r(o(n(e(t))));case 6:return l(r(o(n(e(t)))));case 7:return a(l(r(o(n(e(t))))));case 8:return u(a(l(r(o(n(e(t)))))));case 9:return c(u(a(l(r(o(n(e(t))))))));default:{let f=arguments[0];for(let p=1;p<arguments.length;p++)f=arguments[p](f);return f}}}const y8=t=>(e,n)=>e===n||t(e,n),Kwe=he(2,(t,e)=>y8((n,o)=>t(e(n),e(o)))),Gwe=t=>y8((e,n)=>{if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!t(e[o],n[o]))return!1;return!0}),Ywe=t=>he(3,(e,n,o)=>t(e,r=>({...r,[n]:o(r)}))),Jwe=t=>he(2,(e,n)=>t(e,o=>({[n]:o}))),Xwe=(t,e)=>he(3,(n,o,r)=>e(n,l=>t(r(l),a=>({...l,[o]:a})))),mU="effect/GlobalValue";let Hb;const uo=(t,e)=>(Hb||(globalThis[mU]??=new Map,Hb=globalThis[mU]),Hb.has(t)||Hb.set(t,e()),Hb.get(t)),Vi=t=>typeof t=="string",Yf=t=>typeof t=="number",pw=t=>typeof t=="boolean",b8=t=>typeof t=="bigint",DO=t=>typeof t=="symbol",By=Hwe,Qwe=t=>t===void 0,Zwe=t=>t!==void 0,FA=t=>t!==null,e2e=t=>!1,w5=t=>typeof t=="object"&&t!==null,Nd=t=>w5(t)||By(t),mn=he(2,(t,e)=>Nd(t)&&e in t),x8=he(2,(t,e)=>mn(t,"_tag")&&t._tag===e),Tg=t=>t==null,t2e=t=>t!=null,n2e=t=>t instanceof Date,hp=t=>typeof t=="string"||mn(t,Symbol.iterator),Jx=t=>w5(t)&&!Array.isArray(t),UJ=t=>mn(t,"then")&&By(t.then),_8=t=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`;let qJ=class jJ{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new jJ(this.self)}};const o2e=335903614,r2e=4150755663,l2e=1481765933,i2e=1284865837,a2e=9007199254740992,s2e=134217728;class u2e{_state;constructor(e,n,o,r){return Tg(n)&&Tg(e)?(n=Math.random()*4294967295>>>0,e=0):Tg(n)&&(n=e,e=0),Tg(r)&&Tg(o)?(r=this._state?this._state[3]:r2e,o=this._state?this._state[2]:o2e):Tg(r)&&(r=o,o=0),this._state=new Int32Array([0,0,o>>>0,((r||0)|1)>>>0]),this._next(),hU(this._state,this._state[0],this._state[1],e>>>0,n>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(e){this._state[0]=e[0],this._state[1]=e[1],this._state[2]=e[2],this._state[3]=e[3]|1}integer(e){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%e}number(){const e=(this._next()&67108863)*1,n=(this._next()&134217727)*1;return(e*s2e+n)/a2e}_next(){const e=this._state[0]>>>0,n=this._state[1]>>>0;c2e(this._state,e,n,l2e,i2e),hU(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let o=e>>>18,r=(n>>>18|e<<14)>>>0;o=(o^e)>>>0,r=(r^n)>>>0;const l=(r>>>27|o<<5)>>>0,a=e>>>27,u=(-a>>>0&31)>>>0;return(l>>>a|l<<u)>>>0}}function c2e(t,e,n,o,r){let l=(n>>>16)*(r&65535)>>>0,a=(n&65535)*(r>>>16)>>>0,u=(n&65535)*(r&65535)>>>0,c=(n>>>16)*(r>>>16)+((a>>>16)+(l>>>16))>>>0;a=a<<16>>>0,u=u+a>>>0,u>>>0<a>>>0&&(c=c+1>>>0),l=l<<16>>>0,u=u+l>>>0,u>>>0<l>>>0&&(c=c+1>>>0),c=c+Math.imul(n,o)>>>0,c=c+Math.imul(e,r)>>>0,t[0]=c,t[1]=u}function hU(t,e,n,o,r){let l=e+o>>>0;const a=n+r>>>0;a>>>0<n>>>0&&(l=l+1|0),t[0]=l,t[1]=a}const zO=Symbol.for("effect/Utils/YieldWrap");class mw{#e;constructor(e){this.#e=e}[zO](){return this.#e}}function d2e(t){if(typeof t=="object"&&t!==null&&zO in t)return t[zO]();throw new Error(_8("yieldWrapGet"))}const Ws=uo("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0})),HJ={effect_internal_function:t=>t()},f2e={effect_internal_function:t=>t()},p2e=HJ.effect_internal_function(()=>new Error().stack)?.includes("effect_internal_function")===!0,Xl=p2e?HJ.effect_internal_function:f2e.effect_internal_function,m2e=function*(){}.constructor,h2e=t=>Nd(t)&&t.constructor===m2e,NA=uo(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),ro=Symbol.for("effect/Hash"),en=t=>{if(Ws.enabled===!0)return 0;switch(typeof t){case"number":return S5(t);case"bigint":return wl(t.toString(10));case"boolean":return wl(String(t));case"symbol":return wl(String(t));case"string":return wl(t);case"undefined":return wl("undefined");case"function":case"object":return t===null?wl("null"):t instanceof Date?Number.isNaN(t.getTime())?wl("Invalid Date"):en(t.toISOString()):t instanceof URL?en(t.href):v2e(t)?t[ro]():k5(t);default:throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},k5=t=>(NA.has(t)||NA.set(t,S5(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),NA.get(t)),yo=t=>e=>e*53^t,w8=t=>t&3221225471|t>>>1&1073741824,v2e=t=>mn(t,ro),S5=t=>{if(t!==t||t===1/0)return 0;let e=t|0;for(e!==t&&(e^=t*4294967295);t>4294967295;)e^=t/=4294967295;return w8(e)},wl=t=>{let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return w8(e)},g2e=(t,e)=>{let n=12289;for(let o=0;o<e.length;o++)n^=Ie(wl(e[o]),yo(en(t[e[o]])));return w8(n)},WJ=t=>g2e(t,Object.keys(t)),hw=t=>{let e=6151;for(let n=0;n<t.length;n++)e=Ie(e,yo(en(t[n])));return w8(e)},Jr=function(){if(arguments.length===1){const n=arguments[0];return function(o){return Object.defineProperty(n,ro,{value(){return o},enumerable:!1}),o}}const t=arguments[0],e=arguments[1];return Object.defineProperty(t,ro,{value(){return e},enumerable:!1}),e},lo=Symbol.for("effect/Equal");function Tn(){return arguments.length===1?t=>TC(t,arguments[0]):TC(arguments[0],arguments[1])}function TC(t,e){if(t===e)return!0;const n=typeof t;if(n!==typeof e)return!1;if(n==="object"||n==="function"){if(t!==null&&e!==null){if(Xx(t)&&Xx(e))return en(t)===en(e)&&t[lo](e)?!0:Ws.enabled&&Ws.tester?Ws.tester(t,e):!1;if(t instanceof Date&&e instanceof Date){const o=t.getTime(),r=e.getTime();return o===r||Number.isNaN(o)&&Number.isNaN(r)}else if(t instanceof URL&&e instanceof URL)return t.href===e.href}if(Ws.enabled){if(t===null||e===null)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every((o,r)=>TC(o,e[r]));if(Object.getPrototypeOf(t)===Object.prototype&&Object.getPrototypeOf(e)===Object.prototype){const o=Object.keys(t),r=Object.keys(e);if(o.length===r.length){for(const l of o)if(!(l in e&&TC(t[l],e[l])))return Ws.tester?Ws.tester(t,e):!1;return!0}}return Ws.tester?Ws.tester(t,e):!1}}return Ws.enabled&&Ws.tester?Ws.tester(t,e):!1}const Xx=t=>mn(t,lo),C5=()=>Tn,Kr=Symbol.for("nodejs.util.inspect.custom"),pl=t=>{try{if(mn(t,"toJSON")&&By(t.toJSON)&&t.toJSON.length===0)return t.toJSON();if(Array.isArray(t))return t.map(pl)}catch{return{}}return _2e(t)},LA="[Circular]";function y2e(t){try{return t.toISOString()}catch{return"Invalid Date"}}function b2e(t){try{const e=t.toString();return typeof e=="string"?e:String(e)}catch{return"[toString threw]"}}function $5(t){return Vi(t)?JSON.stringify(t):String(t)}function Qv(t,e){const n=new WeakSet,o=(a,u)=>{const c=a?.constructor;return c&&c!==Object.prototype.constructor&&c.name?`${c.name}(${u})`:u},r=a=>{try{return Reflect.ownKeys(a)}catch{return["[ownKeys threw]"]}};function l(a,u=0){if(Array.isArray(a))return n.has(a)?LA:(n.add(a),`[${a.map(c=>l(c,u)).join(",")}]`);if(n2e(a))return y2e(a);if(mn(a,"toString")&&By(a.toString)&&a.toString!==Object.prototype.toString&&a.toString!==Array.prototype.toString){const c=b2e(a);return a instanceof Error&&a.cause?`${c} (cause: ${l(a.cause,u)})`:c}if(Vi(a))return JSON.stringify(a);if(Yf(a)||a==null||pw(a)||DO(a))return String(a);if(b8(a))return String(a)+"n";if(a instanceof Set||a instanceof Map)return n.has(a)?LA:(n.add(a),`${a.constructor.name}(${l(Array.from(a),u)})`);if(Nd(a)){if(n.has(a))return LA;n.add(a);const c=r(a);{const f=`{${c.map(p=>`${$5(p)}:${l(a[p],u)}`).join(",")}}`;return o(a,f)}}return String(a)}return l(t,0)}const Wl=t=>JSON.stringify(t,null,2),j0=(t,e=2)=>{if(typeof t=="string")return t;try{return typeof t=="object"?KJ(t,e):String(t)}catch{return String(t)}},KJ=(t,e)=>{let n=[];const o=JSON.stringify(t,(r,l)=>typeof l=="object"&&l!==null?n.includes(l)?void 0:n.push(l)&&(rv.fiberRefs!==void 0&&GJ(l)?l[T5](rv.fiberRefs):l):l,e);return n=void 0,o},T5=Symbol.for("effect/Inspectable/Redactable"),GJ=t=>typeof t=="object"&&t!==null&&T5 in t,rv=uo("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),x2e=(t,e)=>{const n=rv.fiberRefs;rv.fiberRefs=t;try{return e()}finally{rv.fiberRefs=n}},_2e=t=>GJ(t)&&rv.fiberRefs!==void 0?t[T5](rv.fiberRefs):t,yn=(t,e)=>{switch(e.length){case 0:return t;case 1:return e[0](t);case 2:return e[1](e[0](t));case 3:return e[2](e[1](e[0](t)));case 4:return e[3](e[2](e[1](e[0](t))));case 5:return e[4](e[3](e[2](e[1](e[0](t)))));case 6:return e[5](e[4](e[3](e[2](e[1](e[0](t))))));case 7:return e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))));case 8:return e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t))))))));case 9:return e[8](e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))))));default:{let n=t;for(let o=0,r=e.length;o<r;o++)n=e[o](n);return n}}},sx="Async",k8="Commit",Li="Failure",pS="OnFailure",EC="OnSuccess",AC="OnSuccessAndFailure",Bi="Success",YJ="Sync",w2e="Tag",Zv="UpdateRuntimeFlags",DC="While",ux="Iterator",JJ="WithRuntime",mS="Yield",E5="RevertFlags";let k2e="3.21.2";const A5=()=>k2e,S2e=Symbol.for("effect/Effect"),C2e=Symbol.for("effect/Stream"),$2e=Symbol.for("effect/Sink"),T2e=Symbol.for("effect/Channel"),H0={_R:t=>t,_E:t=>t,_A:t=>t,_V:A5()},E2e={_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t},A2e={_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},vw={[S2e]:H0,[C2e]:H0,[$2e]:E2e,[T2e]:A2e,[lo](t){return this===t},[ro](){return Jr(this,k5(this))},[Symbol.iterator](){return new qJ(new mw(this))},pipe(){return yn(this,arguments)}},S8={[ro](){return Jr(this,WJ(this))},[lo](t){const e=Object.keys(this),n=Object.keys(t);if(e.length!==n.length)return!1;for(const o of e)if(!(o in t&&Tn(this[o],t[o])))return!1;return!0}},Uy={...vw,_op:k8},D2e={...Uy,...S8},z2e=(function(){function t(){}return t.prototype=Uy,t})(),XJ=Symbol.for("effect/Option"),QJ={...vw,[XJ]:{_A:t=>t},[Kr](){return this.toJSON()},toString(){return Wl(this.toJSON())}},O2e=Object.assign(Object.create(QJ),{_tag:"Some",_op:"Some",[lo](t){return D5(t)&&ZJ(t)&&Tn(this.value,t.value)},[ro](){return Jr(this,yo(en(this._tag))(en(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:pl(this.value)}}}),M2e=en("None"),I2e=Object.assign(Object.create(QJ),{_tag:"None",_op:"None",[lo](t){return D5(t)&&C8(t)},[ro](){return M2e},toJSON(){return{_id:"Option",_tag:this._tag}}}),D5=t=>mn(t,XJ),C8=t=>t._tag==="None",ZJ=t=>t._tag==="Some",$8=Object.create(I2e),bv=t=>{const e=Object.create(O2e);return e.value=t,e},eX=Symbol.for("effect/Either"),tX={...vw,[eX]:{_R:t=>t},[Kr](){return this.toJSON()},toString(){return Wl(this.toJSON())}},R2e=Object.assign(Object.create(tX),{_tag:"Right",_op:"Right",[lo](t){return z5(t)&&nX(t)&&Tn(this.right,t.right)},[ro](){return yo(en(this._tag))(en(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:pl(this.right)}}}),V2e=Object.assign(Object.create(tX),{_tag:"Left",_op:"Left",[lo](t){return z5(t)&&O5(t)&&Tn(this.left,t.left)},[ro](){return yo(en(this._tag))(en(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:pl(this.left)}}}),z5=t=>mn(t,eX),O5=t=>t._tag==="Left",nX=t=>t._tag==="Right",P2e=t=>{const e=Object.create(V2e);return e.left=t,e},F2e=t=>{const e=Object.create(R2e);return e.right=t,e},N2e=t=>O5(t)?$8:bv(t.right),fn=F2e,nn=P2e,L2e=z5,Fo=O5,ba=nX,B2e=he(2,(t,{onLeft:e,onRight:n})=>Fo(t)?nn(e(t.left)):fn(n(t.right))),oX=he(2,(t,e)=>Fo(t)?nn(e(t.left)):fn(t.right)),rX=he(2,(t,e)=>ba(t)?fn(e(t.right)):nn(t.left)),gs=he(2,(t,{onLeft:e,onRight:n})=>Fo(t)?e(t.left):n(t.right)),lX=gs({onLeft:Un,onRight:Un}),M5=he(2,(t,e)=>{if(ba(t))return t.right;throw e(t.left)}),iX=M5(()=>new Error("getOrThrow called on a Left")),aX=t=>t.length>0,sX=t=>(e,n)=>e===n?0:t(e,n),U2e=sX((t,e)=>t<e?-1:1),uX=he(2,(t,e)=>sX((n,o)=>t(e(n),e(o)))),q2e=t=>he(2,(e,n)=>t(e,n)===1),pt=()=>$8,bt=bv,Ms=D5,mr=C8,cn=ZJ,lr=he(2,(t,{onNone:e,onSome:n})=>mr(t)?e():n(t.value)),cX=N2e,Pr=he(2,(t,e)=>mr(t)?e():t.value),Pf=he(2,(t,e)=>mr(t)?e():t),j2e=he(2,(t,e)=>mr(t)?bt(e()):t),qy=t=>t==null?pt():bt(t),bc=Pr(Wwe),Vl=Pr(BJ),dX=t=>(...e)=>{try{return bt(t(...e))}catch{return pt()}},H2e=he(2,(t,e)=>{if(cn(t))return t.value;throw e()}),W2e=H2e(()=>new Error("getOrThrow called on a None")),d0=he(2,(t,e)=>mr(t)?pt():bt(e(t.value))),eg=he(2,(t,e)=>mr(t)?pt():e(t.value)),K2e=he(2,(t,e)=>mr(t)?pt():qy(e(t.value))),G2e=eg,jg=he(2,(t,e)=>G2e(t,n=>e(n)?bv(n):$8)),Y2e=t=>y8((e,n)=>mr(e)?mr(n):mr(n)?!1:t(e.value,n.value)),J2e=t=>he(2,(e,n)=>mr(e)?!1:t(e.value,n)),X2e=C5(),Q2e=J2e(X2e),Z2e=he(2,(t,e)=>mr(t)?!1:e(t.value)),zC=t=>(e,n)=>mr(e)?n:mr(n)?e:bt(t(e.value,n.value)),eke=(...t)=>t,tke=t=>oke(t).length===0,nke=he(2,(t,e)=>Object.prototype.hasOwnProperty.call(t,e)),oke=t=>Object.keys(t),T8=t=>new Array(t),rke=he(2,(t,e)=>{const n=Math.max(1,Math.floor(t)),o=new Array(n);for(let r=0;r<n;r++)o[r]=e(r);return o}),To=t=>Array.isArray(t)?t:Array.from(t),lke=t=>Array.isArray(t)?t:[t],ike=he(2,(t,{onEmpty:e,onNonEmpty:n})=>El(t)?n(Fa(t),xv(t)):e()),OC=he(2,(t,e)=>[e,...t]),ake=he(2,(t,e)=>[...t,e]),fX=he(2,(t,e)=>To(t).concat(To(e))),ske=Array.isArray,uke=t=>t.length===0,cke=uke,cx=aX,El=aX,pX=(t,e)=>t<0||t>=e.length,dke=(t,e)=>Math.floor(Math.min(Math.max(0,t),e.length)),fke=he(2,(t,e)=>{const n=Math.floor(e);return pX(n,t)?pt():bt(t[n])}),mX=he(2,(t,e)=>{const n=Math.floor(e);if(pX(n,t))throw new Error(`Index ${n} out of bounds`);return t[n]}),dx=fke(0),Fa=mX(0),pke=t=>El(t)?bt(hX(t)):pt(),hX=t=>t[t.length-1],xv=t=>t.slice(1),mke=(t,e)=>{let n=0;for(const o of t){if(!e(o,n))break;n++}return n},hke=he(2,(t,e)=>vX(t,mke(t,e))),vke=he(2,(t,e)=>{const n=To(t);return n.slice(dke(e,n),n.length)}),vU=t=>Array.from(t).reverse(),Qx=he(2,(t,e)=>{const n=Array.from(t);return n.sort(e),n}),gU=he(2,(t,e)=>gke(t,e,eke)),gke=he(3,(t,e,n)=>{const o=To(t),r=To(e);if(El(o)&&El(r)){const l=[n(Fa(o),Fa(r))],a=Math.min(o.length,r.length);for(let u=1;u<a;u++)l[u]=n(o[u],r[u]);return l}return[]}),yke=C5(),vX=he(2,(t,e)=>{const n=Array.from(t),o=Math.floor(e);return El(n)?o>=1?bke(n,o):[[],n]:[n,[]]}),bke=he(2,(t,e)=>{const n=Math.max(1,Math.floor(e));return n>=t.length?[z1(t),[]]:[OC(t.slice(1,n),Fa(t)),t.slice(n)]}),z1=t=>t.slice(),xke=he(3,(t,e,n)=>{const o=To(t),r=To(e);return El(o)?El(r)?yX(n)(fX(o,r)):o:r}),f0=he(2,(t,e)=>xke(t,e,yke)),_m=()=>[],Ru=t=>[t],lv=he(2,(t,e)=>t.map(e)),gX=he(2,(t,e)=>{if(cke(t))return[];const n=[];for(let o=0;o<t.length;o++){const r=e(t[o],o);for(let l=0;l<r.length;l++)n.push(r[l])}return n}),I5=gX(Un),gw=he(2,(t,e)=>{const n=To(t),o=[];for(let r=0;r<n.length;r++){const l=e(n[r],r);cn(l)&&o.push(l.value)}return o}),_ke=he(2,(t,e)=>{const n=[],o=[],r=To(t);for(let l=0;l<r.length;l++){const a=e(r[l],l);Fo(a)?n.push(a.left):o.push(a.right)}return[n,o]}),wke=gw(Un),kke=he(2,(t,e)=>{const n=To(t),o=[];for(let r=0;r<n.length;r++)e(n[r],r)&&o.push(n[r]);return o}),E8=he(3,(t,e,n)=>To(t).reduce((o,r,l)=>n(o,r,l),e)),Ske=he(3,(t,e,n)=>To(t).reduceRight((o,r,l)=>n(o,r,l),e)),yU=(t,e)=>{const n=[];let o=t,r;for(;cn(r=e(o));){const[l,a]=r.value;n.push(l),o=a}return n},R5=Gwe,yX=he(2,(t,e)=>{const n=To(t);if(El(n)){const o=[Fa(n)],r=xv(n);for(const l of r)o.every(a=>!e(l,a))&&o.push(l);return o}return[]}),Cke=t=>yX(t,C5()),jy=he(2,(t,e)=>To(t).join(e)),bX=(t,e)=>{switch(e._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(t);case"SymbolKeyword":return Object.getOwnPropertySymbols(t);case"Refinement":return bX(t,e.from)}},xX=t=>{let e=!1,n;return()=>(e||(n=t(),e=!0),n)},V5=t=>Array.isArray(t),$ke=t=>!Array.isArray(t),bU=t=>`[${$5(t)}]`,_X=t=>V5(t)?t.map(bU).join(""):bU(t),xc=(t,e,n,o)=>{let r=t;return n&&El(n)&&(r+=`
|
|
@@ -62,7 +62,7 @@ ${f}`,o}},l=t.spanOptions&&"captureStackTrace"in t.spanOptions?t.spanOptions:{ca
|
|
|
62
62
|
`;)f++;const p=r.slice(c,f),m=`> ${`${l}`.padStart(4," ")} | ${p}
|
|
63
63
|
${" ".repeat(9+u)}^`;return`${t}
|
|
64
64
|
|
|
65
|
-
${m}`}function AI(t,e){return t instanceof Db?t.withAst(e):t}function C3(t){return t===void 0?pt():bt(t)}function hst(t){if(mr(t))throw _n("optional_value_missing","Optional value is not present");return t.value}class Qse{#e="optional";toString(){return this.#e}}const vst=new Qse;function gst(t){const e=(f,p)=>t.registerFunctionOverload(f,p);t.registerType("OptionalNamespace",Qse),t.registerConstant("optional","OptionalNamespace",vst),e("optional.hasValue(): bool",f=>cn(f)),e("optional<A>.value(): A",f=>hst(f)),t.registerFunctionOverload("OptionalNamespace.none(): optional<T>",()=>pt()),e("OptionalNamespace.of(A): optional<A>",(f,p)=>C3(p));function n(f,p,m){if(Ms(f))return f;throw _n("optional_expected",`${m} must be optional`,p)}function o(f,p,m){return qt(function*(){const h=yield*f.eval(p.receiver,m),v=n(h,p.receiver,`${p.functionDesc} receiver`);return cn(v)?p.onHasValue(v):yield*p.onEmpty(f,p,m)})}function r(f,p,m,h){const v=f.check(p,m);if(v.kind==="optional")return v;if(v.kind==="dyn")return f.getType("optional");throw f.createError("optional_expected",`${h} must be optional, got '${v}'`,p)}function l({functionDesc:f,evaluate:p,typeCheck:m,onHasValue:h,onEmpty:v}){return g=>{const{ast:b,args:x,receiver:y}=g;return{ast:b,functionDesc:f,receiver:y,arg:x[0],evaluate:p,typeCheck:m,onHasValue:h,onEmpty:v}}}const a="optional.orValue() receiver",u="optional.or(optional) receiver",c="optional.or(optional) argument";t.registerFunctionOverload("optional.or(ast): optional<dyn>",l({functionDesc:"optional.or(optional)",evaluate:o,typeCheck(f,p,m){const h=r(f,p.receiver,m,u),v=r(f,p.arg,m,c),g=h.unify(f.registry,v);if(g)return g;throw f.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${h}' and '${v}'`,p.arg)},onHasValue:f=>f,onEmpty(f,p,m){const h=p.arg;return f.eval(h,m).pipe(Zn(v=>n(v,h,c)))}})),t.registerFunctionOverload("optional.orValue(ast): dyn",l({functionDesc:"optional.orValue(value)",onHasValue:f=>f.value,onEmpty(f,p,m){return f.eval(p.arg,m)},evaluate:o,typeCheck(f,p,m){const h=r(f,p.receiver,m,a).valueType,v=f.check(p.arg,m);if(!h)return v;const g=h.unify(f.registry,v);if(g)return g;throw f.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${h}' and '${v}'`,p.arg)}})),t.registerFunctionOverload("optional<A>.flatMap(ast, ast): optional<dyn>",yst())}function yst(){const t="optional.flatMap(var, body)",e=`${t} invalid iteration variable`,n=`${t} receiver`,o=`${t} body`;function r(c,f,p){if(Ms(c))return c;throw _n("optional_expected",`${p} must be optional`,f)}function l(c,f,p,m){const h=c.check(f,p);if(h.kind==="optional")return h;if(h.kind==="dyn")return c.getType("optional");throw c.createError("optional_expected",`${m} must be optional, got '${h}'`,f)}function a(c,f,p){const h=l(c,f.receiver,p,n).valueType??c.getType("dyn");return f.iterCtx=p.forkWithVariable(f.iterVarName,h),l(c,f.body,f.iterCtx,o)}function u(c,f,p){return qt(function*(){const m=yield*c.eval(f.receiver,p),h=r(m,f.receiver,n);if(mr(h))return pt();const v=f.iterCtx.reuse(p),g=yield*c.eval(f.body,v.setIterValue(h.value,c));return r(g,f.body,o)})}return c=>{const{args:f,receiver:p,ast:m}=c,h=f[0];if(h.op!=="id")throw va("invalid_macro_argument",e,h);return{ast:m,receiver:p,functionDesc:t,iterVarName:h.args,body:f[1],iterCtx:void 0,evaluate:u,typeCheck:a}}}const $3=Object.hasOwn,cu=Object.keys,Tp=Object.freeze,bst=Object.entries,fv=Array.isArray,Mj=Array.from;function Zse(t,e){return t?.[Symbol.toStringTag]==="AsyncFunction"?!0:typeof e=="boolean"?e:!0}const B$=new Set(["as","break","const","continue","else","for","function","if","import","let","loop","package","namespace","return","var","void","while","__proto__","prototype"]);class Ys{#e;constructor(e){this.#e=e,Tp(this)}get name(){return this.#e}get[Symbol.toStringTag](){return`Type<${this.#e}>`}toString(){return`Type<${this.#e}>`}}const sm={string:new Ys("string"),bool:new Ys("bool"),number:new Ys("number"),map:new Ys("map"),list:new Ys("list"),bytes:new Ys("bytes"),null_type:new Ys("null"),type:new Ys("type")},U$={dyn(t,e){switch(typeof t){case"string":case"number":case"bigint":case"boolean":return!0;case"object":if(t instanceof It)return!0;switch(t&&t.constructor){case null:case void 0:case Object:case Map:case Array:case Set:return!0;default:if(e.objectTypesByConstructor.get(t.constructor))return!0}}return!!e.debugType(t)},string(t){return typeof t=="string"},number(t){return t instanceof It||typeof t=="number"||typeof t=="bigint"},bool(t){return typeof t=="boolean"},null(t){return t===null},bytes(t){return t instanceof Uint8Array},type(t){return t instanceof Ys},list(t){switch(t?.constructor){case Array:case Set:return!0;default:return!1}},map(t){switch(typeof t=="object"&&t?t.constructor:null){case void 0:case Object:case Map:return!0;default:return!1}},optional(t){return Ms(t)},message(t,e){return this===e.debugType(t)}};U$.param=U$.dyn;class ip{#e=new WeakMap;kind;type;name;keyType;valueType;unwrappedType;wrappedType;hasDynType;hasPlaceholderType;matchesValueType;fieldLazy;constructor({kind:e,type:n,name:o,keyType:r,valueType:l}){this.kind=e,this.type=n,this.name=o,this.keyType=r,this.valueType=l,this.unwrappedType=e==="dyn"&&l?l.unwrappedType:this,this.wrappedType=e==="dyn"?this:eue(this.unwrappedType),this.hasDynType=this.kind==="dyn"||this.valueType?.hasDynType||this.keyType?.hasDynType||!1,this.hasPlaceholderType=this.kind==="param"||this.keyType?.hasPlaceholderType||this.valueType?.hasPlaceholderType||!1,this.fieldLazy=(a,u,c,f)=>{},e==="list"?this.fieldLazy=this.#i.bind(this):e==="map"?this.fieldLazy=this.#r.bind(this):e==="message"?this.fieldLazy=this.#o.bind(this):e==="optional"&&(this.fieldLazy=this.#t.bind(this)),this.matchesValueType=U$[o]||U$[e],Tp(this)}isDynOrBool(){return this.type==="bool"||this.kind==="dyn"}isEmpty(){return!!(this.valueType&&this.valueType.kind==="param")}unify(e,n){if(this===n||this.kind==="dyn"||n.kind==="param")return this;if(n.kind==="dyn"||this.kind==="param")return n;if(this.kind!==n.kind||!(this.hasPlaceholderType||n.hasPlaceholderType||this.hasDynType||n.hasDynType))return null;const o=this.valueType.unify(e,n.valueType);if(!o)return null;switch(this.kind){case"optional":return e.getOptionalType(o);case"list":return e.getListType(o);case"map":{const r=this.keyType.unify(e,n.keyType);return r?e.getMapType(r,o):null}}return null}templated(e,n){if(!this.hasPlaceholderType)return this;switch(this.kind){case"dyn":return this.valueType.templated(e,n);case"param":return n?.get(this.name)||this;case"map":return e.getMapType(this.keyType.templated(e,n),this.valueType.templated(e,n));case"list":return e.getListType(this.valueType.templated(e,n));case"optional":return e.getOptionalType(this.valueType.templated(e,n));default:return this}}toString(){return this.name}#t(e,n,o,r){const l=Ms(e)?Vl(e):e;if(l===void 0)return pt();const a=r.debugType(l);try{return C3(a.fieldLazy(l,n,o,r))}catch(u){if(u instanceof EI)return pt();throw u}}#o(e,n,o,r){const l=e&&typeof e=="object"?e.constructor:void 0,a=l?r.objectTypesByConstructor.get(l):void 0;if(!a)return;const u=a.fields?a.fields[n]:Ya;if(!u)return;const c=e instanceof Map?e.get(n):e[n];if(c!==void 0){if(u.matchesValueType(c,r))return c;throw _n("field_type_mismatch",`Field '${n}' is not of type '${u}', got '${r.debugType(c)}'`,o)}}#r(e,n,o,r){const l=e instanceof Map?e.get(n):e&&$3(e,n)?e[n]:void 0;if(l!==void 0){if(this.valueType.matchesValueType(l,r))return l;throw _n("field_type_mismatch",`Field '${n}' is not of type '${this.valueType}', got '${r.debugType(l)}'`,o)}}#l(e,n){switch(e?.constructor){case Array:return e[n];case Set:{let o=0;for(const r of e)if(o++===n)return r}}}#i(e,n,o,r){let l;if(n instanceof It)l=n.toNumber();else if(typeof n=="bigint")l=Number(n);else if(typeof n=="number")l=n;else return;const a=this.#l(e,l);if(a===void 0){if(!e)return;const u=e;throw _n("index_out_of_bounds",`No such key: index out of bounds, index ${l} ${l<0?"< 0":`>= size ${u.length??u.size}`}`,o)}if(this.valueType.matchesValueType(a,r))return a;throw _n("list_item_type_mismatch",`List item with index '${l}' is not of type '${this.valueType}', got '${r.debugType(a)}'`,o)}field(e,n,o,r){const l=this.fieldLazy(e,n,o,r);if(l!==void 0)return l;throw _n("no_such_key",`No such key: ${n}`,o)}matchesBoth(e){return this.matches(e)&&e.matches(this)}matches(e){const n=this.unwrappedType;return e=e.unwrappedType,n===e||n.kind==="dyn"||e.kind==="dyn"||e.kind==="param"?!0:this.#e.get(e)??this.#e.set(e,this.#n(n,e)).get(e)}#n(e,n){switch(e.kind){case"dyn":case"param":return!0;case"list":return n.kind==="list"&&e.valueType.matches(n.valueType);case"map":return n.kind==="map"&&e.keyType.matches(n.keyType)&&e.valueType.matches(n.valueType);case"optional":return n.kind==="optional"&&e.valueType.matches(n.valueType);default:return e.name===n.name}}}const xst="have a .callAst property or .evaluate(checker, macro, ctx) method.",_st="have a .callAst property or .typeCheck(checker, macro, ctx) method.";function wst(t,e){const n=`Macro '${t}' must`;return function(r){const l=e(r);if(!l||typeof l!="object")throw new Error(`${n} return an object.`);if(l.callAst)return l;if(!l.evaluate)throw new Error(`${n} ${xst}`);if(!l.typeCheck)throw new Error(`${n} ${_st}`);return l}}class rF{name;type;description;label;constant;value;constructor(e,n,o,r,l){this.name=e,this.type=n,this.description=o??null,this.label=l??null,this.constant=r!==void 0,this.value=r,Tp(this)}}class q${name;async;receiverType;returnType;description;params;argTypes;macro;signature;handler;partitionKey;hasPlaceholderType;constructor({name:e,receiverType:n,returnType:o,handler:r,description:l,params:a,async:u}){if(typeof e!="string")throw new Error("name must be a string");if(r!==void 0&&typeof r!="function")throw new Error("handler must be a function");const c=r||((...p)=>{throw new Error(`Function '${e}' has no runtime implementation (type-checking stub)`)});this.name=e,this.async=r?Zse(r,u):!1,this.receiverType=n??null,this.returnType=o,this.description=l??null,this.params=a,this.argTypes=this.params.map(p=>p.type),this.macro=this.argTypes.includes(nue);const f=n?`${n}.`:"";this.signature=`${f}${e}(${this.argTypes.join(", ")}): ${o}`,this.handler=this.macro?wst(this.signature,c):c,this.partitionKey=`${n?"rcall":"call"}:${e}:${a.length}`,this.hasPlaceholderType=this.returnType.hasPlaceholderType||this.receiverType?.hasPlaceholderType||this.argTypes.some(p=>p.hasPlaceholderType)||!1,Tp(this)}matchesArgs(e){return e.length===this.argTypes.length&&this.argTypes.every((n,o)=>n.matches(e[o]))?this:null}}class yf{operator;leftType;rightType;handler;async;returnType;signature;hasPlaceholderType;constructor({op:e,leftType:n,rightType:o,handler:r,returnType:l,async:a}){this.operator=e,this.leftType=n,this.rightType=o||null,this.handler=r,this.async=Zse(r,a),this.returnType=l,o?this.signature=`${n} ${e} ${o}: ${l}`:this.signature=`${e}${n}: ${l}`,this.hasPlaceholderType=this.leftType.hasPlaceholderType||this.rightType?.hasPlaceholderType||!1,Tp(this)}equals(e){return this.operator===e.operator&&this.leftType===e.leftType&&this.rightType===e.rightType}}function lF(t){return new ip({kind:"list",name:`list<${t}>`,type:"list",valueType:t})}function Rh(t){return new ip({kind:"primitive",name:t,type:t})}function kst(t){return new ip({kind:"message",name:t,type:t})}function eue(t){const e=t?`dyn<${t}>`:"dyn";return new ip({kind:"dyn",name:e,type:e,valueType:t})}function tue(t){const e=`optional<${t}>`;return new ip({kind:"optional",name:e,type:"optional",valueType:t})}function iF(t,e){return new ip({kind:"map",name:`map<${t}, ${e}>`,type:"map",keyType:t,valueType:e})}function Sst(t){return new ip({kind:"param",name:t,type:t})}const Ya=eue(),nue=Rh("ast"),Ij=lF(Ya),Rj=iF(Ya,Ya),_l={string:Rh("string"),bool:Rh("bool"),number:Rh("number"),bytes:Rh("bytes"),dyn:Ya,null:Rh("null"),type:Rh("type"),optional:tue(Ya),list:Ij,"list<dyn>":Ij,map:Rj,"map<dyn, dyn>":Rj};for(const t of[_l.string,_l.number]){const e=lF(t),n=iF(_l.string,t);_l[e.name]=e,_l[n.name]=n}Object.freeze(_l);class Cst{returnType=null;async=!1;macro=!1;#e=null;#t=null;declarations=[];registry;constructor(e){this.registry=e}[Symbol.iterator](){return this.declarations[Symbol.iterator]()}add(e){this.returnType=(this.returnType||e.returnType).unify(this.registry,e.returnType)||Ya,e instanceof q$&&e.macro&&(this.macro=e),e.async&&!this.async&&(this.async=!0),this.declarations.push(e),this.#e?.clear(),this.#t?.clear()}findFunction(e,n=null){for(let o=0;o<this.declarations.length;o++){const r=this.declarations[o];if(!(r instanceof q$))continue;const l=this.#c(r,e,n);if(l)return l}return null}findUnaryOverload(e){const n=(this.#e??=new Map).get(e);if(n!==void 0)return n;let o=!1;for(const r of this.declarations)if(r instanceof yf&&r.leftType===e){o=r;break}return this.#e.set(e,o),o}findBinaryOverload(e,n){return e.kind==="dyn"&&e.valueType?n=n.wrappedType:n.kind==="dyn"&&n.valueType&&(e=e.wrappedType),this.#e?.get(e)?.get(n)??this.#r(this.#e??=new Map,e,n,this.#l(e,n))}checkBinaryOverload(e,n){return(this.#t??=new Map).get(e)?.get(n)??this.#o(this.#t,e,n,this.#i(e,n))}#o(e,n,o,r){return(e.get(n)??(e.set(n,new Map),e.get(n))).set(o,r),r}#r(e,n,o,r){return(e.get(n)??(e.set(n,new Map),e.get(n))).set(o,r),r}#l(e,n){const o=this.#n(e,n);if(o.length===0)return!1;if(o.length===1)return o[0];throw new Error(`Operator overload '${o[0].signature}' overlaps with '${o[1].signature}'.`)}#i(e,n){const o=this.#n(e,n);if(o.length===0)return!1;let r=o[0].returnType;for(let l=1;l<o.length;l++)r=r.unify(this.registry,o[l].returnType)||Ya;return r}#n(e,n){const o=[];for(const r of this.declarations){if(!(r instanceof yf))continue;if(r.leftType===e&&r.rightType===n)return[r];const l=this.#a(r,e,n);l&&o.push(l)}if(o.length===0){const l=this.declarations.find(a=>a instanceof yf)?.operator;if((l==="=="||l==="!=")&&e.kind==="dyn")return Est[l]}return o}#a(e,n,o){const r=e.hasPlaceholderType?new Map:null,l=this.#d(e.leftType,n,r);if(!l)return!1;const a=e.rightType?this.#d(e.rightType,o,r):null;return e.rightType&&!a||(e.operator==="=="||e.operator==="!=")&&e.leftType.kind==="dyn"&&e.leftType.valueType&&n.kind!=="dyn"&&o.kind!=="dyn"?!1:e.hasPlaceholderType?{async:e.async,signature:e.signature,handler:e.handler,leftType:l,rightType:a??void 0,returnType:e.returnType.templated(this.registry,r)}:e}#c(e,n,o){return e.hasPlaceholderType?this.#f(e,n,o):o&&e.receiverType&&!o.matches(e.receiverType)?null:e.matchesArgs(n)}#f(e,n,o){const r=new Map;if(o&&e.receiverType&&!this.#d(e.receiverType,o,r))return null;for(let l=0;l<n.length;l++)if(!this.#d(e.argTypes[l],n[l],r))return null;return{async:e.async,handler:e.handler,signature:e.signature,returnType:e.returnType.templated(this.registry,r)}}#d(e,n,o){if(!e.hasPlaceholderType)return n.matches(e)?n:null;const r=n.kind==="dyn";return this.#s(e,n,o,r)&&(r||n.matches(e.templated(this.registry,o)))?n:null}#s(e,n,o,r=!1){if(!e.hasPlaceholderType)return!0;if(!n)return!1;const l=r||n.kind==="dyn";switch(n=n.unwrappedType,e.kind){case"param":{const a=l?Ya:n,u=o.get(e.name);return u?u.kind==="dyn"||a.kind==="dyn"?!0:u.matchesBoth(a):o.set(e.name,a)&&!0}case"list":return n.name==="dyn"&&(n=e),n.kind!=="list"?!1:this.#s(e.valueType,n.valueType,o,l);case"map":return n.name==="dyn"&&(n=e),n.kind!=="map"?!1:this.#s(e.keyType,n.keyType,o,l)&&this.#s(e.valueType,n.valueType,o,l);case"optional":return n.name==="dyn"&&(n=e),n.kind!=="optional"?!1:this.#s(e.valueType,n.valueType,o,l)}return!0}}function Vj(t){const e=[];let n="",o=0;for(const r of t){if(r==="<")o++;else if(r===">")o--;else if(r===","&&o===0){e.push(n.trim()),n="";continue}n+=r}return n&&e.push(n.trim()),e}const oue=[[It,"number",sm.number,_l.number],[Ys,"type",sm.type,_l.type],[Uint8Array,"bytes",sm.bytes,_l.bytes],...typeof Buffer<"u"?[[Buffer,"bytes",sm.bytes,_l.bytes]]:[]].map(t=>{const[e,n,o,r]=t;return Object.freeze({name:n,typeType:o,type:r,ctor:e})}),$st=oue.map(t=>[t.name,t]),Tst=oue.map(t=>[t.ctor,t]),mk=t=>new Error(`Invalid variable declaration: ${t}`),hk=t=>new Error(`Invalid type declaration: ${t}`),Est={"==":[{handler:(t,e)=>t===e,returnType:_l.bool}],"!=":[{handler:(t,e)=>t!==e,returnType:_l.bool}]};class j${#e=null;#t;#o=!0;#r=null;#l=null;#i=null;#n=null;#a=null;#c=null;#f=null;#d=null;#s=!1;objectTypes;objectTypesByConstructor;variables;unlistedVariablesAreDyn;constructor(e={}){this.unlistedVariablesAreDyn=e.unlistedVariablesAreDyn??!1;const n=e.parent instanceof j$?e.parent:null;if(n){this.#e=n;let o=n;for(;o&&!o.#r;)o=o.#e;let r=n;for(;r&&!r.#l;)r=r.#e;this.#i=n.#i,this.#n=n.#n,this.#d={operators:o.#r,functions:r.#l},this.objectTypes=new Map(n.objectTypes),this.objectTypesByConstructor=new Map(n.objectTypesByConstructor),this.variables=n.variables,this.#o=!1,this.#t=n.#t,this.#a=n.#a,this.#c=n.#c,this.#f=n.#f,this.unlistedVariablesAreDyn!==n.unlistedVariablesAreDyn&&this.#h()}else{this.#r=[],this.#l=[],this.objectTypes=new Map($st),this.objectTypesByConstructor=new Map(Tst),this.#t=new Map(bst(_l)),this.#a=new Map,this.#c=new Map,this.#f=new Map,this.variables=new Map,this.variables.dyn=this.unlistedVariablesAreDyn;for(const o in sm)this.registerConstant(o,"type",sm[o])}}#h(){this.#o||(this.variables=new Map(this.variables),this.variables.dyn=this.unlistedVariablesAreDyn,this.#o=!0)}deleteVariable(e){this.#h(),this.variables.delete(e)}#v(e){this.#r||(this.#i=null),this.operatorCandidates(e.operator).add(e),this.#r.push(e)}#w(e){this.#l||(this.#n=null),this.#b(e.partitionKey).add(e),this.#l.push(e)}#p(e,n){return e.get(n)||e.set(n,new Cst(this)).get(n)}#k(){return this.#r?this.#r:this.#r=[...this.#d.operators]}#g(){return this.#l?this.#l:this.#l=[...this.#d.functions]}operatorCandidates(e){if(this.#i)return this.#p(this.#i,e);const n=this.#i=new Map;for(const o of this.#k())this.#p(n,o.operator).add(o);return this.#p(n,e)}functionCandidates(e,n,o){return this.#b(`${e?"rcall":"call"}:${n}:${o}`)}#b(e){if(this.#n)return this.#p(this.#n,e);const n=this.#n=new Map;for(const o of this.#g())this.#p(n,o.partitionKey).add(o);return this.#p(n,e)}registerVariable(e,n,o){if(this.#s)throw new Error("Cannot modify frozen registry");let r=o?.description,l=o?.label,a;if(typeof e=="string"&&typeof n=="object"&&!(n instanceof ip)?(r=n.description,l=n.label,a=n.value,n.schema?n=this.registerType({name:`$${e}`,schema:n.schema}).type:n=n.type):typeof e=="object"&&(e.schema?n=this.registerType({name:`$${e.name}`,schema:e.schema}).type:n=e.type,r=e.description,l=e.label,a=e.value,e=e.name),typeof e!="string"||!e)throw mk("name must be a string");if(B$.has(e))throw mk(`'${e}' is a reserved name`);if(this.variables.get(e)!==void 0)throw mk(`'${e}' is already registered`);if(typeof n=="string")n=this.getType(n);else if(!(n instanceof ip))throw mk("type is required");return this.#h(),this.variables.set(e,new rF(e,n,r,a,l)),this}#S(e,n){const o=Object.create(null);for(const r of cu(n)){const l=n[r];if(typeof l=="object"&&l)o[r]=this.registerType({name:`${e}.${r}`,schema:l}).type.name;else if(typeof l=="string")o[r]=l;else throw new TypeError(`Invalid field definition for '${e}.${r}'`)}return o}registerConstant(e,n,o){return typeof e=="object"?this.registerVariable(e):this.registerVariable({name:e,type:n,value:o}),this}getType(e){return this.#u(e,!0)}getListType(e){return this.#a.get(e)||this.#a.set(e,this.#u(`list<${e}>`,!0)).get(e)}getMapType(e,n){return this.#c.get(e)?.get(n)||(this.#c.get(e)??(this.#c.set(e,new Map),this.#c.get(e))).set(n,this.#u(`map<${e}, ${n}>`,!0)).get(n)}getOptionalType(e){return this.#f.get(e)||this.#f.set(e,this.#u(`optional<${e}>`,!0)).get(e)}assertType(e,n,o){try{return this.#u(e,!0)}catch(r){throw r.message=`Invalid ${n} '${r.unknownType||e}' in '${o}'`,r}}declareType(e){return this.#u(e,!1)}getFunctionType(e){if(e==="ast")return nue;const n=this.#u(e,!0);if(n.kind==="dyn"&&n.valueType)throw new Error(`type '${n.name}' is not supported`);return n}registerType(e,n){if(this.#s)throw new Error("Cannot modify frozen registry");if(typeof e=="object"&&(n=e,e=n.fullName||n.name||n.ctor?.name),typeof e=="string"&&e[0]==="."&&(e=e.slice(1)),typeof e!="string"||e.length<2||B$.has(e))throw hk(`name '${e}' is not valid`);if(this.objectTypes.has(e))throw hk(`type '${e}' already registered`);const o=this.#u(e,!1);if(o.kind!=="message")throw hk(`type '${e}' is not valid`);const r=n,l={name:e,typeType:new Ys(e),type:o,ctor:typeof n=="function"?n:r?.ctor,convert:typeof n=="function"?void 0:r?.convert,fields:typeof r?.schema=="object"?this.#x(e,this.#S(e,r.schema)):this.#x(e,typeof n=="function"?void 0:r?.fields)};if(typeof l.ctor!="function"){if(!l.fields)throw hk(`type '${e}' requires a constructor or fields`);Object.assign(l,this.#T(e,l.fields))}return this.objectTypes.set(e,Object.freeze(l)),this.objectTypesByConstructor.set(l.ctor,l),this.registerFunctionOverload(`type(${e}): type`,()=>l.typeType,{async:!1}),l}#u(e,n=!0){const o=this.#t.get(e);if(o)return o;if(typeof e!="string"||!e.length)throw new Error("Invalid type: must be a string");if(e.match(/^[A-Z]$/))return this.#m(Sst,e,e);const l=e.match(/^(dyn|list|map|optional)<(.+)>$/);if(!l){if(n){const c=new Error(`Unknown type: ${e}`);throw c.unknownType=e,c}return this.#m(kst,e,e)}const a=l[1],u=l[2].trim();switch(a){case"dyn":{const c=this.#u(u,n).wrappedType;return this.#t.set(c.name,c),c}case"list":{const c=this.#u(u,n);return this.#m(lF,`list<${c}>`,c)}case"map":{const c=Vj(u);if(c.length!==2)throw new Error(`Invalid map type: ${e}`);const f=this.#u(c[0],n),p=this.#u(c[1],n);return this.#m(iF,`map<${f}, ${p}>`,f,p)}case"optional":{const c=this.#u(u,n);return this.#m(tue,`optional<${c}>`,c)}}throw new Error(`Unknown type kind: ${a}`)}#m(e,n,...o){const r=e;return this.#t.get(n)||this.#t.set(n,r(...o)).get(n)}findMacro(e,n,o){return this.functionCandidates(n,e,o).macro}findUnaryOverload(e,n){return this.operatorCandidates(e).findUnaryOverload(n)}findBinaryOverload(e,n,o){return this.operatorCandidates(e).findBinaryOverload(n,o)}#C(e){return typeof e=="string"?{type:e}:e?.id?Dst(e):e}#$(e,n,o,r=!1){try{const l=this.#C(n[o]);if(typeof l?.type!="string")throw new Error("unsupported declaration");return this.#u(l.type,r)}catch(l){throw l.message=`Field '${o}' in type '${e}' has unsupported declaration: ${JSON.stringify(n[o])}`,l}}#x(e,n){if(!n)return;const o=Object.create(null);for(const r of cu(n))o[r]=this.#$(e,n,r);return o}#T(e,n){const o=cu(n),r=Object.create(null);for(const a of o){const u=n[a],c=u.kind==="message"&&this.objectTypes.get(u.name);c===!1?r[a]=!1:r[a]=c&&c.convert?c:!1}const l={[e]:class extends Map{#_;constructor(a){super(),this.#_=a}[Symbol.iterator](){if(this.size!==o.length)for(const a of o)this.get(a);return super[Symbol.iterator]()}get(a){let u=super.get(a);if(u!==void 0||this.has(a))return u;const c=r[a];if(c===void 0)return;const f=this.#_;if(u=f instanceof Map?f.get(a):f?.[a],c&&u&&typeof u=="object")switch(u.constructor){case void 0:case Object:case Map:u=c.convert(u)}return super.set(a,u),u}}}[e];return{ctor:l,convert(a){if(a)return a.constructor===l?a:new l(a)}}}clone(e){return this.#s=!0,new j$({parent:this,unlistedVariablesAreDyn:e.unlistedVariablesAreDyn})}getDefinitions(){const e=[],n=[];for(const[,o]of this.variables)o&&e.push({name:o.name,description:o.description||null,label:o.label||null,type:o.type.name});for(const o of this.#g())n.push({signature:o.signature,name:o.name,description:o.description,receiverType:o.receiverType?o.receiverType.name:null,returnType:o.returnType.name,params:o.params.map(r=>({name:r.name,type:r.type.name,description:r.description}))});return{variables:e,functions:n}}#E(e){if(typeof e!="string")throw new Error("Invalid signature: must be a string");const n=e.match(/^(?:([a-z0-9.<>]+)\.)?(\w+)\((.*?)\):(.+)$/i);if(!n)throw new Error(`Invalid signature: ${e}`);return{receiverType:n[1]||null,name:n[2],argTypes:Vj(n[3]),returnType:n[4].trim()}}#A(e,n){return e.name!==n.name||e.argTypes.length!==n.argTypes.length||(e.receiverType||n.receiverType)&&(!e.receiverType||!n.receiverType)?!1:!(e.receiverType!==n.receiverType&&e.receiverType!==Ya&&n.receiverType!==Ya)&&(!!n.macro||!!e.macro||n.argTypes.every((r,l)=>{const a=e.argTypes[l];return r===a||r===Ya||a===Ya}))}#D(e){const n=this.#g();for(let o=0;o<n.length;o++){const r=n[o];if(r instanceof q$&&this.#A(r,e))return n[o]=e,this.#n=null,!0}return!1}#z(e,n,o){if(!o)return{type:this.getFunctionType(n),name:`arg${e}`,description:null};const r=o.type||n;if(!r)throw new Error(`params[${e}].type is required`);if(n&&r!==n)throw new Error(`params[${e}].type not equal to signature type`);return{name:o.name||`arg${e}`,type:this.getFunctionType(r),description:o.description??null}}registerFunctionOverload(e,n,o){if(this.#s)throw new Error("Cannot modify frozen registry");typeof e=="object"?o=e:typeof n=="object"?o=n:o||(o={});const r=typeof e=="string"?e:o.signature,l=r!==void 0?this.#E(r):void 0,a=l?.name||o.name,u=l?.receiverType||o.receiverType,c=l?.argTypes,f=l?.returnType||o.returnType,p=o.params;n=typeof n=="function"?n:o.handler;let m;try{if(!a)throw new Error("signature or name are required");if(!f)throw new Error("must have a returnType");if(p){if(c&&p.length!==c.length)throw new Error("mismatched length in params and args in signature")}else if(!c)throw new Error("signature or params are required");m=new q$({name:a,async:o?.async,receiverType:u?this.getType(u):null,returnType:this.getType(f),handler:n,description:o.description,params:(c||p).map((v,g)=>this.#z(g,c?.[g],p?.[g]))})}catch(v){throw v.message=typeof r=="string"?`Invalid function declaration '${r}': ${v.message}`:a?`Invalid function declaration '${a}': ${v.message}`:`Invalid function declaration: ${v.message}`,v}this.#D(m)||this.#w(m)}registerOperatorOverload(e,n,o){const r=e.match(/^([-!])([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(r){const[,p,m,h]=r;return this.unaryOverload(p,m,n,h,o?.async)}const l=e.match(/^([\w.<>]+) ([-+*%/<>]|==|!=|<=|>=|in) ([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(!l)throw new Error(`Operator overload invalid: ${e}`);const[,a,u,c,f]=l;return this.binaryOverload(a,u,c,n,f)}unaryOverload(e,n,o,r,l){if(this.#s)throw new Error("Cannot modify frozen registry");const a=this.assertType(n,"type",`${e}${n}`),u=this.assertType(r||n,"return type",`${e}${n}: ${r||n}`),c=new yf({op:`${e}_`,leftType:a,returnType:u,handler:o,async:l});this.#v(this.#y(c))}#O(e){for(const n of this.operatorCandidates(e.operator))if(n instanceof yf&&e.equals(n))return!0;return!1}#y(e){if(!this.#O(e))return e;throw new Error(`Operator overload already registered: ${e.signature}`)}binaryOverload(e,n,o,r,l,a){if(this.#s)throw new Error("Cannot modify frozen registry");l??=Pj.has(n)?"bool":e;const u=`${e} ${n} ${o}: ${l}`;let c=this.assertType(e,"left type",u),f=this.assertType(o,"right type",u);const p=this.assertType(l,"return type",u);if(c.kind==="dyn"&&c.valueType?f=f.wrappedType:f.kind==="dyn"&&f.valueType&&(c=c.wrappedType),Pj.has(n)&&p.type!=="bool")throw new Error(`Comparison operator '${n}' must return 'bool', got '${p.type}'`);const m=new yf({op:n,leftType:c,rightType:f,returnType:p,handler:r,async:a});if(m.hasPlaceholderType&&!(f.hasPlaceholderType&&c.hasPlaceholderType))throw new Error(`Operator overload with placeholders must use them in both left and right types: ${u}`);if(this.#y(m),n==="=="){const h=[new yf({op:"!=",leftType:c,rightType:f,handler(v,g,b,x){return!r(v,g,b,x)},returnType:p,async:a})];c!==f&&h.push(new yf({op:"==",leftType:f,rightType:c,handler(v,g,b,x){return r(g,v,b,x)},returnType:p,async:a}),new yf({op:"!=",leftType:f,rightType:c,handler(v,g,b,x){return!r(g,v,b,x)},returnType:p,async:a}));for(const v of h)this.#y(v);for(const v of h)this.#v(v)}this.#v(m)}}const Pj=new Set(["<","<=",">",">=","==","!=","in"]);function Ast(t){return new j$(t)}class vk{#e;#t;#o;#r;constructor(e,n){if(this.#e=e.variables,n!=null){if(typeof n!="object")throw _n("invalid_context","Context must be an object");n instanceof Map?this.#o=n:this.#t=n}}getValue(e){return this.#r?.get(e)||(this.#t?this.#t[e]:this.#o?.get(e))}getVariable(e){return this.#e.get(e)??(this.#e.dyn&&!B$.has(e)?new rF(e,Ya):void 0)}getCheckedValue(e,n){const o=this.getValue(n.args);if(o===void 0)throw _n("unknown_variable",`Unknown variable: ${n.args}`,n);if(n.checkedType.matchesValueType(o,e))return o;const r=n.checkedType,l=e.debugType(o);if(r.kind==="message"&&l.kind==="map"){const a=e.objectTypes.get(r.name)?.convert?.(o);if(a)return(this.#r??=new Map).set(n.args,a),a}throw _n("variable_type_mismatch",`Variable '${n.args}' is not of type '${r}', got '${l}'`,n)}forkWithVariable(e,n){return new H$(this,e,n)}}class H${#e;accuType;accuValue;iterValue;iterVar;iterType;async;constructor(e,n,o){this.#e=e,this.iterVar=n,this.iterType=o}forkWithVariable(e,n){return new H$(this,e,n)}reuse(e){if(!this.async)return this.#e=e,this;const n=new H$(e,this.iterVar,this.iterType);return n.accuType=this.accuType,n}setIterValue(e,n){if(this.iterType.matchesValueType(e,n))return this.iterValue=e,this;const o=this.iterType,r=n.debugType(e);if(o.kind==="message"&&r.kind==="map"){const l=n.objectTypes.get(o.name)?.convert?.(e);if(l)return this.iterValue=l,this}throw _n("variable_type_mismatch",`Variable '${this.iterVar}' is not of type '${o}', got '${r}'`)}setAccuType(e){return this.accuType=e,this}setAccuValue(e){return this.accuValue=e,this}getValue(e){return this.iterVar===e?this.iterValue:this.#e.getValue(e)}getCheckedValue(e,n){return this.iterVar===n.args?this.iterValue:this.#e.getCheckedValue(e,n)}getVariable(e){return this.iterVar===e?new rF(e,this.iterType):this.#e.getVariable(e)}}function Dst(t){let e;if(t.map){const n=tz(t.keyType,t.resolvedKeyType),o=tz(t.type,t.resolvedType);e=`map<${n}, ${o}>`}else e=tz(t.type,t.resolvedType);return{type:t.repeated?`list<${e}>`:e}}function tz(t,e){switch(t){case"string":return"string";case"bytes":return"bytes";case"bool":return"bool";case"double":case"float":case"int32":case"int64":case"sint32":case"sint64":case"sfixed32":case"sfixed64":case"uint32":case"uint64":case"fixed32":case"fixed64":return"double";default:switch(e?.constructor?.name){case"Type":return e.fullName.slice(1);case"Enum":return"int"}return t?.includes(".")?t:"dyn"}}function zst(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const Ost={},U1={};function Jh(t,e){try{const o=(Ost[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return o in U1?U1[o]:Fj(o,o.split(":"))}catch{if(t in U1)return U1[t];const n=t?.match(Mst);return n?Fj(t,n.slice(1)):NaN}}const Mst=/([+-]\d\d):?(\d\d)?/;function Fj(t,e){const n=+(e[0]||0),o=+(e[1]||0),r=+(e[2]||0)/60;return U1[t]=n*60+o>0?n*60+o+r:n*60-o-r}class hd extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Jh(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),rue(this),DI(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new hd(...n,e):new hd(Date.now(),e)}withTimeZone(e){return new hd(+this,e)}getTimezoneOffset(){const e=-Jh(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),DI(this),+this}[Symbol.for("constructDateFrom")](e){return new hd(+new Date(e),this.timeZone)}}const Nj=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!Nj.test(t))return;const e=t.replace(Nj,"$1UTC");hd.prototype[e]&&(t.startsWith("get")?hd.prototype[t]=function(){return this.internal[e]()}:(hd.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),Ist(this),+this},hd.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),DI(this),+this}))});function DI(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Jh(t.timeZone,t)*60))}function Ist(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),rue(t)}function rue(t){const e=Jh(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),l=-new Date(+o).getTimezoneOffset(),a=r-l,u=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&u&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=r-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const f=new Date(+t);f.setUTCSeconds(0);const p=r>0?f.getSeconds():(f.getSeconds()-60)%60,m=Math.round(-(Jh(t.timeZone,t)*60))%60;(m||p)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+p));const h=Jh(t.timeZone,t),v=h>0?Math.floor(h):Math.ceil(h),b=-new Date(+t).getTimezoneOffset()-v,x=v!==n,y=b-c;if(x&&y){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+y);const _=Jh(t.timeZone,t),k=_>0?Math.floor(_):Math.ceil(_),w=v-k;w&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+w))}}class ju extends hd{static tz(e,...n){return n.length?new ju(...n,e):new ju(Date.now(),e)}toISOString(){const[e,n,o]=this.tzComponents(),r=`${e}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,o,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${o} ${n} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,o,r]=this.tzComponents();return`${e} GMT${n}${o}${r} (${zst(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",o=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),r=String(Math.abs(e)%60).padStart(2,"0");return[n,o,r]}withTimeZone(e){return new ju(+this,e)}[Symbol.for("constructDateFrom")](e){return new ju(+new Date(e),this.timeZone)}}const lue=6048e5,Rst=864e5,iue=6e4,aue=36e5,Vst=1e3,Lj=Symbol.for("constructDateFrom");function il(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Lj in t?t[Lj](e):t instanceof Date?new t.constructor(e):new Date(e)}function go(t,e){return il(e||t,t)}function D_(t,e,n){const o=go(t,n?.in);return isNaN(e)?il(n?.in||t,NaN):(e&&o.setDate(o.getDate()+e),o)}function zI(t,e,n){const o=go(t,n?.in);if(isNaN(e))return il(n?.in||t,NaN);if(!e)return o;const r=o.getDate(),l=il(n?.in||t,o.getTime());l.setMonth(o.getMonth()+e+1,0);const a=l.getDate();return r>=a?l:(o.setFullYear(l.getFullYear(),l.getMonth(),r),o)}function Pst(t,e,n){return il(n?.in||t,+go(t)+e)}function Fst(t,e,n){return Pst(t,e*aue,n)}let Nst={};function vg(){return Nst}function ap(t,e){const n=vg(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=go(t,e?.in),l=r.getDay(),a=(l<o?7:0)+l-o;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function xy(t,e){return ap(t,{...e,weekStartsOn:1})}function sue(t,e){const n=go(t,e?.in),o=n.getFullYear(),r=il(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const l=xy(r),a=il(n,0);a.setFullYear(o,0,4),a.setHours(0,0,0,0);const u=xy(a);return n.getTime()>=l.getTime()?o+1:n.getTime()>=u.getTime()?o:o-1}function W$(t){const e=go(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Lst(t,...e){const n=il.bind(null,e.find(o=>typeof o=="object"));return e.map(n)}function OI(t,e){const n=go(t,e?.in);return n.setHours(0,0,0,0),n}function Bst(t,e,n){const[o,r]=Lst(n?.in,t,e),l=OI(o),a=OI(r),u=+l-W$(l),c=+a-W$(a);return Math.round((u-c)/Rst)}function Ust(t,e){const n=sue(t,e),o=il(t,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),xy(o)}function qst(t,e,n){const o=go(t,n?.in);return o.setTime(o.getTime()+e*iue),o}function jst(t,e,n){return D_(t,e*7,n)}function Bj(t,e,n){return zI(t,e*12,n)}function Hst(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function zb(t){return!(!Hst(t)&&typeof t!="number"||isNaN(+go(t)))}function Wst(t,e){const n=go(t,e?.in);return n.setHours(23,59,59,999),n}function Kst(t,e){const n=go(t,e?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function Gst(t,e){const n=go(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Yst(t,e){const n=go(t,e?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}function uue(t,e){const n=go(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Jst(t,e){const n=vg(),o=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=go(t,e?.in),l=r.getDay(),a=(l<o?-7:0)+6-(l-o);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}const Xst={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"}},Qst=(t,e,n)=>{let o;const r=Xst[t];return typeof r=="string"?o=r:e===1?o=r.one:o=r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function nz(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Zst={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eut={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nut={date:nz({formats:Zst,defaultWidth:"full"}),time:nz({formats:eut,defaultWidth:"full"}),dateTime:nz({formats:tut,defaultWidth:"full"})},out={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rut=(t,e,n,o)=>out[t];function o1(t){return(e,n)=>{const o=n?.context?String(n.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):a;r=t.formattingValues[u]||t.formattingValues[a]}else{const a=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;r=t.values[u]||t.values[a]}const l=t.argumentCallback?t.argumentCallback(e):e;return r[l]}}const lut={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},iut={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aut={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"]},sut={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"]},uut={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"}},cut={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"}},dut=(t,e)=>{const n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},fut={ordinalNumber:dut,era:o1({values:lut,defaultWidth:"wide"}),quarter:o1({values:iut,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o1({values:aut,defaultWidth:"wide"}),day:o1({values:sut,defaultWidth:"wide"}),dayPeriod:o1({values:uut,defaultWidth:"wide",formattingValues:cut,defaultFormattingWidth:"wide"})};function r1(t){return(e,n={})=>{const o=n.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],l=e.match(r);if(!l)return null;const a=l[0],u=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(u)?mut(u,m=>m.test(a)):put(u,m=>m.test(a));let f;f=t.valueCallback?t.valueCallback(c):c,f=n.valueCallback?n.valueCallback(f):f;const p=e.slice(a.length);return{value:f,rest:p}}}function put(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function mut(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function hut(t){return(e,n={})=>{const o=e.match(t.matchPattern);if(!o)return null;const r=o[0],l=e.match(t.parsePattern);if(!l)return null;let a=t.valueCallback?t.valueCallback(l[0]):l[0];a=n.valueCallback?n.valueCallback(a):a;const u=e.slice(r.length);return{value:a,rest:u}}}const vut=/^(\d+)(th|st|nd|rd)?/i,gut=/\d+/i,yut={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},but={any:[/^b/i,/^(a|c)/i]},xut={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_ut={any:[/1/i,/2/i,/3/i,/4/i]},wut={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},kut={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]},Sut={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},Cut={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]},$ut={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},Tut={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}},Eut={ordinalNumber:hut({matchPattern:vut,parsePattern:gut,valueCallback:t=>parseInt(t,10)}),era:r1({matchPatterns:yut,defaultMatchWidth:"wide",parsePatterns:but,defaultParseWidth:"any"}),quarter:r1({matchPatterns:xut,defaultMatchWidth:"wide",parsePatterns:_ut,defaultParseWidth:"any",valueCallback:t=>t+1}),month:r1({matchPatterns:wut,defaultMatchWidth:"wide",parsePatterns:kut,defaultParseWidth:"any"}),day:r1({matchPatterns:Sut,defaultMatchWidth:"wide",parsePatterns:Cut,defaultParseWidth:"any"}),dayPeriod:r1({matchPatterns:$ut,defaultMatchWidth:"any",parsePatterns:Tut,defaultParseWidth:"any"})},cue={code:"en-US",formatDistance:Qst,formatLong:nut,formatRelative:rut,localize:fut,match:Eut,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Aut(t,e){const n=go(t,e?.in);return Bst(n,uue(n))+1}function due(t,e){const n=go(t,e?.in),o=+xy(n)-+Ust(n);return Math.round(o/lue)+1}function aF(t,e){const n=go(t,e?.in),o=n.getFullYear(),r=vg(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=il(e?.in||t,0);a.setFullYear(o+1,0,l),a.setHours(0,0,0,0);const u=ap(a,e),c=il(e?.in||t,0);c.setFullYear(o,0,l),c.setHours(0,0,0,0);const f=ap(c,e);return+n>=+u?o+1:+n>=+f?o:o-1}function Dut(t,e){const n=vg(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=aF(t,e),l=il(e?.in||t,0);return l.setFullYear(r,0,o),l.setHours(0,0,0,0),ap(l,e)}function fue(t,e){const n=go(t,e?.in),o=+ap(n,e)-+Dut(n,e);return Math.round(o/lue)+1}function yr(t,e){const n=t<0?"-":"",o=Math.abs(t).toString().padStart(e,"0");return n+o}const Np={y(t,e){const n=t.getFullYear(),o=n>0?n:1-n;return yr(e==="yy"?o%100:o,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):yr(n+1,2)},d(t,e){return yr(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return yr(t.getHours()%12||12,e.length)},H(t,e){return yr(t.getHours(),e.length)},m(t,e){return yr(t.getMinutes(),e.length)},s(t,e){return yr(t.getSeconds(),e.length)},S(t,e){const n=e.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,n-3));return yr(r,e.length)}},Fg={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Uj={G:function(t,e,n){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const o=t.getFullYear(),r=o>0?o:1-o;return n.ordinalNumber(r,{unit:"year"})}return Np.y(t,e)},Y:function(t,e,n,o){const r=aF(t,o),l=r>0?r:1-r;if(e==="YY"){const a=l%100;return yr(a,2)}return e==="Yo"?n.ordinalNumber(l,{unit:"year"}):yr(l,e.length)},R:function(t,e){const n=sue(t);return yr(n,e.length)},u:function(t,e){const n=t.getFullYear();return yr(n,e.length)},Q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return yr(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return yr(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,n){const o=t.getMonth();switch(e){case"M":case"MM":return Np.M(t,e);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,n){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return yr(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,n,o){const r=fue(t,o);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):yr(r,e.length)},I:function(t,e,n){const o=due(t);return e==="Io"?n.ordinalNumber(o,{unit:"week"}):yr(o,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Np.d(t,e)},D:function(t,e,n){const o=Aut(t);return e==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):yr(o,e.length)},E:function(t,e,n){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,n,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return yr(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});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"})}},c:function(t,e,n,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return yr(l,e.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const o=t.getDay(),r=o===0?7:o;switch(e){case"i":return String(r);case"ii":return yr(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e,n){const o=t.getHours();let r;switch(o===12?r=Fg.noon:o===0?r=Fg.midnight:r=o/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const o=t.getHours();let r;switch(o>=17?r=Fg.evening:o>=12?r=Fg.afternoon:o>=4?r=Fg.morning:r=Fg.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let o=t.getHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return Np.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Np.H(t,e)},K:function(t,e,n){const o=t.getHours()%12;return e==="Ko"?n.ordinalNumber(o,{unit:"hour"}):yr(o,e.length)},k:function(t,e,n){let o=t.getHours();return o===0&&(o=24),e==="ko"?n.ordinalNumber(o,{unit:"hour"}):yr(o,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Np.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Np.s(t,e)},S:function(t,e){return Np.S(t,e)},X:function(t,e,n){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(e){case"X":return jj(o);case"XXXX":case"XX":return Vh(o);default:return Vh(o,":")}},x:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"x":return jj(o);case"xxxx":case"xx":return Vh(o);default:return Vh(o,":")}},O:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qj(o,":");default:return"GMT"+Vh(o,":")}},z:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qj(o,":");default:return"GMT"+Vh(o,":")}},t:function(t,e,n){const o=Math.trunc(+t/1e3);return yr(o,e.length)},T:function(t,e,n){return yr(+t,e.length)}};function qj(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),l=o%60;return l===0?n+String(r):n+String(r)+e+yr(l,2)}function jj(t,e){return t%60===0?(t>0?"-":"+")+yr(Math.abs(t)/60,2):Vh(t,e)}function Vh(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),r=yr(Math.trunc(o/60),2),l=yr(o%60,2);return n+r+e+l}const Hj=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},pue=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},zut=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return Hj(t,e);let l;switch(o){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",Hj(o,e)).replace("{{time}}",pue(r,e))},MI={p:pue,P:zut},Out=/^D+$/,Mut=/^Y+$/,Iut=["D","DD","YY","YYYY"];function mue(t){return Out.test(t)}function hue(t){return Mut.test(t)}function II(t,e,n){const o=Rut(t,e,n);if(console.warn(o),Iut.includes(t))throw new RangeError(o)}function Rut(t,e,n){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vut=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Put=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fut=/^'([^]*?)'?$/,Nut=/''/g,Lut=/[a-zA-Z]/;function Wr(t,e,n){const o=vg(),r=o.locale??cue,l=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,u=go(t,n?.in);if(!zb(u))throw new RangeError("Invalid time value");let c=e.match(Put).map(p=>{const m=p[0];if(m==="p"||m==="P"){const h=MI[m];return h(p,r.formatLong)}return p}).join("").match(Vut).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:But(p)};if(Uj[m])return{isToken:!0,value:p};if(m.match(Lut))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(c=r.localize.preprocessor(u,c));const f={firstWeekContainsDate:l,weekStartsOn:a,locale:r};return c.map(p=>{if(!p.isToken)return p.value;const m=p.value;(hue(m)||mue(m))&&II(m,e,String(t));const h=Uj[m[0]];return h(u,m,r.localize,f)}).join("")}function But(t){const e=t.match(Fut);return e?e[1].replace(Nut,"'"):t}function Uut(t,e){const n=go(t,e?.in),o=n.getFullYear(),r=n.getMonth(),l=il(n,0);return l.setFullYear(o,r+1,0),l.setHours(0,0,0,0),l.getDate()}function qut(){return Object.assign({},vg())}function jut(t,e){const n=go(t,e?.in).getDay();return n===0?7:n}function Wj(t,e){return+go(t)>+go(e)}function Kj(t,e){return+go(t)<+go(e)}function Hut(t,e){return+go(t)==+go(e)}function Wut(t,e){const n=Kut(e)?new e(0):il(e,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}function Kut(t){return typeof t=="function"&&t.prototype?.constructor===t}const Gut=10;class vue{subPriority=0;validate(e,n){return!0}}class Yut extends vue{constructor(e,n,o,r,l){super(),this.value=e,this.validateValue=n,this.setValue=o,this.priority=r,l&&(this.subPriority=l)}validate(e,n){return this.validateValue(e,this.value,n)}set(e,n,o){return this.setValue(e,n,this.value,o)}}class Jut extends vue{priority=Gut;subPriority=-1;constructor(e,n){super(),this.context=e||(o=>il(n,o))}set(e,n){return n.timestampIsSet?e:il(e,Wut(e,this.context))}}let sr=class{run(e,n,o,r){const l=this.parse(e,n,o,r);return l?{setter:new Yut(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(e,n,o){return!0}};class Xut extends sr{priority=140;parse(e,n,o){switch(n){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,n,o){return n.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const Ll={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},rd={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Bl(t,e){return t&&{value:e(t.value),rest:t.rest}}function fl(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function ld(t,e){const n=e.match(t);if(!n)return null;if(n[0]==="Z")return{value:0,rest:e.slice(1)};const o=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:o*(r*aue+l*iue+a*Vst),rest:e.slice(n[0].length)}}function gue(t){return fl(Ll.anyDigitsSigned,t)}function Dl(t,e){switch(t){case 1:return fl(Ll.singleDigit,e);case 2:return fl(Ll.twoDigits,e);case 3:return fl(Ll.threeDigits,e);case 4:return fl(Ll.fourDigits,e);default:return fl(new RegExp("^\\d{1,"+t+"}"),e)}}function K$(t,e){switch(t){case 1:return fl(Ll.singleDigitSigned,e);case 2:return fl(Ll.twoDigitsSigned,e);case 3:return fl(Ll.threeDigitsSigned,e);case 4:return fl(Ll.fourDigitsSigned,e);default:return fl(new RegExp("^-?\\d{1,"+t+"}"),e)}}function sF(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function yue(t,e){const n=e>0,o=n?e:1-e;let r;if(o<=50)r=t||100;else{const l=o+50,a=Math.trunc(l/100)*100,u=t>=l%100;r=t+a-(u?100:0)}return n?r:1-r}function bue(t){return t%400===0||t%4===0&&t%100!==0}class Qut extends sr{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,n,o){const r=l=>({year:l,isTwoDigitYear:n==="yy"});switch(n){case"y":return Bl(Dl(4,e),r);case"yo":return Bl(o.ordinalNumber(e,{unit:"year"}),r);default:return Bl(Dl(n.length,e),r)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,o){const r=e.getFullYear();if(o.isTwoDigitYear){const a=yue(o.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const l=!("era"in n)||n.era===1?o.year:1-o.year;return e.setFullYear(l,0,1),e.setHours(0,0,0,0),e}}class Zut extends sr{priority=130;parse(e,n,o){const r=l=>({year:l,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Bl(Dl(4,e),r);case"Yo":return Bl(o.ordinalNumber(e,{unit:"year"}),r);default:return Bl(Dl(n.length,e),r)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,o,r){const l=aF(e,r);if(o.isTwoDigitYear){const u=yue(o.year,l);return e.setFullYear(u,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),ap(e,r)}const a=!("era"in n)||n.era===1?o.year:1-o.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),ap(e,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ect extends sr{priority=130;parse(e,n){return K$(n==="R"?4:n.length,e)}set(e,n,o){const r=il(e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),xy(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class tct extends sr{priority=130;parse(e,n){return K$(n==="u"?4:n.length,e)}set(e,n,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class nct extends sr{priority=120;parse(e,n,o){switch(n){case"Q":case"QQ":return Dl(n.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class oct extends sr{priority=120;parse(e,n,o){switch(n){case"q":case"qq":return Dl(n.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class rct extends sr{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,n,o){const r=l=>l-1;switch(n){case"M":return Bl(fl(Ll.month,e),r);case"MM":return Bl(Dl(2,e),r);case"Mo":return Bl(o.ordinalNumber(e,{unit:"month"}),r);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class lct extends sr{priority=110;parse(e,n,o){const r=l=>l-1;switch(n){case"L":return Bl(fl(Ll.month,e),r);case"LL":return Bl(Dl(2,e),r);case"Lo":return Bl(o.ordinalNumber(e,{unit:"month"}),r);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function ict(t,e,n){const o=go(t,n?.in),r=fue(o,n)-e;return o.setDate(o.getDate()-r*7),go(o,n?.in)}class act extends sr{priority=100;parse(e,n,o){switch(n){case"w":return fl(Ll.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,o,r){return ap(ict(e,o,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function sct(t,e,n){const o=go(t,n?.in),r=due(o,n)-e;return o.setDate(o.getDate()-r*7),o}class uct extends sr{priority=100;parse(e,n,o){switch(n){case"I":return fl(Ll.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,o){return xy(sct(e,o))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const cct=[31,28,31,30,31,30,31,31,30,31,30,31],dct=[31,29,31,30,31,30,31,31,30,31,30,31];class fct extends sr{priority=90;subPriority=1;parse(e,n,o){switch(n){case"d":return fl(Ll.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return Dl(n.length,e)}}validate(e,n){const o=e.getFullYear(),r=bue(o),l=e.getMonth();return r?n>=1&&n<=dct[l]:n>=1&&n<=cct[l]}set(e,n,o){return e.setDate(o),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class pct extends sr{priority=90;subpriority=1;parse(e,n,o){switch(n){case"D":case"DD":return fl(Ll.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return Dl(n.length,e)}}validate(e,n){const o=e.getFullYear();return bue(o)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function uF(t,e,n){const o=vg(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,l=go(t,n?.in),a=l.getDay(),c=(e%7+7)%7,f=7-r,p=e<0||e>6?e-(a+f)%7:(c+f)%7-(a+f)%7;return D_(l,p,n)}class mct extends sr{priority=90;parse(e,n,o){switch(n){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,o,r){return e=uF(e,o,r),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class hct extends sr{priority=90;parse(e,n,o,r){const l=a=>{const u=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+u};switch(n){case"e":case"ee":return Bl(Dl(n.length,e),l);case"eo":return Bl(o.ordinalNumber(e,{unit:"day"}),l);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,o,r){return e=uF(e,o,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class vct extends sr{priority=90;parse(e,n,o,r){const l=a=>{const u=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+u};switch(n){case"c":case"cc":return Bl(Dl(n.length,e),l);case"co":return Bl(o.ordinalNumber(e,{unit:"day"}),l);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,o,r){return e=uF(e,o,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function gct(t,e,n){const o=go(t,n?.in),r=jut(o,n),l=e-r;return D_(o,l,n)}class yct extends sr{priority=90;parse(e,n,o){const r=l=>l===0?7:l;switch(n){case"i":case"ii":return Dl(n.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Bl(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Bl(o.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Bl(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),r);default:return Bl(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,n){return n>=1&&n<=7}set(e,n,o){return e=gct(e,o),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class bct extends sr{priority=80;parse(e,n,o){switch(n){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,o){return e.setHours(sF(o),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class xct extends sr{priority=80;parse(e,n,o){switch(n){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,o){return e.setHours(sF(o),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class _ct extends sr{priority=80;parse(e,n,o){switch(n){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,o){return e.setHours(sF(o),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class wct extends sr{priority=70;parse(e,n,o){switch(n){case"h":return fl(Ll.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,o){const r=e.getHours()>=12;return r&&o<12?e.setHours(o+12,0,0,0):!r&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class kct extends sr{priority=70;parse(e,n,o){switch(n){case"H":return fl(Ll.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,o){return e.setHours(o,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class Sct extends sr{priority=70;parse(e,n,o){switch(n){case"K":return fl(Ll.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class Cct extends sr{priority=70;parse(e,n,o){switch(n){case"k":return fl(Ll.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,o){const r=o<=24?o%24:o;return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class $ct extends sr{priority=60;parse(e,n,o){switch(n){case"m":return fl(Ll.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,o){return e.setMinutes(o,0,0),e}incompatibleTokens=["t","T"]}class Tct extends sr{priority=50;parse(e,n,o){switch(n){case"s":return fl(Ll.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,o){return e.setSeconds(o,0),e}incompatibleTokens=["t","T"]}class Ect extends sr{priority=30;parse(e,n){const o=r=>Math.trunc(r*Math.pow(10,-n.length+3));return Bl(Dl(n.length,e),o)}set(e,n,o){return e.setMilliseconds(o),e}incompatibleTokens=["t","T"]}class Act extends sr{priority=10;parse(e,n){switch(n){case"X":return ld(rd.basicOptionalMinutes,e);case"XX":return ld(rd.basic,e);case"XXXX":return ld(rd.basicOptionalSeconds,e);case"XXXXX":return ld(rd.extendedOptionalSeconds,e);default:return ld(rd.extended,e)}}set(e,n,o){return n.timestampIsSet?e:il(e,e.getTime()-W$(e)-o)}incompatibleTokens=["t","T","x"]}class Dct extends sr{priority=10;parse(e,n){switch(n){case"x":return ld(rd.basicOptionalMinutes,e);case"xx":return ld(rd.basic,e);case"xxxx":return ld(rd.basicOptionalSeconds,e);case"xxxxx":return ld(rd.extendedOptionalSeconds,e);default:return ld(rd.extended,e)}}set(e,n,o){return n.timestampIsSet?e:il(e,e.getTime()-W$(e)-o)}incompatibleTokens=["t","T","X"]}class zct extends sr{priority=40;parse(e){return gue(e)}set(e,n,o){return[il(e,o*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Oct extends sr{priority=20;parse(e){return gue(e)}set(e,n,o){return[il(e,o),{timestampIsSet:!0}]}incompatibleTokens="*"}const Mct={G:new Xut,y:new Qut,Y:new Zut,R:new ect,u:new tct,Q:new nct,q:new oct,M:new rct,L:new lct,w:new act,I:new uct,d:new fct,D:new pct,E:new mct,e:new hct,c:new vct,i:new yct,a:new bct,b:new xct,B:new _ct,h:new wct,H:new kct,K:new Sct,k:new Cct,m:new $ct,s:new Tct,S:new Ect,X:new Act,x:new Dct,t:new zct,T:new Oct},Ict=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vct=/^'([^]*?)'?$/,Pct=/''/g,Fct=/\S/,Nct=/[a-zA-Z]/;function T3(t,e,n,o){const r=()=>il(n,NaN),l=qut(),a=l.locale??cue,u=l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,c=l.weekStartsOn??l.locale?.options?.weekStartsOn??0;if(!e)return t?r():go(n,o?.in);const f={firstWeekContainsDate:u,weekStartsOn:c,locale:a},p=[new Jut(o?.in,n)],m=e.match(Rct).map(x=>{const y=x[0];if(y in MI){const _=MI[y];return _(x,a.formatLong)}return x}).join("").match(Ict),h=[];for(let x of m){hue(x)&&II(x,e,t),mue(x)&&II(x,e,t);const y=x[0],_=Mct[y];if(_){const{incompatibleTokens:k}=_;if(Array.isArray(k)){const $=h.find(C=>k.includes(C.token)||C.token===y);if($)throw new RangeError(`The format string mustn't contain \`${$.fullToken}\` and \`${x}\` at the same time`)}else if(_.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${x}\` and any other token at the same time`);h.push({token:y,fullToken:x});const w=_.run(t,x,a.match,f);if(!w)return r();p.push(w.setter),t=w.rest}else{if(y.match(Nct))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(x==="''"?x="'":y==="'"&&(x=Lct(x)),t.indexOf(x)===0)t=t.slice(x.length);else return r()}}if(t.length>0&&Fct.test(t))return r();const v=p.map(x=>x.priority).sort((x,y)=>y-x).filter((x,y,_)=>_.indexOf(x)===y).map(x=>p.filter(y=>y.priority===x).sort((y,_)=>_.subPriority-y.subPriority)).map(x=>x[0]);let g=go(n,o?.in);if(isNaN(+g))return r();const b={};for(const x of v){if(!x.validate(g,f))return r();const y=x.set(g,b,f);Array.isArray(y)?(g=y[0],Object.assign(b,y[1])):g=y}return g}function Lct(t){return t.match(Vct)[1].replace(Pct,"'")}function Bct(t,e,n){const o=go(t,n?.in),r=o.getFullYear(),l=o.getDate(),a=il(t,0);a.setFullYear(r,e,15),a.setHours(0,0,0,0);const u=Uut(a);return o.setMonth(e,Math.min(l,u)),o}function Uct(t,e,n){const o=go(t,n?.in);return o.setDate(e),o}function qct(t,e,n){const o=go(t,n?.in);return isNaN(+o)?il(t,NaN):(o.setFullYear(e),o)}function Pc(t){return t instanceof It?t.toNumber():typeof t=="bigint"?Number(t):t}function jct(t){const e={async:!1},n=(m,h)=>t.registerFunctionOverload(m,h,e),o=m=>m;n("dyn(dyn): dyn",o);for(const m in sm){const h=sm[m];h instanceof Ys&&n(`type(${h.name}): type`,()=>h)}n("bool(bool): bool",o),n("bool(string): bool",m=>{switch(m){case"1":case"t":case"true":case"TRUE":case"True":return!0;case"0":case"f":case"false":case"FALSE":case"False":return!1;default:throw _n("bool_conversion_error",`bool() conversion error: invalid string value "${m}"`)}}),n("size(string): number",m=>It.from(Gj(m))),n("size(bytes): number",m=>It.from(m.length)),n("size(list): number",m=>It.from(m.length??m.size)),n("size(map): number",m=>It.from(m instanceof Map?m.size:cu(m).length)),n("string.size(): number",m=>It.from(Gj(m))),n("bytes.size(): number",m=>It.from(m.length)),n("list.size(): number",m=>It.from(m.length??m.size)),n("map.size(): number",m=>It.from(m instanceof Map?m.size:cu(m).length)),n("bytes(string): bytes",m=>a.fromString(m)),n("bytes(bytes): bytes",o),n("number(number): number",m=>It.from(m)),n("number(string): number",m=>{const h=m;if(!h||h!==h.trim())throw _n("number_conversion_error","number() type error: cannot convert to number");try{return It.from(h)}catch{throw _n("number_conversion_error","number() type error: cannot convert to number")}}),n("number(bool): number",m=>It.from(m?1:0)),n("int(number): number",m=>{const h=It.from(m);if(h.isInteger())return h;const v=h.toNumber();if(!Number.isFinite(v))throw _n("numeric_overflow","int() type error: integer overflow");return It.from(BigInt(Math.trunc(v)))}),n("int(string): number",m=>{const h=m;if(h!==h.trim()||h.length>20||h.includes("0x"))throw _n("int_conversion_error","int() type error: cannot convert to int");try{return It.from(h)}catch{throw _n("int_conversion_error","int() type error: cannot convert to int")}}),n("double(number): number",m=>It.from(m)),n("double(string): number",m=>{const h=m;if(!h||h!==h.trim())throw _n("double_conversion_error","double() type error: cannot convert to double");try{return It.from(h)}catch{throw _n("double_conversion_error","double() type error: cannot convert to double")}}),n("uint(number): number",m=>It.from(m)),n("uint(string): number",m=>{const h=m;if(h!==h.trim()||h.length>20||h.includes("0x"))throw _n("uint_conversion_error","uint() type error: cannot convert to uint");try{return It.from(h)}catch{throw _n("uint_conversion_error","uint() type error: cannot convert to uint")}}),n("string(string): string",o),n("string(bool): string",m=>`${m}`),n("string(number): string",m=>It.from(m).toString()),n("string(bytes): string",m=>a.toUtf8(m)),n("string.startsWith(string): bool",(m,h)=>m.startsWith(h)),n("string.endsWith(string): bool",(m,h)=>m.endsWith(h)),n("string.contains(string): bool",(m,h)=>m.includes(h)),n("string.lowerAscii(): string",m=>m.toLowerCase()),n("string.upperAscii(): string",m=>m.toUpperCase()),n("string.trim(): string",m=>m.trim()),n("string.indexOf(string): number",(m,h)=>It.from(m.indexOf(h))),n("string.indexOf(string, number): number",(m,h,v)=>{if(h==="")return v;const g=Pc(v),b=m;if(g<0||g>=b.length)throw _n("index_out_of_range","string.indexOf(search, fromIndex): fromIndex out of range");return It.from(b.indexOf(h,g))}),n("string.lastIndexOf(string): number",(m,h)=>It.from(m.lastIndexOf(h))),n("string.lastIndexOf(string, number): number",(m,h,v)=>{if(h==="")return v;const g=Pc(v),b=m;if(g<0||g>=b.length)throw _n("index_out_of_range","string.lastIndexOf(search, fromIndex): fromIndex out of range");return It.from(b.lastIndexOf(h,g))}),n("string.substring(number): string",(m,h)=>{const v=Pc(h),g=m;if(v<0||v>g.length)throw _n("index_out_of_range","string.substring(start, end): start index out of range");return g.substring(v)}),n("string.substring(number, number): string",(m,h,v)=>{const g=Pc(h),b=m;if(g<0||g>b.length)throw _n("index_out_of_range","string.substring(start, end): start index out of range");const x=Pc(v);if(x<g||x>b.length)throw _n("index_out_of_range","string.substring(start, end): end index out of range");return b.substring(g,x)}),n("string.matches(string): bool",(m,h)=>{try{return new RegExp(h).test(m)}catch{throw _n("invalid_regular_expression",`Invalid regular expression: ${h}`)}}),n("string.split(string): list<string>",(m,h)=>m.split(h)),n("string.split(string, number): list<string>",(m,h,v)=>{const g=Pc(v);if(g===0)return[];const b=m.split(h);if(g<0||b.length<=g)return b;const x=b.slice(0,g-1);return x.push(b.slice(g-1).join(h)),x}),n("list<string>.join(): string",m=>{const h=m;for(let v=0;v<h.length;v++)if(typeof h[v]!="string")throw _n("invalid_list_element_type","string.join(): list must contain only strings");return h.join("")}),n("list<string>.join(string): string",(m,h)=>{const v=m;for(let g=0;g<v.length;g++)if(typeof v[g]!="string")throw _n("invalid_list_element_type","string.join(separator): list must contain only strings");return v.join(h)});const r=new TextEncoder,l=new TextDecoder("utf8"),a=typeof Buffer<"u"?{byteLength:m=>Buffer.byteLength(m),fromString:m=>Buffer.from(m,"utf8"),toHex:m=>Buffer.prototype.hexSlice.call(m,0,m.length),toBase64:m=>Buffer.prototype.base64Slice.call(m,0,m.length),toUtf8:m=>Buffer.prototype.utf8Slice.call(m,0,m.length),jsonParse:m=>JSON.parse(m)}:{textEncoder:new TextEncoder,byteLength:m=>r.encode(m).length,fromString:m=>r.encode(m),toHex:typeof Uint8Array.prototype.toHex=="function"?m=>m.toHex():m=>Mj(m,h=>h.toString(16).padStart(2,"0")).join(""),toBase64:typeof Uint8Array.prototype.toBase64=="function"?m=>m.toBase64():m=>btoa(Mj(m,h=>String.fromCodePoint(h)).join("")),toUtf8:m=>l.decode(m),jsonParse:m=>JSON.parse(l.decode(m))};n("bytes.json(): map",a.jsonParse),n("bytes.hex(): string",a.toHex),n("bytes.string(): string",a.toUtf8),n("bytes.base64(): string",a.toBase64),n("bytes.at(number): number",(m,h)=>{const v=Pc(h),g=m;if(v<0||v>=g.length)throw _n("index_out_of_range","Bytes index out of range");return It.from(g[v])});function u(m,h){return m instanceof ju?m:new ju(m.getTime(),h.timeZone)}t.registerType("Date",ju),n("date(string): Date",m=>{const h=new ju(m);if(Number.isNaN(h.getTime()))throw _n("invalid_date",`date() requires a valid date string, got "${m}"`);return h}),n("date(number): Date",m=>{const h=Pc(m);if(!Number.isFinite(h))throw _n("invalid_date",`date() requires a finite timestamp, got ${m}`);const v=Math.abs(h)<1e11?h*1e3:h,g=new ju(v);if(Number.isNaN(g.getTime()))throw _n("invalid_date",`date() got an out-of-range timestamp: ${m}`);return g});const c=1e5;function f(m,h,v){const g=v.toNumber();if(!(g>0))throw _n("invalid_range",`range(): step must be greater than 0, got ${g}`);const b=h.toNumber(),x=m.toNumber()<b,y=x?v:v.neg(),_=[];let k=m;for(;x?k.toNumber()<b:k.toNumber()>b;){if(_.push(k),_.length>c)throw _n("range_too_large",`range(): exceeded the ${c}-item limit`);k=k.add(y)}return _}n("range(number, number): list<dyn>",(m,h)=>f(m,h,It.from(1))),n("range(number, number, number): list<dyn>",(m,h,v)=>f(m,h,v));const p={year:Bj,month:zI,day:D_,hour:Fst,minute:qst};n("range(Date, Date, string): list<dyn>",(m,h,v)=>{const g=m,b=p[v];if(!b)throw _n("invalid_unit",`range(): unknown unit "${v}" (expected year / month / day / hour / minute)`);const x=h.getTime(),y=g.getTime()<x,_=[];let k=g;for(;y?k.getTime()<x:k.getTime()>x;){if(_.push(k),_.length>c)throw _n("range_too_large",`range(): exceeded the ${c}-item limit`);k=u(b(k,y?1:-1),g)}return _}),n("Date.startOf(string): Date",(m,h)=>{const v=m;switch(h){case"day":return u(OI(v),v);case"week":return u(ap(v),v);case"month":return u(Gst(v),v);case"year":return u(uue(v),v);default:throw _n("invalid_unit",`startOf(): unknown unit "${h}"`)}}),n("Date.endOf(string): Date",(m,h)=>{const v=m;switch(h){case"day":return u(Wst(v),v);case"week":return u(Jst(v),v);case"month":return u(Kst(v),v);case"year":return u(Yst(v),v);default:throw _n("invalid_unit",`endOf(): unknown unit "${h}"`)}}),n("Date.offset(number, string): Date",(m,h,v)=>{const g=m,b=Pc(h);switch(v.replace(/s$/,"")){case"day":return u(D_(g,b),g);case"week":return u(jst(g,b),g);case"month":return u(zI(g,b),g);case"year":return u(Bj(g,b),g);default:throw _n("invalid_unit",`offset(): unknown unit "${v}"`)}}),n("Date.set(string, number): Date",(m,h,v)=>{const g=m,b=Pc(v);switch(h){case"day":return u(Uct(g,b),g);case"month":return u(Bct(g,b-1),g);case"year":return u(qct(g,b),g);default:throw _n("invalid_field",`set(): unknown field "${h}"`)}}),n("Date.format(string): string",(m,h)=>Wr(m,h)),t.registerType("File",File),t.registerType("URL",URL),n("URL.query(string): optional<string>",(m,h)=>C3(m.searchParams.get(h)??void 0)),gst(t)}function Gj(t){let e=0;for(const n of t)e++;return e}class xue{brand="http"}const Hct=new xue;function Wct(t){t.registerType("http",xue),t.registerType("HttpRequest",Fu),t.registerVariable({name:"http",type:"http",value:Hct,description:"HTTP 客户端"}),t.registerFunctionOverload("http.get(string): HttpRequest",(e,n)=>new Fu(n,"GET")),t.registerFunctionOverload("http.post(string): HttpRequest",(e,n)=>new Fu(n,"POST")),t.registerFunctionOverload("http.put(string): HttpRequest",(e,n)=>new Fu(n,"PUT")),t.registerFunctionOverload("http.patch(string): HttpRequest",(e,n)=>new Fu(n,"PATCH")),t.registerFunctionOverload("http.delete(string): HttpRequest",(e,n)=>new Fu(n,"DELETE")),t.registerFunctionOverload("HttpRequest.header(string, string): HttpRequest",(e,n,o)=>e.header(n,o)),t.registerFunctionOverload("HttpRequest.query(string, string): HttpRequest",(e,n,o)=>e.query(n,o)),t.registerFunctionOverload("HttpRequest.query(string, number): HttpRequest",(e,n,o)=>e.query(n,Number(o))),t.registerFunctionOverload("HttpRequest.query(dyn): HttpRequest",(e,n)=>e.query(n)),t.registerFunctionOverload("HttpRequest.body(dyn): HttpRequest",(e,n)=>e.body(n))}class _ue{brand="JSON"}const Kct=new _ue;function q1(t){if(t==null)return t;if(t instanceof It)return t.toNumber();if(Ms(t))return cn(t)?q1(t.value):null;if(t instanceof Date)return t;if(t instanceof Map){const e={};for(const[n,o]of t)e[String(n)]=q1(o);return e}if(Array.isArray(t))return t.map(q1);if(typeof t=="object"){const e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;const n={};for(const o of Object.keys(t))n[o]=q1(t[o]);return n}return t}function Gct(t){t.registerType("JSON",_ue),t.registerVariable({name:"JSON",type:"JSON",value:Kct,description:"JSON 编解码"}),t.registerFunctionOverload("JSON.parse(string): dyn",(e,n)=>{try{return globalThis.JSON.parse(n)}catch(o){throw _n("invalid_json",`JSON.parse(): ${o.message}`)}}),t.registerFunctionOverload("JSON.stringify(dyn): string",(e,n)=>globalThis.JSON.stringify(q1(n)))}function Yct(t){if(t instanceof Blob)return t;if(t instanceof It)return t.toString();if(t instanceof Date)return t.toISOString();if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"||typeof t=="bigint")return String(t);throw _n("invalid_form_value",`form(): unsupported value type ${Object.prototype.toString.call(t)}`)}function G$(t,e,n){if(n!=null){if(Ms(n)){cn(n)&&G$(t,e,n.value);return}if(Array.isArray(n)){for(const o of n)G$(t,e,o);return}if(n instanceof Blob){t.append(e,n);return}if(typeof n=="object"&&!(n instanceof It)&&!(n instanceof Date))throw _n("invalid_form_value",`form(): nested object values are not supported (key: "${e}")`);t.append(e,Yct(n))}}function Jct(t){t.registerType("FormData",FormData),t.registerFunctionOverload("form(dyn): FormData",e=>{if(e==null)throw _n("invalid_form_value","form(): expected a map, got null");const n=new FormData;if(e instanceof Map){for(const[o,r]of e)G$(n,String(o),r);return n}if(typeof e!="object"||Array.isArray(e))throw _n("invalid_form_value","form(): expected a map");for(const o of Object.keys(e))o==="__proto__"||o==="constructor"||o==="prototype"||G$(n,o,e[o]);return n})}const NS=_l.dyn;class wue{dynType=_l.dyn;optionalType=_l.optional;stringType=_l.string;numberType=_l.number;boolType=_l.bool;nullType=_l.null;listType=_l.list;mapType=_l.map;opts;registry;objectTypes;objectTypesByConstructor;constructor(e){this.opts=e.opts,this.registry=e.registry,this.objectTypes=this.registry.objectTypes,this.objectTypesByConstructor=this.registry.objectTypesByConstructor}getType(e){return this.registry.getType(e)}debugType(e){switch(typeof e){case"string":return this.stringType;case"number":case"bigint":return this.numberType;case"boolean":return this.boolType;case"object":if(e===null)return this.nullType;if(e instanceof It)return this.numberType;if(Ms(e))return this.optionalType;switch(e.constructor){case void 0:case Object:case Map:return this.mapType;case Array:case Set:return this.listType;default:return this.objectTypesByConstructor.get(e.constructor)?.type||RI(this,e.constructor?.name||typeof e)}default:RI(this,typeof e)}}}function RI(t,e){throw t.createError("unsupported_type",`Unsupported type: ${e}`)}function Yj(t,e,n){e.right=e.args[1];const o=t.check(e.left=e.args[0],n);return e.op==="[]"&&t.check(e.right,n),e.handle=o!==NS?mdt:vdt,o.kind!=="optional"?t.checkAccessOnType(e,n,o):t.registry.getOptionalType(t.checkAccessOnType(e,n,o.valueType,!0))}function Jj(t,e,n){e.right=e.args[1];const o=t.check(e.left=e.args[0],n);e.op==="[?]"&&t.check(e.right,n),e.handle=pdt;const r=o.kind==="optional"?o.valueType:o;return t.registry.getOptionalType(t.checkAccessOnType(e,n,r,!0))}function E3(t){return t.args}function Xct(t,e,n){const o=t.check(E3(n),e);if(o.kind==="dyn")return t.dynType;if(o.kind==="list")return o.valueType;throw t.createError("invalid_spread",`Cannot spread '${t.formatType(o)}' into a list (expected a list)`,n)}function Qct(t,e,n){const o=t.check(E3(n),e);if(o.kind==="dyn")return[t.dynType,t.dynType];if(o.kind==="map")return[o.keyType,o.valueType];if(o.kind==="message")return[t.stringType,t.dynType];throw t.createError("invalid_spread",`Cannot spread '${t.formatType(o)}' into a map (expected a map)`,n)}const Zct=new Set(["__proto__","constructor","prototype"]);function oz(t,e,n){const o=e;Zct.has(o)||(t[o]=n)}function edt(t,e){const n={};for(const o of e){if("kv"in o){oz(n,o.kv[0],o.kv[1]);continue}const r=o.spread;if(r instanceof Map){for(const[l,a]of r)oz(n,l,a);continue}if(r!==null&&typeof r=="object"&&!fv(r)){for(const l in r)$3(r,l)&&oz(n,l,r[l]);continue}throw t.createError("invalid_spread","Cannot spread a non-map value into a map",o.node)}return n}function tdt(t,e,n){const o=e.args;return tp(o.map(r=>r.op==="spread"?t.eval(E3(r),n).pipe(Zt(l=>fv(l)?Er(l):$r(t.createError("invalid_spread","Cannot spread a non-list value into a list",r)))):t.eval(r,n).pipe(Zn(l=>[l])))).pipe(Zn(r=>r.flat()))}function ndt(t,e,n){const o=e.args;return tp(o.map(r=>{if(r.length===1||r[0].op==="spread"){const a=r[0];return t.eval(E3(a),n).pipe(Zn(u=>({spread:u,node:a})))}const l=r;return tp([t.eval(l[0],n),t.eval(l[1],n)]).pipe(Zn(([a,u])=>({kv:[a,u]})))})).pipe(Zt(r=>rl({try:()=>edt(t,r),catch:l=>l})))}function odt(t,e,n){const o=t.debugRuntimeType(e);return t.createError("invalid_condition_type",`${n.meta.label||"Ternary condition must be bool"}, got '${o}'`,n)}function Xj(t,e,n,o){return t===!0?e.eval(n.left,o):t===!1?e.eval(n.right,o):$r(odt(e,t,n.condition))}function Fc(t,e,n){const o=t.debugRuntimeType(e);return t.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${o}'`,n)}function Qj(t,e,n){const o=t.check(e.left=e.args[0],n),r=t.check(e.right=e.args[1],n);if(!o.isDynOrBool())throw t.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${t.formatType(o)}'`,e);if(!r.isDynOrBool())throw t.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${t.formatType(r)}'`,e);return t.boolType}function Zj(t,e,n){const o=e.op,r=t.check(e.args,n);if(e.candidates=t.registry.operatorCandidates(o),r.kind==="dyn")return e.handle=rdt,e.candidates.returnType;const l=e.candidates.findUnaryOverload(r);if(!l)throw t.createError("no_such_overload",`no such overload: ${o[0]}${t.formatType(r)}`,e);return e.handle=l.handler,l.returnType}function rdt(t,e,n){const o=e,r=n,l=r.debugRuntimeType(t,o.args.checkedType),a=o.candidates.findUnaryOverload(l);if(a)return a.handler(t);throw r.createError("no_such_overload",`no such overload: ${o.op[0]}${l}`,o)}function eH(t,e,n){return t.eval(e.args,n).pipe(Zt(o=>rl({try:()=>e.handle(o,e,t),catch:r=>r})))}function ldt(t,e,n){const o=e.op,r=t.check(e.left=e.args[0],n),l=t.check(e.right=e.args[1],n);e.candidates=t.registry.operatorCandidates(o);const a=r.hasDynType||l.hasDynType?void 0:e.candidates.findBinaryOverload(r,l);if(e.handle=a?a.handler:idt,a)return a.returnType;const u=e.candidates.checkBinaryOverload(r,l);if(r.hasDynType||(e.leftStaticType=r),l.hasDynType||(e.rightStaticType=l),u)return u;throw t.createError("no_such_overload",`no such overload: ${t.formatType(r)} ${o} ${t.formatType(l)}`,e)}function VI(t,e,n){return tp([t.eval(e.left,n),t.eval(e.right,n)]).pipe(Zt(([o,r])=>rl({try:()=>e.handle(o,r,e,t),catch:l=>l})))}function tH(t,e,n){return t.eval(e.left,n).pipe(Zt(o=>rl({try:()=>e.handle(o,e.right,e,t),catch:r=>r})))}function idt(t,e,n,o){const r=n,l=o,a=r.leftStaticType||l.debugTypeDeep(t).wrappedType,u=r.rightStaticType||l.debugTypeDeep(e).wrappedType,c=r.candidates.findBinaryOverload(a,u);if(c)return c.handler(t,e,n,o);throw l.createError("no_such_overload",`no such overload: ${a} ${r.op} ${u}`,r)}function Y$(t,e,n,o){return rl({try:()=>t.apply(e,n),catch:r=>AI(r,o)}).pipe(Zt(r=>eh(r)&&!Ms(r)?r.pipe(dy(l=>AI(l,o))):Er(r)))}function adt(t,e,n){const o=e,r=n,l=t,a=o.args[1],u=o.argTypes;let c=a.length;for(;c--;)u[c]=r.debugRuntimeType(l[c],a[c].checkedType);const f=o.candidates.findFunction(u);return f?Y$(f.handler,r,l,o):$r(r.createError("no_matching_overload",`found no matching overload for '${o.args[0]}(${u.map(p=>p.unwrappedType).join(", ")})'`,o))}function sdt(t,e,n){const o=n,r=e,l=t,[,a,u]=o.args,c=o.argTypes;for(let m=0;m<c.length;m++)c[m]=r.debugRuntimeType(l[m+1],u[m].checkedType);const f=r.debugRuntimeType(l[0],a.checkedType),p=o.candidates.findFunction(c,f);return p?Y$(p.handler,r,l,o):$r(r.createError("no_matching_overload",`found no matching overload for '${f.type}.${o.args[0]}(${c.map(m=>m.unwrappedType).join(", ")})'`,o))}function rz(t,e,n){return e.length===0?Er([]):tp(e.map(o=>t.eval(o,n)))}function udt(t){const e={};for(let n=0;n<t.length;n++){const[o,r]=t[n];o==="__proto__"||o==="constructor"||o==="prototype"||(e[o]=r)}return e}function cdt(t,e,n){const o=t.check(e,n);if(o.kind==="dyn")return o;if(o.kind==="list")return o.valueType;if(o.kind==="map")return o.keyType;throw t.createError("invalid_comprehension_range",`Expression of type '${t.formatType(o)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e)}function kue(t,e,n){if(n instanceof Set)return[...n];if(n instanceof Map)return[...n.keys()];if(n&&typeof n=="object")return cu(n);throw t.createError("invalid_comprehension_range",`Expression of type '${t.debugType(n)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e.iterable)}function ddt(t,e,n,o){return qt(function*(){fv(t)||(t=kue(n,e,t));let r=yield*n.eval(e.init,o=e.iterCtx.reuse(o));o.accuValue=r;let l=null;const a=e.condition,u=e.step,c=t.length;for(let f=0;f<c;f++){if(!a(r))return e.result(r);const p=yield*gf(n.eval(u,o.setIterValue(t[f],n)));if(Fo(p)){l??=p.left;continue}r=p.right,o.accuValue=r}return l&&a(r)?yield*$r(l):e.result(r)})}function fdt(t,e,n,o){return qt(function*(){fv(t)||(t=kue(n,e,t));let r=yield*n.eval(e.init,o=e.iterCtx.reuse(o));o.accuValue=r;const l=e.condition,a=e.step,u=t.length;for(let c=0;c<u&&!(l&&!l(r));c++)r=yield*n.eval(a,o.setIterValue(t[c],n));return e.result(r)})}function pdt(t,e,n,o){const r=o;return r.optionalType.field(t,e,n,r)}function mdt(t,e,n,o){const r=n,l=o;return r.left.checkedType.field(t,e,r,l)}const hdt=Object.create(null);function vdt(t,e,n,o){const r=n,l=o;switch(t?.constructor){case void 0:case Object:{const a=$3(t||hdt,e)?t[e]:void 0;if(a!==void 0)return l.debugType(a),a;break}case Map:{const a=t.get(e);if(a!==void 0)return l.debugType(a),a;break}case Array:case Set:return l.listType.field(t,e,r,l);default:{const a=l.objectTypesByConstructor.get(t.constructor);if(a)return a.type.field(t,e,r,l);typeof t=="object"&&RI(l,t.constructor?.name??"object")}}throw l.createError("no_such_key",`No such key: ${e}`,r)}const gdt=()=>Er([]),ydt=()=>Er({}),$0={value:{check(t,e){return t.debugType(e.args)},evaluate(t,e){return Er(e.args)}},id:{check(t,e,n){const o=n.getVariable(e.args);if(!o)throw t.createError("unknown_variable",`Unknown variable: ${e.args}`,e);if(o.constant){const r=e.clone($0.value,o.value);return e.setMeta("alternate",r),t.check(r,n)}return o.type},evaluate(t,e,n){return rl({try:()=>n.getCheckedValue(t,e),catch:o=>o})}},".":{alias:"fieldAccess",check:Yj,evaluate:tH},".?":{alias:"optionalFieldAccess",check:Jj,evaluate:tH},"[]":{alias:"bracketAccess",check:Yj,evaluate:VI},"[?]":{alias:"optionalBracketAccess",check:Jj,evaluate:VI},call:{check(t,e,n){const[o,r]=e.args,l=e.candidates=t.registry.functionCandidates(!1,o,r.length),a=e.argTypes=r.map(f=>t.check(f,n)),u=l.findFunction(a);if(!u)throw t.createError("no_matching_overload",`found no matching overload for '${o}(${t.formatTypeList(a)})'`,e);const c=a.some(f=>f.hasDynType)?adt:((f,p,m)=>Y$(u.handler,m,f,p));return e.handle=c,u.returnType},evaluate(t,e,n){return rz(t,e.args[1],n).pipe(Zt(o=>e.handle(o,e,t)))}},rcall:{check(t,e,n){const[o,r,l]=e.args,a=t.check(r,n),u=e.candidates=t.registry.functionCandidates(!0,o,l.length),c=e.argTypes=l.map(p=>t.check(p,n));if(e.receiverWithArgs=[r,...l],e.handle=sdt,a.kind==="dyn"&&u.returnType)return u.returnType;const f=u.findFunction(c,a);if(!f)throw t.createError("no_matching_overload",`found no matching overload for '${a.type}.${o}(${t.formatTypeList(c)})'`,e);if(!a.hasPlaceholderType&&!c.some(p=>p.hasDynType)){const p=f.handler,m=(h,v,g)=>Y$(p,v,h,g);e.handle=m}return f.returnType},evaluate(t,e,n){return rz(t,e.receiverWithArgs,n).pipe(Zt(o=>e.handle(o,t,e)))}},list:{check(t,e,n){const o=e.args;if(o.length===0)return e.setMeta("evaluate",gdt)&&t.getType("list<T>");let l=!1,a;for(const u of o){let c;u.op==="spread"?(l=!0,c=Xct(t,n,u)):c=t.check(u,n),a=a===void 0?c:a.unify(t.registry,c)??NS}return l&&e.setMeta("evaluate",tdt),t.registry.getListType(a)},evaluate(t,e,n){return rz(t,e.args,n)}},map:{check(t,e,n){const o=e.args;if(o.length===0)return e.setMeta("evaluate",ydt)&&t.getType("map<K, V>");let l=!1,a,u;for(const c of o){let f,p;c.length===1||c[0].op==="spread"?(l=!0,[f,p]=Qct(t,n,c[0])):(f=t.check(c[0],n),p=t.check(c[1],n)),a=a===void 0?f:a.unify(t.registry,f)??NS,u=u===void 0?p:u.unify(t.registry,p)??NS}return l&&e.setMeta("evaluate",ndt),t.registry.getMapType(a,u)},evaluate(t,e,n){const o=e.args;return tp(o.map(r=>tp([t.eval(r[0],n),t.eval(r[1],n)]))).pipe(Zn(udt))}},spread:{check(t,e){throw t.createError("misplaced_spread","'...' is only valid inside a list or map literal",e)},evaluate(t,e){return $r(t.createError("misplaced_spread","'...' is only valid inside a list or map literal",e))}},comprehension:{check(t,e,n){const o=e.args;o.iterCtx=n.forkWithVariable(o.iterVarName,cdt(t,o.iterable,n)).setAccuType(t.check(o.init,n));const r=t.check(o.step,o.iterCtx),l=o.errorsAreFatal?fdt:ddt;return e.handle=l,o.kind==="quantifier"?t.boolType:r},evaluate(t,e,n){return t.eval(e.args.iterable,n).pipe(Zt(o=>e.handle(o,e.args,t,n)))}},accuValue:{check(t,e,n){return n.accuType},evaluate(t,e,n){return Er(n.accuValue)}},accuInc:{check(t,e,n){return n.accuType},evaluate(t,e,n){return Er(n.accuValue=n.accuValue+1)}},accuPush:{check(t,e,n){const o=n.accuType,r=t.check(e.args,n);return o.kind==="list"&&o.valueType.kind!=="param"?o:t.registry.getListType(r)},evaluate(t,e,n){return t.eval(e.args,n).pipe(Zn(o=>{const r=n.accuValue;return r.push(o),r}))}},"?:":{alias:"ternary",check(t,e,n){const o=e.condition=e.args[0],r=e.left=e.args[1],l=e.right=e.args[2],a=t.check(o,n);if(!a.isDynOrBool())throw t.createError("invalid_condition_type",`${o.meta.label||"Ternary condition must be bool"}, got '${t.formatType(a)}'`,o);const u=t.check(r,n),c=t.check(l,n),f=u.unify(t.registry,c);if(e.handle=Xj,f)return f;throw t.createError("incompatible_ternary_branches",`Ternary branches must have the same type, got '${t.formatType(u)}' and '${t.formatType(c)}'`,e)},evaluate(t,e,n){return t.eval(e.condition,n).pipe(Zt(o=>Xj(o,t,e,n)))}},"||":{check:Qj,evaluate(t,e,n){return qt(function*(){const o=yield*t.tryEval(e.left,n);if(ba(o)){const l=o.right;if(l===!0)return!0;if(l===!1){const u=yield*t.eval(e.right,n);return typeof u=="boolean"?u:yield*$r(Fc(t,u,e.right))}const a=yield*t.tryEval(e.right,n);if(ba(a)){const u=a.right;return u===!0?!0:typeof u=="boolean"?yield*$r(Fc(t,l,e.left)):yield*$r(Fc(t,u,e.right))}return yield*$r(Fc(t,l,e.left))}const r=yield*t.tryEval(e.right,n);if(ba(r)){const l=r.right;return l===!0?!0:l===!1?yield*$r(o.left):yield*$r(Fc(t,l,e.right))}return yield*$r(o.left)})}},"&&":{check:Qj,evaluate(t,e,n){return qt(function*(){const o=yield*t.tryEval(e.left,n);if(ba(o)){const l=o.right;if(l===!1)return!1;if(l===!0){const u=yield*t.eval(e.right,n);return typeof u=="boolean"?u:yield*$r(Fc(t,u,e.right))}const a=yield*t.tryEval(e.right,n);if(ba(a)){const u=a.right;return u===!1?!1:typeof u=="boolean"?yield*$r(Fc(t,l,e.left)):yield*$r(Fc(t,u,e.right))}return yield*$r(Fc(t,l,e.left))}const r=yield*t.tryEval(e.right,n);if(ba(r)){const l=r.right;return l===!1?!1:l===!0?yield*$r(o.left):yield*$r(Fc(t,l,e.right))}return yield*$r(o.left)})}},"!_":{alias:"unaryNot",check:Zj,evaluate:eH},"-_":{alias:"unaryMinus",check:Zj,evaluate:eH}},bdt=["!=","==","in","+","-","*","/","%","<","<=",">",">="];for(const t of bdt)$0[t]={check:ldt,evaluate:VI};for(const t of cu($0)){const e=$0[t];e.name=t,e.alias&&($0[e.alias]=e)}const bn=$0,A3=t=>t;function Ob(t,e){if(t.op==="id")return t.args;throw va("invalid_macro_argument",e,t)}function nH(t,e,n,o,r,l,a){let u=r.clone(bn.accuPush,r);if(o){const c=o.clone(bn.accuValue,void 0);u=o.clone(bn.ternary,[o.setMeta("label",a),u,c])}return t.clone(bn.comprehension,{errorsAreFatal:!0,iterable:e,iterVarName:Ob(n,l),init:t.clone(bn.list,[]),step:u,result:A3})}function oH(t){const e=t?"map(var, filter, transform)":"map(var, transform)",n=`${e} invalid predicate iteration variable`,o=`${e} filter predicate must return bool`;if(t)return u=>{const{args:c,receiver:f,ast:p}=u;return{callAst:nH(p,f,c[0],c[1],c[2],n,o)}};function r(u,c,f,p){return qt(function*(){if(mr(p))return pt();const m=c.iterCtx.reuse(f),h=yield*u.eval(c.body,m.setIterValue(p.value,u));return bt(h)})}function l(u,c,f){const p=u.check(c.receiver,f);if(p.kind==="optional"){c.mode="optional";const m=p.valueType??u.getType("dyn");c.iterCtx=f.forkWithVariable(c.iterVarName,m);const h=u.check(c.body,c.iterCtx);return u.registry.getOptionalType(h)}return p.kind==="dyn"?(c.mode="dyn",c.iterCtx=f.forkWithVariable(c.iterVarName,u.getType("dyn")),u.check(c.comprehension,f),u.getType("dyn")):(c.mode="list",u.check(c.comprehension,f))}function a(u,c,f){return c.mode==="list"?u.eval(c.comprehension,f):c.mode==="optional"?Zt(u.eval(c.receiver,f),p=>r(u,c,f,p)):Zt(u.eval(c.receiver,f),p=>Ms(p)?r(u,c,f,p):u.eval(c.comprehension,f))}return u=>{const{args:c,receiver:f,ast:p}=u;return{ast:p,receiver:f,iterVarName:Ob(c[0],n),body:c[1],comprehension:nH(p,f,c[0],null,c[1],n,o),iterCtx:void 0,mode:"list",typeCheck:l,evaluate:a}}}function xdt(){const t="filter(var, predicate)",e=`${t} invalid predicate iteration variable`,n=`${t} predicate must return bool`;return o=>{const{args:r,receiver:l,ast:a}=o,u=Ob(r[0],e),c=a.clone(bn.accuValue,void 0),f=r[1].setMeta("label",n),p=a.clone(bn.accuPush,a.clone(bn.id,u)),m=f.clone(bn.ternary,[f,p,c]);return{callAst:a.clone(bn.comprehension,{errorsAreFatal:!0,iterable:l,iterVarName:u,init:a.clone(bn.list,[]),step:m,result:A3})}}}function lz(t){const e=`${t.name}(var, predicate) invalid predicate iteration variable`,n=`${t.name}(var, predicate) predicate must return bool`;return o=>{const{args:r,receiver:l,ast:a}=o,u=r[1].setMeta("label",n),c=t.transform({args:r,ast:a,predicate:u,opts:t});return{callAst:a.clone(bn.comprehension,{kind:"quantifier",errorsAreFatal:t.errorsAreFatal||!1,iterable:l,iterVarName:Ob(r[0],e),init:c.init,condition:c.condition,step:c.step,result:c.result||A3})}}}function _dt(){const t="find(var, predicate)",e=`${t} invalid iteration variable`,n=`${t} predicate must return bool`;function o(a,u,c){const f=a.check(u,c);if(f.kind==="dyn")return f;if(f.kind==="list")return f.valueType;if(f.kind==="map")return f.keyType;throw a.createError("invalid_comprehension_range",`Expression of type '${f}' cannot be range of find (must be list, map, or dynamic).`,u)}function r(a,u,c){const f=o(a,u.receiver,c);return u.iterCtx=c.forkWithVariable(u.iterVarName,f),a.check(u.predicate,u.iterCtx),a.registry.getOptionalType(f)}function l(a,u,c){return qt(function*(){let f=yield*a.eval(u.receiver,c);if(!Array.isArray(f))if(f instanceof Set)f=[...f];else if(f instanceof Map)f=[...f.keys()];else if(f&&typeof f=="object")f=Object.keys(f);else return yield*$r(a.createError("invalid_comprehension_range",`Expression of type '${a.debugType(f)}' cannot be range of find.`,u.receiver));const p=u.iterCtx.reuse(c),m=f;for(let h=0;h<m.length;h++)if(yield*a.eval(u.predicate,p.setIterValue(m[h],a)))return C3(m[h]);return pt()})}return a=>{const{args:u,receiver:c,ast:f}=a;return{ast:f,receiver:c,iterVarName:Ob(u[0],e),predicate:u[1].setMeta("label",n),iterCtx:void 0,evaluate:l,typeCheck:r}}}function wdt(){const t="has() invalid argument";function e(o,r,l){return qt(function*(){const a=r.macroHasProps;let u=a.length,c=yield*o.eval(a[--u],l),f;for(;u--;){const p=a[u];if(p.op===".?"&&(f??=!0),c=o.debugType(c).fieldLazy(c,p.args[1],p,o),c===void 0){if(!(!f&&u&&p.op==="."))break;throw _n("no_such_key",`No such key: ${p.args[1]}`,p)}}return c!==void 0})}function n(o,r,l){let a=r.args[0];if(a.op!==".")throw o.createError("invalid_macro_argument",t,a);if(!r.macroHasProps){const u=[];for(;a.op==="."||a.op===".?";)a=(u.push(a),a.args[0]);if(a.op!=="id")throw o.createError("invalid_macro_argument",t,a);o.check(a,l),u.push(a),r.macroHasProps=u}return o.getType("bool")}return function(o){const{args:r}=o;return{args:r,evaluate:e,typeCheck:n}}}function kdt(t){const e=(a,u)=>t.registerFunctionOverload(a,u);e("has(ast): bool",wdt()),e("list.all(ast, ast): bool",lz({name:"all",transform({ast:a,predicate:u}){return{init:a.clone(bn.value,!0),condition:A3,step:u.clone(bn.ternary,[u,u.clone(bn.value,!0),u.clone(bn.value,!1)])}}})),e("list.exists(ast, ast): bool",lz({name:"exists",condition(a){return!a},transform({ast:a,predicate:u,opts:c}){return{init:a.clone(bn.value,!1),condition:c.condition,step:u.clone(bn.ternary,[u,u.clone(bn.value,!0),u.clone(bn.value,!1)])}}})),e("list.exists_one(ast, ast): bool",lz({name:"exists_one",errorsAreFatal:!0,result(a){return a===1},transform({ast:a,predicate:u,opts:c}){const f=a.clone(bn.accuValue,void 0);return{init:a.clone(bn.value,0),step:u.clone(bn.ternary,[u,a.clone(bn.accuInc,void 0),f]),result:c.result}}})),e("list.map(ast, ast): list<dyn>",oH(!1)),e("list.map(ast, ast, ast): list<dyn>",oH(!0)),e("list.filter(ast, ast): list<dyn>",xdt()),e("list.find(ast, ast): optional<dyn>",_dt());class n{#e="cel";toString(){return this.#e}}const o=new n;t.registerType("CelNamespace",n),t.registerConstant("cel","CelNamespace",o);function r(a,u,c){return u.bindCtx=c.forkWithVariable(u.var,a.check(u.val,c)),a.check(u.exp,u.bindCtx)}function l(a,{val:u,exp:c,bindCtx:f},p){return qt(function*(){const m=yield*a.eval(u,p);return yield*a.eval(c,f.reuse(p).setIterValue(m,a))})}e("CelNamespace.bind(ast, dyn, ast): dyn",a=>{const{ast:u,args:c}=a;return{ast:u,var:Ob(c[0],"invalid variable argument"),val:c[1],exp:c[2],bindCtx:void 0,typeCheck:r,evaluate:l}})}function Sdt(t){const e=(c,f,p,m)=>t.unaryOverload(c,f,p,m,!1),n=(c,f,p,m,h)=>t.binaryOverload(c,f,p,m,h,!1);function o(c){throw _n("division_by_zero","division by zero",c)}function r(c){throw _n("modulo_by_zero","modulo by zero",c)}e("!","bool",c=>!c),e("-","number",c=>It.from(c).neg()),n("number","*","number",(c,f)=>It.from(c).mul(f)),n("number","+","number",(c,f)=>It.from(c).add(f)),n("number","-","number",(c,f)=>It.from(c).sub(f)),n("number","/","number",(c,f,p)=>{const m=It.from(f);return m.isZero()?o(p):It.from(c).div(m)}),n("number","%","number",(c,f,p)=>{const m=It.from(f);return m.isZero()?r(p):It.from(c).mod(m)}),n("string","+","string",(c,f)=>c+f),n("list<V>","+","list<V>",(c,f)=>[...c,...f]),n("bytes","+","bytes",(c,f)=>{const p=c,m=f;if(!p.length)return m;if(!m.length)return p;const h=new Uint8Array(p.length+m.length);return h.set(p,0),h.set(m,p.length),h}),n("Date","==","Date",(c,f)=>Hut(c,f)),n("Date","<","Date",(c,f)=>Kj(c,f)),n("Date","<=","Date",(c,f)=>!Wj(c,f)),n("Date",">","Date",(c,f)=>Wj(c,f)),n("Date",">=","Date",(c,f)=>!Kj(c,f));function l(c,f,p,m){const h=f;if(h instanceof Set&&h.has(c))return!0;for(const v of h)if(l1(c,v,p,m))return!0;return!1}function a(c,f){const p=f;return p instanceof Map?p.get(c)!==void 0:$3(p,c)?p[c]!==void 0:!1}function u(c,f,p,m){return l(c,f,p,m)}n("V","in","list<V>",u),n("K","in","map<K, V>",a);for(const c of["type","null","bool","string"])n(c,"==",c,(f,p)=>f===p);n("number","==","number",(c,f)=>It.from(c).eq(f)),n("bytes","==","bytes",(c,f)=>{if(c===f)return!0;const p=c,m=f;let h=p.length;if(h!==m.length)return!1;for(;h--;)if(p[h]!==m[h])return!1;return!0}),n("list<V>","==","list<V>",(c,f,p,m)=>{if(c===f)return!0;if(fv(c)&&fv(f)){const x=c,y=f,_=x.length;if(_!==y.length)return!1;for(let k=0;k<_;k++)if(!l1(x[k],y[k],p,m))return!1;return!0}if(c instanceof Set&&f instanceof Set){if(c.size!==f.size)return!1;for(const x of c)if(!f.has(x))return!1;return!0}const h=c instanceof Set?f:c,v=c instanceof Set?c:f;if(!fv(h))return!1;const g=h,b=v;if(g.length!==b?.size)return!1;for(let x=0;x<g.length;x++)if(!b.has(g[x]))return!1;return!0}),n("map<K, V>","==","map<K, V>",(c,f,p,m)=>{if(c===f)return!0;if(c instanceof Map&&f instanceof Map){if(c.size!==f.size)return!1;for(const[x,y]of c)if(!(f.has(x)&&l1(y,f.get(x),p,m)))return!1;return!0}if(c instanceof Map||f instanceof Map){const x=c instanceof Map?f:c,y=c instanceof Map?c:f,_=cu(x);if(y.size!==_.length)return!1;for(const[k,w]of y)if(!(k in x&&l1(w,x[k],p,m)))return!1;return!0}const h=c,v=f,g=cu(h),b=cu(v);if(g.length!==b.length)return!1;for(let x=0;x<g.length;x++){const y=g[x];if(!(y in v&&l1(h[y],v[y],p,m)))return!1}return!0});for(const[c,f]of[["bool","bool"],["number","number"],["string","string"]]){const p=c==="number";n(c,"<",f,p?(m,h)=>It.from(m).lt(h):(m,h)=>m<h),n(c,"<=",f,p?(m,h)=>It.from(m).lte(h):(m,h)=>m<=h),n(c,">",f,p?(m,h)=>It.from(m).gt(h):(m,h)=>m>h),n(c,">=",f,p?(m,h)=>It.from(m).gte(h):(m,h)=>m>=h)}}function l1(t,e,n,o){if(t===e)return!0;switch(typeof t){case"undefined":case"string":case"boolean":return!1;case"number":case"bigint":return typeof e=="number"||typeof e=="bigint"||e instanceof It?It.from(t).eq(e):!1;case"object":{if(t instanceof It)return e instanceof It||typeof e=="number"||typeof e=="bigint"?t.eq(e):!1;if(typeof e!="object")return!1;const r=o.debugType(t),l=o.debugType(e);if(r!==l)return!1;const a=o.registry.findBinaryOverload("==",r,l);return a?a.handler(t,e,n,o):!1}}throw _n("invalid_comparison_type",`Cannot compare values of type ${typeof t}`,n)}const Cdt=new Map().set("A","dyn").set("T","dyn").set("K","dyn").set("V","dyn");class rH extends wue{constructor(e,n){super(e),this.createError=n?_n:mst}check(e,n){try{return e.checkedType??=e.check(this,e,n)}catch(o){throw AI(o,e)}}checkAccessOnType(e,n,o,r=!1){if(o===this.dynType)return o;const l=(e.op==="[]"||e.op==="[?]"?this.check(e.args[1],n):this.stringType).type;if(o.kind==="list"){if(l==="number"||l==="dyn")return o.valueType;throw this.createError("invalid_index_type",`List index must be number, got '${l}'`,e)}if(o.kind==="map")return o.valueType;const a=this.objectTypes.get(o.name);if(a){if(!(l==="string"||l==="dyn"))throw this.createError("invalid_index_type",`Cannot index type '${o.name}' with type '${l}'`,e);if(a.fields){let u;const c=e.args;if(e.op==="."||e.op===".?"?u=c[1]:c[1]?.op==="value"&&(u=c[1].args),typeof u=="string"){const f=a.fields[u];if(f)return f;if(r)return this.dynType;throw this.createError("no_such_key",`No such key: ${u}`,e)}}return this.dynType}throw this.createError("cannot_index_type",`Cannot index type '${this.formatType(o)}'`,e)}formatType(e){return e.hasPlaceholderType?e.templated(this.registry,Cdt).name:e.name}formatTypeList(e){return e.map(n=>this.formatType(n)).join(", ")}}const yt={EOF:0,NUMBER:1,STRING:2,BOOLEAN:3,NULL:4,IDENTIFIER:5,PLUS:6,MINUS:7,MULTIPLY:8,DIVIDE:9,MODULO:10,EQ:11,NE:12,LT:13,LE:14,GT:15,GE:16,AND:17,OR:18,NOT:19,IN:20,LPAREN:21,RPAREN:22,LBRACKET:23,RBRACKET:24,LBRACE:25,RBRACE:26,DOT:27,COMMA:28,COLON:29,QUESTION:30,BYTES:31,ELLIPSIS:32},gk={[yt.EQ]:bn["=="],[yt.PLUS]:bn["+"],[yt.MINUS]:bn["-"],[yt.MULTIPLY]:bn["*"],[yt.DIVIDE]:bn["/"],[yt.MODULO]:bn["%"],[yt.LE]:bn["<="],[yt.LT]:bn["<"],[yt.GE]:bn[">="],[yt.GT]:bn[">"],[yt.NE]:bn["!="],[yt.IN]:bn.in},LS={};for(const t in yt)LS[yt[t]]=t;const Sue=new Uint8Array(128);for(const t of"0123456789abcdefABCDEF")Sue[t.charCodeAt(0)]=1;const $dt={bytes_unicode_escape:t=>`\\${t} not allowed in bytes literals`,invalid_unicode_escape:t=>`Invalid Unicode escape: \\${t}`,invalid_unicode_surrogate:t=>`Invalid Unicode surrogate: \\${t}`,invalid_hex_escape:t=>`Invalid hex escape: \\${t}`,invalid_octal_escape:()=>"Octal escape must be 3 digits",octal_escape_out_of_range:t=>`Octal escape out of range: \\${t}`,invalid_escape_sequence:t=>`Invalid escape sequence: \\${t}`},lH={"\\":"\\","?":"?",'"':'"',"'":"'","`":"`",a:"\x07",b:"\b",f:"\f",n:`
|
|
65
|
+
${m}`}function AI(t,e){return t instanceof Db?t.withAst(e):t}function C3(t){return t===void 0?pt():bt(t)}function hst(t){if(mr(t))throw _n("optional_value_missing","Optional value is not present");return t.value}class Qse{#e="optional";toString(){return this.#e}}const vst=new Qse;function gst(t){const e=(f,p)=>t.registerFunctionOverload(f,p);t.registerType("OptionalNamespace",Qse),t.registerConstant("optional","OptionalNamespace",vst),e("optional.hasValue(): bool",f=>cn(f)),e("optional<A>.value(): A",f=>hst(f)),t.registerFunctionOverload("OptionalNamespace.none(): optional<T>",()=>pt()),e("OptionalNamespace.of(A): optional<A>",(f,p)=>C3(p));function n(f,p,m){if(Ms(f))return f;throw _n("optional_expected",`${m} must be optional`,p)}function o(f,p,m){return qt(function*(){const h=yield*f.eval(p.receiver,m),v=n(h,p.receiver,`${p.functionDesc} receiver`);return cn(v)?p.onHasValue(v):yield*p.onEmpty(f,p,m)})}function r(f,p,m,h){const v=f.check(p,m);if(v.kind==="optional")return v;if(v.kind==="dyn")return f.getType("optional");throw f.createError("optional_expected",`${h} must be optional, got '${v}'`,p)}function l({functionDesc:f,evaluate:p,typeCheck:m,onHasValue:h,onEmpty:v}){return g=>{const{ast:b,args:x,receiver:y}=g;return{ast:b,functionDesc:f,receiver:y,arg:x[0],evaluate:p,typeCheck:m,onHasValue:h,onEmpty:v}}}const a="optional.orValue() receiver",u="optional.or(optional) receiver",c="optional.or(optional) argument";t.registerFunctionOverload("optional.or(ast): optional<dyn>",l({functionDesc:"optional.or(optional)",evaluate:o,typeCheck(f,p,m){const h=r(f,p.receiver,m,u),v=r(f,p.arg,m,c),g=h.unify(f.registry,v);if(g)return g;throw f.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${h}' and '${v}'`,p.arg)},onHasValue:f=>f,onEmpty(f,p,m){const h=p.arg;return f.eval(h,m).pipe(Zn(v=>n(v,h,c)))}})),t.registerFunctionOverload("optional.orValue(ast): dyn",l({functionDesc:"optional.orValue(value)",onHasValue:f=>f.value,onEmpty(f,p,m){return f.eval(p.arg,m)},evaluate:o,typeCheck(f,p,m){const h=r(f,p.receiver,m,a).valueType,v=f.check(p.arg,m);if(!h)return v;const g=h.unify(f.registry,v);if(g)return g;throw f.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${h}' and '${v}'`,p.arg)}})),t.registerFunctionOverload("optional<A>.flatMap(ast, ast): optional<dyn>",yst())}function yst(){const t="optional.flatMap(var, body)",e=`${t} invalid iteration variable`,n=`${t} receiver`,o=`${t} body`;function r(c,f,p){if(Ms(c))return c;throw _n("optional_expected",`${p} must be optional`,f)}function l(c,f,p,m){const h=c.check(f,p);if(h.kind==="optional")return h;if(h.kind==="dyn")return c.getType("optional");throw c.createError("optional_expected",`${m} must be optional, got '${h}'`,f)}function a(c,f,p){const h=l(c,f.receiver,p,n).valueType??c.getType("dyn");return f.iterCtx=p.forkWithVariable(f.iterVarName,h),l(c,f.body,f.iterCtx,o)}function u(c,f,p){return qt(function*(){const m=yield*c.eval(f.receiver,p),h=r(m,f.receiver,n);if(mr(h))return pt();const v=f.iterCtx.reuse(p),g=yield*c.eval(f.body,v.setIterValue(h.value,c));return r(g,f.body,o)})}return c=>{const{args:f,receiver:p,ast:m}=c,h=f[0];if(h.op!=="id")throw va("invalid_macro_argument",e,h);return{ast:m,receiver:p,functionDesc:t,iterVarName:h.args,body:f[1],iterCtx:void 0,evaluate:u,typeCheck:a}}}const $3=Object.hasOwn,cu=Object.keys,Tp=Object.freeze,bst=Object.entries,fv=Array.isArray,Mj=Array.from;function Zse(t,e){return t?.[Symbol.toStringTag]==="AsyncFunction"?!0:typeof e=="boolean"?e:!0}const B$=new Set(["as","break","const","continue","else","for","function","if","import","let","loop","package","namespace","return","var","void","while","__proto__","prototype"]);class Ys{#e;constructor(e){this.#e=e,Tp(this)}get name(){return this.#e}get[Symbol.toStringTag](){return`Type<${this.#e}>`}toString(){return`Type<${this.#e}>`}}const sm={string:new Ys("string"),bool:new Ys("bool"),number:new Ys("number"),map:new Ys("map"),list:new Ys("list"),bytes:new Ys("bytes"),null_type:new Ys("null"),type:new Ys("type")},U$={dyn(t,e){switch(typeof t){case"string":case"number":case"bigint":case"boolean":return!0;case"object":if(t instanceof It)return!0;switch(t&&t.constructor){case null:case void 0:case Object:case Map:case Array:case Set:return!0;default:if(e.objectTypesByConstructor.get(t.constructor))return!0}}return!!e.debugType(t)},string(t){return typeof t=="string"},number(t){return t instanceof It||typeof t=="number"||typeof t=="bigint"},bool(t){return typeof t=="boolean"},null(t){return t===null},bytes(t){return t instanceof Uint8Array},type(t){return t instanceof Ys},list(t){switch(t?.constructor){case Array:case Set:return!0;default:return!1}},map(t){switch(typeof t=="object"&&t?t.constructor:null){case void 0:case Object:case Map:return!0;default:return!1}},optional(t){return Ms(t)},message(t,e){return this===e.debugType(t)}};U$.param=U$.dyn;class ip{#e=new WeakMap;kind;type;name;keyType;valueType;unwrappedType;wrappedType;hasDynType;hasPlaceholderType;matchesValueType;fieldLazy;constructor({kind:e,type:n,name:o,keyType:r,valueType:l}){this.kind=e,this.type=n,this.name=o,this.keyType=r,this.valueType=l,this.unwrappedType=e==="dyn"&&l?l.unwrappedType:this,this.wrappedType=e==="dyn"?this:eue(this.unwrappedType),this.hasDynType=this.kind==="dyn"||this.valueType?.hasDynType||this.keyType?.hasDynType||!1,this.hasPlaceholderType=this.kind==="param"||this.keyType?.hasPlaceholderType||this.valueType?.hasPlaceholderType||!1,this.fieldLazy=(a,u,c,f)=>{},e==="list"?this.fieldLazy=this.#i.bind(this):e==="map"?this.fieldLazy=this.#r.bind(this):e==="message"?this.fieldLazy=this.#o.bind(this):e==="optional"&&(this.fieldLazy=this.#t.bind(this)),this.matchesValueType=U$[o]||U$[e],Tp(this)}isDynOrBool(){return this.type==="bool"||this.kind==="dyn"}isEmpty(){return!!(this.valueType&&this.valueType.kind==="param")}unify(e,n){if(this===n||this.kind==="dyn"||n.kind==="param")return this;if(n.kind==="dyn"||this.kind==="param")return n;if(this.kind!==n.kind||!(this.hasPlaceholderType||n.hasPlaceholderType||this.hasDynType||n.hasDynType))return null;const o=this.valueType.unify(e,n.valueType);if(!o)return null;switch(this.kind){case"optional":return e.getOptionalType(o);case"list":return e.getListType(o);case"map":{const r=this.keyType.unify(e,n.keyType);return r?e.getMapType(r,o):null}}return null}templated(e,n){if(!this.hasPlaceholderType)return this;switch(this.kind){case"dyn":return this.valueType.templated(e,n);case"param":return n?.get(this.name)||this;case"map":return e.getMapType(this.keyType.templated(e,n),this.valueType.templated(e,n));case"list":return e.getListType(this.valueType.templated(e,n));case"optional":return e.getOptionalType(this.valueType.templated(e,n));default:return this}}toString(){return this.name}#t(e,n,o,r){const l=Ms(e)?Vl(e):e;if(l===void 0)return pt();const a=r.debugType(l);try{return C3(a.fieldLazy(l,n,o,r))}catch(u){if(u instanceof EI)return pt();throw u}}#o(e,n,o,r){const l=e&&typeof e=="object"?e.constructor:void 0,a=l?r.objectTypesByConstructor.get(l):void 0;if(!a)return;const u=a.fields?a.fields[n]:Ya;if(!u)return;const c=e instanceof Map?e.get(n):e[n];if(c!==void 0){if(u.matchesValueType(c,r))return c;throw _n("field_type_mismatch",`Field '${n}' is not of type '${u}', got '${r.debugType(c)}'`,o)}}#r(e,n,o,r){const l=e instanceof Map?e.get(n):e&&$3(e,n)?e[n]:void 0;if(l!==void 0){if(this.valueType.matchesValueType(l,r))return l;throw _n("field_type_mismatch",`Field '${n}' is not of type '${this.valueType}', got '${r.debugType(l)}'`,o)}}#l(e,n){switch(e?.constructor){case Array:return e[n];case Set:{let o=0;for(const r of e)if(o++===n)return r}}}#i(e,n,o,r){let l;if(n instanceof It)l=n.toNumber();else if(typeof n=="bigint")l=Number(n);else if(typeof n=="number")l=n;else return;const a=this.#l(e,l);if(a===void 0){if(!e)return;const u=e;throw _n("index_out_of_bounds",`No such key: index out of bounds, index ${l} ${l<0?"< 0":`>= size ${u.length??u.size}`}`,o)}if(this.valueType.matchesValueType(a,r))return a;throw _n("list_item_type_mismatch",`List item with index '${l}' is not of type '${this.valueType}', got '${r.debugType(a)}'`,o)}field(e,n,o,r){const l=this.fieldLazy(e,n,o,r);if(l!==void 0)return l;throw _n("no_such_key",`No such key: ${n}`,o)}matchesBoth(e){return this.matches(e)&&e.matches(this)}matches(e){const n=this.unwrappedType;return e=e.unwrappedType,n===e||n.kind==="dyn"||e.kind==="dyn"||e.kind==="param"?!0:this.#e.get(e)??this.#e.set(e,this.#n(n,e)).get(e)}#n(e,n){switch(e.kind){case"dyn":case"param":return!0;case"list":return n.kind==="list"&&e.valueType.matches(n.valueType);case"map":return n.kind==="map"&&e.keyType.matches(n.keyType)&&e.valueType.matches(n.valueType);case"optional":return n.kind==="optional"&&e.valueType.matches(n.valueType);default:return e.name===n.name}}}const xst="have a .callAst property or .evaluate(checker, macro, ctx) method.",_st="have a .callAst property or .typeCheck(checker, macro, ctx) method.";function wst(t,e){const n=`Macro '${t}' must`;return function(r){const l=e(r);if(!l||typeof l!="object")throw new Error(`${n} return an object.`);if(l.callAst)return l;if(!l.evaluate)throw new Error(`${n} ${xst}`);if(!l.typeCheck)throw new Error(`${n} ${_st}`);return l}}class rF{name;type;description;label;constant;value;constructor(e,n,o,r,l){this.name=e,this.type=n,this.description=o??null,this.label=l??null,this.constant=r!==void 0,this.value=r,Tp(this)}}class q${name;async;receiverType;returnType;description;params;argTypes;macro;signature;handler;partitionKey;hasPlaceholderType;constructor({name:e,receiverType:n,returnType:o,handler:r,description:l,params:a,async:u}){if(typeof e!="string")throw new Error("name must be a string");if(r!==void 0&&typeof r!="function")throw new Error("handler must be a function");const c=r||((...p)=>{throw new Error(`Function '${e}' has no runtime implementation (type-checking stub)`)});this.name=e,this.async=r?Zse(r,u):!1,this.receiverType=n??null,this.returnType=o,this.description=l??null,this.params=a,this.argTypes=this.params.map(p=>p.type),this.macro=this.argTypes.includes(nue);const f=n?`${n}.`:"";this.signature=`${f}${e}(${this.argTypes.join(", ")}): ${o}`,this.handler=this.macro?wst(this.signature,c):c,this.partitionKey=`${n?"rcall":"call"}:${e}:${a.length}`,this.hasPlaceholderType=this.returnType.hasPlaceholderType||this.receiverType?.hasPlaceholderType||this.argTypes.some(p=>p.hasPlaceholderType)||!1,Tp(this)}matchesArgs(e){return e.length===this.argTypes.length&&this.argTypes.every((n,o)=>n.matches(e[o]))?this:null}}class yf{operator;leftType;rightType;handler;async;returnType;signature;hasPlaceholderType;constructor({op:e,leftType:n,rightType:o,handler:r,returnType:l,async:a}){this.operator=e,this.leftType=n,this.rightType=o||null,this.handler=r,this.async=Zse(r,a),this.returnType=l,o?this.signature=`${n} ${e} ${o}: ${l}`:this.signature=`${e}${n}: ${l}`,this.hasPlaceholderType=this.leftType.hasPlaceholderType||this.rightType?.hasPlaceholderType||!1,Tp(this)}equals(e){return this.operator===e.operator&&this.leftType===e.leftType&&this.rightType===e.rightType}}function lF(t){return new ip({kind:"list",name:`list<${t}>`,type:"list",valueType:t})}function Rh(t){return new ip({kind:"primitive",name:t,type:t})}function kst(t){return new ip({kind:"message",name:t,type:t})}function eue(t){const e=t?`dyn<${t}>`:"dyn";return new ip({kind:"dyn",name:e,type:e,valueType:t})}function tue(t){const e=`optional<${t}>`;return new ip({kind:"optional",name:e,type:"optional",valueType:t})}function iF(t,e){return new ip({kind:"map",name:`map<${t}, ${e}>`,type:"map",keyType:t,valueType:e})}function Sst(t){return new ip({kind:"param",name:t,type:t})}const Ya=eue(),nue=Rh("ast"),Ij=lF(Ya),Rj=iF(Ya,Ya),_l={string:Rh("string"),bool:Rh("bool"),number:Rh("number"),bytes:Rh("bytes"),dyn:Ya,null:Rh("null"),type:Rh("type"),optional:tue(Ya),list:Ij,"list<dyn>":Ij,map:Rj,"map<dyn, dyn>":Rj};for(const t of[_l.string,_l.number]){const e=lF(t),n=iF(_l.string,t);_l[e.name]=e,_l[n.name]=n}Object.freeze(_l);class Cst{returnType=null;async=!1;macro=!1;#e=null;#t=null;declarations=[];registry;constructor(e){this.registry=e}[Symbol.iterator](){return this.declarations[Symbol.iterator]()}add(e){this.returnType=(this.returnType||e.returnType).unify(this.registry,e.returnType)||Ya,e instanceof q$&&e.macro&&(this.macro=e),e.async&&!this.async&&(this.async=!0),this.declarations.push(e),this.#e?.clear(),this.#t?.clear()}findFunction(e,n=null){for(let o=0;o<this.declarations.length;o++){const r=this.declarations[o];if(!(r instanceof q$))continue;const l=this.#c(r,e,n);if(l)return l}return null}findUnaryOverload(e){const n=(this.#e??=new Map).get(e);if(n!==void 0)return n;let o=!1;for(const r of this.declarations)if(r instanceof yf&&r.leftType===e){o=r;break}return this.#e.set(e,o),o}findBinaryOverload(e,n){return e.kind==="dyn"&&e.valueType?n=n.wrappedType:n.kind==="dyn"&&n.valueType&&(e=e.wrappedType),this.#e?.get(e)?.get(n)??this.#r(this.#e??=new Map,e,n,this.#l(e,n))}checkBinaryOverload(e,n){return(this.#t??=new Map).get(e)?.get(n)??this.#o(this.#t,e,n,this.#i(e,n))}#o(e,n,o,r){return(e.get(n)??(e.set(n,new Map),e.get(n))).set(o,r),r}#r(e,n,o,r){return(e.get(n)??(e.set(n,new Map),e.get(n))).set(o,r),r}#l(e,n){const o=this.#n(e,n);if(o.length===0)return!1;if(o.length===1)return o[0];throw new Error(`Operator overload '${o[0].signature}' overlaps with '${o[1].signature}'.`)}#i(e,n){const o=this.#n(e,n);if(o.length===0)return!1;let r=o[0].returnType;for(let l=1;l<o.length;l++)r=r.unify(this.registry,o[l].returnType)||Ya;return r}#n(e,n){const o=[];for(const r of this.declarations){if(!(r instanceof yf))continue;if(r.leftType===e&&r.rightType===n)return[r];const l=this.#a(r,e,n);l&&o.push(l)}if(o.length===0){const l=this.declarations.find(a=>a instanceof yf)?.operator;if((l==="=="||l==="!=")&&e.kind==="dyn")return Est[l]}return o}#a(e,n,o){const r=e.hasPlaceholderType?new Map:null,l=this.#d(e.leftType,n,r);if(!l)return!1;const a=e.rightType?this.#d(e.rightType,o,r):null;return e.rightType&&!a||(e.operator==="=="||e.operator==="!=")&&e.leftType.kind==="dyn"&&e.leftType.valueType&&n.kind!=="dyn"&&o.kind!=="dyn"?!1:e.hasPlaceholderType?{async:e.async,signature:e.signature,handler:e.handler,leftType:l,rightType:a??void 0,returnType:e.returnType.templated(this.registry,r)}:e}#c(e,n,o){return e.hasPlaceholderType?this.#f(e,n,o):o&&e.receiverType&&!o.matches(e.receiverType)?null:e.matchesArgs(n)}#f(e,n,o){const r=new Map;if(o&&e.receiverType&&!this.#d(e.receiverType,o,r))return null;for(let l=0;l<n.length;l++)if(!this.#d(e.argTypes[l],n[l],r))return null;return{async:e.async,handler:e.handler,signature:e.signature,returnType:e.returnType.templated(this.registry,r)}}#d(e,n,o){if(!e.hasPlaceholderType)return n.matches(e)?n:null;const r=n.kind==="dyn";return this.#s(e,n,o,r)&&(r||n.matches(e.templated(this.registry,o)))?n:null}#s(e,n,o,r=!1){if(!e.hasPlaceholderType)return!0;if(!n)return!1;const l=r||n.kind==="dyn";switch(n=n.unwrappedType,e.kind){case"param":{const a=l?Ya:n,u=o.get(e.name);return u?u.kind==="dyn"||a.kind==="dyn"?!0:u.matchesBoth(a):o.set(e.name,a)&&!0}case"list":return n.name==="dyn"&&(n=e),n.kind!=="list"?!1:this.#s(e.valueType,n.valueType,o,l);case"map":return n.name==="dyn"&&(n=e),n.kind!=="map"?!1:this.#s(e.keyType,n.keyType,o,l)&&this.#s(e.valueType,n.valueType,o,l);case"optional":return n.name==="dyn"&&(n=e),n.kind!=="optional"?!1:this.#s(e.valueType,n.valueType,o,l)}return!0}}function Vj(t){const e=[];let n="",o=0;for(const r of t){if(r==="<")o++;else if(r===">")o--;else if(r===","&&o===0){e.push(n.trim()),n="";continue}n+=r}return n&&e.push(n.trim()),e}const oue=[[It,"number",sm.number,_l.number],[Ys,"type",sm.type,_l.type],[Uint8Array,"bytes",sm.bytes,_l.bytes],...typeof Buffer<"u"?[[Buffer,"bytes",sm.bytes,_l.bytes]]:[]].map(t=>{const[e,n,o,r]=t;return Object.freeze({name:n,typeType:o,type:r,ctor:e})}),$st=oue.map(t=>[t.name,t]),Tst=oue.map(t=>[t.ctor,t]),mk=t=>new Error(`Invalid variable declaration: ${t}`),hk=t=>new Error(`Invalid type declaration: ${t}`),Est={"==":[{handler:(t,e)=>t===e,returnType:_l.bool}],"!=":[{handler:(t,e)=>t!==e,returnType:_l.bool}]};class j${#e=null;#t;#o=!0;#r=null;#l=null;#i=null;#n=null;#a=null;#c=null;#f=null;#d=null;#s=!1;objectTypes;objectTypesByConstructor;variables;unlistedVariablesAreDyn;constructor(e={}){this.unlistedVariablesAreDyn=e.unlistedVariablesAreDyn??!1;const n=e.parent instanceof j$?e.parent:null;if(n){this.#e=n;let o=n;for(;o&&!o.#r;)o=o.#e;let r=n;for(;r&&!r.#l;)r=r.#e;this.#i=n.#i,this.#n=n.#n,this.#d={operators:o.#r,functions:r.#l},this.objectTypes=new Map(n.objectTypes),this.objectTypesByConstructor=new Map(n.objectTypesByConstructor),this.variables=n.variables,this.#o=!1,this.#t=n.#t,this.#a=n.#a,this.#c=n.#c,this.#f=n.#f,this.unlistedVariablesAreDyn!==n.unlistedVariablesAreDyn&&this.#h()}else{this.#r=[],this.#l=[],this.objectTypes=new Map($st),this.objectTypesByConstructor=new Map(Tst),this.#t=new Map(bst(_l)),this.#a=new Map,this.#c=new Map,this.#f=new Map,this.variables=new Map,this.variables.dyn=this.unlistedVariablesAreDyn;for(const o in sm)this.registerConstant(o,"type",sm[o])}}#h(){this.#o||(this.variables=new Map(this.variables),this.variables.dyn=this.unlistedVariablesAreDyn,this.#o=!0)}deleteVariable(e){this.#h(),this.variables.delete(e)}#v(e){this.#r||(this.#i=null),this.operatorCandidates(e.operator).add(e),this.#r.push(e)}#w(e){this.#l||(this.#n=null),this.#b(e.partitionKey).add(e),this.#l.push(e)}#p(e,n){return e.get(n)||e.set(n,new Cst(this)).get(n)}#k(){return this.#r?this.#r:this.#r=[...this.#d.operators]}#g(){return this.#l?this.#l:this.#l=[...this.#d.functions]}operatorCandidates(e){if(this.#i)return this.#p(this.#i,e);const n=this.#i=new Map;for(const o of this.#k())this.#p(n,o.operator).add(o);return this.#p(n,e)}functionCandidates(e,n,o){return this.#b(`${e?"rcall":"call"}:${n}:${o}`)}#b(e){if(this.#n)return this.#p(this.#n,e);const n=this.#n=new Map;for(const o of this.#g())this.#p(n,o.partitionKey).add(o);return this.#p(n,e)}registerVariable(e,n,o){if(this.#s)throw new Error("Cannot modify frozen registry");let r=o?.description,l=o?.label,a;if(typeof e=="string"&&typeof n=="object"&&!(n instanceof ip)?(r=n.description,l=n.label,a=n.value,n.schema?n=this.registerType({name:`$${e}`,schema:n.schema}).type:n=n.type):typeof e=="object"&&(e.schema?n=this.registerType({name:`$${e.name}`,schema:e.schema}).type:n=e.type,r=e.description,l=e.label,a=e.value,e=e.name),typeof e!="string"||!e)throw mk("name must be a string");if(B$.has(e))throw mk(`'${e}' is a reserved name`);if(this.variables.get(e)!==void 0)throw mk(`'${e}' is already registered`);if(typeof n=="string")n=this.getType(n);else if(!(n instanceof ip))throw mk("type is required");return this.#h(),this.variables.set(e,new rF(e,n,r,a,l)),this}#S(e,n){const o=Object.create(null);for(const r of cu(n)){const l=n[r];if(typeof l=="object"&&l)o[r]=this.registerType({name:`${e}.${r}`,schema:l}).type.name;else if(typeof l=="string")o[r]=l;else throw new TypeError(`Invalid field definition for '${e}.${r}'`)}return o}registerConstant(e,n,o){return typeof e=="object"?this.registerVariable(e):this.registerVariable({name:e,type:n,value:o}),this}getType(e){return this.#u(e,!0)}getListType(e){return this.#a.get(e)||this.#a.set(e,this.#u(`list<${e}>`,!0)).get(e)}getMapType(e,n){return this.#c.get(e)?.get(n)||(this.#c.get(e)??(this.#c.set(e,new Map),this.#c.get(e))).set(n,this.#u(`map<${e}, ${n}>`,!0)).get(n)}getOptionalType(e){return this.#f.get(e)||this.#f.set(e,this.#u(`optional<${e}>`,!0)).get(e)}assertType(e,n,o){try{return this.#u(e,!0)}catch(r){throw r.message=`Invalid ${n} '${r.unknownType||e}' in '${o}'`,r}}declareType(e){return this.#u(e,!1)}getFunctionType(e){if(e==="ast")return nue;const n=this.#u(e,!0);if(n.kind==="dyn"&&n.valueType)throw new Error(`type '${n.name}' is not supported`);return n}registerType(e,n){if(this.#s)throw new Error("Cannot modify frozen registry");if(typeof e=="object"&&(n=e,e=n.fullName||n.name||n.ctor?.name),typeof e=="string"&&e[0]==="."&&(e=e.slice(1)),typeof e!="string"||e.length<2||B$.has(e))throw hk(`name '${e}' is not valid`);if(this.objectTypes.has(e))throw hk(`type '${e}' already registered`);const o=this.#u(e,!1);if(o.kind!=="message")throw hk(`type '${e}' is not valid`);const r=n,l={name:e,typeType:new Ys(e),type:o,ctor:typeof n=="function"?n:r?.ctor,convert:typeof n=="function"?void 0:r?.convert,fields:typeof r?.schema=="object"?this.#x(e,this.#S(e,r.schema)):this.#x(e,typeof n=="function"?void 0:r?.fields)};if(typeof l.ctor!="function"){if(!l.fields)throw hk(`type '${e}' requires a constructor or fields`);Object.assign(l,this.#T(e,l.fields))}return this.objectTypes.set(e,Object.freeze(l)),this.objectTypesByConstructor.set(l.ctor,l),this.registerFunctionOverload(`type(${e}): type`,()=>l.typeType,{async:!1}),l}#u(e,n=!0){const o=this.#t.get(e);if(o)return o;if(typeof e!="string"||!e.length)throw new Error("Invalid type: must be a string");if(e.match(/^[A-Z]$/))return this.#m(Sst,e,e);const l=e.match(/^(dyn|list|map|optional)<(.+)>$/);if(!l){if(n){const c=new Error(`Unknown type: ${e}`);throw c.unknownType=e,c}return this.#m(kst,e,e)}const a=l[1],u=l[2].trim();switch(a){case"dyn":{const c=this.#u(u,n).wrappedType;return this.#t.set(c.name,c),c}case"list":{const c=this.#u(u,n);return this.#m(lF,`list<${c}>`,c)}case"map":{const c=Vj(u);if(c.length!==2)throw new Error(`Invalid map type: ${e}`);const f=this.#u(c[0],n),p=this.#u(c[1],n);return this.#m(iF,`map<${f}, ${p}>`,f,p)}case"optional":{const c=this.#u(u,n);return this.#m(tue,`optional<${c}>`,c)}}throw new Error(`Unknown type kind: ${a}`)}#m(e,n,...o){const r=e;return this.#t.get(n)||this.#t.set(n,r(...o)).get(n)}findMacro(e,n,o){return this.functionCandidates(n,e,o).macro}findUnaryOverload(e,n){return this.operatorCandidates(e).findUnaryOverload(n)}findBinaryOverload(e,n,o){return this.operatorCandidates(e).findBinaryOverload(n,o)}#C(e){return typeof e=="string"?{type:e}:e?.id?Dst(e):e}#$(e,n,o,r=!1){try{const l=this.#C(n[o]);if(typeof l?.type!="string")throw new Error("unsupported declaration");return this.#u(l.type,r)}catch(l){throw l.message=`Field '${o}' in type '${e}' has unsupported declaration: ${JSON.stringify(n[o])}`,l}}#x(e,n){if(!n)return;const o=Object.create(null);for(const r of cu(n))o[r]=this.#$(e,n,r);return o}#T(e,n){const o=cu(n),r=Object.create(null);for(const a of o){const u=n[a],c=u.kind==="message"&&this.objectTypes.get(u.name);c===!1?r[a]=!1:r[a]=c&&c.convert?c:!1}const l={[e]:class extends Map{#_;constructor(a){super(),this.#_=a}[Symbol.iterator](){if(this.size!==o.length)for(const a of o)this.get(a);return super[Symbol.iterator]()}get(a){let u=super.get(a);if(u!==void 0||this.has(a))return u;const c=r[a];if(c===void 0)return;const f=this.#_;if(u=f instanceof Map?f.get(a):f?.[a],c&&u&&typeof u=="object")switch(u.constructor){case void 0:case Object:case Map:u=c.convert(u)}return super.set(a,u),u}}}[e];return{ctor:l,convert(a){if(a)return a.constructor===l?a:new l(a)}}}clone(e){return this.#s=!0,new j$({parent:this,unlistedVariablesAreDyn:e.unlistedVariablesAreDyn})}getDefinitions(){const e=[],n=[];for(const[,o]of this.variables)o&&e.push({name:o.name,description:o.description||null,label:o.label||null,type:o.type.name});for(const o of this.#g())n.push({signature:o.signature,name:o.name,description:o.description,receiverType:o.receiverType?o.receiverType.name:null,returnType:o.returnType.name,params:o.params.map(r=>({name:r.name,type:r.type.name,description:r.description}))});return{variables:e,functions:n}}#E(e){if(typeof e!="string")throw new Error("Invalid signature: must be a string");const n=e.match(/^(?:([a-z0-9.<>]+)\.)?(\w+)\((.*?)\):(.+)$/i);if(!n)throw new Error(`Invalid signature: ${e}`);return{receiverType:n[1]||null,name:n[2],argTypes:Vj(n[3]),returnType:n[4].trim()}}#A(e,n){return e.name!==n.name||e.argTypes.length!==n.argTypes.length||(e.receiverType||n.receiverType)&&(!e.receiverType||!n.receiverType)?!1:!(e.receiverType!==n.receiverType&&e.receiverType!==Ya&&n.receiverType!==Ya)&&(!!n.macro||!!e.macro||n.argTypes.every((r,l)=>{const a=e.argTypes[l];return r===a||r===Ya||a===Ya}))}#D(e){const n=this.#g();for(let o=0;o<n.length;o++){const r=n[o];if(r instanceof q$&&this.#A(r,e))return n[o]=e,this.#n=null,!0}return!1}#z(e,n,o){if(!o)return{type:this.getFunctionType(n),name:`arg${e}`,description:null};const r=o.type||n;if(!r)throw new Error(`params[${e}].type is required`);if(n&&r!==n)throw new Error(`params[${e}].type not equal to signature type`);return{name:o.name||`arg${e}`,type:this.getFunctionType(r),description:o.description??null}}registerFunctionOverload(e,n,o){if(this.#s)throw new Error("Cannot modify frozen registry");typeof e=="object"?o=e:typeof n=="object"?o=n:o||(o={});const r=typeof e=="string"?e:o.signature,l=r!==void 0?this.#E(r):void 0,a=l?.name||o.name,u=l?.receiverType||o.receiverType,c=l?.argTypes,f=l?.returnType||o.returnType,p=o.params;n=typeof n=="function"?n:o.handler;let m;try{if(!a)throw new Error("signature or name are required");if(!f)throw new Error("must have a returnType");if(p){if(c&&p.length!==c.length)throw new Error("mismatched length in params and args in signature")}else if(!c)throw new Error("signature or params are required");m=new q$({name:a,async:o?.async,receiverType:u?this.getType(u):null,returnType:this.getType(f),handler:n,description:o.description,params:(c||p).map((v,g)=>this.#z(g,c?.[g],p?.[g]))})}catch(v){throw v.message=typeof r=="string"?`Invalid function declaration '${r}': ${v.message}`:a?`Invalid function declaration '${a}': ${v.message}`:`Invalid function declaration: ${v.message}`,v}this.#D(m)||this.#w(m)}registerOperatorOverload(e,n,o){const r=e.match(/^([-!])([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(r){const[,p,m,h]=r;return this.unaryOverload(p,m,n,h,o?.async)}const l=e.match(/^([\w.<>]+) ([-+*%/<>]|==|!=|<=|>=|in) ([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(!l)throw new Error(`Operator overload invalid: ${e}`);const[,a,u,c,f]=l;return this.binaryOverload(a,u,c,n,f)}unaryOverload(e,n,o,r,l){if(this.#s)throw new Error("Cannot modify frozen registry");const a=this.assertType(n,"type",`${e}${n}`),u=this.assertType(r||n,"return type",`${e}${n}: ${r||n}`),c=new yf({op:`${e}_`,leftType:a,returnType:u,handler:o,async:l});this.#v(this.#y(c))}#O(e){for(const n of this.operatorCandidates(e.operator))if(n instanceof yf&&e.equals(n))return!0;return!1}#y(e){if(!this.#O(e))return e;throw new Error(`Operator overload already registered: ${e.signature}`)}binaryOverload(e,n,o,r,l,a){if(this.#s)throw new Error("Cannot modify frozen registry");l??=Pj.has(n)?"bool":e;const u=`${e} ${n} ${o}: ${l}`;let c=this.assertType(e,"left type",u),f=this.assertType(o,"right type",u);const p=this.assertType(l,"return type",u);if(c.kind==="dyn"&&c.valueType?f=f.wrappedType:f.kind==="dyn"&&f.valueType&&(c=c.wrappedType),Pj.has(n)&&p.type!=="bool")throw new Error(`Comparison operator '${n}' must return 'bool', got '${p.type}'`);const m=new yf({op:n,leftType:c,rightType:f,returnType:p,handler:r,async:a});if(m.hasPlaceholderType&&!(f.hasPlaceholderType&&c.hasPlaceholderType))throw new Error(`Operator overload with placeholders must use them in both left and right types: ${u}`);if(this.#y(m),n==="=="){const h=[new yf({op:"!=",leftType:c,rightType:f,handler(v,g,b,x){return!r(v,g,b,x)},returnType:p,async:a})];c!==f&&h.push(new yf({op:"==",leftType:f,rightType:c,handler(v,g,b,x){return r(g,v,b,x)},returnType:p,async:a}),new yf({op:"!=",leftType:f,rightType:c,handler(v,g,b,x){return!r(g,v,b,x)},returnType:p,async:a}));for(const v of h)this.#y(v);for(const v of h)this.#v(v)}this.#v(m)}}const Pj=new Set(["<","<=",">",">=","==","!=","in"]);function Ast(t){return new j$(t)}class vk{#e;#t;#o;#r;constructor(e,n){if(this.#e=e.variables,n!=null){if(typeof n!="object")throw _n("invalid_context","Context must be an object");n instanceof Map?this.#o=n:this.#t=n}}getValue(e){return this.#r?.get(e)||(this.#t?this.#t[e]:this.#o?.get(e))}getVariable(e){return this.#e.get(e)??(this.#e.dyn&&!B$.has(e)?new rF(e,Ya):void 0)}getCheckedValue(e,n){const o=this.getValue(n.args);if(o===void 0)throw _n("unknown_variable",`Unknown variable: ${n.args}`,n);if(n.checkedType.matchesValueType(o,e))return o;const r=n.checkedType,l=e.debugType(o);if(r.kind==="message"&&l.kind==="map"){const a=e.objectTypes.get(r.name)?.convert?.(o);if(a)return(this.#r??=new Map).set(n.args,a),a}throw _n("variable_type_mismatch",`Variable '${n.args}' is not of type '${r}', got '${l}'`,n)}forkWithVariable(e,n){return new H$(this,e,n)}}class H${#e;accuType;accuValue;iterValue;iterVar;iterType;async;constructor(e,n,o){this.#e=e,this.iterVar=n,this.iterType=o}forkWithVariable(e,n){return new H$(this,e,n)}reuse(e){if(!this.async)return this.#e=e,this;const n=new H$(e,this.iterVar,this.iterType);return n.accuType=this.accuType,n}setIterValue(e,n){if(this.iterType.matchesValueType(e,n))return this.iterValue=e,this;const o=this.iterType,r=n.debugType(e);if(o.kind==="message"&&r.kind==="map"){const l=n.objectTypes.get(o.name)?.convert?.(e);if(l)return this.iterValue=l,this}throw _n("variable_type_mismatch",`Variable '${this.iterVar}' is not of type '${o}', got '${r}'`)}setAccuType(e){return this.accuType=e,this}setAccuValue(e){return this.accuValue=e,this}getValue(e){return this.iterVar===e?this.iterValue:this.#e.getValue(e)}getCheckedValue(e,n){return this.iterVar===n.args?this.iterValue:this.#e.getCheckedValue(e,n)}getVariable(e){return this.iterVar===e?new rF(e,this.iterType):this.#e.getVariable(e)}}function Dst(t){let e;if(t.map){const n=tz(t.keyType,t.resolvedKeyType),o=tz(t.type,t.resolvedType);e=`map<${n}, ${o}>`}else e=tz(t.type,t.resolvedType);return{type:t.repeated?`list<${e}>`:e}}function tz(t,e){switch(t){case"string":return"string";case"bytes":return"bytes";case"bool":return"bool";case"double":case"float":case"int32":case"int64":case"sint32":case"sint64":case"sfixed32":case"sfixed64":case"uint32":case"uint64":case"fixed32":case"fixed64":return"double";default:switch(e?.constructor?.name){case"Type":return e.fullName.slice(1);case"Enum":return"int"}return t?.includes(".")?t:"dyn"}}function zst(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const Ost={},U1={};function Jh(t,e){try{const o=(Ost[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return o in U1?U1[o]:Fj(o,o.split(":"))}catch{if(t in U1)return U1[t];const n=t?.match(Mst);return n?Fj(t,n.slice(1)):NaN}}const Mst=/([+-]\d\d):?(\d\d)?/;function Fj(t,e){const n=+(e[0]||0),o=+(e[1]||0),r=+(e[2]||0)/60;return U1[t]=n*60+o>0?n*60+o+r:n*60-o-r}class hd extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Jh(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),rue(this),DI(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new hd(...n,e):new hd(Date.now(),e)}withTimeZone(e){return new hd(+this,e)}getTimezoneOffset(){const e=-Jh(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),DI(this),+this}[Symbol.for("constructDateFrom")](e){return new hd(+new Date(e),this.timeZone)}}const Nj=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!Nj.test(t))return;const e=t.replace(Nj,"$1UTC");hd.prototype[e]&&(t.startsWith("get")?hd.prototype[t]=function(){return this.internal[e]()}:(hd.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),Ist(this),+this},hd.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),DI(this),+this}))});function DI(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Jh(t.timeZone,t)*60))}function Ist(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),rue(t)}function rue(t){const e=Jh(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),l=-new Date(+o).getTimezoneOffset(),a=r-l,u=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&u&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=r-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const f=new Date(+t);f.setUTCSeconds(0);const p=r>0?f.getSeconds():(f.getSeconds()-60)%60,m=Math.round(-(Jh(t.timeZone,t)*60))%60;(m||p)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+p));const h=Jh(t.timeZone,t),v=h>0?Math.floor(h):Math.ceil(h),b=-new Date(+t).getTimezoneOffset()-v,x=v!==n,y=b-c;if(x&&y){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+y);const _=Jh(t.timeZone,t),k=_>0?Math.floor(_):Math.ceil(_),w=v-k;w&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+w))}}class ju extends hd{static tz(e,...n){return n.length?new ju(...n,e):new ju(Date.now(),e)}toISOString(){const[e,n,o]=this.tzComponents(),r=`${e}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,o,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${o} ${n} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,o,r]=this.tzComponents();return`${e} GMT${n}${o}${r} (${zst(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",o=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),r=String(Math.abs(e)%60).padStart(2,"0");return[n,o,r]}withTimeZone(e){return new ju(+this,e)}[Symbol.for("constructDateFrom")](e){return new ju(+new Date(e),this.timeZone)}}const lue=6048e5,Rst=864e5,iue=6e4,aue=36e5,Vst=1e3,Lj=Symbol.for("constructDateFrom");function il(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Lj in t?t[Lj](e):t instanceof Date?new t.constructor(e):new Date(e)}function go(t,e){return il(e||t,t)}function D_(t,e,n){const o=go(t,n?.in);return isNaN(e)?il(n?.in||t,NaN):(e&&o.setDate(o.getDate()+e),o)}function zI(t,e,n){const o=go(t,n?.in);if(isNaN(e))return il(n?.in||t,NaN);if(!e)return o;const r=o.getDate(),l=il(n?.in||t,o.getTime());l.setMonth(o.getMonth()+e+1,0);const a=l.getDate();return r>=a?l:(o.setFullYear(l.getFullYear(),l.getMonth(),r),o)}function Pst(t,e,n){return il(n?.in||t,+go(t)+e)}function Fst(t,e,n){return Pst(t,e*aue,n)}let Nst={};function vg(){return Nst}function ap(t,e){const n=vg(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=go(t,e?.in),l=r.getDay(),a=(l<o?7:0)+l-o;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function xy(t,e){return ap(t,{...e,weekStartsOn:1})}function sue(t,e){const n=go(t,e?.in),o=n.getFullYear(),r=il(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const l=xy(r),a=il(n,0);a.setFullYear(o,0,4),a.setHours(0,0,0,0);const u=xy(a);return n.getTime()>=l.getTime()?o+1:n.getTime()>=u.getTime()?o:o-1}function W$(t){const e=go(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Lst(t,...e){const n=il.bind(null,e.find(o=>typeof o=="object"));return e.map(n)}function OI(t,e){const n=go(t,e?.in);return n.setHours(0,0,0,0),n}function Bst(t,e,n){const[o,r]=Lst(n?.in,t,e),l=OI(o),a=OI(r),u=+l-W$(l),c=+a-W$(a);return Math.round((u-c)/Rst)}function Ust(t,e){const n=sue(t,e),o=il(t,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),xy(o)}function qst(t,e,n){const o=go(t,n?.in);return o.setTime(o.getTime()+e*iue),o}function jst(t,e,n){return D_(t,e*7,n)}function Bj(t,e,n){return zI(t,e*12,n)}function Hst(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function zb(t){return!(!Hst(t)&&typeof t!="number"||isNaN(+go(t)))}function Wst(t,e){const n=go(t,e?.in);return n.setHours(23,59,59,999),n}function Kst(t,e){const n=go(t,e?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function Gst(t,e){const n=go(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Yst(t,e){const n=go(t,e?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}function uue(t,e){const n=go(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Jst(t,e){const n=vg(),o=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=go(t,e?.in),l=r.getDay(),a=(l<o?-7:0)+6-(l-o);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}const Xst={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"}},Qst=(t,e,n)=>{let o;const r=Xst[t];return typeof r=="string"?o=r:e===1?o=r.one:o=r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function nz(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Zst={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eut={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nut={date:nz({formats:Zst,defaultWidth:"full"}),time:nz({formats:eut,defaultWidth:"full"}),dateTime:nz({formats:tut,defaultWidth:"full"})},out={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rut=(t,e,n,o)=>out[t];function o1(t){return(e,n)=>{const o=n?.context?String(n.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):a;r=t.formattingValues[u]||t.formattingValues[a]}else{const a=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;r=t.values[u]||t.values[a]}const l=t.argumentCallback?t.argumentCallback(e):e;return r[l]}}const lut={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},iut={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aut={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"]},sut={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"]},uut={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"}},cut={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"}},dut=(t,e)=>{const n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},fut={ordinalNumber:dut,era:o1({values:lut,defaultWidth:"wide"}),quarter:o1({values:iut,defaultWidth:"wide",argumentCallback:t=>t-1}),month:o1({values:aut,defaultWidth:"wide"}),day:o1({values:sut,defaultWidth:"wide"}),dayPeriod:o1({values:uut,defaultWidth:"wide",formattingValues:cut,defaultFormattingWidth:"wide"})};function r1(t){return(e,n={})=>{const o=n.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],l=e.match(r);if(!l)return null;const a=l[0],u=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(u)?mut(u,m=>m.test(a)):put(u,m=>m.test(a));let f;f=t.valueCallback?t.valueCallback(c):c,f=n.valueCallback?n.valueCallback(f):f;const p=e.slice(a.length);return{value:f,rest:p}}}function put(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function mut(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function hut(t){return(e,n={})=>{const o=e.match(t.matchPattern);if(!o)return null;const r=o[0],l=e.match(t.parsePattern);if(!l)return null;let a=t.valueCallback?t.valueCallback(l[0]):l[0];a=n.valueCallback?n.valueCallback(a):a;const u=e.slice(r.length);return{value:a,rest:u}}}const vut=/^(\d+)(th|st|nd|rd)?/i,gut=/\d+/i,yut={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},but={any:[/^b/i,/^(a|c)/i]},xut={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_ut={any:[/1/i,/2/i,/3/i,/4/i]},wut={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},kut={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]},Sut={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},Cut={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]},$ut={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},Tut={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}},Eut={ordinalNumber:hut({matchPattern:vut,parsePattern:gut,valueCallback:t=>parseInt(t,10)}),era:r1({matchPatterns:yut,defaultMatchWidth:"wide",parsePatterns:but,defaultParseWidth:"any"}),quarter:r1({matchPatterns:xut,defaultMatchWidth:"wide",parsePatterns:_ut,defaultParseWidth:"any",valueCallback:t=>t+1}),month:r1({matchPatterns:wut,defaultMatchWidth:"wide",parsePatterns:kut,defaultParseWidth:"any"}),day:r1({matchPatterns:Sut,defaultMatchWidth:"wide",parsePatterns:Cut,defaultParseWidth:"any"}),dayPeriod:r1({matchPatterns:$ut,defaultMatchWidth:"any",parsePatterns:Tut,defaultParseWidth:"any"})},cue={code:"en-US",formatDistance:Qst,formatLong:nut,formatRelative:rut,localize:fut,match:Eut,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Aut(t,e){const n=go(t,e?.in);return Bst(n,uue(n))+1}function due(t,e){const n=go(t,e?.in),o=+xy(n)-+Ust(n);return Math.round(o/lue)+1}function aF(t,e){const n=go(t,e?.in),o=n.getFullYear(),r=vg(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=il(e?.in||t,0);a.setFullYear(o+1,0,l),a.setHours(0,0,0,0);const u=ap(a,e),c=il(e?.in||t,0);c.setFullYear(o,0,l),c.setHours(0,0,0,0);const f=ap(c,e);return+n>=+u?o+1:+n>=+f?o:o-1}function Dut(t,e){const n=vg(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=aF(t,e),l=il(e?.in||t,0);return l.setFullYear(r,0,o),l.setHours(0,0,0,0),ap(l,e)}function fue(t,e){const n=go(t,e?.in),o=+ap(n,e)-+Dut(n,e);return Math.round(o/lue)+1}function yr(t,e){const n=t<0?"-":"",o=Math.abs(t).toString().padStart(e,"0");return n+o}const Np={y(t,e){const n=t.getFullYear(),o=n>0?n:1-n;return yr(e==="yy"?o%100:o,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):yr(n+1,2)},d(t,e){return yr(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return yr(t.getHours()%12||12,e.length)},H(t,e){return yr(t.getHours(),e.length)},m(t,e){return yr(t.getMinutes(),e.length)},s(t,e){return yr(t.getSeconds(),e.length)},S(t,e){const n=e.length,o=t.getMilliseconds(),r=Math.trunc(o*Math.pow(10,n-3));return yr(r,e.length)}},Fg={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Uj={G:function(t,e,n){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const o=t.getFullYear(),r=o>0?o:1-o;return n.ordinalNumber(r,{unit:"year"})}return Np.y(t,e)},Y:function(t,e,n,o){const r=aF(t,o),l=r>0?r:1-r;if(e==="YY"){const a=l%100;return yr(a,2)}return e==="Yo"?n.ordinalNumber(l,{unit:"year"}):yr(l,e.length)},R:function(t,e){const n=sue(t);return yr(n,e.length)},u:function(t,e){const n=t.getFullYear();return yr(n,e.length)},Q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return yr(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return yr(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,n){const o=t.getMonth();switch(e){case"M":case"MM":return Np.M(t,e);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,n){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return yr(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,n,o){const r=fue(t,o);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):yr(r,e.length)},I:function(t,e,n){const o=due(t);return e==="Io"?n.ordinalNumber(o,{unit:"week"}):yr(o,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Np.d(t,e)},D:function(t,e,n){const o=Aut(t);return e==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):yr(o,e.length)},E:function(t,e,n){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,n,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return yr(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});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"})}},c:function(t,e,n,o){const r=t.getDay(),l=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return yr(l,e.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const o=t.getDay(),r=o===0?7:o;switch(e){case"i":return String(r);case"ii":return yr(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e,n){const o=t.getHours();let r;switch(o===12?r=Fg.noon:o===0?r=Fg.midnight:r=o/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const o=t.getHours();let r;switch(o>=17?r=Fg.evening:o>=12?r=Fg.afternoon:o>=4?r=Fg.morning:r=Fg.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let o=t.getHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return Np.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Np.H(t,e)},K:function(t,e,n){const o=t.getHours()%12;return e==="Ko"?n.ordinalNumber(o,{unit:"hour"}):yr(o,e.length)},k:function(t,e,n){let o=t.getHours();return o===0&&(o=24),e==="ko"?n.ordinalNumber(o,{unit:"hour"}):yr(o,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Np.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Np.s(t,e)},S:function(t,e){return Np.S(t,e)},X:function(t,e,n){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(e){case"X":return jj(o);case"XXXX":case"XX":return Vh(o);default:return Vh(o,":")}},x:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"x":return jj(o);case"xxxx":case"xx":return Vh(o);default:return Vh(o,":")}},O:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qj(o,":");default:return"GMT"+Vh(o,":")}},z:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qj(o,":");default:return"GMT"+Vh(o,":")}},t:function(t,e,n){const o=Math.trunc(+t/1e3);return yr(o,e.length)},T:function(t,e,n){return yr(+t,e.length)}};function qj(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),l=o%60;return l===0?n+String(r):n+String(r)+e+yr(l,2)}function jj(t,e){return t%60===0?(t>0?"-":"+")+yr(Math.abs(t)/60,2):Vh(t,e)}function Vh(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),r=yr(Math.trunc(o/60),2),l=yr(o%60,2);return n+r+e+l}const Hj=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},pue=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},zut=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return Hj(t,e);let l;switch(o){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",Hj(o,e)).replace("{{time}}",pue(r,e))},MI={p:pue,P:zut},Out=/^D+$/,Mut=/^Y+$/,Iut=["D","DD","YY","YYYY"];function mue(t){return Out.test(t)}function hue(t){return Mut.test(t)}function II(t,e,n){const o=Rut(t,e,n);if(console.warn(o),Iut.includes(t))throw new RangeError(o)}function Rut(t,e,n){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vut=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Put=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fut=/^'([^]*?)'?$/,Nut=/''/g,Lut=/[a-zA-Z]/;function Wr(t,e,n){const o=vg(),r=o.locale??cue,l=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,u=go(t,n?.in);if(!zb(u))throw new RangeError("Invalid time value");let c=e.match(Put).map(p=>{const m=p[0];if(m==="p"||m==="P"){const h=MI[m];return h(p,r.formatLong)}return p}).join("").match(Vut).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:But(p)};if(Uj[m])return{isToken:!0,value:p};if(m.match(Lut))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(c=r.localize.preprocessor(u,c));const f={firstWeekContainsDate:l,weekStartsOn:a,locale:r};return c.map(p=>{if(!p.isToken)return p.value;const m=p.value;(hue(m)||mue(m))&&II(m,e,String(t));const h=Uj[m[0]];return h(u,m,r.localize,f)}).join("")}function But(t){const e=t.match(Fut);return e?e[1].replace(Nut,"'"):t}function Uut(t,e){const n=go(t,e?.in),o=n.getFullYear(),r=n.getMonth(),l=il(n,0);return l.setFullYear(o,r+1,0),l.setHours(0,0,0,0),l.getDate()}function qut(){return Object.assign({},vg())}function jut(t,e){const n=go(t,e?.in).getDay();return n===0?7:n}function Wj(t,e){return+go(t)>+go(e)}function Kj(t,e){return+go(t)<+go(e)}function Hut(t,e){return+go(t)==+go(e)}function Wut(t,e){const n=Kut(e)?new e(0):il(e,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}function Kut(t){return typeof t=="function"&&t.prototype?.constructor===t}const Gut=10;class vue{subPriority=0;validate(e,n){return!0}}class Yut extends vue{constructor(e,n,o,r,l){super(),this.value=e,this.validateValue=n,this.setValue=o,this.priority=r,l&&(this.subPriority=l)}validate(e,n){return this.validateValue(e,this.value,n)}set(e,n,o){return this.setValue(e,n,this.value,o)}}class Jut extends vue{priority=Gut;subPriority=-1;constructor(e,n){super(),this.context=e||(o=>il(n,o))}set(e,n){return n.timestampIsSet?e:il(e,Wut(e,this.context))}}let sr=class{run(e,n,o,r){const l=this.parse(e,n,o,r);return l?{setter:new Yut(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(e,n,o){return!0}};class Xut extends sr{priority=140;parse(e,n,o){switch(n){case"G":case"GG":case"GGG":return o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"});case"GGGGG":return o.era(e,{width:"narrow"});default:return o.era(e,{width:"wide"})||o.era(e,{width:"abbreviated"})||o.era(e,{width:"narrow"})}}set(e,n,o){return n.era=o,e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const Ll={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},rd={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Bl(t,e){return t&&{value:e(t.value),rest:t.rest}}function fl(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function ld(t,e){const n=e.match(t);if(!n)return null;if(n[0]==="Z")return{value:0,rest:e.slice(1)};const o=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:o*(r*aue+l*iue+a*Vst),rest:e.slice(n[0].length)}}function gue(t){return fl(Ll.anyDigitsSigned,t)}function Dl(t,e){switch(t){case 1:return fl(Ll.singleDigit,e);case 2:return fl(Ll.twoDigits,e);case 3:return fl(Ll.threeDigits,e);case 4:return fl(Ll.fourDigits,e);default:return fl(new RegExp("^\\d{1,"+t+"}"),e)}}function K$(t,e){switch(t){case 1:return fl(Ll.singleDigitSigned,e);case 2:return fl(Ll.twoDigitsSigned,e);case 3:return fl(Ll.threeDigitsSigned,e);case 4:return fl(Ll.fourDigitsSigned,e);default:return fl(new RegExp("^-?\\d{1,"+t+"}"),e)}}function sF(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function yue(t,e){const n=e>0,o=n?e:1-e;let r;if(o<=50)r=t||100;else{const l=o+50,a=Math.trunc(l/100)*100,u=t>=l%100;r=t+a-(u?100:0)}return n?r:1-r}function bue(t){return t%400===0||t%4===0&&t%100!==0}class Qut extends sr{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,n,o){const r=l=>({year:l,isTwoDigitYear:n==="yy"});switch(n){case"y":return Bl(Dl(4,e),r);case"yo":return Bl(o.ordinalNumber(e,{unit:"year"}),r);default:return Bl(Dl(n.length,e),r)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,o){const r=e.getFullYear();if(o.isTwoDigitYear){const a=yue(o.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const l=!("era"in n)||n.era===1?o.year:1-o.year;return e.setFullYear(l,0,1),e.setHours(0,0,0,0),e}}class Zut extends sr{priority=130;parse(e,n,o){const r=l=>({year:l,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Bl(Dl(4,e),r);case"Yo":return Bl(o.ordinalNumber(e,{unit:"year"}),r);default:return Bl(Dl(n.length,e),r)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,o,r){const l=aF(e,r);if(o.isTwoDigitYear){const u=yue(o.year,l);return e.setFullYear(u,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),ap(e,r)}const a=!("era"in n)||n.era===1?o.year:1-o.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),ap(e,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ect extends sr{priority=130;parse(e,n){return K$(n==="R"?4:n.length,e)}set(e,n,o){const r=il(e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),xy(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class tct extends sr{priority=130;parse(e,n){return K$(n==="u"?4:n.length,e)}set(e,n,o){return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class nct extends sr{priority=120;parse(e,n,o){switch(n){case"Q":case"QQ":return Dl(n.length,e);case"Qo":return o.ordinalNumber(e,{unit:"quarter"});case"QQQ":return o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(e,{width:"narrow",context:"formatting"});default:return o.quarter(e,{width:"wide",context:"formatting"})||o.quarter(e,{width:"abbreviated",context:"formatting"})||o.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class oct extends sr{priority=120;parse(e,n,o){switch(n){case"q":case"qq":return Dl(n.length,e);case"qo":return o.ordinalNumber(e,{unit:"quarter"});case"qqq":return o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(e,{width:"narrow",context:"standalone"});default:return o.quarter(e,{width:"wide",context:"standalone"})||o.quarter(e,{width:"abbreviated",context:"standalone"})||o.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,o){return e.setMonth((o-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class rct extends sr{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,n,o){const r=l=>l-1;switch(n){case"M":return Bl(fl(Ll.month,e),r);case"MM":return Bl(Dl(2,e),r);case"Mo":return Bl(o.ordinalNumber(e,{unit:"month"}),r);case"MMM":return o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(e,{width:"narrow",context:"formatting"});default:return o.month(e,{width:"wide",context:"formatting"})||o.month(e,{width:"abbreviated",context:"formatting"})||o.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}}class lct extends sr{priority=110;parse(e,n,o){const r=l=>l-1;switch(n){case"L":return Bl(fl(Ll.month,e),r);case"LL":return Bl(Dl(2,e),r);case"Lo":return Bl(o.ordinalNumber(e,{unit:"month"}),r);case"LLL":return o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(e,{width:"narrow",context:"standalone"});default:return o.month(e,{width:"wide",context:"standalone"})||o.month(e,{width:"abbreviated",context:"standalone"})||o.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,o){return e.setMonth(o,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function ict(t,e,n){const o=go(t,n?.in),r=fue(o,n)-e;return o.setDate(o.getDate()-r*7),go(o,n?.in)}class act extends sr{priority=100;parse(e,n,o){switch(n){case"w":return fl(Ll.week,e);case"wo":return o.ordinalNumber(e,{unit:"week"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,o,r){return ap(ict(e,o,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function sct(t,e,n){const o=go(t,n?.in),r=due(o,n)-e;return o.setDate(o.getDate()-r*7),o}class uct extends sr{priority=100;parse(e,n,o){switch(n){case"I":return fl(Ll.week,e);case"Io":return o.ordinalNumber(e,{unit:"week"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,o){return xy(sct(e,o))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const cct=[31,28,31,30,31,30,31,31,30,31,30,31],dct=[31,29,31,30,31,30,31,31,30,31,30,31];class fct extends sr{priority=90;subPriority=1;parse(e,n,o){switch(n){case"d":return fl(Ll.date,e);case"do":return o.ordinalNumber(e,{unit:"date"});default:return Dl(n.length,e)}}validate(e,n){const o=e.getFullYear(),r=bue(o),l=e.getMonth();return r?n>=1&&n<=dct[l]:n>=1&&n<=cct[l]}set(e,n,o){return e.setDate(o),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class pct extends sr{priority=90;subpriority=1;parse(e,n,o){switch(n){case"D":case"DD":return fl(Ll.dayOfYear,e);case"Do":return o.ordinalNumber(e,{unit:"date"});default:return Dl(n.length,e)}}validate(e,n){const o=e.getFullYear();return bue(o)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,o){return e.setMonth(0,o),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function uF(t,e,n){const o=vg(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,l=go(t,n?.in),a=l.getDay(),c=(e%7+7)%7,f=7-r,p=e<0||e>6?e-(a+f)%7:(c+f)%7-(a+f)%7;return D_(l,p,n)}class mct extends sr{priority=90;parse(e,n,o){switch(n){case"E":case"EE":case"EEE":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,o,r){return e=uF(e,o,r),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class hct extends sr{priority=90;parse(e,n,o,r){const l=a=>{const u=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+u};switch(n){case"e":case"ee":return Bl(Dl(n.length,e),l);case"eo":return Bl(o.ordinalNumber(e,{unit:"day"}),l);case"eee":return o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});case"eeeee":return o.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"});default:return o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,o,r){return e=uF(e,o,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class vct extends sr{priority=90;parse(e,n,o,r){const l=a=>{const u=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+u};switch(n){case"c":case"cc":return Bl(Dl(n.length,e),l);case"co":return Bl(o.ordinalNumber(e,{unit:"day"}),l);case"ccc":return o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});case"ccccc":return o.day(e,{width:"narrow",context:"standalone"});case"cccccc":return o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"});default:return o.day(e,{width:"wide",context:"standalone"})||o.day(e,{width:"abbreviated",context:"standalone"})||o.day(e,{width:"short",context:"standalone"})||o.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,o,r){return e=uF(e,o,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function gct(t,e,n){const o=go(t,n?.in),r=jut(o,n),l=e-r;return D_(o,l,n)}class yct extends sr{priority=90;parse(e,n,o){const r=l=>l===0?7:l;switch(n){case"i":case"ii":return Dl(n.length,e);case"io":return o.ordinalNumber(e,{unit:"day"});case"iii":return Bl(o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Bl(o.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Bl(o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),r);default:return Bl(o.day(e,{width:"wide",context:"formatting"})||o.day(e,{width:"abbreviated",context:"formatting"})||o.day(e,{width:"short",context:"formatting"})||o.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,n){return n>=1&&n<=7}set(e,n,o){return e=gct(e,o),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class bct extends sr{priority=80;parse(e,n,o){switch(n){case"a":case"aa":case"aaa":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(e,{width:"narrow",context:"formatting"});default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,o){return e.setHours(sF(o),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class xct extends sr{priority=80;parse(e,n,o){switch(n){case"b":case"bb":case"bbb":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(e,{width:"narrow",context:"formatting"});default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,o){return e.setHours(sF(o),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class _ct extends sr{priority=80;parse(e,n,o){switch(n){case"B":case"BB":case"BBB":return o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(e,{width:"narrow",context:"formatting"});default:return o.dayPeriod(e,{width:"wide",context:"formatting"})||o.dayPeriod(e,{width:"abbreviated",context:"formatting"})||o.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,o){return e.setHours(sF(o),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class wct extends sr{priority=70;parse(e,n,o){switch(n){case"h":return fl(Ll.hour12h,e);case"ho":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,o){const r=e.getHours()>=12;return r&&o<12?e.setHours(o+12,0,0,0):!r&&o===12?e.setHours(0,0,0,0):e.setHours(o,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class kct extends sr{priority=70;parse(e,n,o){switch(n){case"H":return fl(Ll.hour23h,e);case"Ho":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,o){return e.setHours(o,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class Sct extends sr{priority=70;parse(e,n,o){switch(n){case"K":return fl(Ll.hour11h,e);case"Ko":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,o){return e.getHours()>=12&&o<12?e.setHours(o+12,0,0,0):e.setHours(o,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class Cct extends sr{priority=70;parse(e,n,o){switch(n){case"k":return fl(Ll.hour24h,e);case"ko":return o.ordinalNumber(e,{unit:"hour"});default:return Dl(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,o){const r=o<=24?o%24:o;return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class $ct extends sr{priority=60;parse(e,n,o){switch(n){case"m":return fl(Ll.minute,e);case"mo":return o.ordinalNumber(e,{unit:"minute"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,o){return e.setMinutes(o,0,0),e}incompatibleTokens=["t","T"]}class Tct extends sr{priority=50;parse(e,n,o){switch(n){case"s":return fl(Ll.second,e);case"so":return o.ordinalNumber(e,{unit:"second"});default:return Dl(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,o){return e.setSeconds(o,0),e}incompatibleTokens=["t","T"]}class Ect extends sr{priority=30;parse(e,n){const o=r=>Math.trunc(r*Math.pow(10,-n.length+3));return Bl(Dl(n.length,e),o)}set(e,n,o){return e.setMilliseconds(o),e}incompatibleTokens=["t","T"]}class Act extends sr{priority=10;parse(e,n){switch(n){case"X":return ld(rd.basicOptionalMinutes,e);case"XX":return ld(rd.basic,e);case"XXXX":return ld(rd.basicOptionalSeconds,e);case"XXXXX":return ld(rd.extendedOptionalSeconds,e);default:return ld(rd.extended,e)}}set(e,n,o){return n.timestampIsSet?e:il(e,e.getTime()-W$(e)-o)}incompatibleTokens=["t","T","x"]}class Dct extends sr{priority=10;parse(e,n){switch(n){case"x":return ld(rd.basicOptionalMinutes,e);case"xx":return ld(rd.basic,e);case"xxxx":return ld(rd.basicOptionalSeconds,e);case"xxxxx":return ld(rd.extendedOptionalSeconds,e);default:return ld(rd.extended,e)}}set(e,n,o){return n.timestampIsSet?e:il(e,e.getTime()-W$(e)-o)}incompatibleTokens=["t","T","X"]}class zct extends sr{priority=40;parse(e){return gue(e)}set(e,n,o){return[il(e,o*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Oct extends sr{priority=20;parse(e){return gue(e)}set(e,n,o){return[il(e,o),{timestampIsSet:!0}]}incompatibleTokens="*"}const Mct={G:new Xut,y:new Qut,Y:new Zut,R:new ect,u:new tct,Q:new nct,q:new oct,M:new rct,L:new lct,w:new act,I:new uct,d:new fct,D:new pct,E:new mct,e:new hct,c:new vct,i:new yct,a:new bct,b:new xct,B:new _ct,h:new wct,H:new kct,K:new Sct,k:new Cct,m:new $ct,s:new Tct,S:new Ect,X:new Act,x:new Dct,t:new zct,T:new Oct},Ict=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vct=/^'([^]*?)'?$/,Pct=/''/g,Fct=/\S/,Nct=/[a-zA-Z]/;function T3(t,e,n,o){const r=()=>il(n,NaN),l=qut(),a=l.locale??cue,u=l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,c=l.weekStartsOn??l.locale?.options?.weekStartsOn??0;if(!e)return t?r():go(n,o?.in);const f={firstWeekContainsDate:u,weekStartsOn:c,locale:a},p=[new Jut(o?.in,n)],m=e.match(Rct).map(x=>{const y=x[0];if(y in MI){const _=MI[y];return _(x,a.formatLong)}return x}).join("").match(Ict),h=[];for(let x of m){hue(x)&&II(x,e,t),mue(x)&&II(x,e,t);const y=x[0],_=Mct[y];if(_){const{incompatibleTokens:k}=_;if(Array.isArray(k)){const $=h.find(C=>k.includes(C.token)||C.token===y);if($)throw new RangeError(`The format string mustn't contain \`${$.fullToken}\` and \`${x}\` at the same time`)}else if(_.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${x}\` and any other token at the same time`);h.push({token:y,fullToken:x});const w=_.run(t,x,a.match,f);if(!w)return r();p.push(w.setter),t=w.rest}else{if(y.match(Nct))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(x==="''"?x="'":y==="'"&&(x=Lct(x)),t.indexOf(x)===0)t=t.slice(x.length);else return r()}}if(t.length>0&&Fct.test(t))return r();const v=p.map(x=>x.priority).sort((x,y)=>y-x).filter((x,y,_)=>_.indexOf(x)===y).map(x=>p.filter(y=>y.priority===x).sort((y,_)=>_.subPriority-y.subPriority)).map(x=>x[0]);let g=go(n,o?.in);if(isNaN(+g))return r();const b={};for(const x of v){if(!x.validate(g,f))return r();const y=x.set(g,b,f);Array.isArray(y)?(g=y[0],Object.assign(b,y[1])):g=y}return g}function Lct(t){return t.match(Vct)[1].replace(Pct,"'")}function Bct(t,e,n){const o=go(t,n?.in),r=o.getFullYear(),l=o.getDate(),a=il(t,0);a.setFullYear(r,e,15),a.setHours(0,0,0,0);const u=Uut(a);return o.setMonth(e,Math.min(l,u)),o}function Uct(t,e,n){const o=go(t,n?.in);return o.setDate(e),o}function qct(t,e,n){const o=go(t,n?.in);return isNaN(+o)?il(t,NaN):(o.setFullYear(e),o)}function Pc(t){return t instanceof It?t.toNumber():typeof t=="bigint"?Number(t):t}function jct(t){const e={async:!1},n=(m,h)=>t.registerFunctionOverload(m,h,e),o=m=>m;n("dyn(dyn): dyn",o);for(const m in sm){const h=sm[m];h instanceof Ys&&n(`type(${h.name}): type`,()=>h)}n("bool(bool): bool",o),n("bool(string): bool",m=>{switch(m){case"1":case"t":case"true":case"TRUE":case"True":return!0;case"0":case"f":case"false":case"FALSE":case"False":return!1;default:throw _n("bool_conversion_error",`bool() conversion error: invalid string value "${m}"`)}}),n("size(string): number",m=>It.from(Gj(m))),n("size(bytes): number",m=>It.from(m.length)),n("size(list): number",m=>It.from(m.length??m.size)),n("size(map): number",m=>It.from(m instanceof Map?m.size:cu(m).length)),n("string.size(): number",m=>It.from(Gj(m))),n("bytes.size(): number",m=>It.from(m.length)),n("list.size(): number",m=>It.from(m.length??m.size)),n("map.size(): number",m=>It.from(m instanceof Map?m.size:cu(m).length)),n("list.enumerate(): list<map<string, dyn>>",m=>m.map((h,v)=>({index:It.from(v),value:h}))),n("bytes(string): bytes",m=>a.fromString(m)),n("bytes(bytes): bytes",o),n("number(number): number",m=>It.from(m)),n("number(string): number",m=>{const h=m;if(!h||h!==h.trim())throw _n("number_conversion_error","number() type error: cannot convert to number");try{return It.from(h)}catch{throw _n("number_conversion_error","number() type error: cannot convert to number")}}),n("number(bool): number",m=>It.from(m?1:0)),n("int(number): number",m=>{const h=It.from(m);if(h.isInteger())return h;const v=h.toNumber();if(!Number.isFinite(v))throw _n("numeric_overflow","int() type error: integer overflow");return It.from(BigInt(Math.trunc(v)))}),n("int(string): number",m=>{const h=m;if(h!==h.trim()||h.length>20||h.includes("0x"))throw _n("int_conversion_error","int() type error: cannot convert to int");try{return It.from(h)}catch{throw _n("int_conversion_error","int() type error: cannot convert to int")}}),n("double(number): number",m=>It.from(m)),n("double(string): number",m=>{const h=m;if(!h||h!==h.trim())throw _n("double_conversion_error","double() type error: cannot convert to double");try{return It.from(h)}catch{throw _n("double_conversion_error","double() type error: cannot convert to double")}}),n("uint(number): number",m=>It.from(m)),n("uint(string): number",m=>{const h=m;if(h!==h.trim()||h.length>20||h.includes("0x"))throw _n("uint_conversion_error","uint() type error: cannot convert to uint");try{return It.from(h)}catch{throw _n("uint_conversion_error","uint() type error: cannot convert to uint")}}),n("string(string): string",o),n("string(bool): string",m=>`${m}`),n("string(number): string",m=>It.from(m).toString()),n("string(bytes): string",m=>a.toUtf8(m)),n("string.startsWith(string): bool",(m,h)=>m.startsWith(h)),n("string.endsWith(string): bool",(m,h)=>m.endsWith(h)),n("string.contains(string): bool",(m,h)=>m.includes(h)),n("string.lowerAscii(): string",m=>m.toLowerCase()),n("string.upperAscii(): string",m=>m.toUpperCase()),n("string.trim(): string",m=>m.trim()),n("string.indexOf(string): number",(m,h)=>It.from(m.indexOf(h))),n("string.indexOf(string, number): number",(m,h,v)=>{if(h==="")return v;const g=Pc(v),b=m;if(g<0||g>=b.length)throw _n("index_out_of_range","string.indexOf(search, fromIndex): fromIndex out of range");return It.from(b.indexOf(h,g))}),n("string.lastIndexOf(string): number",(m,h)=>It.from(m.lastIndexOf(h))),n("string.lastIndexOf(string, number): number",(m,h,v)=>{if(h==="")return v;const g=Pc(v),b=m;if(g<0||g>=b.length)throw _n("index_out_of_range","string.lastIndexOf(search, fromIndex): fromIndex out of range");return It.from(b.lastIndexOf(h,g))}),n("string.substring(number): string",(m,h)=>{const v=Pc(h),g=m;if(v<0||v>g.length)throw _n("index_out_of_range","string.substring(start, end): start index out of range");return g.substring(v)}),n("string.substring(number, number): string",(m,h,v)=>{const g=Pc(h),b=m;if(g<0||g>b.length)throw _n("index_out_of_range","string.substring(start, end): start index out of range");const x=Pc(v);if(x<g||x>b.length)throw _n("index_out_of_range","string.substring(start, end): end index out of range");return b.substring(g,x)}),n("string.matches(string): bool",(m,h)=>{try{return new RegExp(h).test(m)}catch{throw _n("invalid_regular_expression",`Invalid regular expression: ${h}`)}}),n("string.split(string): list<string>",(m,h)=>m.split(h)),n("string.split(string, number): list<string>",(m,h,v)=>{const g=Pc(v);if(g===0)return[];const b=m.split(h);if(g<0||b.length<=g)return b;const x=b.slice(0,g-1);return x.push(b.slice(g-1).join(h)),x}),n("list<string>.join(): string",m=>{const h=m;for(let v=0;v<h.length;v++)if(typeof h[v]!="string")throw _n("invalid_list_element_type","string.join(): list must contain only strings");return h.join("")}),n("list<string>.join(string): string",(m,h)=>{const v=m;for(let g=0;g<v.length;g++)if(typeof v[g]!="string")throw _n("invalid_list_element_type","string.join(separator): list must contain only strings");return v.join(h)});const r=new TextEncoder,l=new TextDecoder("utf8"),a=typeof Buffer<"u"?{byteLength:m=>Buffer.byteLength(m),fromString:m=>Buffer.from(m,"utf8"),toHex:m=>Buffer.prototype.hexSlice.call(m,0,m.length),toBase64:m=>Buffer.prototype.base64Slice.call(m,0,m.length),toUtf8:m=>Buffer.prototype.utf8Slice.call(m,0,m.length),jsonParse:m=>JSON.parse(m)}:{textEncoder:new TextEncoder,byteLength:m=>r.encode(m).length,fromString:m=>r.encode(m),toHex:typeof Uint8Array.prototype.toHex=="function"?m=>m.toHex():m=>Mj(m,h=>h.toString(16).padStart(2,"0")).join(""),toBase64:typeof Uint8Array.prototype.toBase64=="function"?m=>m.toBase64():m=>btoa(Mj(m,h=>String.fromCodePoint(h)).join("")),toUtf8:m=>l.decode(m),jsonParse:m=>JSON.parse(l.decode(m))};n("bytes.json(): map",a.jsonParse),n("bytes.hex(): string",a.toHex),n("bytes.string(): string",a.toUtf8),n("bytes.base64(): string",a.toBase64),n("bytes.at(number): number",(m,h)=>{const v=Pc(h),g=m;if(v<0||v>=g.length)throw _n("index_out_of_range","Bytes index out of range");return It.from(g[v])});function u(m,h){return m instanceof ju?m:new ju(m.getTime(),h.timeZone)}t.registerType("Date",ju),n("date(string): Date",m=>{const h=new ju(m);if(Number.isNaN(h.getTime()))throw _n("invalid_date",`date() requires a valid date string, got "${m}"`);return h}),n("date(number): Date",m=>{const h=Pc(m);if(!Number.isFinite(h))throw _n("invalid_date",`date() requires a finite timestamp, got ${m}`);const v=Math.abs(h)<1e11?h*1e3:h,g=new ju(v);if(Number.isNaN(g.getTime()))throw _n("invalid_date",`date() got an out-of-range timestamp: ${m}`);return g});const c=1e5;function f(m,h,v){const g=v.toNumber();if(!(g>0))throw _n("invalid_range",`range(): step must be greater than 0, got ${g}`);const b=h.toNumber(),x=m.toNumber()<b,y=x?v:v.neg(),_=[];let k=m;for(;x?k.toNumber()<b:k.toNumber()>b;){if(_.push(k),_.length>c)throw _n("range_too_large",`range(): exceeded the ${c}-item limit`);k=k.add(y)}return _}n("range(number, number): list<dyn>",(m,h)=>f(m,h,It.from(1))),n("range(number, number, number): list<dyn>",(m,h,v)=>f(m,h,v));const p={year:Bj,month:zI,day:D_,hour:Fst,minute:qst};n("range(Date, Date, string): list<dyn>",(m,h,v)=>{const g=m,b=p[v];if(!b)throw _n("invalid_unit",`range(): unknown unit "${v}" (expected year / month / day / hour / minute)`);const x=h.getTime(),y=g.getTime()<x,_=[];let k=g;for(;y?k.getTime()<x:k.getTime()>x;){if(_.push(k),_.length>c)throw _n("range_too_large",`range(): exceeded the ${c}-item limit`);k=u(b(k,y?1:-1),g)}return _}),n("Date.startOf(string): Date",(m,h)=>{const v=m;switch(h){case"day":return u(OI(v),v);case"week":return u(ap(v),v);case"month":return u(Gst(v),v);case"year":return u(uue(v),v);default:throw _n("invalid_unit",`startOf(): unknown unit "${h}"`)}}),n("Date.endOf(string): Date",(m,h)=>{const v=m;switch(h){case"day":return u(Wst(v),v);case"week":return u(Jst(v),v);case"month":return u(Kst(v),v);case"year":return u(Yst(v),v);default:throw _n("invalid_unit",`endOf(): unknown unit "${h}"`)}}),n("Date.offset(number, string): Date",(m,h,v)=>{const g=m,b=Pc(h);switch(v.replace(/s$/,"")){case"day":return u(D_(g,b),g);case"week":return u(jst(g,b),g);case"month":return u(zI(g,b),g);case"year":return u(Bj(g,b),g);default:throw _n("invalid_unit",`offset(): unknown unit "${v}"`)}}),n("Date.set(string, number): Date",(m,h,v)=>{const g=m,b=Pc(v);switch(h){case"day":return u(Uct(g,b),g);case"month":return u(Bct(g,b-1),g);case"year":return u(qct(g,b),g);default:throw _n("invalid_field",`set(): unknown field "${h}"`)}}),n("Date.format(string): string",(m,h)=>Wr(m,h)),t.registerType("File",File),t.registerType("URL",URL),n("URL.query(string): optional<string>",(m,h)=>C3(m.searchParams.get(h)??void 0)),gst(t)}function Gj(t){let e=0;for(const n of t)e++;return e}class xue{brand="http"}const Hct=new xue;function Wct(t){t.registerType("http",xue),t.registerType("HttpRequest",Fu),t.registerVariable({name:"http",type:"http",value:Hct,description:"HTTP 客户端"}),t.registerFunctionOverload("http.get(string): HttpRequest",(e,n)=>new Fu(n,"GET")),t.registerFunctionOverload("http.post(string): HttpRequest",(e,n)=>new Fu(n,"POST")),t.registerFunctionOverload("http.put(string): HttpRequest",(e,n)=>new Fu(n,"PUT")),t.registerFunctionOverload("http.patch(string): HttpRequest",(e,n)=>new Fu(n,"PATCH")),t.registerFunctionOverload("http.delete(string): HttpRequest",(e,n)=>new Fu(n,"DELETE")),t.registerFunctionOverload("HttpRequest.header(string, string): HttpRequest",(e,n,o)=>e.header(n,o)),t.registerFunctionOverload("HttpRequest.query(string, string): HttpRequest",(e,n,o)=>e.query(n,o)),t.registerFunctionOverload("HttpRequest.query(string, number): HttpRequest",(e,n,o)=>e.query(n,Number(o))),t.registerFunctionOverload("HttpRequest.query(dyn): HttpRequest",(e,n)=>e.query(n)),t.registerFunctionOverload("HttpRequest.body(dyn): HttpRequest",(e,n)=>e.body(n))}class _ue{brand="JSON"}const Kct=new _ue;function q1(t){if(t==null)return t;if(t instanceof It)return t.toNumber();if(Ms(t))return cn(t)?q1(t.value):null;if(t instanceof Date)return t;if(t instanceof Map){const e={};for(const[n,o]of t)e[String(n)]=q1(o);return e}if(Array.isArray(t))return t.map(q1);if(typeof t=="object"){const e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;const n={};for(const o of Object.keys(t))n[o]=q1(t[o]);return n}return t}function Gct(t){t.registerType("JSON",_ue),t.registerVariable({name:"JSON",type:"JSON",value:Kct,description:"JSON 编解码"}),t.registerFunctionOverload("JSON.parse(string): dyn",(e,n)=>{try{return globalThis.JSON.parse(n)}catch(o){throw _n("invalid_json",`JSON.parse(): ${o.message}`)}}),t.registerFunctionOverload("JSON.stringify(dyn): string",(e,n)=>globalThis.JSON.stringify(q1(n)))}function Yct(t){if(t instanceof Blob)return t;if(t instanceof It)return t.toString();if(t instanceof Date)return t.toISOString();if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"||typeof t=="bigint")return String(t);throw _n("invalid_form_value",`form(): unsupported value type ${Object.prototype.toString.call(t)}`)}function G$(t,e,n){if(n!=null){if(Ms(n)){cn(n)&&G$(t,e,n.value);return}if(Array.isArray(n)){for(const o of n)G$(t,e,o);return}if(n instanceof Blob){t.append(e,n);return}if(typeof n=="object"&&!(n instanceof It)&&!(n instanceof Date))throw _n("invalid_form_value",`form(): nested object values are not supported (key: "${e}")`);t.append(e,Yct(n))}}function Jct(t){t.registerType("FormData",FormData),t.registerFunctionOverload("form(dyn): FormData",e=>{if(e==null)throw _n("invalid_form_value","form(): expected a map, got null");const n=new FormData;if(e instanceof Map){for(const[o,r]of e)G$(n,String(o),r);return n}if(typeof e!="object"||Array.isArray(e))throw _n("invalid_form_value","form(): expected a map");for(const o of Object.keys(e))o==="__proto__"||o==="constructor"||o==="prototype"||G$(n,o,e[o]);return n})}const NS=_l.dyn;class wue{dynType=_l.dyn;optionalType=_l.optional;stringType=_l.string;numberType=_l.number;boolType=_l.bool;nullType=_l.null;listType=_l.list;mapType=_l.map;opts;registry;objectTypes;objectTypesByConstructor;constructor(e){this.opts=e.opts,this.registry=e.registry,this.objectTypes=this.registry.objectTypes,this.objectTypesByConstructor=this.registry.objectTypesByConstructor}getType(e){return this.registry.getType(e)}debugType(e){switch(typeof e){case"string":return this.stringType;case"number":case"bigint":return this.numberType;case"boolean":return this.boolType;case"object":if(e===null)return this.nullType;if(e instanceof It)return this.numberType;if(Ms(e))return this.optionalType;switch(e.constructor){case void 0:case Object:case Map:return this.mapType;case Array:case Set:return this.listType;default:return this.objectTypesByConstructor.get(e.constructor)?.type||RI(this,e.constructor?.name||typeof e)}default:RI(this,typeof e)}}}function RI(t,e){throw t.createError("unsupported_type",`Unsupported type: ${e}`)}function Yj(t,e,n){e.right=e.args[1];const o=t.check(e.left=e.args[0],n);return e.op==="[]"&&t.check(e.right,n),e.handle=o!==NS?mdt:vdt,o.kind!=="optional"?t.checkAccessOnType(e,n,o):t.registry.getOptionalType(t.checkAccessOnType(e,n,o.valueType,!0))}function Jj(t,e,n){e.right=e.args[1];const o=t.check(e.left=e.args[0],n);e.op==="[?]"&&t.check(e.right,n),e.handle=pdt;const r=o.kind==="optional"?o.valueType:o;return t.registry.getOptionalType(t.checkAccessOnType(e,n,r,!0))}function E3(t){return t.args}function Xct(t,e,n){const o=t.check(E3(n),e);if(o.kind==="dyn")return t.dynType;if(o.kind==="list")return o.valueType;throw t.createError("invalid_spread",`Cannot spread '${t.formatType(o)}' into a list (expected a list)`,n)}function Qct(t,e,n){const o=t.check(E3(n),e);if(o.kind==="dyn")return[t.dynType,t.dynType];if(o.kind==="map")return[o.keyType,o.valueType];if(o.kind==="message")return[t.stringType,t.dynType];throw t.createError("invalid_spread",`Cannot spread '${t.formatType(o)}' into a map (expected a map)`,n)}const Zct=new Set(["__proto__","constructor","prototype"]);function oz(t,e,n){const o=e;Zct.has(o)||(t[o]=n)}function edt(t,e){const n={};for(const o of e){if("kv"in o){oz(n,o.kv[0],o.kv[1]);continue}const r=o.spread;if(r instanceof Map){for(const[l,a]of r)oz(n,l,a);continue}if(r!==null&&typeof r=="object"&&!fv(r)){for(const l in r)$3(r,l)&&oz(n,l,r[l]);continue}throw t.createError("invalid_spread","Cannot spread a non-map value into a map",o.node)}return n}function tdt(t,e,n){const o=e.args;return tp(o.map(r=>r.op==="spread"?t.eval(E3(r),n).pipe(Zt(l=>fv(l)?Er(l):$r(t.createError("invalid_spread","Cannot spread a non-list value into a list",r)))):t.eval(r,n).pipe(Zn(l=>[l])))).pipe(Zn(r=>r.flat()))}function ndt(t,e,n){const o=e.args;return tp(o.map(r=>{if(r.length===1||r[0].op==="spread"){const a=r[0];return t.eval(E3(a),n).pipe(Zn(u=>({spread:u,node:a})))}const l=r;return tp([t.eval(l[0],n),t.eval(l[1],n)]).pipe(Zn(([a,u])=>({kv:[a,u]})))})).pipe(Zt(r=>rl({try:()=>edt(t,r),catch:l=>l})))}function odt(t,e,n){const o=t.debugRuntimeType(e);return t.createError("invalid_condition_type",`${n.meta.label||"Ternary condition must be bool"}, got '${o}'`,n)}function Xj(t,e,n,o){return t===!0?e.eval(n.left,o):t===!1?e.eval(n.right,o):$r(odt(e,t,n.condition))}function Fc(t,e,n){const o=t.debugRuntimeType(e);return t.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${o}'`,n)}function Qj(t,e,n){const o=t.check(e.left=e.args[0],n),r=t.check(e.right=e.args[1],n);if(!o.isDynOrBool())throw t.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${t.formatType(o)}'`,e);if(!r.isDynOrBool())throw t.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${t.formatType(r)}'`,e);return t.boolType}function Zj(t,e,n){const o=e.op,r=t.check(e.args,n);if(e.candidates=t.registry.operatorCandidates(o),r.kind==="dyn")return e.handle=rdt,e.candidates.returnType;const l=e.candidates.findUnaryOverload(r);if(!l)throw t.createError("no_such_overload",`no such overload: ${o[0]}${t.formatType(r)}`,e);return e.handle=l.handler,l.returnType}function rdt(t,e,n){const o=e,r=n,l=r.debugRuntimeType(t,o.args.checkedType),a=o.candidates.findUnaryOverload(l);if(a)return a.handler(t);throw r.createError("no_such_overload",`no such overload: ${o.op[0]}${l}`,o)}function eH(t,e,n){return t.eval(e.args,n).pipe(Zt(o=>rl({try:()=>e.handle(o,e,t),catch:r=>r})))}function ldt(t,e,n){const o=e.op,r=t.check(e.left=e.args[0],n),l=t.check(e.right=e.args[1],n);e.candidates=t.registry.operatorCandidates(o);const a=r.hasDynType||l.hasDynType?void 0:e.candidates.findBinaryOverload(r,l);if(e.handle=a?a.handler:idt,a)return a.returnType;const u=e.candidates.checkBinaryOverload(r,l);if(r.hasDynType||(e.leftStaticType=r),l.hasDynType||(e.rightStaticType=l),u)return u;throw t.createError("no_such_overload",`no such overload: ${t.formatType(r)} ${o} ${t.formatType(l)}`,e)}function VI(t,e,n){return tp([t.eval(e.left,n),t.eval(e.right,n)]).pipe(Zt(([o,r])=>rl({try:()=>e.handle(o,r,e,t),catch:l=>l})))}function tH(t,e,n){return t.eval(e.left,n).pipe(Zt(o=>rl({try:()=>e.handle(o,e.right,e,t),catch:r=>r})))}function idt(t,e,n,o){const r=n,l=o,a=r.leftStaticType||l.debugTypeDeep(t).wrappedType,u=r.rightStaticType||l.debugTypeDeep(e).wrappedType,c=r.candidates.findBinaryOverload(a,u);if(c)return c.handler(t,e,n,o);throw l.createError("no_such_overload",`no such overload: ${a} ${r.op} ${u}`,r)}function Y$(t,e,n,o){return rl({try:()=>t.apply(e,n),catch:r=>AI(r,o)}).pipe(Zt(r=>eh(r)&&!Ms(r)?r.pipe(dy(l=>AI(l,o))):Er(r)))}function adt(t,e,n){const o=e,r=n,l=t,a=o.args[1],u=o.argTypes;let c=a.length;for(;c--;)u[c]=r.debugRuntimeType(l[c],a[c].checkedType);const f=o.candidates.findFunction(u);return f?Y$(f.handler,r,l,o):$r(r.createError("no_matching_overload",`found no matching overload for '${o.args[0]}(${u.map(p=>p.unwrappedType).join(", ")})'`,o))}function sdt(t,e,n){const o=n,r=e,l=t,[,a,u]=o.args,c=o.argTypes;for(let m=0;m<c.length;m++)c[m]=r.debugRuntimeType(l[m+1],u[m].checkedType);const f=r.debugRuntimeType(l[0],a.checkedType),p=o.candidates.findFunction(c,f);return p?Y$(p.handler,r,l,o):$r(r.createError("no_matching_overload",`found no matching overload for '${f.type}.${o.args[0]}(${c.map(m=>m.unwrappedType).join(", ")})'`,o))}function rz(t,e,n){return e.length===0?Er([]):tp(e.map(o=>t.eval(o,n)))}function udt(t){const e={};for(let n=0;n<t.length;n++){const[o,r]=t[n];o==="__proto__"||o==="constructor"||o==="prototype"||(e[o]=r)}return e}function cdt(t,e,n){const o=t.check(e,n);if(o.kind==="dyn")return o;if(o.kind==="list")return o.valueType;if(o.kind==="map")return o.keyType;throw t.createError("invalid_comprehension_range",`Expression of type '${t.formatType(o)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e)}function kue(t,e,n){if(n instanceof Set)return[...n];if(n instanceof Map)return[...n.keys()];if(n&&typeof n=="object")return cu(n);throw t.createError("invalid_comprehension_range",`Expression of type '${t.debugType(n)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e.iterable)}function ddt(t,e,n,o){return qt(function*(){fv(t)||(t=kue(n,e,t));let r=yield*n.eval(e.init,o=e.iterCtx.reuse(o));o.accuValue=r;let l=null;const a=e.condition,u=e.step,c=t.length;for(let f=0;f<c;f++){if(!a(r))return e.result(r);const p=yield*gf(n.eval(u,o.setIterValue(t[f],n)));if(Fo(p)){l??=p.left;continue}r=p.right,o.accuValue=r}return l&&a(r)?yield*$r(l):e.result(r)})}function fdt(t,e,n,o){return qt(function*(){fv(t)||(t=kue(n,e,t));let r=yield*n.eval(e.init,o=e.iterCtx.reuse(o));o.accuValue=r;const l=e.condition,a=e.step,u=t.length;for(let c=0;c<u&&!(l&&!l(r));c++)r=yield*n.eval(a,o.setIterValue(t[c],n));return e.result(r)})}function pdt(t,e,n,o){const r=o;return r.optionalType.field(t,e,n,r)}function mdt(t,e,n,o){const r=n,l=o;return r.left.checkedType.field(t,e,r,l)}const hdt=Object.create(null);function vdt(t,e,n,o){const r=n,l=o;switch(t?.constructor){case void 0:case Object:{const a=$3(t||hdt,e)?t[e]:void 0;if(a!==void 0)return l.debugType(a),a;break}case Map:{const a=t.get(e);if(a!==void 0)return l.debugType(a),a;break}case Array:case Set:return l.listType.field(t,e,r,l);default:{const a=l.objectTypesByConstructor.get(t.constructor);if(a)return a.type.field(t,e,r,l);typeof t=="object"&&RI(l,t.constructor?.name??"object")}}throw l.createError("no_such_key",`No such key: ${e}`,r)}const gdt=()=>Er([]),ydt=()=>Er({}),$0={value:{check(t,e){return t.debugType(e.args)},evaluate(t,e){return Er(e.args)}},id:{check(t,e,n){const o=n.getVariable(e.args);if(!o)throw t.createError("unknown_variable",`Unknown variable: ${e.args}`,e);if(o.constant){const r=e.clone($0.value,o.value);return e.setMeta("alternate",r),t.check(r,n)}return o.type},evaluate(t,e,n){return rl({try:()=>n.getCheckedValue(t,e),catch:o=>o})}},".":{alias:"fieldAccess",check:Yj,evaluate:tH},".?":{alias:"optionalFieldAccess",check:Jj,evaluate:tH},"[]":{alias:"bracketAccess",check:Yj,evaluate:VI},"[?]":{alias:"optionalBracketAccess",check:Jj,evaluate:VI},call:{check(t,e,n){const[o,r]=e.args,l=e.candidates=t.registry.functionCandidates(!1,o,r.length),a=e.argTypes=r.map(f=>t.check(f,n)),u=l.findFunction(a);if(!u)throw t.createError("no_matching_overload",`found no matching overload for '${o}(${t.formatTypeList(a)})'`,e);const c=a.some(f=>f.hasDynType)?adt:((f,p,m)=>Y$(u.handler,m,f,p));return e.handle=c,u.returnType},evaluate(t,e,n){return rz(t,e.args[1],n).pipe(Zt(o=>e.handle(o,e,t)))}},rcall:{check(t,e,n){const[o,r,l]=e.args,a=t.check(r,n),u=e.candidates=t.registry.functionCandidates(!0,o,l.length),c=e.argTypes=l.map(p=>t.check(p,n));if(e.receiverWithArgs=[r,...l],e.handle=sdt,a.kind==="dyn"&&u.returnType)return u.returnType;const f=u.findFunction(c,a);if(!f)throw t.createError("no_matching_overload",`found no matching overload for '${a.type}.${o}(${t.formatTypeList(c)})'`,e);if(!a.hasPlaceholderType&&!c.some(p=>p.hasDynType)){const p=f.handler,m=(h,v,g)=>Y$(p,v,h,g);e.handle=m}return f.returnType},evaluate(t,e,n){return rz(t,e.receiverWithArgs,n).pipe(Zt(o=>e.handle(o,t,e)))}},list:{check(t,e,n){const o=e.args;if(o.length===0)return e.setMeta("evaluate",gdt)&&t.getType("list<T>");let l=!1,a;for(const u of o){let c;u.op==="spread"?(l=!0,c=Xct(t,n,u)):c=t.check(u,n),a=a===void 0?c:a.unify(t.registry,c)??NS}return l&&e.setMeta("evaluate",tdt),t.registry.getListType(a)},evaluate(t,e,n){return rz(t,e.args,n)}},map:{check(t,e,n){const o=e.args;if(o.length===0)return e.setMeta("evaluate",ydt)&&t.getType("map<K, V>");let l=!1,a,u;for(const c of o){let f,p;c.length===1||c[0].op==="spread"?(l=!0,[f,p]=Qct(t,n,c[0])):(f=t.check(c[0],n),p=t.check(c[1],n)),a=a===void 0?f:a.unify(t.registry,f)??NS,u=u===void 0?p:u.unify(t.registry,p)??NS}return l&&e.setMeta("evaluate",ndt),t.registry.getMapType(a,u)},evaluate(t,e,n){const o=e.args;return tp(o.map(r=>tp([t.eval(r[0],n),t.eval(r[1],n)]))).pipe(Zn(udt))}},spread:{check(t,e){throw t.createError("misplaced_spread","'...' is only valid inside a list or map literal",e)},evaluate(t,e){return $r(t.createError("misplaced_spread","'...' is only valid inside a list or map literal",e))}},comprehension:{check(t,e,n){const o=e.args;o.iterCtx=n.forkWithVariable(o.iterVarName,cdt(t,o.iterable,n)).setAccuType(t.check(o.init,n));const r=t.check(o.step,o.iterCtx),l=o.errorsAreFatal?fdt:ddt;return e.handle=l,o.kind==="quantifier"?t.boolType:r},evaluate(t,e,n){return t.eval(e.args.iterable,n).pipe(Zt(o=>e.handle(o,e.args,t,n)))}},accuValue:{check(t,e,n){return n.accuType},evaluate(t,e,n){return Er(n.accuValue)}},accuInc:{check(t,e,n){return n.accuType},evaluate(t,e,n){return Er(n.accuValue=n.accuValue+1)}},accuPush:{check(t,e,n){const o=n.accuType,r=t.check(e.args,n);return o.kind==="list"&&o.valueType.kind!=="param"?o:t.registry.getListType(r)},evaluate(t,e,n){return t.eval(e.args,n).pipe(Zn(o=>{const r=n.accuValue;return r.push(o),r}))}},"?:":{alias:"ternary",check(t,e,n){const o=e.condition=e.args[0],r=e.left=e.args[1],l=e.right=e.args[2],a=t.check(o,n);if(!a.isDynOrBool())throw t.createError("invalid_condition_type",`${o.meta.label||"Ternary condition must be bool"}, got '${t.formatType(a)}'`,o);const u=t.check(r,n),c=t.check(l,n),f=u.unify(t.registry,c);if(e.handle=Xj,f)return f;throw t.createError("incompatible_ternary_branches",`Ternary branches must have the same type, got '${t.formatType(u)}' and '${t.formatType(c)}'`,e)},evaluate(t,e,n){return t.eval(e.condition,n).pipe(Zt(o=>Xj(o,t,e,n)))}},"||":{check:Qj,evaluate(t,e,n){return qt(function*(){const o=yield*t.tryEval(e.left,n);if(ba(o)){const l=o.right;if(l===!0)return!0;if(l===!1){const u=yield*t.eval(e.right,n);return typeof u=="boolean"?u:yield*$r(Fc(t,u,e.right))}const a=yield*t.tryEval(e.right,n);if(ba(a)){const u=a.right;return u===!0?!0:typeof u=="boolean"?yield*$r(Fc(t,l,e.left)):yield*$r(Fc(t,u,e.right))}return yield*$r(Fc(t,l,e.left))}const r=yield*t.tryEval(e.right,n);if(ba(r)){const l=r.right;return l===!0?!0:l===!1?yield*$r(o.left):yield*$r(Fc(t,l,e.right))}return yield*$r(o.left)})}},"&&":{check:Qj,evaluate(t,e,n){return qt(function*(){const o=yield*t.tryEval(e.left,n);if(ba(o)){const l=o.right;if(l===!1)return!1;if(l===!0){const u=yield*t.eval(e.right,n);return typeof u=="boolean"?u:yield*$r(Fc(t,u,e.right))}const a=yield*t.tryEval(e.right,n);if(ba(a)){const u=a.right;return u===!1?!1:typeof u=="boolean"?yield*$r(Fc(t,l,e.left)):yield*$r(Fc(t,u,e.right))}return yield*$r(Fc(t,l,e.left))}const r=yield*t.tryEval(e.right,n);if(ba(r)){const l=r.right;return l===!1?!1:l===!0?yield*$r(o.left):yield*$r(Fc(t,l,e.right))}return yield*$r(o.left)})}},"!_":{alias:"unaryNot",check:Zj,evaluate:eH},"-_":{alias:"unaryMinus",check:Zj,evaluate:eH}},bdt=["!=","==","in","+","-","*","/","%","<","<=",">",">="];for(const t of bdt)$0[t]={check:ldt,evaluate:VI};for(const t of cu($0)){const e=$0[t];e.name=t,e.alias&&($0[e.alias]=e)}const bn=$0,A3=t=>t;function Ob(t,e){if(t.op==="id")return t.args;throw va("invalid_macro_argument",e,t)}function nH(t,e,n,o,r,l,a){let u=r.clone(bn.accuPush,r);if(o){const c=o.clone(bn.accuValue,void 0);u=o.clone(bn.ternary,[o.setMeta("label",a),u,c])}return t.clone(bn.comprehension,{errorsAreFatal:!0,iterable:e,iterVarName:Ob(n,l),init:t.clone(bn.list,[]),step:u,result:A3})}function oH(t){const e=t?"map(var, filter, transform)":"map(var, transform)",n=`${e} invalid predicate iteration variable`,o=`${e} filter predicate must return bool`;if(t)return u=>{const{args:c,receiver:f,ast:p}=u;return{callAst:nH(p,f,c[0],c[1],c[2],n,o)}};function r(u,c,f,p){return qt(function*(){if(mr(p))return pt();const m=c.iterCtx.reuse(f),h=yield*u.eval(c.body,m.setIterValue(p.value,u));return bt(h)})}function l(u,c,f){const p=u.check(c.receiver,f);if(p.kind==="optional"){c.mode="optional";const m=p.valueType??u.getType("dyn");c.iterCtx=f.forkWithVariable(c.iterVarName,m);const h=u.check(c.body,c.iterCtx);return u.registry.getOptionalType(h)}return p.kind==="dyn"?(c.mode="dyn",c.iterCtx=f.forkWithVariable(c.iterVarName,u.getType("dyn")),u.check(c.comprehension,f),u.getType("dyn")):(c.mode="list",u.check(c.comprehension,f))}function a(u,c,f){return c.mode==="list"?u.eval(c.comprehension,f):c.mode==="optional"?Zt(u.eval(c.receiver,f),p=>r(u,c,f,p)):Zt(u.eval(c.receiver,f),p=>Ms(p)?r(u,c,f,p):u.eval(c.comprehension,f))}return u=>{const{args:c,receiver:f,ast:p}=u;return{ast:p,receiver:f,iterVarName:Ob(c[0],n),body:c[1],comprehension:nH(p,f,c[0],null,c[1],n,o),iterCtx:void 0,mode:"list",typeCheck:l,evaluate:a}}}function xdt(){const t="filter(var, predicate)",e=`${t} invalid predicate iteration variable`,n=`${t} predicate must return bool`;return o=>{const{args:r,receiver:l,ast:a}=o,u=Ob(r[0],e),c=a.clone(bn.accuValue,void 0),f=r[1].setMeta("label",n),p=a.clone(bn.accuPush,a.clone(bn.id,u)),m=f.clone(bn.ternary,[f,p,c]);return{callAst:a.clone(bn.comprehension,{errorsAreFatal:!0,iterable:l,iterVarName:u,init:a.clone(bn.list,[]),step:m,result:A3})}}}function lz(t){const e=`${t.name}(var, predicate) invalid predicate iteration variable`,n=`${t.name}(var, predicate) predicate must return bool`;return o=>{const{args:r,receiver:l,ast:a}=o,u=r[1].setMeta("label",n),c=t.transform({args:r,ast:a,predicate:u,opts:t});return{callAst:a.clone(bn.comprehension,{kind:"quantifier",errorsAreFatal:t.errorsAreFatal||!1,iterable:l,iterVarName:Ob(r[0],e),init:c.init,condition:c.condition,step:c.step,result:c.result||A3})}}}function _dt(){const t="find(var, predicate)",e=`${t} invalid iteration variable`,n=`${t} predicate must return bool`;function o(a,u,c){const f=a.check(u,c);if(f.kind==="dyn")return f;if(f.kind==="list")return f.valueType;if(f.kind==="map")return f.keyType;throw a.createError("invalid_comprehension_range",`Expression of type '${f}' cannot be range of find (must be list, map, or dynamic).`,u)}function r(a,u,c){const f=o(a,u.receiver,c);return u.iterCtx=c.forkWithVariable(u.iterVarName,f),a.check(u.predicate,u.iterCtx),a.registry.getOptionalType(f)}function l(a,u,c){return qt(function*(){let f=yield*a.eval(u.receiver,c);if(!Array.isArray(f))if(f instanceof Set)f=[...f];else if(f instanceof Map)f=[...f.keys()];else if(f&&typeof f=="object")f=Object.keys(f);else return yield*$r(a.createError("invalid_comprehension_range",`Expression of type '${a.debugType(f)}' cannot be range of find.`,u.receiver));const p=u.iterCtx.reuse(c),m=f;for(let h=0;h<m.length;h++)if(yield*a.eval(u.predicate,p.setIterValue(m[h],a)))return C3(m[h]);return pt()})}return a=>{const{args:u,receiver:c,ast:f}=a;return{ast:f,receiver:c,iterVarName:Ob(u[0],e),predicate:u[1].setMeta("label",n),iterCtx:void 0,evaluate:l,typeCheck:r}}}function wdt(){const t="has() invalid argument";function e(o,r,l){return qt(function*(){const a=r.macroHasProps;let u=a.length,c=yield*o.eval(a[--u],l),f;for(;u--;){const p=a[u];if(p.op===".?"&&(f??=!0),c=o.debugType(c).fieldLazy(c,p.args[1],p,o),c===void 0){if(!(!f&&u&&p.op==="."))break;throw _n("no_such_key",`No such key: ${p.args[1]}`,p)}}return c!==void 0})}function n(o,r,l){let a=r.args[0];if(a.op!==".")throw o.createError("invalid_macro_argument",t,a);if(!r.macroHasProps){const u=[];for(;a.op==="."||a.op===".?";)a=(u.push(a),a.args[0]);if(a.op!=="id")throw o.createError("invalid_macro_argument",t,a);o.check(a,l),u.push(a),r.macroHasProps=u}return o.getType("bool")}return function(o){const{args:r}=o;return{args:r,evaluate:e,typeCheck:n}}}function kdt(t){const e=(a,u)=>t.registerFunctionOverload(a,u);e("has(ast): bool",wdt()),e("list.all(ast, ast): bool",lz({name:"all",transform({ast:a,predicate:u}){return{init:a.clone(bn.value,!0),condition:A3,step:u.clone(bn.ternary,[u,u.clone(bn.value,!0),u.clone(bn.value,!1)])}}})),e("list.exists(ast, ast): bool",lz({name:"exists",condition(a){return!a},transform({ast:a,predicate:u,opts:c}){return{init:a.clone(bn.value,!1),condition:c.condition,step:u.clone(bn.ternary,[u,u.clone(bn.value,!0),u.clone(bn.value,!1)])}}})),e("list.exists_one(ast, ast): bool",lz({name:"exists_one",errorsAreFatal:!0,result(a){return a===1},transform({ast:a,predicate:u,opts:c}){const f=a.clone(bn.accuValue,void 0);return{init:a.clone(bn.value,0),step:u.clone(bn.ternary,[u,a.clone(bn.accuInc,void 0),f]),result:c.result}}})),e("list.map(ast, ast): list<dyn>",oH(!1)),e("list.map(ast, ast, ast): list<dyn>",oH(!0)),e("list.filter(ast, ast): list<dyn>",xdt()),e("list.find(ast, ast): optional<dyn>",_dt());class n{#e="cel";toString(){return this.#e}}const o=new n;t.registerType("CelNamespace",n),t.registerConstant("cel","CelNamespace",o);function r(a,u,c){return u.bindCtx=c.forkWithVariable(u.var,a.check(u.val,c)),a.check(u.exp,u.bindCtx)}function l(a,{val:u,exp:c,bindCtx:f},p){return qt(function*(){const m=yield*a.eval(u,p);return yield*a.eval(c,f.reuse(p).setIterValue(m,a))})}e("CelNamespace.bind(ast, dyn, ast): dyn",a=>{const{ast:u,args:c}=a;return{ast:u,var:Ob(c[0],"invalid variable argument"),val:c[1],exp:c[2],bindCtx:void 0,typeCheck:r,evaluate:l}})}function Sdt(t){const e=(c,f,p,m)=>t.unaryOverload(c,f,p,m,!1),n=(c,f,p,m,h)=>t.binaryOverload(c,f,p,m,h,!1);function o(c){throw _n("division_by_zero","division by zero",c)}function r(c){throw _n("modulo_by_zero","modulo by zero",c)}e("!","bool",c=>!c),e("-","number",c=>It.from(c).neg()),n("number","*","number",(c,f)=>It.from(c).mul(f)),n("number","+","number",(c,f)=>It.from(c).add(f)),n("number","-","number",(c,f)=>It.from(c).sub(f)),n("number","/","number",(c,f,p)=>{const m=It.from(f);return m.isZero()?o(p):It.from(c).div(m)}),n("number","%","number",(c,f,p)=>{const m=It.from(f);return m.isZero()?r(p):It.from(c).mod(m)}),n("string","+","string",(c,f)=>c+f),n("list<V>","+","list<V>",(c,f)=>[...c,...f]),n("bytes","+","bytes",(c,f)=>{const p=c,m=f;if(!p.length)return m;if(!m.length)return p;const h=new Uint8Array(p.length+m.length);return h.set(p,0),h.set(m,p.length),h}),n("Date","==","Date",(c,f)=>Hut(c,f)),n("Date","<","Date",(c,f)=>Kj(c,f)),n("Date","<=","Date",(c,f)=>!Wj(c,f)),n("Date",">","Date",(c,f)=>Wj(c,f)),n("Date",">=","Date",(c,f)=>!Kj(c,f));function l(c,f,p,m){const h=f;if(h instanceof Set&&h.has(c))return!0;for(const v of h)if(l1(c,v,p,m))return!0;return!1}function a(c,f){const p=f;return p instanceof Map?p.get(c)!==void 0:$3(p,c)?p[c]!==void 0:!1}function u(c,f,p,m){return l(c,f,p,m)}n("V","in","list<V>",u),n("K","in","map<K, V>",a);for(const c of["type","null","bool","string"])n(c,"==",c,(f,p)=>f===p);n("number","==","number",(c,f)=>It.from(c).eq(f)),n("bytes","==","bytes",(c,f)=>{if(c===f)return!0;const p=c,m=f;let h=p.length;if(h!==m.length)return!1;for(;h--;)if(p[h]!==m[h])return!1;return!0}),n("list<V>","==","list<V>",(c,f,p,m)=>{if(c===f)return!0;if(fv(c)&&fv(f)){const x=c,y=f,_=x.length;if(_!==y.length)return!1;for(let k=0;k<_;k++)if(!l1(x[k],y[k],p,m))return!1;return!0}if(c instanceof Set&&f instanceof Set){if(c.size!==f.size)return!1;for(const x of c)if(!f.has(x))return!1;return!0}const h=c instanceof Set?f:c,v=c instanceof Set?c:f;if(!fv(h))return!1;const g=h,b=v;if(g.length!==b?.size)return!1;for(let x=0;x<g.length;x++)if(!b.has(g[x]))return!1;return!0}),n("map<K, V>","==","map<K, V>",(c,f,p,m)=>{if(c===f)return!0;if(c instanceof Map&&f instanceof Map){if(c.size!==f.size)return!1;for(const[x,y]of c)if(!(f.has(x)&&l1(y,f.get(x),p,m)))return!1;return!0}if(c instanceof Map||f instanceof Map){const x=c instanceof Map?f:c,y=c instanceof Map?c:f,_=cu(x);if(y.size!==_.length)return!1;for(const[k,w]of y)if(!(k in x&&l1(w,x[k],p,m)))return!1;return!0}const h=c,v=f,g=cu(h),b=cu(v);if(g.length!==b.length)return!1;for(let x=0;x<g.length;x++){const y=g[x];if(!(y in v&&l1(h[y],v[y],p,m)))return!1}return!0});for(const[c,f]of[["bool","bool"],["number","number"],["string","string"]]){const p=c==="number";n(c,"<",f,p?(m,h)=>It.from(m).lt(h):(m,h)=>m<h),n(c,"<=",f,p?(m,h)=>It.from(m).lte(h):(m,h)=>m<=h),n(c,">",f,p?(m,h)=>It.from(m).gt(h):(m,h)=>m>h),n(c,">=",f,p?(m,h)=>It.from(m).gte(h):(m,h)=>m>=h)}}function l1(t,e,n,o){if(t===e)return!0;switch(typeof t){case"undefined":case"string":case"boolean":return!1;case"number":case"bigint":return typeof e=="number"||typeof e=="bigint"||e instanceof It?It.from(t).eq(e):!1;case"object":{if(t instanceof It)return e instanceof It||typeof e=="number"||typeof e=="bigint"?t.eq(e):!1;if(typeof e!="object")return!1;const r=o.debugType(t),l=o.debugType(e);if(r!==l)return!1;const a=o.registry.findBinaryOverload("==",r,l);return a?a.handler(t,e,n,o):!1}}throw _n("invalid_comparison_type",`Cannot compare values of type ${typeof t}`,n)}const Cdt=new Map().set("A","dyn").set("T","dyn").set("K","dyn").set("V","dyn");class rH extends wue{constructor(e,n){super(e),this.createError=n?_n:mst}check(e,n){try{return e.checkedType??=e.check(this,e,n)}catch(o){throw AI(o,e)}}checkAccessOnType(e,n,o,r=!1){if(o===this.dynType)return o;const l=(e.op==="[]"||e.op==="[?]"?this.check(e.args[1],n):this.stringType).type;if(o.kind==="list"){if(l==="number"||l==="dyn")return o.valueType;throw this.createError("invalid_index_type",`List index must be number, got '${l}'`,e)}if(o.kind==="map")return o.valueType;const a=this.objectTypes.get(o.name);if(a){if(!(l==="string"||l==="dyn"))throw this.createError("invalid_index_type",`Cannot index type '${o.name}' with type '${l}'`,e);if(a.fields){let u;const c=e.args;if(e.op==="."||e.op===".?"?u=c[1]:c[1]?.op==="value"&&(u=c[1].args),typeof u=="string"){const f=a.fields[u];if(f)return f;if(r)return this.dynType;throw this.createError("no_such_key",`No such key: ${u}`,e)}}return this.dynType}throw this.createError("cannot_index_type",`Cannot index type '${this.formatType(o)}'`,e)}formatType(e){return e.hasPlaceholderType?e.templated(this.registry,Cdt).name:e.name}formatTypeList(e){return e.map(n=>this.formatType(n)).join(", ")}}const yt={EOF:0,NUMBER:1,STRING:2,BOOLEAN:3,NULL:4,IDENTIFIER:5,PLUS:6,MINUS:7,MULTIPLY:8,DIVIDE:9,MODULO:10,EQ:11,NE:12,LT:13,LE:14,GT:15,GE:16,AND:17,OR:18,NOT:19,IN:20,LPAREN:21,RPAREN:22,LBRACKET:23,RBRACKET:24,LBRACE:25,RBRACE:26,DOT:27,COMMA:28,COLON:29,QUESTION:30,BYTES:31,ELLIPSIS:32},gk={[yt.EQ]:bn["=="],[yt.PLUS]:bn["+"],[yt.MINUS]:bn["-"],[yt.MULTIPLY]:bn["*"],[yt.DIVIDE]:bn["/"],[yt.MODULO]:bn["%"],[yt.LE]:bn["<="],[yt.LT]:bn["<"],[yt.GE]:bn[">="],[yt.GT]:bn[">"],[yt.NE]:bn["!="],[yt.IN]:bn.in},LS={};for(const t in yt)LS[yt[t]]=t;const Sue=new Uint8Array(128);for(const t of"0123456789abcdefABCDEF")Sue[t.charCodeAt(0)]=1;const $dt={bytes_unicode_escape:t=>`\\${t} not allowed in bytes literals`,invalid_unicode_escape:t=>`Invalid Unicode escape: \\${t}`,invalid_unicode_surrogate:t=>`Invalid Unicode surrogate: \\${t}`,invalid_hex_escape:t=>`Invalid hex escape: \\${t}`,invalid_octal_escape:()=>"Octal escape must be 3 digits",octal_escape_out_of_range:t=>`Octal escape out of range: \\${t}`,invalid_escape_sequence:t=>`Invalid escape sequence: \\${t}`},lH={"\\":"\\","?":"?",'"':'"',"'":"'","`":"`",a:"\x07",b:"\b",f:"\f",n:`
|
|
66
66
|
`,r:"\r",t:" ",v:"\v"};class J${#e;#t;op;args;pos;start;end;constructor(e,n,o,r,l,a){this.#e={check:l.check,evaluate:l.evaluate},this.#t=e,this.op=l.name,this.args=a,this.pos=n,this.start=o,this.end=r}clone(e,n){return new J$(this.#t,this.pos,this.start,this.end,e,n)}get meta(){return this.#e}get input(){return this.#t}check(e,n,o){const r=this.#e;return r.alternate?e.check(r.alternate,o):r.macro?r.macro.typeCheck(e,r.macro,o):r.check(e,n,o)}evaluate(e,n,o){const r=this.#e;if(r.alternate){const l=r.alternate;return l.evaluate(e,l,o)}if(r.macro){const l=r.macro;return l.evaluate(e,l,o)}return r.evaluate(e,n,o)}setMeta(e,n){return this.#e[e]=n,this}get range(){return{start:this.start,end:this.end}}toOldStructure(){const e=Array.isArray(this.args)?this.args:[this.args];return[this.op,...e.map(n=>n instanceof J$?n.toOldStructure():n)]}}class Tdt{input;pos;length;tokenPos;tokenType;tokenValue;reset(e){return this.pos=0,this.input=e,this.length=e.length,e}token(e,n,o){return this.tokenPos=e,this.tokenType=n,this.tokenValue=o,this}nextToken(){for(;;){const{pos:e,input:n,length:o}=this;if(e>=o)return this.token(e,yt.EOF);const r=n[e];switch(r){case" ":case" ":case`
|
|
67
67
|
`:case"\r":this.pos++;continue;case"=":if(n[e+1]!=="=")break;return this.token((this.pos+=2)-2,yt.EQ);case"&":if(n[e+1]!=="&")break;return this.token((this.pos+=2)-2,yt.AND);case"|":if(n[e+1]!=="|")break;return this.token((this.pos+=2)-2,yt.OR);case"+":return this.token(this.pos++,yt.PLUS);case"-":return this.token(this.pos++,yt.MINUS);case"*":return this.token(this.pos++,yt.MULTIPLY);case"/":if(n[e+1]==="/"){for(;this.pos<o&&this.input[this.pos]!==`
|
|
68
68
|
`;)this.pos++;continue}return this.token(this.pos++,yt.DIVIDE);case"%":return this.token(this.pos++,yt.MODULO);case"<":return n[e+1]==="="?this.token((this.pos+=2)-2,yt.LE):this.token(this.pos++,yt.LT);case">":return n[e+1]==="="?this.token((this.pos+=2)-2,yt.GE):this.token(this.pos++,yt.GT);case"!":return n[e+1]==="="?this.token((this.pos+=2)-2,yt.NE):this.token(this.pos++,yt.NOT);case"(":return this.token(this.pos++,yt.LPAREN);case")":return this.token(this.pos++,yt.RPAREN);case"[":return this.token(this.pos++,yt.LBRACKET);case"]":return this.token(this.pos++,yt.RBRACKET);case"{":return this.token(this.pos++,yt.LBRACE);case"}":return this.token(this.pos++,yt.RBRACE);case".":return n[e+1]==="."&&n[e+2]==="."?this.token((this.pos+=3)-3,yt.ELLIPSIS):this.token(this.pos++,yt.DOT);case",":return this.token(this.pos++,yt.COMMA);case":":return this.token(this.pos++,yt.COLON);case"?":return this.token(this.pos++,yt.QUESTION);case'"':case"'":return this.readString(r);case"b":case"B":case"r":case"R":{const l=n[e+1];return l==='"'||l==="'"?(++this.pos,this.readString(l,r)):this.readIdentifier()}default:{const l=r.charCodeAt(0);if(l<=57&&l>=48)return this.readNumber();if(this._isIdentifierCharCode(l))return this.readIdentifier()}}throw va("unexpected_character",`Unexpected character: ${r}`,{pos:e,start:e,end:e+1,input:n})}}_isIdentifierCharCode(e){return e<48||e>122?!1:e>=97||e>=65&&e<=90||e<=57||e===95}_parseAsNumber(e,n){const o=this.input.substring(e,n);try{return this.token(e,yt.NUMBER,It.from(o))}catch{}throw va("invalid_number",`Invalid number: ${o}`,{pos:e,start:e,end:n,input:this.input})}_parseAsHexNumber(e,n){const o=this.input.substring(e,n);try{return this.token(e,yt.NUMBER,It.from(BigInt(o)))}catch{}throw va("invalid_hex_integer",`Invalid hex integer: ${o}`,{pos:e,start:e,end:this.pos,input:this.input})}_readDigits(e,n,o,r){for(;o<n&&(r=e.charCodeAt(o))&&!(r>57||r<48);)o++;return o}_readExponent(e,n,o){let r=o<n&&e[o];if(r==="e"||r==="E"){r=++o<n&&e[o],(r==="-"||r==="+")&&o++;const l=o;if(o=this._readDigits(e,n,o),l===o)throw va("invalid_exponent","Invalid exponent",{pos:o,start:o,end:Math.min(o+1,e.length),input:e})}return o}readNumber(){const{input:e,length:n,pos:o}=this;let r=o;if(e[r]==="0"&&(e[r+1]==="x"||e[r+1]==="X")){for(r+=2;r<n&&Sue[e[r].charCodeAt(0)];)r++;this.pos=r;const a=this._parseAsHexNumber(o,r);return r<n&&(e[r]==="u"||e[r]==="U")&&this.pos++,a}if(r=this._readDigits(e,n,r),r+1<n){let a=e[r]==="."?this._readDigits(e,n,r+1):r+1;a!==r+1&&(r=a),a=this._readExponent(e,n,r),a!==r&&(r=a)}this.pos=r;const l=this._parseAsNumber(o,r);return r<n&&(e[r]==="u"||e[r]==="U")&&this.pos++,l}readString(e,n){const{input:o,pos:r}=this;return o[r+1]===e&&o[r+2]===e?this.readTripleQuotedString(e,n):this.readSingleQuotedString(e,n)}_closeQuotedString(e,n,o,r){switch(o){case"b":case"B":{const l=this.processEscapes(e,n,!0),a=new Uint8Array(l.length);for(let u=0;u<l.length;u++)a[u]=l.charCodeAt(u)&255;return this.token(r-1,yt.BYTES,a)}case"r":case"R":return this.token(r-1,yt.STRING,n);default:{const l=this.processEscapes(e,n,!1);return this.token(r,yt.STRING,l)}}}readSingleQuotedString(e,n){const{input:o,length:r,pos:l}=this;let a,u=this.pos+1;for(;u<r&&(a=o[u]);){switch(a){case e:{const c=l+1,f=o.slice(c,u);return this.pos=++u,this._closeQuotedString(c,f,n,l)}case`
|
|
@@ -140,7 +140,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
140
140
|
点击后求值,返回一个 \`map\`。其每个顶层键都会被写入到最近祖先的表单状态中:
|
|
141
141
|
对象值与当前值深合并(数组整体替换),其他类型直接替换。
|
|
142
142
|
返回 \`{}\` 表示不进行任何写入。
|
|
143
|
-
`}),onSuccess:re(Ur.annotations({title:"写入后",description:"写入完成后执行的操作"}))}).annotations({title:"StateWriteAction",description:"点击后将 CEL 表达式的结果写回最近祖先的表单状态"})}const mbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Ofe,metadata:fbt,schema:pbt,type:zfe},Symbol.toStringTag,{value:"Module"})),Mfe="com.shwfed.actions.item.markdown",Ife="2026-05-21",hbt={name:"内联 Markdown",icon:"fluent:markdown-20-regular"};function vbt(t){return Ge({id:On.annotations({description:"Markdown 项唯一标识"}),groupId:re(On.annotations({description:"所属按钮组标识"})),type:Le(Mfe),compatibilityDate:Le(Ife),name:ht.annotations({title:"内部名称",description:"仅用于编辑器内识别该 Markdown 项,不会展示给最终用户"}),content:at.annotations({title:"内容",description:"内联 Markdown 内容,与按钮并排展示,支持本地化"})}).annotations({title:"MarkdownItem",description:"按钮组内的内联 Markdown 节点"})}const gbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Ife,metadata:hbt,schema:vbt,type:Mfe},Symbol.toStringTag,{value:"Module"}));function _2(t){const{hostName:e,dirSegment:n,schemaModules:o,configModules:r,runtimeModules:l,validateModule:a,deriveEntryExtras:u}=t,c=new RegExp(`/${n}/([^/]+)/([^/]+)/schema\\.(?:ts|js)$`),f=g=>{const b=c.exec(g);if(!b)throw new Error(`[${e}] unrecognized schema path: ${g}`);return{date:b[1],type:b[2]}},p=(g,b,x,y)=>{const _=`/${n}/${b}/${x}/${y}`;for(const[k,w]of Object.entries(g))if(k.endsWith(_))return w;throw new Error(`[${e}] missing ${y} for ${x}@${b}`)};let m=null;const h=()=>{if(m)return m;const g=[];for(const[x,y]of Object.entries(o)){const{date:_,type:k}=f(x);if(y.type!==k)throw new Error(`[${e}] type "${y.type}" does not match folder "${k}"`);if(y.compatibilityDate!==_)throw new Error(`[${e}] compatibilityDate "${y.compatibilityDate}" does not match folder "${_}"`);a?.(y,k,_),g.push({type:y.type,compatibilityDate:y.compatibilityDate,config:p(r,_,k,"config.vue"),runtime:p(l,_,k,"runtime.vue"),module:y})}const b=u?u(g):()=>({});return m=g.map(x=>({type:x.type,compatibilityDate:x.compatibilityDate,config:x.config,runtime:x.runtime,module:x.module,...b(x)})),m};return{get ENTRIES(){return h()},find:(g,b)=>h().find(x=>x.type===g&&x.compatibilityDate===b)}}const ybt=Object.assign({"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.ts":Uyt,"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.ts":Hyt,"../buttons/2026-04-18/com.shwfed.actions.button.prototype/schema.ts":Gyt,"../buttons/2026-04-21/com.shwfed.actions.button.navigation/schema.ts":Qyt,"../buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.ts":lbt,"../buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.ts":sbt,"../buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.ts":dbt,"../buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.ts":mbt}),bbt=Object.assign({"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue":()=>ul(()=>import("./config-
|
|
143
|
+
`}),onSuccess:re(Ur.annotations({title:"写入后",description:"写入完成后执行的操作"}))}).annotations({title:"StateWriteAction",description:"点击后将 CEL 表达式的结果写回最近祖先的表单状态"})}const mbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Ofe,metadata:fbt,schema:pbt,type:zfe},Symbol.toStringTag,{value:"Module"})),Mfe="com.shwfed.actions.item.markdown",Ife="2026-05-21",hbt={name:"内联 Markdown",icon:"fluent:markdown-20-regular"};function vbt(t){return Ge({id:On.annotations({description:"Markdown 项唯一标识"}),groupId:re(On.annotations({description:"所属按钮组标识"})),type:Le(Mfe),compatibilityDate:Le(Ife),name:ht.annotations({title:"内部名称",description:"仅用于编辑器内识别该 Markdown 项,不会展示给最终用户"}),content:at.annotations({title:"内容",description:"内联 Markdown 内容,与按钮并排展示,支持本地化"})}).annotations({title:"MarkdownItem",description:"按钮组内的内联 Markdown 节点"})}const gbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Ife,metadata:hbt,schema:vbt,type:Mfe},Symbol.toStringTag,{value:"Module"}));function _2(t){const{hostName:e,dirSegment:n,schemaModules:o,configModules:r,runtimeModules:l,validateModule:a,deriveEntryExtras:u}=t,c=new RegExp(`/${n}/([^/]+)/([^/]+)/schema\\.(?:ts|js)$`),f=g=>{const b=c.exec(g);if(!b)throw new Error(`[${e}] unrecognized schema path: ${g}`);return{date:b[1],type:b[2]}},p=(g,b,x,y)=>{const _=`/${n}/${b}/${x}/${y}`;for(const[k,w]of Object.entries(g))if(k.endsWith(_))return w;throw new Error(`[${e}] missing ${y} for ${x}@${b}`)};let m=null;const h=()=>{if(m)return m;const g=[];for(const[x,y]of Object.entries(o)){const{date:_,type:k}=f(x);if(y.type!==k)throw new Error(`[${e}] type "${y.type}" does not match folder "${k}"`);if(y.compatibilityDate!==_)throw new Error(`[${e}] compatibilityDate "${y.compatibilityDate}" does not match folder "${_}"`);a?.(y,k,_),g.push({type:y.type,compatibilityDate:y.compatibilityDate,config:p(r,_,k,"config.vue"),runtime:p(l,_,k,"runtime.vue"),module:y})}const b=u?u(g):()=>({});return m=g.map(x=>({type:x.type,compatibilityDate:x.compatibilityDate,config:x.config,runtime:x.runtime,module:x.module,...b(x)})),m};return{get ENTRIES(){return h()},find:(g,b)=>h().find(x=>x.type===g&&x.compatibilityDate===b)}}const ybt=Object.assign({"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.ts":Uyt,"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.ts":Hyt,"../buttons/2026-04-18/com.shwfed.actions.button.prototype/schema.ts":Gyt,"../buttons/2026-04-21/com.shwfed.actions.button.navigation/schema.ts":Qyt,"../buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.ts":lbt,"../buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.ts":sbt,"../buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.ts":dbt,"../buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.ts":mbt}),bbt=Object.assign({"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue":()=>ul(()=>import("./config-BlpdrD6d.js"),[],import.meta.url),"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue":()=>ul(()=>import("./config-zybwxOyV.js"),[],import.meta.url),"../buttons/2026-04-18/com.shwfed.actions.button.prototype/config.vue":()=>ul(()=>import("./config-0PaXoAiK.js"),[],import.meta.url),"../buttons/2026-04-21/com.shwfed.actions.button.navigation/config.vue":()=>ul(()=>import("./config-CtENh936.js"),[],import.meta.url),"../buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.vue":()=>ul(()=>import("./config-3Dav11rw.js"),[],import.meta.url),"../buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue":()=>ul(()=>import("./config-CTA1p6um.js"),[],import.meta.url),"../buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue":()=>ul(()=>import("./config-CS-NMWcV.js"),[],import.meta.url),"../buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue":()=>ul(()=>import("./config-CHRzxGVx.js"),[],import.meta.url)}),xbt=Object.assign({"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/runtime.vue":()=>ul(()=>import("./runtime-ByvaY-sA.js"),__vite__mapDeps([0,1]),import.meta.url),"../buttons/2026-04-18/com.shwfed.actions.button.http.request.json/runtime.vue":()=>ul(()=>import("./runtime-Dpy_UDRy.js"),__vite__mapDeps([2,1]),import.meta.url),"../buttons/2026-04-18/com.shwfed.actions.button.prototype/runtime.vue":()=>ul(()=>import("./runtime-DCftiZTY.js"),__vite__mapDeps([3,1]),import.meta.url),"../buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue":()=>ul(()=>import("./runtime-D9EdrQs6.js"),__vite__mapDeps([4,1]),import.meta.url),"../buttons/2026-05-11/com.shwfed.actions.button.modal.layout/runtime.vue":()=>ul(()=>import("./runtime-B3kAucV_.js"),__vite__mapDeps([5,1]),import.meta.url),"../buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/runtime.vue":()=>ul(()=>import("./runtime-DNEDM9BZ.js"),__vite__mapDeps([6,1]),import.meta.url),"../buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.vue":()=>ul(()=>import("./runtime-yP47ki_o.js"),__vite__mapDeps([7,1]),import.meta.url),"../buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue":()=>ul(()=>import("./runtime-D8qWgTCC.js"),__vite__mapDeps([8,1]),import.meta.url)}),_bt=Object.fromEntries(Object.entries(bbt).map(([t,e])=>[t,Gf(e)])),wbt=Object.fromEntries(Object.entries(xbt).map(([t,e])=>[t,Gf(e)])),kbt=_2({hostName:"shwfed-actions",dirSegment:"buttons",schemaModules:ybt,configModules:_bt,runtimeModules:wbt,deriveEntryExtras:t=>{const e=new Map;for(const n of t){const o=e.get(n.type);(!o||n.compatibilityDate>o)&&e.set(n.type,n.compatibilityDate)}return n=>{const o=n.module.metadata.deprecated;return o?{deprecated:!0,deprecationNote:o}:n.compatibilityDate<e.get(n.type)?{deprecated:!0,deprecationNote:`已被更新版本 ${e.get(n.type)} 取代。`}:{deprecated:!1}}}}),HF=kbt.ENTRIES.map(t=>({type:t.type,compatibilityDate:t.compatibilityDate,metadata:t.module.metadata,schema:t.module.schema,config:t.config,runtime:t.runtime,deprecated:t.deprecated,...t.deprecationNote!==void 0?{deprecationNote:t.deprecationNote}:{}}));function Sbt(t){return HF.map(e=>e.schema(t).annotations({identifier:`${e.type}@${e.compatibilityDate}`}))}function Zp(t,e){return HF.find(n=>n.type===t&&n.compatibilityDate===e)}const Cbt=Object.assign({"../items/2026-05-21/com.shwfed.actions.item.markdown/schema.ts":gbt}),$bt=Object.assign({"../items/2026-05-21/com.shwfed.actions.item.markdown/config.vue":()=>ul(()=>import("./config-Cb6kwkJ7.js"),[],import.meta.url)}),Tbt=Object.assign({"../items/2026-05-21/com.shwfed.actions.item.markdown/runtime.vue":()=>ul(()=>import("./runtime-BWeksK7X.js"),[],import.meta.url)}),Ebt=Object.fromEntries(Object.entries($bt).map(([t,e])=>[t,Gf(e)])),Abt=Object.fromEntries(Object.entries(Tbt).map(([t,e])=>[t,Gf(e)])),Dbt=_2({hostName:"shwfed-actions",dirSegment:"items",schemaModules:Cbt,configModules:Ebt,runtimeModules:Abt}),WF=Dbt.ENTRIES.map(t=>({type:t.type,compatibilityDate:t.compatibilityDate,metadata:t.module.metadata,schema:t.module.schema,config:t.config,runtime:t.runtime}));function zbt(t){return WF.map(e=>e.schema(t).annotations({identifier:`${e.type}@${e.compatibilityDate}`}))}function Fh(t,e){return WF.find(n=>n.type===t&&n.compatibilityDate===e)}const Obt=/\{\{(.*?)\}\}/gs;function NJt(t,e){return t.replace(Obt,(n,o)=>{const r=o.trim();if(r.length===0)return"{{ }}";try{return Mbt(We(e(r)))}catch{return`{{${o}}}`}})}function Mbt(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}const Ibt=new Set(["success","error","warning","info"]);function LJt(t,e,n={}){const{messageExpression:o,resultExpression:r,channel:l,triggers:a}=n,u=Zt(e(t),c=>c.json());return Zt(u,c=>{const f={json:c},p=r===void 0?Er("success"):Zn(e(r,f),m=>Ibt.has(m)?m:"success");return Zt(p,m=>{const h=o===void 0?So:Zt(e(o,f),v=>on(()=>Io[m](v)));return $P(h,$c(l,a?.[m]))})})}const Rfe="shwfed.component.action",Dz=Le("default","primary","destructive","ghost","link").annotations({description:"按钮变体"}),Rbt=Le("default","sm","xs").annotations({description:"按钮大小"});function w2(t){const e=et({configure:t,resultType:"bool"}),n=Sbt(t);if(n.length===0)throw new Error("[shwfed-actions] no buttons registered under buttons/<date>/<type>/");const o=(n.length===1?n[0]:oo(...n)).annotations({description:"按钮动作,由 type 字段区分类型"}),r=Ge({id:On.annotations({description:"Action 唯一标识"}),groupId:On.annotations({description:"所属按钮组标识"}),title:at.annotations({title:"名称",description:"按钮上的文字"}),tooltip:re(at.annotations({title:"提示",description:"当用户将鼠标移动至该按钮上,将展示的提示内容"})),icon:re(ht.annotations({title:"图标",description:"按钮上的文字左侧展示的图标"})),hidden:re(e.annotations({title:"隐藏条件",description:"返回 `true` 时,按钮将不可见"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时,按钮将依旧可见但被禁用"})),variant:re(Dz.annotations({title:"变体"})),hideTitle:re(_o.annotations({title:"仅显示图标",description:ol`
|
|
144
144
|
隐藏按钮文字内容,仅显示其图标。常见于有一定关联隐喻的按钮,如
|
|
145
145
|
|
|
146
146
|
- 异步下载与下载历史:下载历史仅展示历史图标
|
|
@@ -157,13 +157,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
157
157
|
`}))}).annotations({title:"ActionGroup"});return{ActionGroup:p,ActionGroupItem:f,ActionItem:r,DropdownAction:l,DropdownActionItem:c,fields:{size:Et(Rbt,{default:()=>"default"}).annotations({title:"按钮大小",description:"组件内所有按钮共享的大小"}),gap:Et(Wn.pipe(Xw(),nh()),{default:()=>4}).annotations({title:"间距",description:"Action 项之间的间距倍率,运行时按 0.25rem 步进换算"}),style:re(ht).annotations({title:"容器样式",description:"容器样式字符串"}),groups:Bn(p).annotations({title:"按钮组",description:"按钮组列表"}),items:Bn(f).annotations({title:"Action 项",description:"Action 项列表"})}}}function Vfe(t){const{fields:e}=w2(t);return Ge({kind:Al(Rfe),...e}).annotations({title:"ActionConfig",description:"Action 组件完整配置"})}function Vbt(){return{kind:Rfe,size:"default",gap:4,groups:[],items:[]}}function Pfe(t){switch(t._tag){case"TypeLiteral":return t;case"Transformation":return Pfe(t.to);default:return null}}function Pbt(t,e){const n=Pfe(t.ast);return n?n.propertySignatures.find(o=>o.name===e)??null:null}function Fbt(t){const e=t.type;if(e._tag==="Union"&&t.isOptional){const n=e.types.find(o=>o._tag!=="UndefinedKeyword");if(n)return n}return e}function Ffe(t,e,n){const o=Pbt(t,e);if(!o)return;const r=n(o);if(cn(r))return r.value;const l=Fbt(o),a=n(l);if(cn(a))return a.value;if(l!==o.type){const u=n(o.type);if(cn(u))return u.value}}function p1(t,e){return Ffe(t,e,tg)}function m1(t,e){return Ffe(t,e,ng)}const Nfe="com.shwfed.block.actions",Lfe="2026-05-06",Nbt={name:"操作按钮",icon:"fluent:cursor-click-20-regular",w:{initial:8,min:8,max:1/0},h:{initial:2,min:2,max:1/0}};function Lbt(t,e){const n=Vfe(t);return Ge({id:On.annotations({description:"块唯一标识"}),type:Al(Nfe),compatibilityDate:Al(Lfe),actions:n.annotations({title:"操作按钮配置",description:"内嵌的 Actions 组件配置"})}).annotations({title:"操作按钮块",description:"将一组 Actions 按钮作为页面块嵌入"})}function Bbt(){return{actions:Vbt()}}const Ubt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Lfe,defaultBody:Bbt,metadata:Nbt,schema:Lbt,type:Nfe},Symbol.toStringTag,{value:"Module"}));function Bfe(t){const e=et({configure:t,resultType:"bool"});return Ge({when:e.annotations({title:"规则",description:ol`
|
|
158
158
|
返回 \`true\` 时视为校验**未**通过,返回 \`false\` 视为通过
|
|
159
159
|
`}),warning:re(_o.annotations({title:"仅警告",description:"开启后该规则仅黄色提示、不阻止提交"})),message:Oo({configure:t}).annotations({title:"消息",description:"校验未通过时展示的本地化消息,支持 inline Markdown 与 `{{ 表达式 }}` 插值"})})}function Lo(t){const e=et({configure:t,resultType:"bool"});return{id:On.annotations({description:"字段唯一标识;布局通过该 id 引用字段"}),displayName:re(ht.annotations({title:"内部名称",description:"仅在编辑器内可见的字段名,用于在侧边栏和布局编辑器中识别字段;运行时不展示"})),hidden:re(e.annotations({title:"隐藏条件",description:"返回 `true` 时字段在所有布局中都不渲染"})),required:re(e.annotations({title:"必填条件",description:"返回 `true` 时显示必填星号并要求非空,留空表示不必填"})),validations:re(Bn(Bfe(t)).annotations({title:"校验规则",description:"反馈消息将按照校验规则列表顺序展示"}))}}const qbt=["vertical","floating"],hl=[{value:"vertical",label:"垂直(标签在上)"},{value:"floating",label:"浮动(标签嵌入输入框)"}],vl=Le(...qbt).annotations({title:"方向",description:"标签与输入框的排列方向"}),Kn="vertical",Ufe=["formula","prefill"],ZW={formula:"计算值",prefill:"智能填充"};function wr(t,e){return re(Ge({mode:Le(...Ufe).annotations({title:"派生方式",description:"`计算值` 只读、始终以表达式为准;`智能填充` 可编辑、用户修改后以用户为准"}),expression:et({configure:t,resultType:e}).annotations({title:"表达式",description:"返回该字段值的 CEL 表达式;可访问 `form` 当前表单状态"})}).annotations({title:"派生值",description:ol`
|
|
160
|
-
|
|
160
|
+
该字段值的**派生来源**:
|
|
161
161
|
|
|
162
162
|
- **计算值**:字段变为只读,其值始终由表达式计算得出,依赖字段提交时重算。
|
|
163
163
|
|
|
164
164
|
- **智能填充**:字段保持可编辑。用户未手动修改前由表达式持续计算并填入;一旦用户手动修改(含清空),即以用户输入为准,表达式不再覆盖。
|
|
165
|
-
|
|
166
|
-
两种方式都支持异步调用(如 \`http.get(...)\`)。
|
|
167
165
|
`}))}const qfe="com.shwfed.form.field.markdown",jfe="2026-04-22",jbt={name:"Markdown",icon:"fluent:markdown-20-regular",w:{initial:8,min:2,max:1/0},h:{initial:2,min:2,max:1/0}};function Hfe(t){return Ge({type:Le(qfe),compatibilityDate:Le(jfe),...Lo(t),content:Oo({configure:t}).annotations({title:"内容",description:"渲染为 Markdown 的多语言文本,支持 `{{ 表达式 }}` 插值"})}).annotations({title:"MarkdownField",description:"渲染一段 Markdown 文本(仅展示,不参与表单提交)"})}const Hbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:jfe,metadata:jbt,schema:Hfe,type:qfe},Symbol.toStringTag,{value:"Module"})),Wfe="com.shwfed.form.field.text",Kfe="2026-04-22",Wbt={name:"文本输入",icon:"fluent:text-field-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}};function Gfe(t){const e=et({configure:t,resultType:"bool"});return Ge({type:Le(Wfe),compatibilityDate:Le(Kfe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"输入为空时的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.name`;留空则为非受控字段,不写入表单状态"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"string")}).annotations({title:"TextField",description:"单行文本输入"})}const Kbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Kfe,metadata:Wbt,schema:Gfe,type:Wfe},Symbol.toStringTag,{value:"Module"})),Yfe="com.shwfed.form.field.textarea",Jfe="2026-04-22",Gbt={name:"多行文本输入",icon:"fluent:text-description-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:3,min:2,max:1/0,grow:!0}};function Xfe(t){const e=et({configure:t,resultType:"bool"});return Ge({type:Le(Yfe),compatibilityDate:Le(Jfe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"输入为空时的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.bio`;留空则为非受控字段,不写入表单状态"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),maxLength:re(Wn.pipe(wi(),Cl()).annotations({title:"字数限制",description:"允许输入的最大字符数;达到上限后无法继续输入,并在右下角展示字数计数"})),derived:wr(t,"string")}).annotations({title:"TextareaField",description:"多行文本输入"})}const Ybt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Jfe,metadata:Gbt,schema:Xfe,type:Yfe},Symbol.toStringTag,{value:"Module"})),Qfe="com.shwfed.form.field.actions",Zfe="2026-04-24",Jbt={name:"操作",icon:"fluent:cursor-click-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:1/0},inlineConfig:!1};function epe(t){const{fields:e}=w2(t),{size:n,groups:o,items:r,...l}=e;return Ge({type:Le(Qfe),compatibilityDate:Le(Zfe),...Lo(t),...l,groups:Et(o,{default:()=>[]}),items:Et(r,{default:()=>[]})}).annotations({title:"ActionsField",description:"渲染一组操作按钮(仅展示,不参与表单提交)"})}const Xbt=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Zfe,metadata:Jbt,schema:epe,type:Qfe},Symbol.toStringTag,{value:"Module"})),tpe="com.shwfed.form.field.combobox.single",npe="2026-04-24",Qbt={name:"下拉单选",icon:"fluent:chevron-down-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}};function eK(t){return e=>{t(e),e.registerVariable("option","dyn",{description:"当前选项"})}}const Zbt=t=>t==="dyn"||t.startsWith("list");function ope(t){const e=et({configure:t,resultType:"bool"}),n=et({configure:t,resultType:Zbt}),o=et({configure:eK(t),resultType:"dyn"}),r=Oo({configure:eK(t)});return Ge({type:Le(tpe),compatibilityDate:Le(npe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"未选中任何选项时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.role`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时下拉框仍然渲染但不可选择"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前选项的标签"})),derived:wr(t,"dyn"),options:Et(n.annotations({title:"选项",description:"返回选项数组的 CEL 表达式,可访问 `form` 当前状态;例:`[{value: 'a', label: 'A'}]`"}),{default:()=>"[]"}),optionValue:Et(o.annotations({title:"选项值",description:"从当前 `option` 提取写入绑定的值;例:`option.value`"}),{default:()=>"option"}),optionLabel:Et(r.annotations({title:"选项标签",description:"每个选项展示的本地化文本,支持 `{{ string(option.foo) }}` 插值"}),{default:()=>[{locale:"zh",message:""}]})}).annotations({title:"ComboboxSingleField",description:"下拉单选输入"})}const e1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:npe,metadata:Qbt,schema:ope,type:tpe},Symbol.toStringTag,{value:"Module"})),rpe="com.shwfed.form.field.date",lpe="2026-04-27",t1t={name:"日期",icon:"fluent:calendar-ltr-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}};function KF(t){const e=et({configure:t,resultType:"Date"});return Ge({id:On.annotations({description:"预设唯一标识,用于稳定的 v-for key"}),label:at.annotations({title:"标签",description:"快捷选项展示的本地化文本"}),value:e.annotations({title:"值",description:'点击该预设时计算出的日期,例如 `now().offset(-7, "days")`'})}).annotations({title:"DateFieldPreset"})}function ipe(t){const e=et({configure:t,resultType:"bool"}),n=KF(t);return Ge({type:Le(rpe),compatibilityDate:Le(lpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"未选中日期时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.birthday`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"string"),format:re(ht.pipe(xn(1)).annotations({title:"展示格式",description:"输入框中展示日期的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd`"})),valueFormat:re(ht.pipe(xn(1)).annotations({title:"存储格式",description:"写入表单状态的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd`"})),presets:re(Bn(n).annotations({title:"快捷选项",description:"在选择器侧栏展示的快捷预设;留空则不渲染侧栏"}))}).annotations({title:"DateField",description:"日期选择输入"})}const n1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:lpe,metadata:t1t,presetSchema:KF,schema:ipe,type:rpe},Symbol.toStringTag,{value:"Module"})),ape="com.shwfed.form.field.daterange",spe="2026-04-27",P4=ht.pipe(xn(1)),o1t=th(P4,P4).pipe(ll(([t,e])=>t!==e,{message:()=>"起始与结束绑定路径不能相同"})),r1t=oo(P4,o1t).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径;填写单个路径时写入 `[start, end]` 字符串数组,例如 `event.range`;填写 `[起始路径, 结束路径]` 元组时分别写入两端;留空则为非受控字段"}),l1t={name:"日期范围",icon:"fluent:calendar-arrow-right-20-regular",w:{initial:10,min:10,max:1/0},h:{initial:2,min:2,max:2}};function GF(t){const e=et({configure:t,resultType:"Date"});return Ge({id:On.annotations({description:"预设唯一标识,用于稳定的 v-for key"}),label:at.annotations({title:"标签",description:"快捷选项展示的本地化文本"}),start:e.annotations({title:"起始值",description:'点击该预设时计算出的起始日期,例如 `now.offset(-7, "days")`'}),end:e.annotations({title:"结束值",description:"点击该预设时计算出的结束日期,例如 `now`"})}).annotations({title:"DateRangeFieldPreset"})}function upe(t){const e=et({configure:t,resultType:"bool"}),n=GF(t);return Ge({type:Le(ape),compatibilityDate:Le(spe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),startPlaceholder:re(at.annotations({title:"起始占位符",description:"未选中起始日期时输入框中的占位文本"})),endPlaceholder:re(at.annotations({title:"结束占位符",description:"未选中结束日期时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(r1t),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"dyn"),format:re(ht.pipe(xn(1)).annotations({title:"展示格式",description:"输入框中展示日期的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd`"})),valueFormat:re(ht.pipe(xn(1)).annotations({title:"存储格式",description:"写入表单状态的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd`"})),rangeSeparatorIcon:re(ht.pipe(xn(1)).annotations({title:"范围分隔图标",description:"范围两端之间分隔图标的 Iconify 名称"})),numberOfMonths:re(Wn.pipe(wi(),Cl()).annotations({title:"面板月数",description:"日历面板中并排显示的月份数;默认 `2`"})),presets:re(Bn(n).annotations({title:"快捷选项",description:"在选择器底部展示的快捷预设;留空则不渲染"}))}).annotations({title:"DateRangeField",description:"日期范围选择输入"})}function i1t(){return{rangeSeparatorIcon:"fluent:arrow-right-20-regular"}}const a1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:spe,defaults:i1t,metadata:l1t,presetSchema:GF,schema:upe,type:ape},Symbol.toStringTag,{value:"Module"})),cpe="com.shwfed.form.field.datetime",dpe="2026-04-27",s1t={name:"日期时间",icon:"fluent:calendar-clock-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}},fpe=["hour","minute","second"],ppe=[{value:"hour",label:"小时"},{value:"minute",label:"分钟"},{value:"second",label:"秒"}],mpe=[{value:24,label:"24 小时制"},{value:12,label:"12 小时制"}];function YF(t){const e=et({configure:t,resultType:"Date"});return Ge({id:On.annotations({description:"预设唯一标识,用于稳定的 v-for key"}),label:at.annotations({title:"标签",description:"快捷选项展示的本地化文本"}),value:e.annotations({title:"值",description:'点击该预设时计算出的日期时间,例如 `now.offset(-1, "hours")`'})}).annotations({title:"DateTimeFieldPreset"})}function hpe(t){const e=et({configure:t,resultType:"bool"}),n=YF(t);return Ge({type:Le(cpe),compatibilityDate:Le(dpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"未选中日期时间时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `event.startAt`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"string"),format:re(ht.pipe(xn(1)).annotations({title:"展示格式",description:"输入框中展示日期时间的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd HH:mm:ss`"})),valueFormat:re(ht.pipe(xn(1)).annotations({title:"存储格式",description:"写入表单状态的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd HH:mm:ss`"})),timeGranularity:re(Le(...fpe).annotations({title:"时间粒度",description:"可编辑到的最小时间单位;默认 `second`"})),hourCycle:re(Le(12,24).annotations({title:"小时制",description:"12 小时制或 24 小时制;默认 `24`"})),presets:re(Bn(n).annotations({title:"快捷选项",description:"在选择器底部展示的快捷预设;留空则不渲染"}))}).annotations({title:"DateTimeField",description:"日期时间选择输入"})}const u1t=Object.freeze(Object.defineProperty({__proto__:null,HOUR_CYCLE_OPTIONS:mpe,TIME_GRANULARITIES:fpe,TIME_GRANULARITY_OPTIONS:ppe,compatibilityDate:dpe,metadata:s1t,presetSchema:YF,schema:hpe,type:cpe},Symbol.toStringTag,{value:"Module"})),vpe="com.shwfed.form.field.datetimerange",gpe="2026-04-27",F4=ht.pipe(xn(1)),c1t=th(F4,F4).pipe(ll(([t,e])=>t!==e,{message:()=>"起始与结束绑定路径不能相同"})),d1t=oo(F4,c1t).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径;填写单个路径时写入 `[start, end]` 字符串数组,例如 `event.range`;填写 `[起始路径, 结束路径]` 元组时分别写入两端;留空则为非受控字段"}),f1t={name:"日期时间范围",icon:"fluent:calendar-clock-20-regular",w:{initial:14,min:14,max:1/0},h:{initial:2,min:2,max:2}},ype=["hour","minute","second"],bpe=[{value:"hour",label:"小时"},{value:"minute",label:"分钟"},{value:"second",label:"秒"}],xpe=[{value:24,label:"24 小时制"},{value:12,label:"12 小时制"}];function JF(t){const e=et({configure:t,resultType:"Date"});return Ge({id:On.annotations({description:"预设唯一标识,用于稳定的 v-for key"}),label:at.annotations({title:"标签",description:"快捷选项展示的本地化文本"}),start:e.annotations({title:"起始值",description:'点击该预设时计算出的起始日期时间,例如 `now.offset(-1, "hours")`'}),end:e.annotations({title:"结束值",description:"点击该预设时计算出的结束日期时间,例如 `now`"})}).annotations({title:"DateTimeRangeFieldPreset"})}function _pe(t){const e=et({configure:t,resultType:"bool"}),n=JF(t);return Ge({type:Le(vpe),compatibilityDate:Le(gpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),startPlaceholder:re(at.annotations({title:"起始占位符",description:"未选中起始日期时间时输入框中的占位文本"})),endPlaceholder:re(at.annotations({title:"结束占位符",description:"未选中结束日期时间时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(d1t),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"dyn"),format:re(ht.pipe(xn(1)).annotations({title:"展示格式",description:"输入框中展示日期时间的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd HH:mm:ss`"})),valueFormat:re(ht.pipe(xn(1)).annotations({title:"存储格式",description:"写入表单状态的 `date-fns` 格式串;留空时使用默认 `yyyy-MM-dd HH:mm:ss`"})),rangeSeparatorIcon:re(ht.pipe(xn(1)).annotations({title:"范围分隔图标",description:"范围两端之间分隔图标的 Iconify 名称"})),numberOfMonths:re(Wn.pipe(wi(),Cl()).annotations({title:"面板月数",description:"日历面板中并排显示的月份数;默认 `2`"})),timeGranularity:re(Le(...ype).annotations({title:"时间粒度",description:"可编辑到的最小时间单位;默认 `second`"})),hourCycle:re(Le(12,24).annotations({title:"小时制",description:"12 小时制或 24 小时制;默认 `24`"})),presets:re(Bn(n).annotations({title:"快捷选项",description:"在选择器底部展示的快捷预设;留空则不渲染"}))}).annotations({title:"DateTimeRangeField",description:"日期时间范围选择输入"})}function p1t(){return{rangeSeparatorIcon:"fluent:arrow-right-20-regular"}}const m1t=Object.freeze(Object.defineProperty({__proto__:null,HOUR_CYCLE_OPTIONS:xpe,TIME_GRANULARITIES:ype,TIME_GRANULARITY_OPTIONS:bpe,compatibilityDate:gpe,defaults:p1t,metadata:f1t,presetSchema:JF,schema:_pe,type:vpe},Symbol.toStringTag,{value:"Module"})),wpe="com.shwfed.form.field.time",kpe="2026-04-27",h1t={name:"时间",icon:"fluent:clock-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}},Spe=["hour","minute","second"],Cpe=[{value:"hour",label:"小时"},{value:"minute",label:"分钟"},{value:"second",label:"秒"}],$pe=[{value:24,label:"24 小时制"},{value:12,label:"12 小时制"}];function Tpe(t){const e=et({configure:t,resultType:"bool"});return Ge({type:Le(wpe),compatibilityDate:Le(kpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `meeting.startTime`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"string"),valueFormat:re(ht.pipe(xn(1)).annotations({title:"存储格式",description:"写入表单状态的 `date-fns` 格式串;留空时使用默认 `HH:mm:ss`"})),timeGranularity:re(Le(...Spe).annotations({title:"时间粒度",description:"可编辑到的最小时间单位;默认 `second`"})),hourCycle:re(Le(12,24).annotations({title:"小时制",description:"12 小时制或 24 小时制;默认 `24`"}))}).annotations({title:"TimeField",description:"时间选择输入"})}const v1t=Object.freeze(Object.defineProperty({__proto__:null,HOUR_CYCLE_OPTIONS:$pe,TIME_GRANULARITIES:Spe,TIME_GRANULARITY_OPTIONS:Cpe,compatibilityDate:kpe,metadata:h1t,schema:Tpe,type:wpe},Symbol.toStringTag,{value:"Module"})),Epe="com.shwfed.form.field.timerange",Ape="2026-04-27",N4=ht.pipe(xn(1)),g1t=th(N4,N4).pipe(ll(([t,e])=>t!==e,{message:()=>"起始与结束绑定路径不能相同"})),y1t=oo(N4,g1t).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径;填写单个路径时写入 `[start, end]` 字符串数组,例如 `meeting.timeRange`;填写 `[起始路径, 结束路径]` 元组时分别写入两端;留空则为非受控字段"}),b1t={name:"时间范围",icon:"fluent:clock-arrow-download-20-regular",w:{initial:14,min:14,max:1/0},h:{initial:2,min:2,max:2}},Dpe=["hour","minute","second"],zpe=[{value:"hour",label:"小时"},{value:"minute",label:"分钟"},{value:"second",label:"秒"}],Ope=[{value:24,label:"24 小时制"},{value:12,label:"12 小时制"}];function Mpe(t){const e=et({configure:t,resultType:"bool"});return Ge({type:Le(Epe),compatibilityDate:Le(Ape),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(y1t),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"dyn"),valueFormat:re(ht.pipe(xn(1)).annotations({title:"存储格式",description:"写入表单状态的 `date-fns` 格式串;留空时使用默认 `HH:mm:ss`"})),rangeSeparatorIcon:re(ht.pipe(xn(1)).annotations({title:"范围分隔图标",description:"范围两端之间分隔图标的 Iconify 名称"})),timeGranularity:re(Le(...Dpe).annotations({title:"时间粒度",description:"可编辑到的最小时间单位;默认 `second`"})),hourCycle:re(Le(12,24).annotations({title:"小时制",description:"12 小时制或 24 小时制;默认 `24`"}))}).annotations({title:"TimeRangeField",description:"时间范围选择输入"})}function x1t(){return{rangeSeparatorIcon:"fluent:arrow-right-20-regular"}}const _1t=Object.freeze(Object.defineProperty({__proto__:null,HOUR_CYCLE_OPTIONS:Ope,TIME_GRANULARITIES:Dpe,TIME_GRANULARITY_OPTIONS:zpe,compatibilityDate:Ape,defaults:x1t,metadata:b1t,schema:Mpe,type:Epe},Symbol.toStringTag,{value:"Module"})),Ipe="com.shwfed.form.field.number",Rpe="2026-04-28",w1t={name:"数值输入",icon:"fluent:number-symbol-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}};function Vpe(t){const e=et({configure:t,resultType:"bool"}),n=et({configure:t,resultType:"number"});return Ge({type:Le(Ipe),compatibilityDate:Le(Rpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"输入为空时的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.age`;留空则为非受控字段,不写入表单状态"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"number"),precision:re(Wn.pipe(wi(),nh()).annotations({title:"小数位数",description:"保留的小数位数;留空表示不限制(任意精度)"})),roundingMode:re(Le("round","floor","ceil").annotations({title:"取整模式",description:"设置了「小数位数」时,失焦时按此模式将值取整;默认 `round`(四舍五入)"})),step:re(Wn.pipe(Cl()).annotations({title:"步长",description:"取值的最小步长;留空时不限制(任意精度)"})),valueAsString:re(_o.annotations({title:"以字符串读写",description:"开启后表单状态以字符串形式存储该值(适用于后端使用 `DECIMAL` / `BIGINT` 等需要原样回传的字段);关闭时若读到的是数值字符串也会被解析,但写回仍为数值。注意:输入时仍经过 JavaScript 浮点数,仅能在「装载-回传」未编辑场景下保留精度"})),min:re(n.annotations({title:"最小值",description:"允许输入的最小值表达式;留空时不限制下限"})),max:re(n.annotations({title:"最大值",description:"允许输入的最大值表达式;留空时不限制上限"}))}).annotations({title:"NumberField",description:"数值输入"})}const k1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Rpe,metadata:w1t,schema:Vpe,type:Ipe},Symbol.toStringTag,{value:"Module"})),Ppe="com.shwfed.form.field.numberrange",Fpe="2026-04-28",L4=ht.pipe(xn(1)),S1t=th(L4,L4).pipe(ll(([t,e])=>t!==e,{message:()=>"起始与结束绑定路径不能相同"})),C1t=oo(L4,S1t).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径;填写单个路径时写入 `[start, end]` 数值数组,例如 `score.range`;填写 `[起始路径, 结束路径]` 元组时分别写入两端;留空则为非受控字段"}),$1t={name:"数值范围",icon:"fluent:arrow-bidirectional-left-right-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}};function Npe(t){const e=et({configure:t,resultType:"bool"}),n=et({configure:t,resultType:"number"});return Ge({type:Le(Ppe),compatibilityDate:Le(Fpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),startPlaceholder:re(at.annotations({title:"起始占位符",description:"未输入起始数值时输入框中的占位文本"})),endPlaceholder:re(at.annotations({title:"结束占位符",description:"未输入结束数值时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(C1t),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时输入框仍然渲染但不可编辑"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"dyn"),precision:re(Wn.pipe(wi(),nh()).annotations({title:"小数位数",description:"保留的小数位数;留空表示不限制(任意精度)"})),roundingMode:re(Le("round","floor","ceil").annotations({title:"取整模式",description:"设置了「小数位数」时,失焦时按此模式将值取整;默认 `round`(四舍五入)"})),step:re(Wn.pipe(Cl()).annotations({title:"步长",description:"取值的最小步长;留空时不限制(任意精度)"})),valueAsString:re(_o.annotations({title:"以字符串读写",description:"开启后表单状态以字符串形式存储两端的值(适用于后端使用 `DECIMAL` / `BIGINT` 等需要原样回传的字段);关闭时若读到的是数值字符串也会被解析,但写回仍为数值。注意:输入时仍经过 JavaScript 浮点数,仅能在「装载-回传」未编辑场景下保留精度"})),min:re(n.annotations({title:"最小值",description:"允许输入的最小值表达式;同时作用于起始与结束输入"})),max:re(n.annotations({title:"最大值",description:"允许输入的最大值表达式;同时作用于起始与结束输入"})),rangeSeparatorIcon:re(ht.pipe(xn(1)).annotations({title:"范围分隔图标",description:"范围两端之间分隔图标的 Iconify 名称"}))}).annotations({title:"NumberRangeField",description:"数值范围输入"})}function T1t(){return{rangeSeparatorIcon:"fluent:arrow-right-20-regular"}}const E1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Fpe,defaults:T1t,metadata:$1t,schema:Npe,type:Ppe},Symbol.toStringTag,{value:"Module"})),Lpe="com.shwfed.form.field.switch",Bpe="2026-04-28",A1t={name:"开关",icon:"fluent:toggle-left-20-regular",w:{initial:4,min:4,max:1/0},h:{initial:2,min:2,max:2}};function Upe(t){const e=et({configure:t,resultType:"bool"});return Ge({type:Le(Lpe),compatibilityDate:Le(Bpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),trueLabel:re(at.annotations({title:"开启文案",description:"只读状态下,值为 `true` 时展示的文本;留空使用默认 `是`"})),falseLabel:re(at.annotations({title:"关闭文案",description:"只读状态下,值为 `false` 时展示的文本;留空使用默认 `否`"})),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.enabled`;留空则为非受控字段,不写入表单状态"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时开关仍然渲染但不可切换"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前值"})),derived:wr(t,"bool")}).annotations({title:"SwitchField",description:"布尔开关"})}const D1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Bpe,metadata:A1t,schema:Upe,type:Lpe},Symbol.toStringTag,{value:"Module"})),bu={left:"justify-start",center:"justify-center",right:"justify-end"},z1t=/\{\{(.*?)\}\}/gs;function O1t(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function Jn(t,e,n){return t.replace(z1t,(o,r)=>{const l=r.trim();if(!l)return"";try{return O1t(We(e(l,n)))}catch(a){return console.error("[shwfed-table] markdown interpolation failed",a),""}})}const qpe="com.shwfed.form.field.combobox.single",XF="2026-04-29",M1t={name:"下拉单选(硬编码)",icon:"fluent:chevron-down-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}};function QF(t){const e=Oo({configure:t}),n=Ge({kind:Le("text"),value:ht}),o=Ge({kind:Le("number"),value:Wn}),r=oo(n,o).annotations({title:"值",description:"选项绑定的值,可以是文本或数字"});return Ge({id:On.annotations({description:"选项唯一标识,用于稳定的 v-for key"}),label:e.annotations({title:"标签",description:"选项展示的本地化文本,支持 Markdown 与 `{{ form.foo }}` 插值"}),value:r,tooltip:re(e.annotations({title:"提示",description:"鼠标悬停在选项上时展示的本地化提示,支持 Markdown"}))}).annotations({title:"ComboboxSingleItem"})}function jpe(t){const e=et({configure:t,resultType:"bool"}),n=QF(t);return Ge({type:Le(qpe),compatibilityDate:Le(XF),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"未选中任何选项时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.role`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时下拉框仍然渲染但不可选择"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前选项的标签"})),derived:wr(t,"dyn"),items:Et(Bn(n).annotations({title:"选项",description:"下拉框可选项列表"}),{default:()=>[]})}).annotations({title:"ComboboxSingleField",description:"下拉单选输入"})}function I1t(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function zz(t){if(t instanceof Error)return t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}const R1t=(t,e)=>{const n=t;return qt(function*(){const o=yield*dy(e.$cel(n.options,{form:{}}),p=>new Error(`选项表达式求值失败:${zz(p)}`));if(!Array.isArray(o))return yield*$r(new Error(`选项表达式未返回列表(实际为 ${typeof o})`));const r=[];for(const p of o){const m=yield*dy(e.$cel(n.optionValue,{form:{},option:p}),g=>new Error(`选项值表达式求值失败:${zz(g)}`));let h;try{h=n.optionLabel.map(({locale:g,message:b})=>({locale:g,message:Jn(b,e.$cel,{form:{},option:p})}))}catch(g){return yield*$r(new Error(`选项标签插值失败:${zz(g)}`))}const v=typeof m=="number"&&Number.isFinite(m)?{kind:"number",value:m}:{kind:"text",value:m==null?"":String(m)};r.push({id:I1t(),label:h,value:v})}const{options:l,optionValue:a,optionLabel:u,compatibilityDate:c,...f}=n;return{...f,compatibilityDate:XF,items:r}})},V1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:XF,itemSchema:QF,metadata:M1t,migrate:R1t,schema:jpe,type:qpe},Symbol.toStringTag,{value:"Module"})),Hpe="com.shwfed.form.field.upload",Wpe="2026-05-12",P1t={name:"文件上传",icon:"fluent:cloud-arrow-up-20-regular",w:{initial:8,min:8,max:1/0},h:{initial:6,min:6,max:1/0,grow:!0}},pT={type:"dyn",label:"HTTP 响应体",description:"第一步 `请求` 的响应体(已解析 JSON);用于构造第二步下载请求"};function F1t(t){return e=>{t(e),e.registerVariable("json",pT.type,{description:pT.description})}}function Kpe(t){const e=et({configure:t,resultType:"bool"}),n=et({configure:t,resultType:"HttpRequest"}),o=et({configure:F1t(t),resultType:"HttpRequest"}),r=Oo({configure:t});return Ge({type:Le(Hpe),compatibilityDate:Le(Wpe),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),description:re(r.annotations({title:"说明",description:"展示在上传区域上方的多语言说明,支持 Markdown 与 `{{ form.foo }}` 插值"})),placeholder:re(at.annotations({title:"占位符",description:"上传区域为空时的提示文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `attachments`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时上传区域仍然渲染但不可操作"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以文件列表展示当前值,不允许增删"})),multiple:re(_o.annotations({title:"允许多文件",description:"开启后可一次选择/拖入多个文件;关闭时新文件会替换已选文件"})),accept:re(Bn(ht).annotations({title:"允许的文件类型",description:"允许上传的 MIME 类型列表;留空表示不限制"})),maxFileSize:re(Wn.pipe(Cl()).annotations({title:"单文件大小限制",description:"单个文件允许的最大字节数;超过此限制的文件会被拒绝"})),maxTotalSize:re(Wn.pipe(Cl()).annotations({title:"总大小限制",description:"所有已选文件累计的最大字节数;新增导致超出时会被拒绝"})),maxFiles:re(Wn.pipe(wi(),Cl()).annotations({title:"文件数量限制",description:"允许同时上传的最大文件数;达到上限后新增文件会被拒绝"})),template:re(Ge({request:n.annotations({title:"请求",description:"返回 `HttpRequest` 的 CEL 表达式。未配置「下载请求」时直接发起并下载其响应;配置了「下载请求」时作为获取下载凭据的第一步请求"}),download:re(o.annotations({title:"下载请求",description:"可选的第二步:返回 `HttpRequest` 的 CEL 表达式,可通过 `json` 引用第一步的响应体,例如用 `json.data.key` 构造真正的下载请求"}))}).annotations({title:"下载模板",description:"下载模板的请求配置;设置后会在上传区域旁渲染下载模板按钮"})),templateIcon:re(ht.pipe(xn(1)).annotations({title:"模板按钮图标",description:"Iconify 图标标识符,例如 `fluent:arrow-download-20-regular`;留空时使用默认图标"})),templateLabel:re(at.annotations({title:"模板按钮文本",description:"下载模板按钮上的本地化文本;留空时使用「下载模板」"}))}).annotations({title:"UploadField",description:"文件上传字段"})}const N1t=Object.freeze(Object.defineProperty({__proto__:null,JSON_VAR:pT,compatibilityDate:Wpe,metadata:P1t,schema:Kpe,type:Hpe},Symbol.toStringTag,{value:"Module"})),Gpe="com.shwfed.form.field.combobox.single.remote",Ype="2026-05-13",L1t={name:"下拉单选(远程)",icon:"fluent:cloud-arrow-down-20-regular",w:{initial:8,min:4,max:1/0},h:{initial:2,min:2,max:2}},mT={type:"dyn",label:"当前选项",description:"`选项` 表达式产出的数组中迭代到的单个元素"},hT={type:"dyn",label:"HTTP 响应体",description:"HTTP 响应体(已解析 JSON);请求失败或尚未完成时为 `null`"};function tK(t){return e=>{t(e),e.registerVariable("option",mT.type,{description:mT.description})}}function B1t(t){return e=>{t(e),e.registerVariable("json",hT.type,{description:hT.description})}}const U1t=t=>t==="dyn"||t.startsWith("list");function Jpe(t){const e=et({configure:t,resultType:"bool"}),n=et({configure:t,resultType:li}),o=et({configure:B1t(t),resultType:U1t}),r=et({configure:tK(t),resultType:"dyn"}),l=Oo({configure:tK(t)});return Ge({type:Le(Gpe),compatibilityDate:Le(Ype),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),placeholder:re(at.annotations({title:"占位符",description:"未选中任何选项时输入框中的占位文本"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),orientation:re(vl),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.role`;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时下拉框仍然渲染但不可选择"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前选项的标签"})),derived:wr(t,"dyn"),request:n.annotations({title:"请求",description:"返回 `HttpRequest` 的 CEL 表达式;可访问 `form` 当前状态。表单状态变化后会重新拉取选项"}),options:o.annotations({title:"选项",description:"从 HTTP 响应体提取选项数组的 CEL 表达式;可访问 `form` 与 `json`。例:`json.data` 或 `json.items.map(x, { value: x.id, label: x.name })`"}),optionValue:Et(r.annotations({title:"选项值",description:"从当前 `option` 提取写入绑定的值;例:`option.value`"}),{default:()=>"option"}),optionLabel:Et(l.annotations({title:"选项标签",description:"每个选项展示的本地化文本,支持 `{{ string(option.foo) }}` 插值"}),{default:()=>[{locale:"zh",message:""}]})}).annotations({title:"ComboboxSingleRemoteField",description:"下拉单选输入(远程拉取选项)"})}const q1t=Object.freeze(Object.defineProperty({__proto__:null,JSON_VAR:hT,OPTION_VAR:mT,compatibilityDate:Ype,metadata:L1t,schema:Jpe,type:Gpe},Symbol.toStringTag,{value:"Module"})),Xpe="com.shwfed.form.field.list",Qpe="2026-05-13",j1t={name:"列表",icon:"fluent:list-20-regular",w:{initial:12,min:4,max:1/0},h:{initial:6,min:4,max:1/0,grow:!0},inlineConfig:!1};function Zpe(t){const e=et({configure:t,resultType:"bool"}),n=r=>{t(r);const l=new Set(r.getDefinitions().variables.map(a=>a.name));l.has("item")||r.registerVariable("item","dyn",{description:"当前列表项"}),l.has("index")||r.registerVariable("index","number",{description:"当前列表项索引,从 0 开始"})},o=HE(()=>Qve(n));return Ge({type:Le(Xpe),compatibilityDate:Le(Qpe),...Lo(t),label:re(at.annotations({title:"标签",description:"列表前展示的文本;留空则不渲染标签"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `members`;留空则为非受控字段,不写入表单状态"})),addLabel:re(at.annotations({title:"新增按钮文案",description:"留空使用默认 `新增`"})),removeLabel:re(at.annotations({title:"删除按钮文案",description:"留空使用默认 `删除`(仅作为辅助文字,按钮以图标展示)"})),reorderable:re(_o.annotations({title:"允许重排",description:"关闭后用户无法上下移动列表项;默认开启"})),min:re(Wn.pipe(wi(),nh()).annotations({title:"最少数量",description:"列表项数量的下限;低于该值时无法删除"})),max:re(Wn.pipe(wi(),Cl()).annotations({title:"最多数量",description:"列表项数量的上限;达到该值后无法新增"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时整个列表只读,不能新增/删除/重排"})),locale:re(at.annotations({title:"列表项摘要",description:"配置后每个列表项可折叠,折叠时展示此处文本渲染的行内 Markdown 作为摘要。支持 `{{ 表达式 }}` 插值,表达式为 CEL,可访问 `item`(当前项)、`index`(序号,从 0 开始)与 `form`"})),unit:o.annotations({identifier:"FormFieldListUnit",title:"列表项配置",description:"单个列表项的字段与布局;每个列表项都按此结构渲染一份"})}).pipe(ll(r=>r.min!=null&&r.max!=null&&r.min>r.max?"最少数量不能大于最多数量":!0)).annotations({title:"ListField",description:"可新增/删除/重排的同构子表单列表"})}function H1t(){return{unit:{fields:[],layouts:[{name:"默认",layout:{columns:1,placements:{}}}]}}}const W1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:Qpe,defaults:H1t,metadata:j1t,schema:Zpe,type:Xpe},Symbol.toStringTag,{value:"Module"})),eme="com.shwfed.form.field.checkbox.group",tme="2026-05-17",K1t={name:"复选框组",icon:"fluent:checkbox-checked-20-regular",w:{initial:8,min:2,max:1/0},h:{initial:2,min:2,max:2}};function ZF(t){const e=Oo({configure:t}),n=Ge({kind:Le("text"),value:ht}),o=Ge({kind:Le("number"),value:Wn}),r=oo(n,o).annotations({title:"值",description:"选项绑定的值,可以是文本或数字"});return Ge({id:On.annotations({description:"选项唯一标识,用于稳定的 v-for key"}),label:e.annotations({title:"标签",description:"选项展示的本地化文本,支持 Markdown 与 `{{ form.foo }}` 插值"}),value:r,tooltip:re(e.annotations({title:"提示",description:"展示在选项标签下方的本地化提示,支持 Markdown"}))}).annotations({title:"CheckboxGroupItem"})}function nme(t){const e=et({configure:t,resultType:"bool"}),n=ZF(t);return Ge({type:Le(eme),compatibilityDate:Le(tme),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.tags`;写入值为已勾选选项值的数组;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时复选框仍然渲染但不可勾选"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前已勾选选项的标签"})),derived:wr(t,"dyn"),items:Et(Bn(n).annotations({title:"选项",description:"复选框组可选项列表"}),{default:()=>[]})}).annotations({title:"CheckboxGroupField",description:"复选框组多选输入"})}const G1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:tme,itemSchema:ZF,metadata:K1t,schema:nme,type:eme},Symbol.toStringTag,{value:"Module"})),ome="com.shwfed.form.field.radio.group",rme="2026-05-17",Y1t={name:"单选框组",icon:"fluent:radio-button-20-regular",w:{initial:8,min:2,max:1/0},h:{initial:2,min:2,max:2}};function eN(t){const e=Oo({configure:t}),n=Ge({kind:Le("text"),value:ht}),o=Ge({kind:Le("number"),value:Wn}),r=oo(n,o).annotations({title:"值",description:"选项绑定的值,可以是文本或数字"});return Ge({id:On.annotations({description:"选项唯一标识,用于稳定的 v-for key"}),label:e.annotations({title:"标签",description:"选项展示的本地化文本,支持 Markdown 与 `{{ form.foo }}` 插值"}),value:r,tooltip:re(e.annotations({title:"提示",description:"展示在选项标签下方的本地化提示,支持 Markdown"}))}).annotations({title:"RadioGroupItem"})}function lme(t){const e=et({configure:t,resultType:"bool"}),n=eN(t);return Ge({type:Le(ome),compatibilityDate:Le(rme),...Lo(t),label:re(at.annotations({title:"标签",description:"字段前展示的文本;留空则不渲染标签"})),tooltip:re(at.annotations({title:"提示",description:"鼠标悬停在标签上时展示的说明"})),binding:re(ht.pipe(xn(1)).annotations({title:"绑定路径",description:"写入表单状态的 `dot-prop` 路径,例如 `user.role`;写入值为选中选项的值;留空则为非受控字段"})),disabled:re(e.annotations({title:"禁用条件",description:"返回 `true` 时单选框仍然渲染但不可选择"})),readonly:re(e.annotations({title:"只读条件",description:"返回 `true` 时仅以纯文本展示当前选中选项的标签"})),derived:wr(t,"dyn"),items:Et(Bn(n).annotations({title:"选项",description:"单选框组可选项列表"}),{default:()=>[]})}).annotations({title:"RadioGroupField",description:"单选框组单选输入"})}const J1t=Object.freeze(Object.defineProperty({__proto__:null,compatibilityDate:rme,itemSchema:eN,metadata:Y1t,schema:lme,type:ome},Symbol.toStringTag,{value:"Module"})),xg=Le("left","center","right").annotations({description:"对齐方式"});function ph(){return{id:On.annotations({description:"列唯一标识"}),groupId:re(On).annotations({description:"所属列分组标识,未设置时为顶层列"})}}function ss(t){return{...ph(),title:at.annotations({title:"名称",description:"列标题"}),accessor:ar(t).annotations({title:"路径",description:"行数据访问 CEL 表达式,例如 `row.user.name`"}),enableSorting:re(_o.annotations({title:"允许排序",description:ol`
|
|
168
166
|
显示排序按钮:
|
|
169
167
|
|
|
@@ -194,13 +192,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
194
192
|
`)}function $e(le,ee){if(e.value.options.kind!=="static")return;const oe=ee.split(`
|
|
195
193
|
`).map(K=>K.trim()).filter(Boolean);if(oe.length===0){const K=e.value.options.items[le];if(!K)return;const{keywords:Y,...R}=K,U=[...e.value.options.items];U[le]=R,_({items:U})}else W(le,{keywords:oe})}return(le,ee)=>(S(),J("div",SIt,[H("div",CIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:用户角色","onUpdate:modelValue":ee[0]||(ee[0]=oe=>{const K=String(oe??"");e.value={...e.value,displayName:K.length>0?K:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:"写入表单状态的嵌套键路径,使用 `.` 分隔,例如 `user.roles`;写入值为已选项 `value` 组成的数组",block:"",class:"prose prose-sm prose-zinc"})]),default:d(()=>[D(" "+A(o("binding")),1)]),_:1}),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":ee[1]||(ee[1]=oe=>v.value=oe),placeholder:"例:user.roles",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",$It,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":ee[2]||(ee[2]=oe=>e.value={...e.value,label:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field placeholder","model-value":e.value.placeholder,"onUpdate:modelValue":ee[3]||(ee[3]=oe=>e.value={...e.value,placeholder:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":ee[4]||(ee[4]=oe=>e.value={...e.value,tooltip:oe})},null,8,["model-value"])]),_:1})]),H("div",TIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":ee[5]||(ee[5]=oe=>e.value={...e.value,orientation:oe})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),oe=>(S(),B(i(Fn),{key:oe.value,value:oe.value},{default:d(()=>[D(A(oe.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:"选项可以是静态配置的固定列表,也可以由 CEL 表达式或远程接口产出",block:"",class:"prose prose-sm prose-zinc"})]),default:d(()=>[ee[18]||(ee[18]=D(" 选项来源 ",-1))]),_:1}),s(i(vc),{"model-value":g.value,"onUpdate:modelValue":ee[11]||(ee[11]=oe=>{(oe==="static"||oe==="remote")&&y(oe)})},{default:d(()=>[s(i(gc),null,{default:d(()=>[s(i(jl),{value:"static"},{default:d(()=>[...ee[19]||(ee[19]=[D(" 静态 ",-1)])]),_:1}),s(i(jl),{value:"remote"},{default:d(()=>[...ee[20]||(ee[20]=[D(" 远程 ",-1)])]),_:1})]),_:1}),s(i(ql),{value:"static",class:"outline-none"},{default:d(()=>[H("div",EIt,[(S(!0),J(Me,null,Ze(N.value,(oe,K)=>(S(),J("div",{key:oe.id,"data-slot":"combobox-multi-item",class:"relative pt-8 grid grid-cols-2 gap-3 rounded border border-zinc-200 bg-zinc-50/40 p-3"},[s(i(ot),{variant:"destructive",size:"icon-xs","data-slot":"combobox-multi-item-delete","aria-label":"删除选项",class:"absolute right-2 top-2 z-10",onClick:Y=>L(K)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["onClick"]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("label")),1)]),_:2},[u("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"combobox option label","model-value":oe.label,"onUpdate:modelValue":Y=>ie(K,Y)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("value")),1)]),_:2},[u("value")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("value"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Ye),{align:"inline-start"},{default:d(()=>[s(i(Wo),null,{default:d(()=>[s(i(Go),{"as-child":""},{default:d(()=>[s(i(ot),{size:"icon-sm","as-child":""},{default:d(()=>[H("button",AIt,[s(i(de),{icon:oe.value.kind==="number"?"fluent:number-symbol-20-regular":"fluent:textbox-20-regular"},null,8,["icon"])])]),_:2},1024)]),_:2},1024),s(i(Ko),{align:"start"},{default:d(()=>[s(i(Mn),{onSelect:Y=>F(K,"text")},{default:d(()=>[s(i(de),{icon:"fluent:textbox-20-regular"}),ee[21]||(ee[21]=H("span",null,"文本",-1))]),_:1},8,["onSelect"]),s(i(Mn),{onSelect:Y=>F(K,"number")},{default:d(()=>[s(i(de),{icon:"fluent:number-symbol-20-regular"}),ee[22]||(ee[22]=H("span",null,"数字",-1))]),_:1},8,["onSelect"])]),_:2},1024)]),_:2},1024)]),_:2},1024),oe.value.kind==="text"?(S(),B(i(Xe),{key:0,"model-value":oe.value.value,placeholder:"例:admin","onUpdate:modelValue":Y=>j(K,String(Y??""))},null,8,["model-value","onUpdate:modelValue"])):(S(),B(i(jt),{key:1,"model-value":oe.value.value,"onUpdate:modelValue":Y=>te(K,Y)},null,8,["model-value","onUpdate:modelValue"]))]),_:2},1024)]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("tooltip")),1)]),_:2},[u("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"combobox option tooltip","model-value":oe.tooltip,"onUpdate:modelValue":Y=>ve(K,Y)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("keywords")),1)]),_:2},[u("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ep),{"data-slot":"combobox-multi-item-keywords",placeholder:"每行一个关键词","model-value":ge(oe),"onUpdate:modelValue":Y=>$e(K,String(Y??""))},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024)]))),128)),s(i(wn),{type:"button","data-slot":"combobox-multi-add-item",class:"w-full justify-center",onClick:Z},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),ee[23]||(ee[23]=H("span",null,"增加选项",-1))]),_:1})])]),_:1}),s(i(ql),{value:"remote",class:"outline-none"},{default:d(()=>[H("div",DIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("request")),1)]),_:2},[p("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:w.value,"onUpdate:modelValue":ee[6]||(ee[6]=oe=>w.value=oe),placeholder:"如 http.get('/api/roles');留空则不发起请求","result-type":"HttpRequest",multiline:""},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("options")),1)]),_:2},[p("options")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("options"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:$.value,"onUpdate:modelValue":ee[7]||(ee[7]=oe=>$.value=oe),placeholder:"如 json.data 或 [{value: 'a', label: 'A'}]","result-type":"dyn","extra-vars":h,multiline:""},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionValue")),1)]),_:2},[p("optionValue")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionValue"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:C.value,"onUpdate:modelValue":ee[8]||(ee[8]=oe=>C.value=oe),placeholder:"如 option.value","result-type":"dyn","extra-vars":m},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionLabel")),1)]),_:2},[p("optionLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":E.value,markdown:"","translate-hint":"combobox option label","onUpdate:modelValue":ee[9]||(ee[9]=oe=>E.value=oe)},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionKeywords")),1)]),_:2},[p("optionKeywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionKeywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:z.value,"onUpdate:modelValue":ee[10]||(ee[10]=oe=>z.value=oe),placeholder:"如 [option.code, option.pinyin]","result-type":"list","extra-vars":m},null,8,["modelValue"])]),_:1})])]),_:1})]),_:1},8,["model-value"])]),_:1}),H("div",zIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[12]||(ee[12]=oe=>e.value={...e.value,required:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[13]||(ee[13]=oe=>e.value={...e.value,hidden:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时下拉框仍然渲染但不可选择",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[14]||(ee[14]=oe=>e.value={...e.value,disabled:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已选项的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[15]||(ee[15]=oe=>e.value={...e.value,readonly:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.category","onUpdate:modelValue":ee[16]||(ee[16]=oe=>e.value={...e.value,derived:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":ee[17]||(ee[17]=oe=>e.value={...e.value,validations:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1})]))}}),MIt={class:"flex flex-col gap-3"},IIt={class:"grid grid-cols-2 gap-3"},RIt={class:"grid grid-cols-3 gap-3"},VIt={class:"grid grid-cols-3 gap-3"},PIt={class:"flex flex-col gap-3 pt-3"},FIt={type:"button","data-slot":"combobox-single-item-kind-trigger",class:"text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5","aria-label":"切换值类型"},NIt={class:"grid grid-cols-2 gap-x-6 gap-y-4 pt-3"},LIt={class:"grid grid-cols-3 gap-3"},BIt=ae({name:"ShwfedComboboxSingleFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=wve(()=>{}),o=le=>an(n,le)??le,r=le=>sn(n,le),l=WN(()=>{}),a=le=>an(l,le)??le,u=le=>sn(l,le),c=KN(()=>{}),f=le=>an(c,le)??le,p=le=>sn(c,le),m={option:{type:"dyn",label:"当前选项"}},h={json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},v=T({get:()=>e.value.binding??"",set:le=>{const ee=le.trim();if(ee.length===0){const{binding:oe,...K}=e.value;e.value=K}else e.value={...e.value,binding:ee}}}),g=T(()=>e.value.options.kind);function b(){return{kind:"static",items:[]}}function x(){return{kind:"remote",request:"",options:"",optionValue:"option",optionLabel:[{locale:"zh",message:""}]}}function y(le){e.value.options.kind!==le&&(e.value={...e.value,options:le==="static"?b():x()})}function _(le){e.value.options.kind==="static"&&(e.value={...e.value,options:{...e.value.options,...le}})}function k(le){e.value.options.kind==="remote"&&(e.value={...e.value,options:{...e.value.options,...le}})}const w=T({get:()=>e.value.options.kind==="remote"?e.value.options.request??"":"",set:le=>{if(e.value.options.kind==="remote")if(le===""){const{request:ee,...oe}=e.value.options;e.value={...e.value,options:oe}}else k({request:le})}}),$=T({get:()=>e.value.options.kind==="remote"?e.value.options.options:"",set:le=>k({options:le})}),C=T({get:()=>e.value.options.kind==="remote"?e.value.options.optionValue:"option",set:le=>k({optionValue:le})}),E=T({get:()=>e.value.options.kind==="remote"?e.value.options.optionLabel:[{locale:"zh",message:""}],set:le=>k({optionLabel:le})}),z=T({get:()=>e.value.options.kind==="remote"?e.value.options.optionKeywords??"":"",set:le=>{if(e.value.options.kind==="remote")if(le===""){const{optionKeywords:ee,...oe}=e.value.options;e.value={...e.value,options:oe}}else k({optionKeywords:le})}}),N=T(()=>e.value.options.kind==="static"?e.value.options.items:[]);function P(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,le=>{const ee=Math.random()*16|0;return(le==="x"?ee:ee&3|8).toString(16)})}function Q(){return{id:P(),label:[{locale:"zh",message:""}],value:{kind:"text",value:""}}}function W(le,ee){if(e.value.options.kind!=="static")return;const oe=[...e.value.options.items],K=oe[le];K&&(oe[le]={...K,...ee},_({items:oe}))}function Z(){e.value.options.kind==="static"&&_({items:[...e.value.options.items,Q()]})}function L(le){if(e.value.options.kind!=="static")return;const ee=[...e.value.options.items];ee.splice(le,1),_({items:ee})}function F(le,ee){if(e.value.options.kind!=="static")return;const oe=e.value.options.items[le];!oe||oe.value.kind===ee||W(le,{value:ee==="text"?{kind:"text",value:""}:{kind:"number",value:0}})}function j(le,ee){W(le,{value:{kind:"text",value:ee}})}function te(le,ee){W(le,{value:{kind:"number",value:typeof ee=="number"&&Number.isFinite(ee)?ee:0}})}function ie(le,ee){W(le,{label:ee})}function ve(le,ee){if(e.value.options.kind!=="static")return;if(!ee||ee.every(K=>K.message.trim().length===0)){const K=e.value.options.items[le];if(!K)return;const{tooltip:Y,...R}=K,U=[...e.value.options.items];U[le]=R,_({items:U})}else W(le,{tooltip:ee})}function ge(le){return(le.keywords??[]).join(`
|
|
196
194
|
`)}function $e(le,ee){if(e.value.options.kind!=="static")return;const oe=ee.split(`
|
|
197
|
-
`).map(K=>K.trim()).filter(Boolean);if(oe.length===0){const K=e.value.options.items[le];if(!K)return;const{keywords:Y,...R}=K,U=[...e.value.options.items];U[le]=R,_({items:U})}else W(le,{keywords:oe})}return(le,ee)=>(S(),J("div",MIt,[H("div",IIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:用户角色","onUpdate:modelValue":ee[0]||(ee[0]=oe=>{const K=String(oe??"");e.value={...e.value,displayName:K.length>0?K:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:"写入表单状态的嵌套键路径,使用 `.` 分隔,例如 `user.role`",block:"",class:"prose prose-sm prose-zinc"})]),default:d(()=>[D(" "+A(o("binding")),1)]),_:1}),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":ee[1]||(ee[1]=oe=>v.value=oe),placeholder:"例:user.role",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",RIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":ee[2]||(ee[2]=oe=>e.value={...e.value,label:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field placeholder","model-value":e.value.placeholder,"onUpdate:modelValue":ee[3]||(ee[3]=oe=>e.value={...e.value,placeholder:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":ee[4]||(ee[4]=oe=>e.value={...e.value,tooltip:oe})},null,8,["model-value"])]),_:1})]),H("div",VIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":ee[5]||(ee[5]=oe=>e.value={...e.value,orientation:oe})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),oe=>(S(),B(i(Fn),{key:oe.value,value:oe.value},{default:d(()=>[D(A(oe.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:"选项可以是静态配置的固定列表,也可以由 CEL 表达式或远程接口产出",block:"",class:"prose prose-sm prose-zinc"})]),default:d(()=>[ee[18]||(ee[18]=D(" 选项来源 ",-1))]),_:1}),s(i(vc),{"model-value":g.value,"onUpdate:modelValue":ee[11]||(ee[11]=oe=>{(oe==="static"||oe==="remote")&&y(oe)})},{default:d(()=>[s(i(gc),null,{default:d(()=>[s(i(jl),{value:"static"},{default:d(()=>[...ee[19]||(ee[19]=[D(" 静态 ",-1)])]),_:1}),s(i(jl),{value:"remote"},{default:d(()=>[...ee[20]||(ee[20]=[D(" 远程 ",-1)])]),_:1})]),_:1}),s(i(ql),{value:"static",class:"outline-none"},{default:d(()=>[H("div",PIt,[(S(!0),J(Me,null,Ze(N.value,(oe,K)=>(S(),J("div",{key:oe.id,"data-slot":"combobox-single-item",class:"relative pt-8 grid grid-cols-2 gap-3 rounded border border-zinc-200 bg-zinc-50/40 p-3"},[s(i(ot),{variant:"destructive",size:"icon-xs","data-slot":"combobox-single-item-delete","aria-label":"删除选项",class:"absolute right-2 top-2 z-10",onClick:Y=>L(K)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["onClick"]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("label")),1)]),_:2},[u("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"combobox option label","model-value":oe.label,"onUpdate:modelValue":Y=>ie(K,Y)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("value")),1)]),_:2},[u("value")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("value"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Ye),{align:"inline-start"},{default:d(()=>[s(i(Wo),null,{default:d(()=>[s(i(Go),{"as-child":""},{default:d(()=>[s(i(ot),{size:"icon-sm","as-child":""},{default:d(()=>[H("button",FIt,[s(i(de),{icon:oe.value.kind==="number"?"fluent:number-symbol-20-regular":"fluent:textbox-20-regular"},null,8,["icon"])])]),_:2},1024)]),_:2},1024),s(i(Ko),{align:"start"},{default:d(()=>[s(i(Mn),{onSelect:Y=>F(K,"text")},{default:d(()=>[s(i(de),{icon:"fluent:textbox-20-regular"}),ee[21]||(ee[21]=H("span",null,"文本",-1))]),_:1},8,["onSelect"]),s(i(Mn),{onSelect:Y=>F(K,"number")},{default:d(()=>[s(i(de),{icon:"fluent:number-symbol-20-regular"}),ee[22]||(ee[22]=H("span",null,"数字",-1))]),_:1},8,["onSelect"])]),_:2},1024)]),_:2},1024)]),_:2},1024),oe.value.kind==="text"?(S(),B(i(Xe),{key:0,"model-value":oe.value.value,placeholder:"例:admin","onUpdate:modelValue":Y=>j(K,String(Y??""))},null,8,["model-value","onUpdate:modelValue"])):(S(),B(i(jt),{key:1,"model-value":oe.value.value,"onUpdate:modelValue":Y=>te(K,Y)},null,8,["model-value","onUpdate:modelValue"]))]),_:2},1024)]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("tooltip")),1)]),_:2},[u("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"combobox option tooltip","model-value":oe.tooltip,"onUpdate:modelValue":Y=>ve(K,Y)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("keywords")),1)]),_:2},[u("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ep),{"data-slot":"combobox-single-item-keywords",placeholder:"每行一个关键词","model-value":ge(oe),"onUpdate:modelValue":Y=>$e(K,String(Y??""))},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024)]))),128)),s(i(wn),{type:"button","data-slot":"combobox-single-add-item",class:"w-full justify-center",onClick:Z},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),ee[23]||(ee[23]=H("span",null,"增加选项",-1))]),_:1})])]),_:1}),s(i(ql),{value:"remote",class:"outline-none"},{default:d(()=>[H("div",NIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("request")),1)]),_:2},[p("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:w.value,"onUpdate:modelValue":ee[6]||(ee[6]=oe=>w.value=oe),placeholder:"如 http.get('/api/roles');留空则不发起请求","result-type":"HttpRequest",multiline:""},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("options")),1)]),_:2},[p("options")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("options"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:$.value,"onUpdate:modelValue":ee[7]||(ee[7]=oe=>$.value=oe),placeholder:"如 json.data 或 [{value: 'a', label: 'A'}]","result-type":"dyn","extra-vars":h,multiline:""},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionValue")),1)]),_:2},[p("optionValue")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionValue"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:C.value,"onUpdate:modelValue":ee[8]||(ee[8]=oe=>C.value=oe),placeholder:"如 option.value","result-type":"dyn","extra-vars":m},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionLabel")),1)]),_:2},[p("optionLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":E.value,markdown:"","translate-hint":"combobox option label","onUpdate:modelValue":ee[9]||(ee[9]=oe=>E.value=oe)},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionKeywords")),1)]),_:2},[p("optionKeywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionKeywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:z.value,"onUpdate:modelValue":ee[10]||(ee[10]=oe=>z.value=oe),placeholder:"如 [option.code, option.pinyin]","result-type":"list","extra-vars":m},null,8,["modelValue"])]),_:1})])]),_:1})]),_:1},8,["model-value"])]),_:1}),H("div",LIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[12]||(ee[12]=oe=>e.value={...e.value,required:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[13]||(ee[13]=oe=>e.value={...e.value,hidden:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时下拉框仍然渲染但不可选择",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[14]||(ee[14]=oe=>e.value={...e.value,disabled:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前选项的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[15]||(ee[15]=oe=>e.value={...e.value,readonly:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.category","onUpdate:modelValue":ee[16]||(ee[16]=oe=>e.value={...e.value,derived:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":ee[17]||(ee[17]=oe=>e.value={...e.value,validations:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1})]))}}),UIt={class:"flex flex-col gap-3"},qIt={class:"grid grid-cols-2 gap-3"},jIt={class:"grid grid-cols-3 gap-3"},HIt={class:"grid grid-cols-3 gap-3"},WIt={class:"text-xs font-medium text-zinc-500"},KIt={class:"grid grid-cols-2 gap-3"},GIt={class:"grid grid-cols-2 gap-3"},YIt={class:"grid grid-cols-3 gap-3"},JIt={key:0,"data-slot":"cascade-description",class:"mt-1 border-t border-zinc-200 px-2 py-1.5 text-xs text-zinc-500"},XIt={class:"grid grid-cols-3 gap-3"},QIt=ae({name:"ShwfedTreeComboboxMultiFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=Sve(()=>{}),o=_=>an(n,_)??_,r=_=>sn(n,_),l=Ei(()=>{}),a=_=>an(l,_)??_,u=_=>sn(l,_),c={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},f={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},p=T({get:()=>e.value.binding??"",set:_=>{const k=_.trim();if(k.length===0){const{binding:w,...$}=e.value;e.value=$}else e.value={...e.value,binding:k}}}),m=[{value:"independent",label:"独立",description:"勾选 / 取消只作用于当前节点;父子互不影响"},{value:"cascade-down",label:"向下级联",description:"勾选父节点自动勾选其全部可选后代;取消时同理。父节点的勾选状态独立追踪"},{value:"cascade-both",label:"双向级联",description:"在向下级联基础上,父节点反映后代勾选状态(全选→选中、部分→半选、全不选→未选)"}],h=ue(!1),v=ue(null);Qe(h,_=>{v.value=_?e.value.cascade??"independent":null});const g=T(()=>m.find(_=>_.value===v.value)?.description);function b(_){e.value={...e.value,dataSource:{...e.value.dataSource,data:_}}}function x(_){if(_.trim().length===0){const{request:w,...$}=e.value.dataSource;e.value={...e.value,dataSource:$}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:_}}}function y(_,k){if(k.length===0){const{[_]:w,...$}=e.value;e.value=$}else e.value={...e.value,[_]:k}}return(_,k)=>(S(),J("div",UIt,[H("div",qIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":k[0]||(k[0]=w=>{const $=String(w??"");e.value={...e.value,displayName:$.length>0?$:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:p.value,"onUpdate:modelValue":k[1]||(k[1]=w=>p.value=w),placeholder:"例:user.departmentIds",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",jIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":k[2]||(k[2]=w=>e.value={...e.value,label:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":e.value.placeholder,"onUpdate:modelValue":k[3]||(k[3]=w=>e.value={...e.value,placeholder:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":k[4]||(k[4]=w=>e.value={...e.value,tooltip:w})},null,8,["model-value"])]),_:1})]),H("div",HIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":k[5]||(k[5]=w=>e.value={...e.value,orientation:w})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),w=>(S(),B(i(Fn),{key:w.value,value:w.value},{default:d(()=>[D(A(w.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),H("h3",WIt,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":x},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":f,"onUpdate:modelValue":b},null,8,["model-value"])]),_:1}),k[21]||(k[21]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",KIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[6]||(k[6]=w=>e.value={...e.value,nodeKey:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[7]||(k[7]=w=>e.value={...e.value,nodeChildren:w})},null,8,["model-value"])]),_:1})]),H("div",GIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":k[8]||(k[8]=w=>e.value={...e.value,nodeLabel:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":k[9]||(k[9]=w=>e.value={...e.value,nodeTooltip:w})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("keywords")),1)]),_:2},[r("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[10]||(k[10]=w=>y("keywords",w))},null,8,["model-value"])]),_:1}),H("div",YIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:!has(node.disabled) || !node.disabled","result-type":"bool","extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[11]||(k[11]=w=>y("nodeSelectable",w))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("cascade")),1)]),_:2},[r("cascade")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("cascade"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{open:h.value,"onUpdate:open":k[12]||(k[12]=w=>h.value=w),"model-value":e.value.cascade??"independent","onUpdate:modelValue":k[13]||(k[13]=w=>e.value={...e.value,cascade:w})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(),J(Me,null,Ze(m,w=>s(i(Fn),{key:w.value,value:w.value,onMouseenter:$=>v.value=w.value,onFocus:$=>v.value=w.value},{default:d(()=>[D(A(w.label),1)]),_:2},1032,["value","onMouseenter","onFocus"])),64)),g.value?(S(),J("div",JIt,A(g.value),1)):be("",!0)]),_:1})]),_:1},8,["open","model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":k[14]||(k[14]=w=>e.value={...e.value,expandAll:w})},null,8,["model-value"])])]),_:1})]),H("div",XIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[15]||(k[15]=w=>e.value={...e.value,required:w.length>0?w:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[16]||(k[16]=w=>y("hidden",w))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可勾选",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[17]||(k[17]=w=>y("disabled",w))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已勾选节点的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[18]||(k[18]=w=>y("readonly",w))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"list",placeholder:"例:form.defaultDepartmentIds","onUpdate:modelValue":k[19]||(k[19]=w=>e.value={...e.value,derived:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":k[20]||(k[20]=w=>e.value={...e.value,validations:w.length>0?w:void 0})},null,8,["model-value"])]),_:1})]))}}),ZIt={class:"flex flex-col gap-3"},e4t={class:"grid grid-cols-2 gap-3"},t4t={class:"grid grid-cols-3 gap-3"},n4t={class:"grid grid-cols-3 gap-3"},o4t={class:"text-xs font-medium text-zinc-500"},r4t={class:"grid grid-cols-2 gap-3"},l4t={class:"grid grid-cols-2 gap-3"},i4t={class:"grid grid-cols-2 gap-3"},a4t={class:"grid grid-cols-3 gap-3"},s4t=ae({name:"ShwfedTreeComboboxSingleFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=$ve(()=>{}),o=g=>an(n,g)??g,r=g=>sn(n,g),l=Ei(()=>{}),a=g=>an(l,g)??g,u=g=>sn(l,g),c={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},f={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},p=T({get:()=>e.value.binding??"",set:g=>{const b=g.trim();if(b.length===0){const{binding:x,...y}=e.value;e.value=y}else e.value={...e.value,binding:b}}});function m(g){e.value={...e.value,dataSource:{...e.value.dataSource,data:g}}}function h(g){if(g.trim().length===0){const{request:x,...y}=e.value.dataSource;e.value={...e.value,dataSource:y}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:g}}}function v(g,b){if(b.length===0){const{[g]:x,...y}=e.value;e.value=y}else e.value={...e.value,[g]:b}}return(g,b)=>(S(),J("div",ZIt,[H("div",e4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":b[0]||(b[0]=x=>{const y=String(x??"");e.value={...e.value,displayName:y.length>0?y:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:p.value,"onUpdate:modelValue":b[1]||(b[1]=x=>p.value=x),placeholder:"例:user.departmentId",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",t4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":b[2]||(b[2]=x=>e.value={...e.value,label:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":e.value.placeholder,"onUpdate:modelValue":b[3]||(b[3]=x=>e.value={...e.value,placeholder:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":b[4]||(b[4]=x=>e.value={...e.value,tooltip:x})},null,8,["model-value"])]),_:1})]),H("div",n4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":b[5]||(b[5]=x=>e.value={...e.value,orientation:x})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),x=>(S(),B(i(Fn),{key:x.value,value:x.value},{default:d(()=>[D(A(x.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),H("h3",o4t,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":h},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":f,"onUpdate:modelValue":m},null,8,["model-value"])]),_:1}),b[19]||(b[19]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",r4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[6]||(b[6]=x=>e.value={...e.value,nodeKey:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[7]||(b[7]=x=>e.value={...e.value,nodeChildren:x})},null,8,["model-value"])]),_:1})]),H("div",l4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":b[8]||(b[8]=x=>e.value={...e.value,nodeLabel:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":b[9]||(b[9]=x=>e.value={...e.value,nodeTooltip:x})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("keywords")),1)]),_:2},[r("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[10]||(b[10]=x=>v("keywords",x))},null,8,["model-value"])]),_:1}),H("div",i4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:!has(node.disabled) || !node.disabled","result-type":"bool","extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[11]||(b[11]=x=>v("nodeSelectable",x))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":b[12]||(b[12]=x=>e.value={...e.value,expandAll:x})},null,8,["model-value"])])]),_:1})]),H("div",a4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[13]||(b[13]=x=>e.value={...e.value,required:x.length>0?x:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[14]||(b[14]=x=>v("hidden",x))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可选择",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[15]||(b[15]=x=>v("disabled",x))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已选项的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[16]||(b[16]=x=>v("readonly",x))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":["string","number","dyn"],placeholder:"例:form.defaultDepartmentId","onUpdate:modelValue":b[17]||(b[17]=x=>e.value={...e.value,derived:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":b[18]||(b[18]=x=>e.value={...e.value,validations:x.length>0?x:void 0})},null,8,["model-value"])]),_:1})]))}}),u4t={class:"flex flex-col gap-3"},c4t={class:"grid grid-cols-2 gap-3"},d4t={class:"grid grid-cols-2 gap-3"},f4t={class:"text-xs font-medium text-zinc-500"},p4t={class:"grid grid-cols-2 gap-3"},m4t={class:"grid grid-cols-2 gap-3"},h4t={class:"grid grid-cols-3 gap-3"},v4t={class:"flex items-center gap-2"},g4t={class:"text-xs font-medium text-zinc-500"},y4t={key:0,class:"grid grid-cols-2 gap-3"},b4t={class:"grid grid-cols-3 gap-3"},x4t=ae({name:"ShwfedTreeMultiFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=Eve(()=>{}),o=C=>an(n,C)??C,r=C=>sn(n,C),l=Ei(()=>{}),a=C=>an(l,C)??C,u=C=>sn(l,C),c=n.fields.filter.from,f=C=>an(c,C)??C,p=C=>sn(c,C),m={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},h={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},v=T({get:()=>e.value.binding??"",set:C=>{const E=C.trim();if(E.length===0){const{binding:z,...N}=e.value;e.value=N}else e.value={...e.value,binding:E}}}),g=[{value:"independent",label:"独立"},{value:"cascade-down",label:"向下级联"},{value:"cascade-both",label:"双向级联"}];function b(C){e.value={...e.value,dataSource:{...e.value.dataSource,data:C}}}function x(C){if(C.trim().length===0){const{request:z,...N}=e.value.dataSource;e.value={...e.value,dataSource:N}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:C}}}function y(C,E){if(E.length===0){const{[C]:z,...N}=e.value;e.value=N}else e.value={...e.value,[C]:E}}const _=T(()=>e.value.filter);function k(C){if(C)e.value={...e.value,filter:{...e.value.filter??{},enabled:!0}};else{const{filter:E,...z}=e.value;e.value=z}}function w(C){const E=e.value.filter;if(!E)return;if(!C||C.every(N=>N.message.trim().length===0)){const{label:N,...P}=E;e.value={...e.value,filter:P}}else e.value={...e.value,filter:{...E,label:C}}}function $(C){const E=e.value.filter;if(E)if(C.length===0){const{keywords:z,...N}=E;e.value={...e.value,filter:N}}else e.value={...e.value,filter:{...E,keywords:C}}}return(C,E)=>(S(),J("div",u4t,[H("div",c4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":E[0]||(E[0]=z=>{const N=String(z??"");e.value={...e.value,displayName:N.length>0?N:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":E[1]||(E[1]=z=>v.value=z),placeholder:"例:user.departmentIds",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",d4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":E[2]||(E[2]=z=>e.value={...e.value,label:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":E[3]||(E[3]=z=>e.value={...e.value,tooltip:z})},null,8,["model-value"])]),_:1})]),H("h3",f4t,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":x},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":h,"onUpdate:modelValue":b},null,8,["model-value"])]),_:1}),E[17]||(E[17]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",p4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":m,class:"min-h-10","onUpdate:modelValue":E[4]||(E[4]=z=>e.value={...e.value,nodeKey:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":E[5]||(E[5]=z=>e.value={...e.value,nodeChildren:z})},null,8,["model-value"])]),_:1})]),H("div",m4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":E[6]||(E[6]=z=>e.value={...e.value,nodeLabel:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":E[7]||(E[7]=z=>e.value={...e.value,nodeTooltip:z})},null,8,["model-value"])]),_:1})]),H("div",h4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:node.kind == 'leaf'","result-type":"bool","extra-vars":m,class:"min-h-10","onUpdate:modelValue":E[8]||(E[8]=z=>y("nodeSelectable",z))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("cascade")),1)]),_:2},[r("cascade")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("cascade"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.cascade??"cascade-both","onUpdate:modelValue":E[9]||(E[9]=z=>e.value={...e.value,cascade:z})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(),J(Me,null,Ze(g,z=>s(i(Fn),{key:z.value,value:z.value},{default:d(()=>[D(A(z.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":E[10]||(E[10]=z=>e.value={...e.value,expandAll:z})},null,8,["model-value"])])]),_:1})]),H("div",v4t,[H("h3",g4t,A(o("filter")),1),s(i(Yo),{size:"sm","model-value":_.value?.enabled??!1,"aria-label":f("enabled"),"onUpdate:modelValue":k},null,8,["model-value","aria-label"])]),_.value?.enabled?(S(),J("div",y4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("label")),1)]),_:2},[p("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"tree filter input label","model-value":_.value.label,"onUpdate:modelValue":w},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("keywords")),1)]),_:2},[p("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":_.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":$},null,8,["model-value"])]),_:1})])):be("",!0),H("div",b4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[11]||(E[11]=z=>e.value={...e.value,required:z.length>0?z:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[12]||(E[12]=z=>y("hidden",z))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可勾选",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[13]||(E[13]=z=>y("disabled",z))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已勾选节点的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[14]||(E[14]=z=>y("readonly",z))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.defaultDepartmentIds","onUpdate:modelValue":E[15]||(E[15]=z=>e.value={...e.value,derived:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":E[16]||(E[16]=z=>e.value={...e.value,validations:z.length>0?z:void 0})},null,8,["model-value"])]),_:1})]))}}),_4t={class:"flex flex-col gap-3"},w4t={class:"grid grid-cols-2 gap-3"},k4t={class:"grid grid-cols-2 gap-3"},S4t={class:"text-xs font-medium text-zinc-500"},C4t={class:"grid grid-cols-2 gap-3"},$4t={class:"grid grid-cols-2 gap-3"},T4t={class:"grid grid-cols-2 gap-3"},E4t={class:"flex items-center gap-2"},A4t={class:"text-xs font-medium text-zinc-500"},D4t={key:0,class:"grid grid-cols-2 gap-3"},z4t={class:"grid grid-cols-3 gap-3"},O4t=ae({name:"ShwfedTreeSingleFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=zve(()=>{}),o=$=>an(n,$)??$,r=$=>sn(n,$),l=Ei(()=>{}),a=$=>an(l,$)??$,u=$=>sn(l,$),c=n.fields.filter.from,f=$=>an(c,$)??$,p=$=>sn(c,$),m={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},h={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},v=T({get:()=>e.value.binding??"",set:$=>{const C=$.trim();if(C.length===0){const{binding:E,...z}=e.value;e.value=z}else e.value={...e.value,binding:C}}});function g($){e.value={...e.value,dataSource:{...e.value.dataSource,data:$}}}function b($){if($.trim().length===0){const{request:E,...z}=e.value.dataSource;e.value={...e.value,dataSource:z}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:$}}}function x($,C){if(C.length===0){const{[$]:E,...z}=e.value;e.value=z}else e.value={...e.value,[$]:C}}const y=T(()=>e.value.filter);function _($){if($)e.value={...e.value,filter:{...e.value.filter??{},enabled:!0}};else{const{filter:C,...E}=e.value;e.value=E}}function k($){const C=e.value.filter;if(!C)return;if(!$||$.every(z=>z.message.trim().length===0)){const{label:z,...N}=C;e.value={...e.value,filter:N}}else e.value={...e.value,filter:{...C,label:$}}}function w($){const C=e.value.filter;if(C)if($.length===0){const{keywords:E,...z}=C;e.value={...e.value,filter:z}}else e.value={...e.value,filter:{...C,keywords:$}}}return($,C)=>(S(),J("div",_4t,[H("div",w4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":C[0]||(C[0]=E=>{const z=String(E??"");e.value={...e.value,displayName:z.length>0?z:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":C[1]||(C[1]=E=>v.value=E),placeholder:"例:user.departmentId",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",k4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":C[2]||(C[2]=E=>e.value={...e.value,label:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":C[3]||(C[3]=E=>e.value={...e.value,tooltip:E})},null,8,["model-value"])]),_:1})]),H("h3",S4t,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":b},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":h,"onUpdate:modelValue":g},null,8,["model-value"])]),_:1}),C[16]||(C[16]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",C4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":m,class:"min-h-10","onUpdate:modelValue":C[4]||(C[4]=E=>e.value={...e.value,nodeKey:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":C[5]||(C[5]=E=>e.value={...e.value,nodeChildren:E})},null,8,["model-value"])]),_:1})]),H("div",$4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":C[6]||(C[6]=E=>e.value={...e.value,nodeLabel:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":C[7]||(C[7]=E=>e.value={...e.value,nodeTooltip:E})},null,8,["model-value"])]),_:1})]),H("div",T4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:node.kind == 'leaf'","result-type":"bool","extra-vars":m,class:"min-h-10","onUpdate:modelValue":C[8]||(C[8]=E=>x("nodeSelectable",E))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":C[9]||(C[9]=E=>e.value={...e.value,expandAll:E})},null,8,["model-value"])])]),_:1})]),H("div",E4t,[H("h3",A4t,A(o("filter")),1),s(i(Yo),{size:"sm","model-value":y.value?.enabled??!1,"aria-label":f("enabled"),"onUpdate:modelValue":_},null,8,["model-value","aria-label"])]),y.value?.enabled?(S(),J("div",D4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("label")),1)]),_:2},[p("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"tree filter input label","model-value":y.value.label,"onUpdate:modelValue":k},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("keywords")),1)]),_:2},[p("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":y.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":w},null,8,["model-value"])]),_:1})])):be("",!0),H("div",z4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[10]||(C[10]=E=>e.value={...e.value,required:E.length>0?E:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[11]||(C[11]=E=>x("hidden",E))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可勾选",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[12]||(C[12]=E=>x("disabled",E))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已勾选节点的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[13]||(C[13]=E=>x("readonly",E))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.defaultDepartmentIds","onUpdate:modelValue":C[14]||(C[14]=E=>e.value={...e.value,derived:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":C[15]||(C[15]=E=>e.value={...e.value,validations:E.length>0?E:void 0})},null,8,["model-value"])]),_:1})]))}}),M4t=ae({name:"ShwfedMarkdownFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=(u,c)=>Dt(u,{...Pt(r),...c}),a=T(()=>{const u=Ke(e.config.content,n.value)??"";return u?Jn(u,l,{form:o.value??{}}):""});return(u,c)=>a.value?(S(),B(i(O),{key:0,source:a.value,block:"",class:"prose prose-sm prose-zinc max-w-none"},null,8,["source"])):be("",!0)}}),I4t=/\{\{([\s\S]*?)\}\}/g;function QN(t,e){return t.replace(I4t,(n,o)=>{const r=o.trim();return r.length===0?"":e(r)})}const Rve=Symbol("shwfed-form-validation");function R4t(t){const e=ue(!1),n=new Map;function o(){const l=[];for(const a of n.values())l.push(...a.results());return l}const r={revealed:e,reveal:()=>{e.value=!0},register:(l,a)=>{const u=Symbol("field");return n.set(u,{fieldId:l,results:a}),()=>{n.delete(u)}},async validate(){t.flush(),await t.seeded,await t.settled(),await Vt();const l=o();return r.reveal(),l.every(a=>a.severity!=="error")},resultsFor(l){const a=new Set(l),u=[];for(const c of n.values())a.has(c.fieldId())&&u.push(...c.results());return u}};return Tr(Rve,r),r}function Vve(){return Yn(Rve,void 0)}const pK={zh:"请填写此字段",ja:"この項目を入力してください",en:"Please fill in this field",ko:"이 항목을 입력해 주세요"};function V4t(t){return pK[t]??pK.zh}function P4t(t){return t==null||t===""||Array.isArray(t)&&t.length===0}function el(t){const{getAt:e,dirty:n}=Xn(),o=Vve();function r(m){if(!m)return!1;try{return We(t.$cel(m))}catch{return!1}}const l=T(()=>r(t.config().required));function a(m){const h=Ke(m,t.locale())??"";return h?QN(h,v=>{try{const g=We(t.$cel(v));return g==null?"":String(g)}catch{return""}}):""}const u=T(()=>{const m=t.config(),h=[];return typeof m.binding=="string"&&l.value&&P4t(e(m.binding))&&h.push({severity:"error",message:V4t(t.locale()),ruleIndex:-1}),(m.validations??[]).forEach((g,b)=>{if(!r(g.when))return;const x=g.warning?"warning":"error";h.push({severity:x,message:a(g.message),ruleIndex:b})}),h});if(o){const m=o.register(t.fieldId,()=>u.value);Um(m)}const c=T(()=>u.value.filter(m=>m.severity==="error").map(m=>m.message)),f=T(()=>u.value.filter(m=>m.severity==="warning").map(m=>m.message)),p=T(()=>{if(o?.revealed.value)return!0;const m=t.config().binding;return typeof m=="string"&&n.value.has(m)});return{isRequired:l,errors:c,warnings:f,visible:p}}const Pve=Symbol("shwfed-form-readonly"),F4t=ue(!1);function N4t(t){Tr(Pve,t)}function kr(){return Yn(Pve,F4t)}const L4t={key:0,"aria-hidden":"true",class:"text-red-600"},B4t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},U4t=ae({name:"ShwfedTextFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=(C,E)=>Dt(C,{...Pt(r),...E}),a=T(()=>Ke(e.config.label,n.value)),u=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),c=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function f(C,E){if(!C)return!1;try{return We(l(C,{form:o.value??{}}))}catch(z){return console.error(`[shwfed-form] failed to evaluate ${E} for ${e.fieldId}:`,z),!1}}const p=T(()=>f(e.config.disabled,"disabled")),m=kr(),h=T(()=>e.config.readonly!=null?f(e.config.readonly,"readonly"):m.value),v=T(()=>h.value||e.config.derived?.mode==="formula"),{draft:g,commit:b}=Pb({binding:()=>e.config.binding,fromState:C=>C==null?"":String(C),toState:C=>C.length===0?null:C}),{isRequired:x,errors:y,warnings:_,visible:k}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:l,locale:()=>n.value}),w=T(()=>!p.value&&g.value.length>0);function $(){g.value="",b()}return(C,E)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":p.value||void 0},{default:d(()=>[a.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a.value),1),i(x)?(S(),J("span",L4t," *")):be("",!0)]),_:2},[c.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:c.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),v.value?(S(),J("div",B4t,A(i(g)||"—"),1)):(S(),B(i(Fe),{key:2,class:"group/text-field"},{default:d(()=>[s(i(Xe),{id:t.fieldId,modelValue:i(g),"onUpdate:modelValue":E[0]||(E[0]=z=>Kt(g)?g.value=z:null),placeholder:u.value,disabled:p.value,onBlur:i(b),onKeydown:fr(i(b),["enter"])},null,8,["id","modelValue","placeholder","disabled","onBlur","onKeydown"]),w.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/text-field:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"text-field-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:E[1]||(E[1]=lt(()=>{},["prevent"])),onClick:lt($,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1})),i(k)?(S(),B(i(Xr),{key:3,errors:i(y),warnings:i(_)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),q4t={key:0,"aria-hidden":"true",class:"text-red-600"},j4t={key:1,class:"min-h-9 py-1.5 text-sm whitespace-pre-wrap text-zinc-700"},H4t=ae({name:"ShwfedTextareaFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=($,C)=>Dt($,{...Pt(r),...C}),a=T(()=>Ke(e.config.label,n.value)),u=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),c=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),f=T(()=>e.config.maxLength);function p($,C){if(!$)return!1;try{return We(l($,{form:o.value??{}}))}catch(E){return console.error(`[shwfed-form] failed to evaluate ${C} for ${e.fieldId}:`,E),!1}}const m=T(()=>p(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?p(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula"),{draft:b,commit:x}=Pb({binding:()=>e.config.binding,fromState:$=>$==null?"":String($),toState:$=>$}),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:l,locale:()=>n.value});return($,C)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[a.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a.value),1),i(y)?(S(),J("span",q4t," *")):be("",!0)]),_:2},[c.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:c.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",j4t,A(i(b)||"—"),1)):(S(),B(i(Fe),{key:2},{default:d(()=>[s(i(Nue),{id:t.fieldId,modelValue:i(b),"onUpdate:modelValue":C[0]||(C[0]=E=>Kt(b)?b.value=E:null),placeholder:u.value,disabled:m.value,maxlength:f.value,onBlur:i(x)},null,8,["id","modelValue","placeholder","disabled","maxlength","onBlur"]),f.value!=null?(S(),B(i(Ye),{key:0,align:"block-end"},{default:d(()=>[s(i(Vr),{class:"tabular-nums"},{default:d(()=>[D(A(i(b).length)+" / "+A(f.value),1)]),_:1})]),_:1})):be("",!0)]),_:1})),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),W4t=ae({name:"ShwfedActionsFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,n=T(()=>({kind:"shwfed.component.action",size:"default",gap:e.config.gap,style:e.config.style,groups:e.config.groups.map(o=>({...o,variant:o.variant??"default"})),items:e.config.items}));return(o,r)=>(S(),B(Q3,{config:n.value},null,8,["config"]))}}),K4t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},G4t=ae({name:"ShwfedComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-placeholder":"请选择","combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项"},en:{"combobox-single-placeholder":"Select…","combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches"},ja:{"combobox-single-placeholder":"選択してください","combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(L,F)=>Dt(L,{...Pt(u),...F}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-single-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(L,F){if(!L)return!1;try{return We(c(L,{form:r.value??{}}))}catch(j){return console.error(`[shwfed-form] failed to evaluate ${F} for ${e.fieldId}:`,j),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula");function y(L){try{return We(c(e.config.optionValue,{form:r.value??{},option:L}))}catch(F){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,F);return}}function _(L){const F=Ke(e.config.optionLabel,n.value)??"";return F?Jn(F,c,{form:r.value??{},option:L}):""}const k=T(()=>{let L;try{L=We(c(e.config.options,{form:r.value??{}}))}catch(F){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,F),[]}return Array.isArray(L)?L.map((F,j)=>({key:String(j),label:_(F),value:y(F)})):[]}),w=ue(void 0),$=T({get:()=>{const L=e.config.binding;return L==null?w.value:l(L)},set:L=>{const F=e.config.binding;if(F==null){w.value=L;return}a(F,L)}});function C(L,F){if(L===F)return!0;if(L==null||F==null)return!1;if(typeof L=="object"&&typeof F=="object")try{return JSON.stringify(L)===JSON.stringify(F)}catch{return!1}return!1}const E=T(()=>k.value.find(L=>C(L.value,$.value))),z=T(()=>E.value?.key),N=T(()=>E.value?.label??""),P=ue(!1);function Q(L){if(typeof L!="string")return;const F=k.value.find(j=>j.key===L);F&&($.value=F.value,Vt().then(()=>{P.value=!1}))}const W=T(()=>!v.value&&E.value!==void 0);function Z(){$.value=void 0,P.value=!1}return(L,F)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",K4t,A(N.value||"—"),1)):(S(),B(i(vr),{key:2,open:P.value,"onUpdate:open":F[1]||(F[1]=j=>P.value=j)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":N.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),W.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:F[0]||(F[0]=lt(()=>{},["prevent"])),onClick:lt(Z,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":z.value,disabled:v.value,"selection-behavior":"toggle","onUpdate:modelValue":Q},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(k.value,j=>(S(),B(i(Fr),{key:j.key,value:j.key},{default:d(()=>[D(A(j.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),Y4t={class:"w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10"},J4t={key:0,class:"text-sm font-medium",style:{"text-autospace":"normal"}},X4t={key:0,class:"grid grid-cols-4 gap-1 mt-4 w-full"},Q4t=["disabled","onClick"],Z4t={key:1,class:"grid grid-cols-4 gap-1 mt-4 w-full"},eRt=["disabled","onClick"],tRt={key:2,class:"flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"},eA=ae({name:"UiCalendar",__name:"Calendar",props:{defaultValue:{},defaultPlaceholder:{},placeholder:{},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{},isDateUnavailable:{},dir:{},nextPage:{},prevPage:{},modelValue:{default:void 0},multiple:{type:Boolean},disableDaysOutsideCurrentView:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},layout:{default:void 0}},emits:["update:modelValue","update:placeholder"],setup(t,{emit:e}){const n=t,o=e,r=Ut(n,"class","layout","placeholder"),l=zo(n,"placeholder",o,{passive:!0,defaultValue:n.defaultPlaceholder??op(As())}),a=o6(),{locale:u}=Bt({useScope:"global",inheritLocale:!0}),c=T(()=>n.locale??u.value??a.language.value??"en"),f=l2(c.value);Qe(c,g=>{f.setLocale(g)});const p=co(r,o),m=T(()=>{const g=a.language.value;if(!a.isSupported||!g)return;const b=new Intl.Locale(g);if("getWeekInfo"in b&&typeof b.getWeekInfo=="function")return b.getWeekInfo().firstDay}),h=T(()=>Math.floor(l.value.year/12)*12);function v(g){const b=n.isDateDisabled;return typeof b!="function"?!1:b(g)}return(g,b)=>(S(),B(i(oYe),Be(i(p),{placeholder:i(l),"onUpdate:placeholder":b[0]||(b[0]=x=>Kt(l)?l.value=x:null),"data-slot":"calendar","week-starts-on":m.value,"fixed-weeks":"",locale:c.value,class:i(dt)("p-3",n.class)}),{default:d(({grid:x,weekDays:y,date:_})=>[s(i(sRt),{class:nt(t.layout==="year"?"pt-2 pb-2":"pt-0")},{default:d(()=>[H("nav",Y4t,[s(i(dRt),{"prev-page":t.layout==="year"?k=>k.subtract({years:12}):t.layout==="month"?k=>k.subtract({years:1}):void 0},{default:d(()=>[we(g.$slots,"calendar-prev-icon")]),_:3},8,["prev-page"]),s(i(cRt),{"next-page":t.layout==="year"?k=>k.add({years:12}):t.layout==="month"?k=>k.add({years:1}):void 0},{default:d(()=>[we(g.$slots,"calendar-next-icon")]),_:3},8,["next-page"])]),we(g.$slots,"calendar-heading",{date:_},()=>[t.layout==="month"?(S(),J("span",J4t,A(i(f).custom(i(Sl)(_),{year:"numeric"})),1)):t.layout==="year"?(S(),J(Me,{key:1},[],64)):(S(),B(i(uRt),{key:2}))])]),_:2},1032,["class"]),t.layout==="month"?(S(),J("div",X4t,[(S(),J(Me,null,Ze(12,k=>H("button",{key:k,type:"button",disabled:v(new(i(Co))(i(l).year,k,1)),class:nt(i(dt)(i(mc)({variant:"ghost"}),"h-9 w-full rounded-md font-normal",t.modelValue&&!Array.isArray(t.modelValue)&&t.modelValue.year===i(l).year&&t.modelValue.month===k?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary)":"",v(new(i(Co))(i(l).year,k,1))?"text-zinc-500 opacity-50 cursor-default":"cursor-pointer")),onClick:w=>o("update:modelValue",new(i(Co))(i(l).year,k,1))},A(i(f).custom(i(Sl)(new(i(Co))(i(l).year,k,1)),{month:"short"})),11,Q4t)),64))])):t.layout==="year"?(S(),J("div",Z4t,[(S(),J(Me,null,Ze(12,k=>H("button",{key:k,type:"button",disabled:v(new(i(Co))(h.value+k-1,1,1)),class:nt(i(dt)(i(mc)({variant:"ghost"}),"h-9 w-full rounded-md font-normal",t.modelValue&&!Array.isArray(t.modelValue)&&t.modelValue.year===h.value+k-1?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary)":"",v(new(i(Co))(h.value+k-1,1,1))?"text-zinc-500 opacity-50 cursor-default":"cursor-pointer")),onClick:w=>o("update:modelValue",new(i(Co))(h.value+k-1,1,1))},A(h.value+k-1),11,eRt)),64))])):(S(),J("div",tRt,[(S(!0),J(Me,null,Ze(x,k=>(S(),B(i(rRt),{key:k.value.toString()},{default:d(()=>[s(i(iRt),null,{default:d(()=>[s(i(mK),null,{default:d(()=>[(S(!0),J(Me,null,Ze(y,w=>(S(),B(i(aRt),{key:w},{default:d(()=>[D(A(w),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),s(i(lRt),null,{default:d(()=>[(S(!0),J(Me,null,Ze(k.rows,(w,$)=>(S(),B(i(mK),{key:`weekDate-${$}`,class:"mt-2 w-full"},{default:d(()=>[(S(!0),J(Me,null,Ze(w,C=>(S(),B(i(nRt),{key:C.toString(),date:C},{default:d(()=>[s(i(oRt),{day:C,month:k.value},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))]))]),_:3},16,["placeholder","week-starts-on","locale","class"]))}}),nRt=ae({__name:"CalendarCell",props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(lYe),Be({"data-slot":"calendar-cell",class:i(dt)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),oRt=ae({__name:"CalendarCellTrigger",props:{day:{},month:{},asChild:{type:Boolean},as:{default:"button"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(aYe),Be({"data-slot":"calendar-cell-trigger",class:i(dt)(i(mc)({variant:"ghost"}),"size-8 rounded-full p-0 font-normal text-center transition-all duration-180 aria-selected:opacity-100 cursor-pointer","[&[data-today]:not([data-selected])]:font-semibold [&[data-today]:not([data-selected])]:text-(--primary)","data-selected:bg-(--primary) data-selected:opacity-100 data-selected:text-white data-selected:hover:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selected:hover:text-white","data-disabled:text-zinc-500 data-disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:hover:bg-transparent data-disabled:hover:text-zinc-500","data-unavailable:text-zinc-300 data-unavailable:line-through","data-outside-view:text-zinc-300",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),rRt=ae({__name:"CalendarGrid",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(uYe),Be({"data-slot":"calendar-grid",class:i(dt)("w-full border-collapse space-x-1",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),lRt=ae({__name:"CalendarGridBody",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,o)=>(S(),B(i(dYe),Be({"data-slot":"calendar-grid-body"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),iRt=ae({__name:"CalendarGridHead",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),B(i(pYe),Be({"data-slot":"calendar-grid-head"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),mK=ae({__name:"CalendarGridRow",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(hYe),Be({"data-slot":"calendar-grid-row",class:i(dt)("flex",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),aRt=ae({__name:"CalendarHeadCell",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(gYe),Be({"data-slot":"calendar-head-cell",class:i(dt)("text-zinc-700 rounded-md flex-1 font-normal text-[0.8rem]",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),sRt=ae({__name:"CalendarHeader",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(bYe),Be({"data-slot":"calendar-header",class:i(dt)("flex justify-center pt-1 relative items-center w-full px-8",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),uRt=ae({__name:"CalendarHeading",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(_Ye),Be({"data-slot":"calendar-heading",class:i(dt)("text-sm font-medium",e.class),style:{textAutospace:"normal"}},i(o)),{default:d(({headingValue:a})=>[we(r.$slots,"default",{headingValue:a},()=>[D(A(a),1)])]),_:3},16,["class"]))}}),cRt=ae({__name:"CalendarNextButton",props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(kYe),Be({"data-slot":"calendar-next-button",class:i(dt)(i(mc)({variant:"ghost",size:"sm"}),"bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-right-20-regular"})])]),_:3},16,["class"]))}}),dRt=ae({__name:"CalendarPrevButton",props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(CYe),Be({"data-slot":"calendar-prev-button",class:i(dt)(i(mc)({variant:"ghost",size:"sm"}),"bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-left-20-regular"})])]),_:3},16,["class"]))}}),fRt=ae({name:"UiDatePickerDatePanel",__name:"DatePickerDatePanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){if(Array.isArray(l)){o("update:modelValue",l[0]);return}o("update:modelValue",l)}return(l,a)=>(S(),B(i(eA),{"data-slot":"date-picker-date-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":r},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["class","model-value","default-placeholder","is-date-disabled"]))}}),Uc={Root:qXe,Header:tQe,Heading:oQe,Grid:YXe,Cell:HXe,Next:lQe,Prev:aQe,GridBody:XXe,GridRow:ZXe,CellTrigger:KXe},Up={Root:CQe,Ellipsis:wQe,First:TQe,Last:AQe,List:MQe,ListItem:RQe,Next:PQe,Prev:NQe},lu={Input:Het,Root:qet},qc={Root:htt,Header:Ttt,Heading:Att,Grid:_tt,Cell:gtt,Next:ztt,Prev:Mtt,GridBody:ktt,GridRow:Ctt,CellTrigger:btt},pRt={class:"border-zinc-200 flex items-center gap-2 border-t p-3"},mRt={key:1,class:"text-zinc-400 select-none"},hRt=ae({name:"UiDatePickerDateTimePanel",__name:"DatePickerDateTimePanel",props:{modelValue:{},isDateDisabled:{},granularity:{default:"second"},hourCycle:{default:24},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=T(()=>{const c=n.modelValue;if(c)return new Co(c.year,c.month,c.day)}),l=T(()=>{const c=n.modelValue;if(c)return new Ka(c.hour,c.minute,c.second)});function a(c){const f=Array.isArray(c)?c[0]:c;if(!f){o("update:modelValue",void 0);return}const p=n.modelValue,m="day"in f?f.day:1;o("update:modelValue",new xs(f.year,f.month,m,p?.hour??0,p?.minute??0,p?.second??0))}function u(c){if(!c){n.modelValue&&o("update:modelValue",new xs(n.modelValue.year,n.modelValue.month,n.modelValue.day,0,0,0));return}const f=c,p=n.modelValue;if(p){o("update:modelValue",new xs(p.year,p.month,p.day,f.hour,f.minute,f.second));return}const m=op(As());o("update:modelValue",new xs(m.year,m.month,m.day,f.hour,f.minute,f.second))}return(c,f)=>(S(),J("div",{"data-slot":"date-picker-datetime-panel",class:nt(i(dt)("flex flex-col",n.class))},[s(i(eA),{"model-value":r.value,"default-placeholder":r.value,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":a},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["model-value","default-placeholder","is-date-disabled"]),H("div",pRt,[s(i(de),{icon:"lucide:clock",class:"text-zinc-500 size-4 shrink-0"}),s(i(lu).Root,{"model-value":l.value,granularity:n.granularity,"hour-cycle":n.hourCycle,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 text-sm outline-none","onUpdate:modelValue":u},{default:d(({segments:p})=>[Array.isArray(p)?(S(!0),J(Me,{key:0},Ze(p,(m,h)=>(S(),J(Me,{key:`${m.part}-${h}`},[m.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:m.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(m.value),1)]),_:2},1032,["part"])):(S(),J("span",mRt,A(m.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle"])])],2))}}),vRt=ae({name:"UiDatePickerInput",inheritAttrs:!1,__name:"DatePickerInput",props:{modelValue:{},format:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},open:{type:Boolean},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e,l=ue(""),a=ue(!1);function u(){l.value=n.modelValue?Wr(n.modelValue,n.format):""}Qe(()=>[n.modelValue,n.format],()=>{a.value||u()},{immediate:!0});function c(){const v=l.value.trim();if(!v){n.modelValue!==void 0&&r("update:modelValue",void 0);return}const g=T3(v,n.format,n.modelValue??new Date);if(!zb(g)){u();return}r("update:modelValue",g)}function f(v){a.value=!0,r("focus",v)}function p(v){a.value=!1,c(),r("blur",v)}function m(){l.value="",r("update:modelValue",void 0),r("clear")}const h=T(()=>n.clearable&&!n.disabled&&!n.readonly&&n.modelValue!==void 0);return(v,g)=>(S(),B(i(Fe),Be(v.$attrs,{"data-slot":"date-picker-input","data-disabled":n.disabled?"true":void 0,"data-state":n.open?"open":void 0,class:i(dt)("group/date-picker-input",o.value,n.class)}),{default:d(()=>[n.prefixIcon?(S(),B(i(Ye),{key:0,align:"inline-start"},{default:d(()=>[s(i(de),{icon:n.prefixIcon},null,8,["icon"])]),_:1})):be("",!0),s(i(Xe),{"model-value":l.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,"onUpdate:modelValue":g[0]||(g[0]=b=>l.value=String(b)),onFocus:f,onBlur:p,onKeydown:fr(lt(c,["prevent"]),["enter"])},null,8,["model-value","placeholder","disabled","readonly","onKeydown"]),h.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:nt(i(dt)("[@media(hover:hover)]:opacity-0 transition-opacity","group-hover/date-picker-input:opacity-100 focus-within:opacity-100"))},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"date-picker-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:g[1]||(g[1]=lt(()=>{},["prevent"])),onClick:lt(m,["stop"])},{default:d(()=>[s(i(de),{icon:n.clearIcon},null,8,["icon"])]),_:1})]),_:1},8,["class"])):be("",!0)]),_:1},16,["data-disabled","data-state","class"]))}}),gRt=ae({name:"UiDatePickerMonthPanel",__name:"DatePickerMonthPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){if(Array.isArray(l)){o("update:modelValue",l[0]);return}o("update:modelValue",l)}return(l,a)=>(S(),B(i(eA),{layout:"month","data-slot":"date-picker-month-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":r},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["class","model-value","default-placeholder","is-date-disabled"]))}}),yRt={key:1,class:"text-zinc-400 select-none"},bRt=ae({name:"UiDatePickerTimeInput",inheritAttrs:!1,__name:"DatePickerTimeInput",props:{modelValue:{},granularity:{default:"second"},hourCycle:{default:24},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e,l=T(()=>n.clearable&&!n.disabled&&!n.readonly&&n.modelValue!==void 0);function a(c){r("update:modelValue",c??void 0)}function u(){r("update:modelValue",void 0),r("clear")}return(c,f)=>(S(),B(i(Fe),Be(c.$attrs,{"data-slot":"date-picker-time-input","data-disabled":n.disabled?"true":void 0,class:i(dt)("group/date-picker-input",o.value,n.class)}),{default:d(()=>[n.prefixIcon?(S(),B(i(Ye),{key:0,align:"inline-start"},{default:d(()=>[s(i(de),{icon:n.prefixIcon},null,8,["icon"])]),_:1})):be("",!0),s(i(lu).Root,{"data-slot":"input-group-control","model-value":n.modelValue,granularity:n.granularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","onUpdate:modelValue":a},{default:d(({segments:p})=>[Array.isArray(p)?(S(!0),J(Me,{key:0},Ze(p,(m,h)=>(S(),J(Me,{key:`${m.part}-${h}`},[m.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:m.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(m.value),1)]),_:2},1032,["part"])):(S(),J("span",yRt,A(m.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle","disabled","readonly"]),l.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:nt(i(dt)("[@media(hover:hover)]:opacity-0 transition-opacity","group-hover/date-picker-input:opacity-100 focus-within:opacity-100"))},{default:d(()=>[s(i(ot),{size:"icon-xs","as-child":""},{default:d(()=>[H("button",{type:"button","data-slot":"date-picker-clear",class:"text-zinc-500 transition-colors hover:text-zinc-700",tabindex:"-1",onMousedown:f[0]||(f[0]=lt(()=>{},["prevent"])),onClick:lt(u,["stop"])},[s(i(de),{icon:n.clearIcon},null,8,["icon"])],32)]),_:1})]),_:1},8,["class"])):be("",!0)]),_:1},16,["data-disabled","class"]))}}),xRt=ae({name:"UiDatePickerYearPanel",__name:"DatePickerYearPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){if(Array.isArray(l)){o("update:modelValue",l[0]);return}o("update:modelValue",l)}return(l,a)=>(S(),B(i(eA),{layout:"year","data-slot":"date-picker-year-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":r},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["class","model-value","default-placeholder","is-date-disabled"]))}}),_Rt=["onClick"],Fve=ae({name:"UiPickerShortcuts",__name:"PickerShortcuts",props:{items:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["select"],setup(t,{emit:e}){const n=t,o=e,r=o6(),l=T(()=>r.language.value?.split("-")[0]??"en");function a(u){return Ke(u,l.value)??""}return(u,c)=>(S(),J("div",{"data-slot":"picker-shortcuts",class:nt(i(dt)("border-zinc-200 flex flex-wrap items-center gap-1 border-t px-2 py-2 text-xs",n.class))},[(S(!0),J(Me,null,Ze(n.items,(f,p)=>(S(),J("button",{key:p,type:"button",class:"text-zinc-700 hover:bg-zinc-100 hover:text-(--primary) cursor-pointer rounded px-2 py-1",onClick:m=>o("select",p)},A(a(f.name)),9,_Rt))),128))],2))}}),K_={date:{display:"yyyy-MM-dd",value:"yyyy-MM-dd"},datetime:{display:"yyyy-MM-dd HH:mm:ss",value:"yyyy-MM-dd HH:mm:ss"},year:{display:"yyyy",value:"yyyy"},month:{display:"yyyy-MM",value:"yyyy-MM"},time:{display:"HH:mm:ss",value:"HH:mm:ss"}},wRt={class:"flex flex-col"},tA=ae({name:"UiDatePicker",inheritAttrs:!1,__name:"DatePicker",props:{modelValue:{},defaultValue:{},type:{default:"date"},format:{},valueFormat:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},disabledDate:{},timeGranularity:{default:"second"},hourCycle:{default:24},class:{type:[Boolean,null,String,Object,Array]},popoverClass:{type:[Boolean,null,String,Object,Array]},prefixIcon:{},clearIcon:{},shortcuts:{},size:{default:"md"}},emits:["update:modelValue","change","clear","focus","blur"],setup(t,{emit:e}){const n=t,o=e,r=zo(n,"modelValue",o,{passive:!0,defaultValue:n.defaultValue}),l=T(()=>n.valueFormat??K_[n.type].value),a=T(()=>n.format??K_[n.type].display);function u(P){if(P instanceof Ka){const Q=new Date(2e3,0,1);return Q.setHours(P.hour,P.minute,P.second,0),Q}return new Date(P.year,P.month-1,"day"in P?P.day:1,"hour"in P?P.hour:0,"hour"in P?P.minute:0,"hour"in P?P.second:0)}function c(P,Q){const W=P.getFullYear(),Z=P.getMonth()+1,L=P.getDate(),F=P.getHours(),j=P.getMinutes(),te=P.getSeconds();switch(Q){case"year":return new Co(W,1,1);case"month":return new Co(W,Z,1);case"datetime":return new xs(W,Z,L,F,j,te);case"time":return new Ka(F,j,te);default:return new Co(W,Z,L)}}const f=T(()=>{const P=r.value;if(!P)return;const Q=T3(P,l.value,new Date);if(zb(Q))return c(Q,n.type)});function p(P){const Q=P?Wr(u(P),l.value):void 0;Q!==r.value&&(r.value=Q,o("change",Q))}const m=T(()=>{const P=f.value;if(!(!P||P instanceof Ka))return u(P)}),h=T(()=>{const P=f.value;return P instanceof Ka?P:void 0}),v=T(()=>{const P=f.value;if(!(!P||P instanceof Ka))return P}),g=T(()=>{const P=f.value;if(!(!P||P instanceof Ka||!("hour"in P)))return P}),b=ue(!1),x=Xv("anchor-el");function y(P){return P instanceof Node?x.value?.contains(P)??!1:!1}function _(P){const W=P.detail?.originalEvent?.target??null;y(W)&&P.preventDefault()}function k(P){!n.disabled&&!n.readonly&&(b.value=!0),o("focus",P)}function w(P){o("blur",P)}function $(){b.value=!1,o("clear")}function C(P){if(!P){p(void 0);return}p(c(P,n.type))}function E(P){p(P)}function z(P,Q){p(P),Q&&(b.value=!1)}function N(P){const Q=n.shortcuts?.[P];if(!Q)return;const W=typeof Q.value=="function"?Q.value():Q.value;if(W===r.value){b.value=!1;return}r.value=W,o("change",W),b.value=!1}return(P,Q)=>(S(),J("div",{ref:"anchor-el","data-slot":"date-picker",class:nt(i(dt)("w-full",n.class))},[n.type==="time"?(S(),B(bRt,Be({key:0},P.$attrs,{"model-value":h.value,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,clearable:n.clearable,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,size:n.size,"onUpdate:modelValue":E,onClear:Q[0]||(Q[0]=W=>o("clear"))}),null,16,["model-value","granularity","hour-cycle","disabled","readonly","clearable","prefix-icon","clear-icon","size"])):(S(),B(i(vr),{key:1,open:b.value,"onUpdate:open":Q[6]||(Q[6]=W=>b.value=W)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(vRt,Be(P.$attrs,{"model-value":m.value,format:a.value,placeholder:n.placeholder,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly,open:b.value,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,size:n.size,"onUpdate:modelValue":C,onFocus:k,onBlur:w,onClear:$}),null,16,["model-value","format","placeholder","clearable","disabled","readonly","open","prefix-icon","clear-icon","size"])]),_:1}),s(i(gr),{align:"start",class:nt(i(dt)("w-auto p-0",n.popoverClass)),onOpenAutoFocus:Q[5]||(Q[5]=W=>W.preventDefault()),onInteractOutside:_},{default:d(()=>[H("div",wRt,[n.type==="date"?(S(),B(fRt,{key:0,"model-value":v.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":Q[1]||(Q[1]=W=>z(W,!0))},null,8,["model-value","is-date-disabled"])):n.type==="month"?(S(),B(gRt,{key:1,"model-value":v.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":Q[2]||(Q[2]=W=>z(W,!0))},null,8,["model-value","is-date-disabled"])):n.type==="year"?(S(),B(xRt,{key:2,"model-value":v.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":Q[3]||(Q[3]=W=>z(W,!0))},null,8,["model-value","is-date-disabled"])):n.type==="datetime"?(S(),B(hRt,{key:3,"model-value":g.value,"is-date-disabled":n.disabledDate,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,"onUpdate:modelValue":Q[4]||(Q[4]=W=>z(W,!1))},null,8,["model-value","is-date-disabled","granularity","hour-cycle"])):be("",!0),n.shortcuts&&n.shortcuts.length>0?(S(),B(Fve,{key:4,items:n.shortcuts,onSelect:N},null,8,["items"])):be("",!0)])]),_:1},8,["class"])]),_:1},8,["open"]))],2))}}),kRt={key:0,"aria-hidden":"true",class:"text-red-600"},SRt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},CRt=ae({name:"ShwfedDateFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),x=T(()=>e.config.valueFormat??K_.date.value),y=T(()=>{const z=e.config.presets;if(!(!z||z.length===0))return z.map(N=>({name:N.label,value:()=>{try{const P=We(u(N.value,{form:o.value??{}}));return Wr(P,x.value)}catch(P){return console.error(`[shwfed-form] failed to evaluate preset "${N.value}" for ${e.fieldId}:`,P),""}}}))}),_=ue(void 0),k=T({get:()=>{const z=e.config.binding;if(z==null)return _.value;const N=r(z);return typeof N=="string"&&N.length>0?N:void 0},set:z=>{const N=e.config.binding;if(N==null){_.value=z;return}l(N,z)}}),{isRequired:w,errors:$,warnings:C,visible:E}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":h.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(w)?(S(),J("span",kRt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),b.value?(S(),J("div",SRt,A(k.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:k.value,"onUpdate:modelValue":N[0]||(N[0]=P=>k.value=P),type:"date",format:t.config.format,"value-format":t.config.valueFormat,placeholder:f.value,disabled:h.value,shortcuts:y.value},null,8,["id","modelValue","format","value-format","placeholder","disabled","shortcuts"])),i(E)?(S(),B(i(Xr),{key:3,errors:i($),warnings:i(C)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),$Rt={class:"flex items-center gap-1"},TRt={class:"flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"},Nve=ae({__name:"RangeCalendar",props:{defaultPlaceholder:{},defaultValue:{},modelValue:{},placeholder:{},allowNonContiguousRanges:{type:Boolean},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},maximumDays:{},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{type:Function},isDateUnavailable:{type:Function},isDateHighlightable:{type:Function},dir:{},nextPage:{type:Function},prevPage:{type:Function},disableDaysOutsideCurrentView:{type:Boolean},fixedDate:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","update:validModelValue","update:placeholder","update:startValue"],setup(t,{emit:e}){const n=t,o=e,r=Ut(n,"class"),l=co(r,o),a=o6(),{locale:u}=Bt({useScope:"global",inheritLocale:!0}),c=T(()=>n.locale??u.value??a.language.value??"en");return(f,p)=>(S(),B(i(tXe),Be({"data-slot":"range-calendar",class:i(dt)("p-3",n.class),"fixed-weeks":""},i(l),{locale:c.value}),{default:d(({grid:m,weekDays:h})=>[s(i(IRt),null,{default:d(()=>[s(i(RRt)),H("div",$Rt,[s(i(PRt)),s(i(VRt))])]),_:1}),H("div",TRt,[(S(!0),J(Me,null,Ze(m,v=>(S(),B(i(DRt),{key:v.value.toString()},{default:d(()=>[s(i(ORt),null,{default:d(()=>[s(i(hK),null,{default:d(()=>[(S(!0),J(Me,null,Ze(h,g=>(S(),B(i(MRt),{key:g},{default:d(()=>[D(A(g),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),s(i(zRt),null,{default:d(()=>[(S(!0),J(Me,null,Ze(v.rows,(g,b)=>(S(),B(i(hK),{key:`weekDate-${b}`,class:"mt-2 w-full"},{default:d(()=>[(S(!0),J(Me,null,Ze(g,x=>(S(),B(i(ERt),{key:x.toString(),date:x},{default:d(()=>[s(i(ARt),{day:x,month:v.value},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))])]),_:1},16,["class","locale"]))}}),ERt=ae({__name:"RangeCalendarCell",props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(oXe),Be({"data-slot":"range-calendar-cell",class:i(dt)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1","[--bar-left:0px] [--bar-right:0px]","[&:has([data-selection-start]):not(:has([data-highlighted]))]:[--bar-left:50%]","[&:has([data-selection-end]):not(:has([data-highlighted]))]:[--bar-right:50%]","[&:has([data-highlighted-start])]:[--bar-left:50%]","[&:has([data-highlighted-end])]:[--bar-right:50%]","before:pointer-events-none before:absolute before:top-1/2 before:-translate-y-1/2","before:h-8 before:z-0","before:left-[var(--bar-left)] before:right-[var(--bar-right)]","before:bg-[color-mix(in_srgb,var(--primary)_15%,white)]","before:hidden","[&:has([data-selected])]:before:block [&:has([data-highlighted])]:before:block","[&:has([data-selection-start][data-selection-end])]:before:hidden","[&:has([data-highlighted-start][data-highlighted-end])]:before:hidden",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),ARt=ae({__name:"RangeCalendarCellTrigger",props:{day:{},month:{},asChild:{type:Boolean},as:{default:"button"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(lXe),Be({"data-slot":"range-calendar-trigger",class:i(dt)(i(mc)({variant:"ghost"}),"relative z-10 size-8 rounded-full p-0 font-normal text-center cursor-pointer data-selected:opacity-100","[&[data-today]:not([data-selected])]:font-semibold [&[data-today]:not([data-selected])]:text-(--primary)","data-selection-start:bg-(--primary) data-selection-start:text-white data-selection-start:hover:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-start:hover:text-white data-selection-start:focus:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-start:focus:text-white","data-selection-end:bg-(--primary) data-selection-end:text-white data-selection-end:hover:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-end:hover:text-white data-selection-end:focus:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-end:focus:text-white","data-highlighted-start:bg-(--primary) data-highlighted-start:text-white","data-highlighted-end:bg-(--primary) data-highlighted-end:text-white","data-outside-view:text-zinc-300","data-disabled:text-zinc-300 data-disabled:opacity-50","data-unavailable:text-zinc-300 data-unavailable:line-through",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),DRt=ae({__name:"RangeCalendarGrid",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(aXe),Be({"data-slot":"range-calendar-grid",class:i(dt)("w-full border-collapse space-x-1",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),zRt=ae({__name:"RangeCalendarGridBody",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,o)=>(S(),B(i(uXe),Be({"data-slot":"range-calendar-grid-body"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),ORt=ae({__name:"RangeCalendarGridHead",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,o)=>(S(),B(i(dXe),Be({"data-slot":"range-calendar-grid-head"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),hK=ae({__name:"RangeCalendarGridRow",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(pXe),Be({"data-slot":"range-calendar-grid-row",class:i(dt)("flex w-full",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),MRt=ae({__name:"RangeCalendarHeadCell",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(hXe),Be({"data-slot":"range-calendar-head-cell",class:i(dt)("flex-1 rounded-md text-[0.8rem] font-normal text-zinc-300",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),IRt=ae({__name:"RangeCalendarHeader",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(gXe),Be({"data-slot":"range-calendar-header",class:i(dt)("flex justify-center pt-1 relative items-center w-full",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),RRt=ae({__name:"RangeCalendarHeading",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(bXe),Be({"data-slot":"range-calendar-heading",class:i(dt)("text-sm font-medium",e.class)},i(o)),{default:d(({headingValue:a})=>[we(r.$slots,"default",{headingValue:a},()=>[D(A(a),1)])]),_:3},16,["class"]))}}),VRt=ae({__name:"RangeCalendarNextButton",props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(_Xe),Be({"data-slot":"range-calendar-next-button",class:i(dt)(i(mc)({variant:"ghost"}),"absolute right-1","size-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-right-20-regular"})])]),_:3},16,["class"]))}}),PRt=ae({__name:"RangeCalendarPrevButton",props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(kXe),Be({"data-slot":"range-calendar-prev-button",class:i(dt)(i(mc)({variant:"ghost"}),"absolute left-1","size-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-left-20-regular"})])]),_:3},16,["class"]))}}),FRt=ae({name:"UiDateRangePickerDatePanel",__name:"DateRangePickerDatePanel",props:{modelValue:{},isDateDisabled:{type:Function},numberOfMonths:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){o("update:modelValue",l)}return(l,a)=>(S(),B(i(Nve),{"data-slot":"date-range-picker-date-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue?.start,"is-date-disabled":n.isDateDisabled,"number-of-months":n.numberOfMonths??2,"onUpdate:modelValue":r},null,8,["class","model-value","default-placeholder","is-date-disabled","number-of-months"]))}}),NRt={class:"border-zinc-200 flex items-center gap-2 border-t p-3"},LRt={key:1,class:"text-zinc-400 select-none"},BRt={key:1,class:"text-zinc-400 select-none"},URt=ae({name:"UiDateRangePickerDateTimePanel",__name:"DateRangePickerDateTimePanel",props:{modelValue:{},isDateDisabled:{},granularity:{default:"second"},hourCycle:{default:24},numberOfMonths:{default:2},rangeSeparatorIcon:{default:"lucide:arrow-right"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(v){if(v)return new Co(v.year,v.month,"day"in v?v.day:1)}function l(v){if(!(!v||!("hour"in v)))return new Ka(v.hour,v.minute,v.second)}const a=T(()=>({start:r(n.modelValue?.start),end:r(n.modelValue?.end)})),u=T(()=>l(n.modelValue?.start)),c=T(()=>l(n.modelValue?.end));function f(v,g){if(v)return new xs(v.year,v.month,"day"in v?v.day:1,g?.hour??0,g?.minute??0,g?.second??0)}function p(v){if(!v){o("update:modelValue",void 0);return}o("update:modelValue",{start:f(v.start,u.value),end:f(v.end,c.value)})}function m(v){const g=v??void 0,b=n.modelValue?.start??r(op(As()));b&&o("update:modelValue",{start:f(b,g),end:n.modelValue?.end})}function h(v){const g=v??void 0,b=n.modelValue?.end??r(op(As()));b&&o("update:modelValue",{start:n.modelValue?.start,end:f(b,g)})}return(v,g)=>(S(),J("div",{"data-slot":"date-range-picker-datetime-panel",class:nt(i(dt)("flex flex-col",n.class))},[s(i(Nve),{"model-value":a.value,"default-placeholder":a.value.start,"is-date-disabled":n.isDateDisabled,"number-of-months":n.numberOfMonths,"onUpdate:modelValue":p},null,8,["model-value","default-placeholder","is-date-disabled","number-of-months"]),H("div",NRt,[s(i(de),{icon:"lucide:clock",class:"text-zinc-500 size-4 shrink-0"}),s(i(lu).Root,{"model-value":u.value,granularity:n.granularity,"hour-cycle":n.hourCycle,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 text-sm outline-none","onUpdate:modelValue":m},{default:d(({segments:b})=>[Array.isArray(b)?(S(!0),J(Me,{key:0},Ze(b,(x,y)=>(S(),J(Me,{key:`s-${x.part}-${y}`},[x.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:x.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(x.value),1)]),_:2},1032,["part"])):(S(),J("span",LRt,A(x.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle"]),s(i(de),{icon:n.rangeSeparatorIcon,class:"text-zinc-400 size-3.5 shrink-0"},null,8,["icon"]),s(i(lu).Root,{"model-value":c.value,granularity:n.granularity,"hour-cycle":n.hourCycle,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 text-sm outline-none","onUpdate:modelValue":h},{default:d(({segments:b})=>[Array.isArray(b)?(S(!0),J(Me,{key:0},Ze(b,(x,y)=>(S(),J(Me,{key:`e-${x.part}-${y}`},[x.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:x.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(x.value),1)]),_:2},1032,["part"])):(S(),J("span",BRt,A(x.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle"])])],2))}}),qRt=["data-disabled","data-value","data-state"],jRt=["placeholder","disabled","readonly"],HRt=["placeholder","disabled","readonly"],WRt=ae({name:"UiDateRangePickerInput",inheritAttrs:!1,__name:"DateRangePickerInput",props:{startValue:{},endValue:{},format:{},startPlaceholder:{},endPlaceholder:{},rangeSeparatorIcon:{},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},open:{type:Boolean},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:startValue","update:endValue","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e,l=ue(""),a=ue(""),u=ue(null);function c(){l.value=n.startValue?Wr(n.startValue,n.format):""}function f(){a.value=n.endValue?Wr(n.endValue,n.format):""}Qe(()=>[n.startValue,n.format],()=>{u.value!=="start"&&c()},{immediate:!0}),Qe(()=>[n.endValue,n.format],()=>{u.value!=="end"&&f()},{immediate:!0});function p(x){const y=x==="start"?l:a,_=x==="start"?n.startValue:n.endValue,k=x==="start"?c:f,w=y.value.trim();if(!w){_!==void 0&&r(x==="start"?"update:startValue":"update:endValue",void 0);return}const $=T3(w,n.format,_??new Date);if(!zb($)){k();return}r(x==="start"?"update:startValue":"update:endValue",$)}function m(x,y){u.value=y,r("focus",x,y)}function h(x,y){u.value=null,p(y),r("blur",x,y)}function v(){l.value="",a.value="",r("update:startValue",void 0),r("update:endValue",void 0),r("clear")}const g=T(()=>n.clearable&&!n.disabled&&!n.readonly&&(n.startValue!==void 0||n.endValue!==void 0)),b=T(()=>n.startValue!==void 0||n.endValue!==void 0);return(x,y)=>(S(),J("div",Be(x.$attrs,{"data-slot":"date-range-picker-input","data-disabled":n.disabled?"true":void 0,"data-value":b.value?"true":void 0,"data-state":n.open?"open":void 0,class:i(dt)("group/date-range-input","border-zinc-200 relative flex w-full min-w-0 items-center rounded-md border bg-transparent transition-[color,box-shadow] outline-none","data-[disabled=true]:bg-zinc-100","has-[input:focus-visible]:border-(--primary)","hover:border-zinc-300",o.value,n.class)}),[n.prefixIcon?(S(),B(i(de),{key:0,icon:n.prefixIcon,class:"text-zinc-500 ml-3 mr-1 size-4 shrink-0"},null,8,["icon"])):be("",!0),Ba(H("input",{"onUpdate:modelValue":y[0]||(y[0]=_=>l.value=_),"data-slot":"input-group-control","data-side":"start",placeholder:n.startPlaceholder,disabled:n.disabled,readonly:n.readonly,class:nt(i(dt)("text-zinc-700 placeholder:text-zinc-300 min-w-0 flex-1 bg-transparent px-1 text-sm outline-none disabled:cursor-not-allowed text-center",!n.prefixIcon&&"pl-3")),onFocus:y[1]||(y[1]=_=>m(_,"start")),onBlur:y[2]||(y[2]=_=>h(_,"start")),onKeydown:y[3]||(y[3]=fr(lt(_=>p("start"),["prevent"]),["enter"]))},null,42,jRt),[[mu,l.value]]),n.rangeSeparatorIcon?(S(),B(i(de),{key:1,icon:n.rangeSeparatorIcon,"data-slot":"date-range-picker-input-separator",class:"text-zinc-400 mx-1 size-3.5 shrink-0"},null,8,["icon"])):be("",!0),Ba(H("input",{"onUpdate:modelValue":y[4]||(y[4]=_=>a.value=_),"data-slot":"input-group-control","data-side":"end",placeholder:n.endPlaceholder,disabled:n.disabled,readonly:n.readonly,class:nt(i(dt)("text-zinc-700 placeholder:text-zinc-300 min-w-0 flex-1 bg-transparent px-1 text-sm outline-none disabled:cursor-not-allowed text-center",!g.value&&"pr-3")),onFocus:y[5]||(y[5]=_=>m(_,"end")),onBlur:y[6]||(y[6]=_=>h(_,"end")),onKeydown:y[7]||(y[7]=fr(lt(_=>p("end"),["prevent"]),["enter"]))},null,42,HRt),[[mu,a.value]]),g.value?(S(),B(i(ot),{key:2,size:"icon-xs","data-slot":"date-range-picker-clear",tabindex:"-1",class:nt(i(dt)("mr-2 shrink-0 text-zinc-500 hover:text-zinc-700 transition-opacity","[@media(hover:hover)]:opacity-0","group-hover/date-range-input:opacity-100 focus-within:opacity-100")),onMousedown:y[8]||(y[8]=lt(()=>{},["prevent"])),onClick:lt(v,["stop"])},{default:d(()=>[s(i(de),{icon:n.clearIcon},null,8,["icon"])]),_:1},8,["class"])):be("",!0)],16,qRt))}}),KRt={class:"w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10"},GRt=ae({name:"UiDateRangePickerMonthPanel",__name:"DateRangePickerMonthPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{locale:r}=Bt({useScope:"global",inheritLocale:!0});function l(a){o("update:modelValue",a)}return(a,u)=>(S(),B(i(Uc).Root,{"data-slot":"date-range-picker-month-panel",class:nt(i(dt)("p-3",n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue?.start,"is-month-disabled":n.isDateDisabled,locale:i(r),"onUpdate:modelValue":l},{default:d(({grid:c})=>[s(i(Uc).Header,{class:"pt-2 pb-2 relative"},{default:d(()=>[H("nav",KRt,[s(i(Uc).Prev,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),_:1}),s(i(Uc).Next,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1})]),s(i(Uc).Heading,{class:"text-sm font-medium text-center w-full"})]),_:1}),s(i(Uc).Grid,{class:"mt-4 w-full"},{default:d(()=>[s(i(Uc).GridBody,null,{default:d(()=>[(S(!0),J(Me,null,Ze(c.rows,(f,p)=>(S(),B(i(Uc).GridRow,{key:`mrow-${p}`,class:"grid grid-cols-4 gap-1 mb-1 last:mb-0"},{default:d(()=>[(S(!0),J(Me,null,Ze(f,m=>(S(),B(i(Uc).Cell,{key:m.toString(),date:m},{default:d(()=>[s(i(Uc).CellTrigger,{month:m,class:"block w-full"},{default:d(({monthValue:h,disabled:v,selected:g,selectionStart:b,selectionEnd:x,highlighted:y})=>[H("span",{class:nt(i(dt)("flex h-9 w-full items-center justify-center rounded-md text-sm font-normal cursor-pointer","hover:bg-zinc-100",g||b||x?"bg-(--primary) text-white hover:bg-(--primary)":"",y&&!g?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary) hover:bg-[color-mix(in_srgb,var(--primary)_25%,white)]":"",v?"text-zinc-400 opacity-50 cursor-default":""))},A(h),3)]),_:1},8,["month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:1},8,["class","model-value","default-placeholder","is-month-disabled","locale"]))}}),YRt=["data-disabled"],JRt={key:1,class:"text-zinc-400 select-none"},XRt={key:1,class:"text-zinc-400 select-none"},QRt=ae({name:"UiDateRangePickerTimeInput",inheritAttrs:!1,__name:"DateRangePickerTimeInput",props:{startValue:{},endValue:{},granularity:{default:"second"},hourCycle:{default:24},rangeSeparatorIcon:{default:"lucide:arrow-right"},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:startValue","update:endValue","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e;function l(f){r("update:startValue",f??void 0)}function a(f){r("update:endValue",f??void 0)}function u(){r("update:startValue",void 0),r("update:endValue",void 0),r("clear")}const c=T(()=>n.clearable&&!n.disabled&&!n.readonly&&(n.startValue!==void 0||n.endValue!==void 0));return(f,p)=>(S(),J("div",Be(f.$attrs,{"data-slot":"date-range-picker-time-input","data-disabled":n.disabled?"true":void 0,class:i(dt)("group/date-range-time-input","border-zinc-200 relative flex w-full min-w-0 items-center rounded-md border bg-transparent transition-[color,box-shadow] outline-none","data-[disabled=true]:bg-zinc-100","has-[[data-reka-time-field-input]:focus]:border-(--primary)","hover:border-zinc-300",o.value,n.class)}),[n.prefixIcon?(S(),B(i(de),{key:0,icon:n.prefixIcon,class:"text-zinc-500 ml-3 mr-1 size-4 shrink-0"},null,8,["icon"])):be("",!0),s(i(lu).Root,{"data-slot":"date-range-picker-time-start","model-value":n.startValue,granularity:n.granularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","onUpdate:modelValue":l},{default:d(({segments:m})=>[Array.isArray(m)?(S(!0),J(Me,{key:0},Ze(m,(h,v)=>(S(),J(Me,{key:`s-${h.part}-${v}`},[h.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:h.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(h.value),1)]),_:2},1032,["part"])):(S(),J("span",JRt,A(h.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle","disabled","readonly"]),s(i(de),{icon:n.rangeSeparatorIcon,"data-slot":"date-range-picker-time-separator",class:"text-zinc-400 size-3.5 shrink-0"},null,8,["icon"]),s(i(lu).Root,{"data-slot":"date-range-picker-time-end","model-value":n.endValue,granularity:n.granularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","onUpdate:modelValue":a},{default:d(({segments:m})=>[Array.isArray(m)?(S(!0),J(Me,{key:0},Ze(m,(h,v)=>(S(),J(Me,{key:`e-${h.part}-${v}`},[h.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:h.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(h.value),1)]),_:2},1032,["part"])):(S(),J("span",XRt,A(h.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle","disabled","readonly"]),c.value?(S(),J("button",{key:1,type:"button","data-slot":"date-range-picker-clear",tabindex:"-1",class:nt(i(dt)("mr-2 size-5 shrink-0 rounded text-zinc-500 transition-opacity hover:text-zinc-700","[@media(hover:hover)]:opacity-0","group-hover/date-range-time-input:opacity-100 focus-within:opacity-100","flex items-center justify-center")),onMousedown:p[0]||(p[0]=lt(()=>{},["prevent"])),onClick:lt(u,["stop"])},[s(i(de),{icon:n.clearIcon,class:"size-3.5"},null,8,["icon"])],34)):be("",!0)],16,YRt))}}),ZRt={class:"w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10"},e5t=ae({name:"UiDateRangePickerYearPanel",__name:"DateRangePickerYearPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{locale:r}=Bt({useScope:"global",inheritLocale:!0});function l(a){o("update:modelValue",a)}return(a,u)=>(S(),B(i(qc).Root,{"data-slot":"date-range-picker-year-panel",class:nt(i(dt)("p-3",n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue?.start,"is-year-disabled":n.isDateDisabled,locale:i(r),"onUpdate:modelValue":l},{default:d(({grid:c})=>[s(i(qc).Header,{class:"pt-2 pb-2 relative"},{default:d(()=>[H("nav",ZRt,[s(i(qc).Prev,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),_:1}),s(i(qc).Next,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1})]),s(i(qc).Heading,{class:"text-sm font-medium text-center w-full"})]),_:1}),s(i(qc).Grid,{class:"mt-4 w-full"},{default:d(()=>[s(i(qc).GridBody,null,{default:d(()=>[(S(!0),J(Me,null,Ze(c.rows,(f,p)=>(S(),B(i(qc).GridRow,{key:`yrow-${p}`,class:"grid grid-cols-4 gap-1 mb-1 last:mb-0"},{default:d(()=>[(S(!0),J(Me,null,Ze(f,m=>(S(),B(i(qc).Cell,{key:m.toString(),date:m},{default:d(()=>[s(i(qc).CellTrigger,{year:m,class:"block w-full"},{default:d(({yearValue:h,disabled:v,selected:g,selectionStart:b,selectionEnd:x,highlighted:y})=>[H("span",{class:nt(i(dt)("flex h-9 w-full items-center justify-center rounded-md text-sm font-normal cursor-pointer","hover:bg-zinc-100",g||b||x?"bg-(--primary) text-white hover:bg-(--primary)":"",y&&!g?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary) hover:bg-[color-mix(in_srgb,var(--primary)_25%,white)]":"",v?"text-zinc-400 opacity-50 cursor-default":""))},A(h),3)]),_:1},8,["year"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:1},8,["class","model-value","default-placeholder","is-year-disabled","locale"]))}}),G_={daterange:{display:"yyyy-MM-dd",value:"yyyy-MM-dd"},datetimerange:{display:"yyyy-MM-dd HH:mm:ss",value:"yyyy-MM-dd HH:mm:ss"},monthrange:{display:"yyyy-MM",value:"yyyy-MM"},yearrange:{display:"yyyy",value:"yyyy"},timerange:{display:"HH:mm:ss",value:"HH:mm:ss"}},t5t={class:"flex flex-col"},nA=ae({name:"UiDateRangePicker",inheritAttrs:!1,__name:"DateRangePicker",props:{modelValue:{},defaultValue:{},type:{default:"daterange"},format:{},valueFormat:{},startPlaceholder:{},endPlaceholder:{},rangeSeparatorIcon:{},prefixIcon:{},clearIcon:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},disabledDate:{},numberOfMonths:{default:2},timeGranularity:{default:"second"},hourCycle:{default:24},shortcuts:{},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]},popoverClass:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","change","clear","focus","blur"],setup(t,{emit:e}){const n=t,o=e,r=zo(n,"modelValue",o,{passive:!0,defaultValue:n.defaultValue}),l=T(()=>n.valueFormat??G_[n.type].value),a=T(()=>n.format??G_[n.type].display);function u(ie,ve){const ge=ie.getFullYear(),$e=ie.getMonth()+1,le=ie.getDate();switch(ve){case"yearrange":return new Co(ge,1,1);case"monthrange":return new Co(ge,$e,1);case"datetimerange":return new xs(ge,$e,le,ie.getHours(),ie.getMinutes(),ie.getSeconds());default:return new Co(ge,$e,le)}}function c(ie){return new Date(ie.year,ie.month-1,"day"in ie?ie.day:1,"hour"in ie?ie.hour:0,"hour"in ie?ie.minute:0,"hour"in ie?ie.second:0)}function f(ie){return new Ka(ie.getHours(),ie.getMinutes(),ie.getSeconds())}function p(ie){const ve=new Date(2e3,0,1);return ve.setHours(ie.hour,ie.minute,ie.second,0),ve}function m(ie){if(!ie)return;const ve=T3(ie,l.value,new Date);if(zb(ve))return ve}const h=T(()=>m(r.value?.[0])),v=T(()=>m(r.value?.[1])),g=T(()=>h.value?f(h.value):void 0),b=T(()=>v.value?f(v.value):void 0),x=T(()=>{if(h.value)return u(h.value,n.type)}),y=T(()=>{if(v.value)return u(v.value,n.type)}),_=$n(void 0),k=T(()=>_.value?_.value:{start:x.value,end:y.value});function w(ie,ve){if(!ie||!ve){r.value!==void 0&&(r.value=void 0,o("change",void 0));return}const ge=Wr(ie,l.value),$e=Wr(ve,l.value),le=[ge,$e],ee=r.value;ee&&ee[0]===le[0]&&ee[1]===le[1]||(r.value=le,o("change",le))}function $(ie){w(ie,v.value)}function C(ie){w(h.value,ie)}function E(ie){w(ie?p(ie):void 0,v.value)}function z(ie){w(h.value,ie?p(ie):void 0)}function N(){r.value!==void 0&&(r.value=void 0,o("change",void 0)),o("clear")}function P(ie){const ve=n.shortcuts?.[ie];if(!ve)return;const ge=typeof ve.value=="function"?ve.value():ve.value,$e=[ge[0],ge[1]],le=r.value;if(le&&le[0]===$e[0]&&le[1]===$e[1]){W.value=!1;return}r.value=$e,o("change",$e),W.value=!1}function Q(ie,ve){if(!ie||!ie.start&&!ie.end){_.value=void 0,w(void 0,void 0);return}if(!ie.start||!ie.end){_.value=ie;return}_.value=void 0;const ge=c(ie.start),$e=c(ie.end);w(ge,$e),ve&&(W.value=!1)}const W=ue(!1),Z=Xv("anchor-el");Qe(W,ie=>{ie||(_.value=void 0)});function L(ie){return ie instanceof Node?Z.value?.contains(ie)??!1:!1}function F(ie){const ge=ie.detail?.originalEvent?.target??null;L(ge)&&ie.preventDefault()}function j(ie,ve){!n.disabled&&!n.readonly&&(W.value=!0),o("focus",ie,ve)}function te(ie,ve){o("blur",ie,ve)}return(ie,ve)=>(S(),J("div",{ref:"anchor-el","data-slot":"date-range-picker",class:nt(i(dt)("w-full",n.class))},[n.type==="timerange"?(S(),B(QRt,Be({key:0},ie.$attrs,{"start-value":g.value,"end-value":b.value,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,"range-separator-icon":n.rangeSeparatorIcon,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly,size:n.size,"onUpdate:startValue":E,"onUpdate:endValue":z,onClear:N}),null,16,["start-value","end-value","granularity","hour-cycle","range-separator-icon","prefix-icon","clear-icon","clearable","disabled","readonly","size"])):(S(),B(i(vr),{key:1,open:W.value,"onUpdate:open":ve[5]||(ve[5]=ge=>W.value=ge)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(WRt,Be(ie.$attrs,{"start-value":h.value,"end-value":v.value,format:a.value,"start-placeholder":n.startPlaceholder,"end-placeholder":n.endPlaceholder,"range-separator-icon":n.rangeSeparatorIcon,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly,open:W.value,size:n.size,"onUpdate:startValue":$,"onUpdate:endValue":C,onFocus:j,onBlur:te,onClear:N}),null,16,["start-value","end-value","format","start-placeholder","end-placeholder","range-separator-icon","prefix-icon","clear-icon","clearable","disabled","readonly","open","size"])]),_:1}),s(i(gr),{align:"start",class:nt(i(dt)("w-auto p-0",n.popoverClass)),style:{minWidth:"var(--reka-popover-trigger-width)"},onOpenAutoFocus:ve[4]||(ve[4]=ge=>ge.preventDefault()),onInteractOutside:F},{default:d(()=>[H("div",t5t,[n.type==="daterange"?(S(),B(FRt,{key:0,"model-value":k.value,"is-date-disabled":n.disabledDate,"number-of-months":n.numberOfMonths,"onUpdate:modelValue":ve[0]||(ve[0]=ge=>Q(ge,!0))},null,8,["model-value","is-date-disabled","number-of-months"])):n.type==="monthrange"?(S(),B(GRt,{key:1,"model-value":k.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":ve[1]||(ve[1]=ge=>Q(ge,!0))},null,8,["model-value","is-date-disabled"])):n.type==="yearrange"?(S(),B(e5t,{key:2,"model-value":k.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":ve[2]||(ve[2]=ge=>Q(ge,!0))},null,8,["model-value","is-date-disabled"])):n.type==="datetimerange"?(S(),B(URt,{key:3,"model-value":k.value,"is-date-disabled":n.disabledDate,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,"number-of-months":n.numberOfMonths,"range-separator-icon":n.rangeSeparatorIcon,"onUpdate:modelValue":ve[3]||(ve[3]=ge=>Q(ge,!1))},null,8,["model-value","is-date-disabled","granularity","hour-cycle","number-of-months","range-separator-icon"])):be("",!0),n.shortcuts&&n.shortcuts.length>0?(S(),B(Fve,{key:4,items:n.shortcuts,onSelect:P},null,8,["items"])):be("",!0)])]),_:1},8,["class"])]),_:1},8,["open"]))],2))}}),n5t={key:0,"aria-hidden":"true",class:"text-red-600"},o5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},r5t=ae({name:"ShwfedDateRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(W,Z)=>Dt(W,{...Pt(a),...Z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(W,Z){if(!W)return!1;try{return We(u(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=T(()=>e.config.valueFormat??G_.daterange.value),_=T(()=>{const W=e.config.presets;if(!(!W||W.length===0))return W.map(Z=>({name:Z.label,value:()=>{try{const L=We(u(Z.start,{form:o.value??{}})),F=We(u(Z.end,{form:o.value??{}}));return[Wr(L,y.value),Wr(F,y.value)]}catch(L){return console.error(`[shwfed-form] failed to evaluate preset "${Z.start}" .. "${Z.end}" for ${e.fieldId}:`,L),["",""]}}}))});function k(W){if(!Array.isArray(W)||W.length!==2)return;const[Z,L]=W;if(!(typeof Z!="string"||typeof L!="string")&&!(Z.length===0||L.length===0))return[Z,L]}function w(W){return typeof W=="string"&&W.length>0?W:void 0}const $=ue(void 0),C=T({get:()=>{const W=e.config.binding;if(W==null)return $.value;if(typeof W=="string")return k(r(W));const Z=w(r(W[0])),L=w(r(W[1]));if(!(Z==null||L==null))return[Z,L]},set:W=>{const Z=e.config.binding;if(Z==null){$.value=W;return}if(typeof Z=="string"){l(Z,W);return}l(Z[0],W?.[0]),l(Z[1],W?.[1])}}),{isRequired:E,errors:z,warnings:N,visible:P}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),Q=T(()=>{const W=C.value;return W?`${W[0]} ~ ${W[1]}`:"—"});return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(E)?(S(),J("span",n5t," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",o5t,A(Q.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:C.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>C.value=L),type:"daterange",format:t.config.format,"value-format":t.config.valueFormat,"start-placeholder":f.value,"end-placeholder":p.value,"range-separator-icon":t.config.rangeSeparatorIcon,"number-of-months":t.config.numberOfMonths,disabled:v.value,shortcuts:_.value},null,8,["id","modelValue","format","value-format","start-placeholder","end-placeholder","range-separator-icon","number-of-months","disabled","shortcuts"])),i(P)?(S(),B(i(Xr),{key:3,errors:i(z),warnings:i(N)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),l5t={key:0,"aria-hidden":"true",class:"text-red-600"},i5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},a5t=ae({name:"ShwfedDateTimeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),x=T(()=>e.config.valueFormat??K_.datetime.value),y=T(()=>{const z=e.config.presets;if(!(!z||z.length===0))return z.map(N=>({name:N.label,value:()=>{try{const P=We(u(N.value,{form:o.value??{}}));return Wr(P,x.value)}catch(P){return console.error(`[shwfed-form] failed to evaluate preset "${N.value}" for ${e.fieldId}:`,P),""}}}))}),_=ue(void 0),k=T({get:()=>{const z=e.config.binding;if(z==null)return _.value;const N=r(z);return typeof N=="string"&&N.length>0?N:void 0},set:z=>{const N=e.config.binding;if(N==null){_.value=z;return}l(N,z)}}),{isRequired:w,errors:$,warnings:C,visible:E}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":h.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(w)?(S(),J("span",l5t," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),b.value?(S(),J("div",i5t,A(k.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:k.value,"onUpdate:modelValue":N[0]||(N[0]=P=>k.value=P),type:"datetime",format:t.config.format,"value-format":t.config.valueFormat,placeholder:f.value,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:h.value,shortcuts:y.value},null,8,["id","modelValue","format","value-format","placeholder","time-granularity","hour-cycle","disabled","shortcuts"])),i(E)?(S(),B(i(Xr),{key:3,errors:i($),warnings:i(C)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),s5t={key:0,"aria-hidden":"true",class:"text-red-600"},u5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},c5t=ae({name:"ShwfedDateTimeRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(W,Z)=>Dt(W,{...Pt(a),...Z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(W,Z){if(!W)return!1;try{return We(u(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=T(()=>e.config.valueFormat??G_.datetimerange.value),_=T(()=>{const W=e.config.presets;if(!(!W||W.length===0))return W.map(Z=>({name:Z.label,value:()=>{try{const L=We(u(Z.start,{form:o.value??{}})),F=We(u(Z.end,{form:o.value??{}}));return[Wr(L,y.value),Wr(F,y.value)]}catch(L){return console.error(`[shwfed-form] failed to evaluate preset "${Z.start}" .. "${Z.end}" for ${e.fieldId}:`,L),["",""]}}}))});function k(W){if(!Array.isArray(W)||W.length!==2)return;const[Z,L]=W;if(!(typeof Z!="string"||typeof L!="string")&&!(Z.length===0||L.length===0))return[Z,L]}function w(W){return typeof W=="string"&&W.length>0?W:void 0}const $=ue(void 0),C=T({get:()=>{const W=e.config.binding;if(W==null)return $.value;if(typeof W=="string")return k(r(W));const Z=w(r(W[0])),L=w(r(W[1]));if(!(Z==null||L==null))return[Z,L]},set:W=>{const Z=e.config.binding;if(Z==null){$.value=W;return}if(typeof Z=="string"){l(Z,W);return}l(Z[0],W?.[0]),l(Z[1],W?.[1])}}),{isRequired:E,errors:z,warnings:N,visible:P}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),Q=T(()=>{const W=C.value;return W?`${W[0]} ~ ${W[1]}`:"—"});return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(E)?(S(),J("span",s5t," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",u5t,A(Q.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:C.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>C.value=L),type:"datetimerange",format:t.config.format,"value-format":t.config.valueFormat,"start-placeholder":f.value,"end-placeholder":p.value,"range-separator-icon":t.config.rangeSeparatorIcon,"number-of-months":t.config.numberOfMonths,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:v.value,shortcuts:_.value},null,8,["id","modelValue","format","value-format","start-placeholder","end-placeholder","range-separator-icon","number-of-months","time-granularity","hour-cycle","disabled","shortcuts"])),i(P)?(S(),B(i(Xr),{key:3,errors:i(z),warnings:i(N)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),d5t={key:0,"aria-hidden":"true",class:"text-red-600"},f5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},p5t=ae({name:"ShwfedTimeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=($,C)=>Dt($,{...Pt(a),...C}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function p($,C){if(!$)return!1;try{return We(u($,{form:o.value??{}}))}catch(E){return console.error(`[shwfed-form] failed to evaluate ${C} for ${e.fieldId}:`,E),!1}}const m=T(()=>p(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?p(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula"),b=ue(void 0),x=T({get:()=>{const $=e.config.binding;if($==null)return b.value;const C=r($);return typeof C=="string"&&C.length>0?C:void 0},set:$=>{const C=e.config.binding;if(C==null){b.value=$;return}l(C,$)}}),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value});return($,C)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(y)?(S(),J("span",d5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",f5t,A(x.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:x.value,"onUpdate:modelValue":C[0]||(C[0]=E=>x.value=E),type:"time","value-format":t.config.valueFormat,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:m.value},null,8,["id","modelValue","value-format","time-granularity","hour-cycle","disabled"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),m5t={key:0,"aria-hidden":"true",class:"text-red-600"},h5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},v5t=ae({name:"ShwfedTimeRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function p(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const m=T(()=>p(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?p(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula");function b(z){if(!Array.isArray(z)||z.length!==2)return;const[N,P]=z;if(!(typeof N!="string"||typeof P!="string")&&!(N.length===0||P.length===0))return[N,P]}function x(z){return typeof z=="string"&&z.length>0?z:void 0}const y=ue(void 0),_=T({get:()=>{const z=e.config.binding;if(z==null)return y.value;if(typeof z=="string")return b(r(z));const N=x(r(z[0])),P=x(r(z[1]));if(!(N==null||P==null))return[N,P]},set:z=>{const N=e.config.binding;if(N==null){y.value=z;return}if(typeof N=="string"){l(N,z);return}l(N[0],z?.[0]),l(N[1],z?.[1])}}),{isRequired:k,errors:w,warnings:$,visible:C}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),E=T(()=>{const z=_.value;return z?`${z[0]} ~ ${z[1]}`:"—"});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(k)?(S(),J("span",m5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",h5t,A(E.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:_.value,"onUpdate:modelValue":N[0]||(N[0]=P=>_.value=P),type:"timerange","value-format":t.config.valueFormat,"range-separator-icon":t.config.rangeSeparatorIcon,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:m.value},null,8,["id","modelValue","value-format","range-separator-icon","time-granularity","hour-cycle","disabled"])),i(C)?(S(),B(i(Xr),{key:3,errors:i(w),warnings:i($)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),g5t={key:0,"aria-hidden":"true",class:"text-red-600"},y5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},b5t=ae({name:"ShwfedNumberFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=(W,Z)=>Dt(W,{...Pt(r),...Z}),a=T(()=>Ke(e.config.label,n.value)),u=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),c=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function f(W,Z){if(!W)return!1;try{return We(l(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}function p(W,Z){if(W)try{const L=We(l(W,{form:o.value??{}}));return typeof L=="number"&&Number.isFinite(L)?L:void 0}catch(L){console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L);return}}const m=T(()=>f(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?f(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula"),b=T(()=>p(e.config.min,"min")),x=T(()=>p(e.config.max,"max")),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:l,locale:()=>n.value}),$=T(()=>({useGrouping:!1,maximumFractionDigits:20})),{draft:C,commit:E}=Pb({binding:()=>e.config.binding,fromState:W=>{if(typeof W=="number"&&Number.isFinite(W))return W;if(typeof W=="string"&&W.length>0){const Z=Number(W);return Number.isFinite(Z)?Z:void 0}},toState:W=>typeof W!="number"||!Number.isFinite(W)?null:e.config.valueAsString?String(W):W});function z(W,Z,L){const F=10**Z;switch(L){case"floor":return Math.floor(W*F)/F;case"ceil":return Math.ceil(W*F)/F;default:return Math.round(W*F)/F}}const N=T(()=>!m.value&&C.value!==void 0);function P(){C.value=void 0,E()}async function Q(){await Vt();const W=e.config.precision;if(W!==void 0){const Z=C.value;if(Z!==void 0){const L=z(Z,W,e.config.roundingMode??"round");L!==Z&&(C.value=L)}}E()}return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[a.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a.value),1),i(y)?(S(),J("span",g5t," *")):be("",!0)]),_:2},[c.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:c.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",y5t,A(i(C)??"—"),1)):(S(),B(i(Fe),{key:2,class:"group/number-field","data-disabled":m.value?"true":void 0},{default:d(()=>[s(i(jt),{id:t.fieldId,"model-value":i(C),step:t.config.step,"step-snapping":t.config.step!==void 0,min:b.value,max:x.value,"format-options":$.value,disabled:m.value,placeholder:u.value,"input-class":"text-left","onUpdate:modelValue":Z[0]||(Z[0]=L=>C.value=L),onBlur:Q},null,8,["id","model-value","step","step-snapping","min","max","format-options","disabled","placeholder"]),N.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/number-field:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"number-field-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:Z[1]||(Z[1]=lt(()=>{},["prevent"])),onClick:lt(P,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),x5t={key:0,"aria-hidden":"true",class:"text-red-600"},_5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},w5t=ae({name:"ShwfedNumberRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(R,U)=>Dt(R,{...Pt(a),...U}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(R,U){if(!R)return!1;try{return We(u(R,{form:o.value??{}}))}catch(V){return console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V),!1}}function v(R,U){if(R)try{const V=We(u(R,{form:o.value??{}}));return typeof V=="number"&&Number.isFinite(V)?V:void 0}catch(V){console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V);return}}const g=T(()=>h(e.config.disabled,"disabled")),b=kr(),x=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):b.value),y=T(()=>x.value||e.config.derived?.mode==="formula"),_=T(()=>v(e.config.min,"min")),k=T(()=>v(e.config.max,"max")),{isRequired:w,errors:$,warnings:C,visible:E}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),z=T(()=>({useGrouping:!1,maximumFractionDigits:20}));function N(R){if(typeof R=="number"&&Number.isFinite(R))return R;if(typeof R=="string"&&R.length>0){const U=Number(R);return Number.isFinite(U)?U:void 0}}function P(R){if(!Array.isArray(R)||R.length!==2)return;const U=N(R[0]),V=N(R[1]);if(!(U==null||V==null))return[U,V]}function Q(R){return e.config.valueAsString?String(R):R}const W=ue(void 0),Z=T({get:()=>{const R=e.config.binding;if(R==null)return W.value;if(typeof R=="string")return P(r(R));const U=N(r(R[0])),V=N(r(R[1]));if(!(U==null||V==null))return[U,V]},set:R=>{const U=e.config.binding;if(U==null){W.value=R;return}if(typeof U=="string"){l(U,R?[Q(R[0]),Q(R[1])]:null);return}l(U[0],R?Q(R[0]):null),l(U[1],R?Q(R[1]):null)}}),L=ue(Z.value?.[0]),F=ue(Z.value?.[1]);Qe(Z,R=>{L.value=R?.[0],F.value=R?.[1]});function j(){const R=L.value,U=F.value;if(typeof R=="number"&&Number.isFinite(R)&&typeof U=="number"&&Number.isFinite(U)){const V=Z.value;if(V&&V[0]===R&&V[1]===U)return;Z.value=[R,U]}else Z.value!==void 0&&(Z.value=void 0)}const te=Mhe().register(j);_r(()=>{te(),j()});function ie(R){L.value=typeof R=="number"&&Number.isFinite(R)?R:void 0}function ve(R){F.value=typeof R=="number"&&Number.isFinite(R)?R:void 0}const ge=T(()=>{const R=F.value,U=k.value;return typeof R=="number"&&typeof U=="number"?Math.min(R,U):typeof R=="number"?R:U}),$e=T(()=>{const R=L.value,U=_.value;return typeof R=="number"&&typeof U=="number"?Math.max(R,U):typeof R=="number"?R:U});function le(R,U,V){const q=10**U;switch(V){case"floor":return Math.floor(R*q)/q;case"ceil":return Math.ceil(R*q)/q;default:return Math.round(R*q)/q}}async function ee(R){await Vt();const U=e.config.precision;if(U!==void 0){const V=R==="start"?L:F,q=V.value;if(q!==void 0){const ne=le(q,U,e.config.roundingMode??"round");ne!==q&&(V.value=ne)}}j()}const oe=T(()=>!g.value&&(L.value!==void 0||F.value!==void 0));function K(){L.value=void 0,F.value=void 0,Z.value!==void 0&&(Z.value=void 0)}const Y=T(()=>{const R=Z.value;return R?`${R[0]} ~ ${R[1]}`:"—"});return(R,U)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":g.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(w)?(S(),J("span",x5t," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),y.value?(S(),J("div",_5t,A(Y.value),1)):(S(),B(i(Fe),{key:2,class:"group/number-range-field","data-disabled":g.value?"true":void 0},{default:d(()=>[s(i(jt),{id:t.fieldId,"model-value":L.value,step:t.config.step,"step-snapping":t.config.step!==void 0,min:_.value,max:ge.value,"format-options":z.value,disabled:g.value,placeholder:f.value,"onUpdate:modelValue":ie,onBlur:U[0]||(U[0]=V=>ee("start"))},null,8,["id","model-value","step","step-snapping","min","max","format-options","disabled","placeholder"]),s(i(de),{icon:t.config.rangeSeparatorIcon??"lucide:arrow-right",class:"mx-1 size-3.5 shrink-0 text-zinc-400"},null,8,["icon"]),s(i(jt),{"model-value":F.value,step:t.config.step,"step-snapping":t.config.step!==void 0,min:$e.value,max:k.value,"format-options":z.value,disabled:g.value,placeholder:p.value,"onUpdate:modelValue":ve,onBlur:U[1]||(U[1]=V=>ee("end"))},null,8,["model-value","step","step-snapping","min","max","format-options","disabled","placeholder"]),oe.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/number-range-field:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"number-range-field-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:U[2]||(U[2]=lt(()=>{},["prevent"])),onClick:lt(K,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])),i(E)?(S(),B(i(Xr),{key:3,errors:i($),warnings:i(C)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),k5t={key:0,"aria-hidden":"true",class:"text-red-600"},S5t={key:1,class:"text-sm text-zinc-700"},C5t=ae({name:"ShwfedSwitchFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(E,z)=>Dt(E,{...Pt(a),...z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),p=T(()=>Ke(e.config.trueLabel,n.value)||"是"),m=T(()=>Ke(e.config.falseLabel,n.value)||"否");function h(E,z){if(!E)return!1;try{return We(u(E,{form:o.value??{}}))}catch(N){return console.error(`[shwfed-form] failed to evaluate ${z} for ${e.fieldId}:`,N),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),$=ue(!1),C=T({get:()=>{const E=e.config.binding;return E==null?$.value:r(E)===!0},set:E=>{const z=E===!0,N=e.config.binding;if(N==null){$.value=z;return}l(N,z)}});return(E,z)=>(S(),B(i(M),{orientation:"horizontal",class:"h-full","data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(y)?(S(),J("span",k5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",S5t,A(C.value?p.value:m.value),1)):(S(),B(i(Yo),{key:2,id:t.fieldId,modelValue:C.value,"onUpdate:modelValue":z[0]||(z[0]=N=>C.value=N),disabled:v.value},null,8,["id","modelValue","disabled"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),$5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},T5t={key:0,class:"border-t border-zinc-200 px-3 py-2"},E5t=ae({name:"ShwfedComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-placeholder":"请选择","combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项"},en:{"combobox-single-placeholder":"Select…","combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches"},ja:{"combobox-single-placeholder":"選択してください","combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(te,ie)=>Dt(te,{...Pt(u),...ie}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-single-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(te,ie){if(!te)return!1;try{return We(c(te,{form:r.value??{}}))}catch(ve){return console.error(`[shwfed-form] failed to evaluate ${ie} for ${e.fieldId}:`,ve),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula");function y(te,ie){try{return Jn(te,c,ie)}catch(ve){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,ve),te}}const _=T(()=>(e.config.items??[]).map(te=>{const ie=Ke(te.label,n.value)??"",ve=te.tooltip?Ke(te.tooltip,n.value):void 0,ge={form:r.value??{}};return{key:te.id,value:te.value.value,label:ie?y(ie,ge):"",tooltip:ve?y(ve,ge):void 0}})),k=ue(void 0),w=T({get:()=>{const te=e.config.binding;return te==null?k.value:l(te)},set:te=>{const ie=e.config.binding;if(ie==null){k.value=te;return}a(ie,te)}});function $(te,ie){if(te===ie)return!0;if(te==null||ie==null)return!1;if(typeof te=="object"&&typeof ie=="object")try{return JSON.stringify(te)===JSON.stringify(ie)}catch{return!1}return!1}const C=T(()=>_.value.find(te=>$(te.value,w.value))),E=T(()=>C.value?.key),z=T(()=>C.value?.label??""),N=ue(!1);function P(te){if(typeof te!="string")return;const ie=_.value.find(ve=>ve.key===te);ie&&(w.value=ie.value,Vt().then(()=>{N.value=!1}))}const Q=T(()=>!v.value&&C.value!==void 0);function W(){w.value=void 0,N.value=!1}const Z=ue(null);Qe(N,te=>{Z.value=te?_.value[0]?.key??null:null});const L=T(()=>_.value.find(te=>te.key===Z.value)),F=T(()=>L.value?.tooltip),j=T(()=>_.value.some(te=>te.tooltip!=null&&te.tooltip.length>0));return(te,ie)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",$5t,A(z.value||"—"),1)):(S(),B(i(vr),{key:2,open:N.value,"onUpdate:open":ie[1]||(ie[1]=ve=>N.value=ve)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":z.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Q.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:ie[0]||(ie[0]=lt(()=>{},["prevent"])),onClick:lt(W,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":E.value,disabled:v.value,"selection-behavior":"toggle","onUpdate:modelValue":P},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(_.value,ve=>(S(),B(i(Fr),{key:ve.key,value:ve.key,onMouseenter:ge=>Z.value=ve.key,onFocus:ge=>Z.value=ve.key},{default:d(()=>[D(A(ve.label),1)]),_:2},1032,["value","onMouseenter","onFocus"]))),128))]),_:1})]),_:1}),j.value&&F.value?(S(),J("div",T5t,[s(i(O),{source:F.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),A5t={key:0,"aria-hidden":"true",class:"text-red-600"},D5t=["id","data-disabled","data-readonly"],z5t=["tabindex","data-disabled","data-readonly","aria-disabled"],O5t={class:"flex flex-1 flex-col items-center justify-center gap-2"},M5t={key:1,class:"text-xs text-zinc-500"},I5t={key:1,class:"flex w-full flex-col gap-2"},R5t={"data-slot":"upload-zone-list",class:"flex flex-col gap-1"},V5t={class:"flex min-w-0 items-center gap-2"},P5t={class:"truncate text-zinc-700"},F5t=["accept","multiple","disabled"],N5t={key:2,class:"flex justify-end"},L5t=ae({name:"ShwfedUploadFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"vscode-icons:file-type-excel","application/vnd.ms-excel":"vscode-icons:file-type-excel","application/vnd.openxmlformats-officedocument.presentationml.presentation":"vscode-icons:file-type-powerpoint","application/vnd.ms-powerpoint":"vscode-icons:file-type-powerpoint","application/zip":"vscode-icons:file-type-zip","application/x-zip-compressed":"vscode-icons:file-type-zip","application/vnd.rar":"vscode-icons:file-type-zip","application/x-rar-compressed":"vscode-icons:file-type-zip","application/pdf":"vscode-icons:file-type-pdf2","application/ofd":"vscode-icons:file-type-ofd","application/xml":"vscode-icons:file-type-xml","image/png":"vscode-icons:file-type-image","image/jpg":"vscode-icons:file-type-image","image/jpeg":"vscode-icons:file-type-image","application/msword":"vscode-icons:file-type-word","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"vscode-icons:file-type-word"},n={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/vnd.ms-powerpoint":"PPT","application/zip":"ZIP","application/x-zip-compressed":"ZIP","application/vnd.rar":"RAR","application/x-rar-compressed":"RAR","application/pdf":"PDF","application/ofd":"OFD","application/xml":"XML","image/png":"PNG","image/jpg":"JPG","image/jpeg":"JPEG","application/msword":"DOC","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX"},o=t,{locale:r,t:l}=Bt({inheritLocale:!0,messages:{zh:{"upload-add-file":"添加文件","upload-accept-hint":"仅接受 {types}","upload-rejected-mime":"「{name}」类型不被允许","upload-rejected-size":"「{name}」超出单文件大小限制","upload-rejected-total":"「{name}」加入后将超出总大小限制","upload-rejected-count":"已达到文件数量上限,「{name}」未添加"},en:{"upload-add-file":"Add file","upload-accept-hint":"Only {types} are accepted","upload-rejected-mime":"{name} is not an allowed file type","upload-rejected-size":"{name} exceeds the maximum file size","upload-rejected-total":"{name} would exceed the total size limit","upload-rejected-count":"File count limit reached; {name} was not added"},ja:{"upload-add-file":"ファイルを追加","upload-accept-hint":"{types} のみ受け付けます","upload-rejected-mime":"「{name}」は許可されたファイル形式ではありません","upload-rejected-size":"「{name}」はファイルサイズの上限を超えています","upload-rejected-total":"「{name}」を追加すると合計サイズの上限を超えます","upload-rejected-count":"ファイル数の上限に達したため「{name}」は追加されません"}}}),{state:a,getAt:u,setAt:c}=Xn(),f=Ft(),p=(oe,K)=>Dt(oe,{...Pt(f),...K}),m=T(()=>o.config.label?Ke(o.config.label,r.value):void 0),h=T(()=>o.config.description?Ke(o.config.description,r.value):void 0),v=T(()=>o.config.tooltip?Ke(o.config.tooltip,r.value):void 0),g=T(()=>(o.config.templateLabel?Ke(o.config.templateLabel,r.value):void 0)??"下载模板");function b(oe,K){if(!oe)return!1;try{return We(p(oe,{form:a.value??{}}))}catch(Y){return console.error(`[shwfed-form] failed to evaluate ${K} for ${o.fieldId}:`,Y),!1}}const x=T(()=>b(o.config.disabled,"disabled")),y=kr(),_=T(()=>o.config.readonly!=null?b(o.config.readonly,"readonly"):y.value),{isRequired:k,errors:w,warnings:$,visible:C}=el({fieldId:()=>o.fieldId,config:()=>o.config,$cel:p,locale:()=>r.value}),E=ue([]),z=T({get:()=>{const oe=o.config.binding;if(oe==null)return E.value;const K=u(oe);return Array.isArray(K)?K.filter(Y=>Y instanceof File):[]},set:oe=>{const K=o.config.binding;if(K==null){E.value=oe;return}c(K,oe.length===0?null:oe)}}),N=ue(),P=T(()=>{const oe=o.config.accept;return oe&&oe.length>0?oe.join(","):void 0}),Q=T(()=>{const oe=o.config.accept;if(!(!oe||oe.length===0))return Array.from(new Set(oe.map(K=>n[K]??K))).join("、")}),W=T(()=>o.config.maxFiles!==void 0&&z.value.length>=o.config.maxFiles),Z=T(()=>!x.value&&!_.value&&!W.value);function L(oe){const K=o.config.accept;return!K||K.length===0?!0:K.includes(oe.type)}function F(oe){const K=[],Y=[];let R=z.value.reduce((V,q)=>V+q.size,0),U=z.value.length;for(const V of oe){if(!L(V)){Y.push({file:V,reason:"mime"});continue}if(o.config.maxFileSize!==void 0&&V.size>o.config.maxFileSize){Y.push({file:V,reason:"size"});continue}if(o.config.maxFiles!==void 0&&U>=o.config.maxFiles){Y.push({file:V,reason:"count"});continue}if(o.config.maxTotalSize!==void 0&&R+V.size>o.config.maxTotalSize){Y.push({file:V,reason:"total"});continue}K.push(V),R+=V.size,U+=1}return{accepted:K,rejected:Y}}function j(oe){if(!oe||oe.length===0)return;const K=o.config.multiple??!1,Y=K?Array.from(oe):Array.from(oe).slice(0,1),{accepted:R,rejected:U}=F(Y);for(const V of U)Io.error(l(`upload-rejected-${V.reason}`,{name:V.file.name}));R.length>0&&(z.value=K?[...z.value,...R]:R),N.value&&(N.value.value="")}function te(oe){j(oe.target.files)}function ie(){Z.value&&N.value?.click()}function ve(oe){Z.value&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),N.value?.click())}function ge(oe){if(x.value||_.value)return;const K=[...z.value];K.splice(oe,1),z.value=K}function $e(oe){return e[oe.type]??"fluent:document-20-regular"}const le=T(()=>o.config.templateIcon??"fluent:arrow-download-20-regular");async function ee(){const oe=o.config.template;if(!oe)return;const K={form:a.value??{}},Y=qt(function*(){const R=yield*p(oe.request,K);if(!oe.download)return yield*R.file();const U=yield*R.json();return yield*(yield*p(oe.download,{...K,json:U})).file()});try{const R=await Cn(ao(Y,Nr));if(!(R instanceof File)){console.error(`[shwfed-form] template request for ${o.fieldId} did not produce a File`);return}const U=URL.createObjectURL(R),V=document.createElement("a");V.href=U,V.download=R.name,document.body.appendChild(V),V.click(),V.remove(),URL.revokeObjectURL(U)}catch(R){console.error(`[shwfed-form] failed to download template for ${o.fieldId}:`,R)}}return(oe,K)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":x.value||void 0},{default:d(()=>[m.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(m.value),1),i(k)?(S(),J("span",A5t," *")):be("",!0)]),_:2},[v.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:v.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),H("div",{id:t.fieldId,class:"flex flex-col gap-2","data-disabled":x.value||void 0,"data-readonly":_.value||void 0},[z.value.length===0?(S(),J("div",{key:0,role:"button",tabindex:Z.value?0:-1,"data-slot":"upload-zone","data-disabled":x.value||void 0,"data-readonly":_.value||void 0,"aria-disabled":x.value||void 0,class:nt(["flex min-h-40 w-full flex-col gap-3 rounded border-2 border-dashed border-zinc-200 bg-zinc-50 p-4 outline-none transition-colors duration-180 ease-out focus-visible:border-(--primary) data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-60",[Z.value&&"cursor-pointer hover:border-zinc-400 hover:bg-zinc-100",_.value&&"cursor-default"]]),onClick:ie,onKeydown:ve},[H("div",O5t,[s(i(de),{icon:"fluent:cloud-arrow-up-20-regular",class:"size-8 text-zinc-400"}),h.value?(S(),B(i(O),{key:0,source:h.value,block:"",class:"prose prose-sm prose-zinc max-w-none text-center text-zinc-500"},null,8,["source"])):be("",!0),Q.value?(S(),J("p",M5t,A(i(l)("upload-accept-hint",{types:Q.value})),1)):be("",!0)])],42,z5t)):(S(),J("div",I5t,[H("ul",R5t,[(S(!0),J(Me,null,Ze(z.value,(Y,R)=>(S(),J("li",{key:`${Y.name}-${R}`,"data-slot":"upload-zone-item",class:"flex items-center justify-between gap-2 rounded px-2 py-1.5 text-sm leading-snug transition-[background-color] duration-180 ease-out hover:bg-zinc-50"},[H("span",V5t,[s(i(de),{icon:$e(Y),class:"size-4 shrink-0"},null,8,["icon"]),H("span",P5t,A(Y.name),1)]),!x.value&&!_.value?(S(),B(i(wn),{key:0,type:"button",variant:"ghost",size:"sm","data-slot":"upload-zone-delete",class:"size-6 p-0 text-zinc-500 hover:bg-red-50 hover:text-red-600","aria-label":`删除:${Y.name}`,onClick:U=>ge(R)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["aria-label","onClick"])):be("",!0)]))),128))]),Z.value?(S(),B(i(wn),{key:0,type:"button",variant:"default","data-slot":"upload-zone-add",class:"w-full shrink-0",onClick:ie},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),D(" "+A(i(l)("upload-add-file")),1)]),_:1})):be("",!0)])),H("input",{ref_key:"inputRef",ref:N,type:"file",class:"hidden",accept:P.value,multiple:t.config.multiple,disabled:x.value||_.value,onChange:te},null,40,F5t),t.config.template&&!_.value?(S(),J("div",N5t,[s(i(wn),{type:"button",variant:"link",size:"sm","data-slot":"upload-zone-template",onClick:ee},{default:d(()=>[s(i(de),{icon:le.value},null,8,["icon"]),D(" "+A(g.value),1)]),_:1})])):be("",!0)],8,D5t),i(C)?(S(),B(i(Xr),{key:1,errors:i(w),warnings:i($)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),B5t={key:0,"aria-hidden":"true",class:"text-red-600"},U5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},q5t=["id","disabled","data-value"],j5t={key:1,class:"block truncate text-zinc-300"},H5t={key:0,"data-slot":"combobox-single-remote-empty",class:"py-6 text-center text-sm text-zinc-500"},W5t=ae({name:"ShwfedComboboxSingleRemoteFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项","combobox-single-loading":"加载中…"},en:{"combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches","combobox-single-loading":"Loading…"},ja:{"combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし","combobox-single-loading":"読み込み中…"}}}),{state:r,getAt:l,setAt:a,setAtSilent:u}=Xn(),c=Ft(),f=(K,Y)=>Dt(K,{...Pt(c),...Y}),p=T(()=>Ke(e.config.label,n.value)),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),h=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function v(K,Y){if(!K)return!1;try{return We(f(K,{form:r.value??{}}))}catch(R){return console.error(`[shwfed-form] failed to evaluate ${Y} for ${e.fieldId}:`,R),!1}}const{isRequired:g,errors:b,warnings:x,visible:y}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:f,locale:()=>n.value}),_=T(()=>v(e.config.disabled,"disabled")),k=kr(),w=T(()=>e.config.readonly!=null?v(e.config.readonly,"readonly"):k.value),$=T(()=>w.value||e.config.derived?.mode==="formula");function C(K){try{return We(f(e.config.optionValue,{form:r.value??{},option:K}))}catch(Y){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,Y);return}}function E(K){const Y=Ke(e.config.optionLabel,n.value)??"";return Y?Jn(Y,f,{form:r.value??{},option:K}):""}const z=ue(null),N=ue(!1),P=T(()=>{const K=e.config.request;if(!K)return null;try{const Y=$u(We(f(K,{form:r.value??{}})));return cn(Y)?JSON.stringify(Y.value.describe()):null}catch{return null}});let Q=0;async function W(){const K=++Q;if(P.value==null){z.value=null,N.value=!1;return}const Y=e.config.request;N.value=!0;const R=qt(function*(){const U=yield*Qr(yield*f(Y,{form:r.value??{}}));return bc(U)});try{const U=await Cn(ao(R,Nr));K===Q&&(z.value=U)}catch{K===Q&&(z.value=null)}finally{K===Q&&(N.value=!1)}}const Z=T(()=>{let K;try{K=We(f(e.config.options,{form:r.value??{},json:z.value}))}catch(Y){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,Y),[]}return Array.isArray(K)?K.map((Y,R)=>({key:String(R),label:E(Y),value:C(Y)})):[]}),L=ue(void 0),F=T({get:()=>{const K=e.config.binding;return K==null?L.value:l(K)},set:K=>{const Y=e.config.binding;if(Y==null){L.value=K;return}a(Y,K)}});let j;wc(P,()=>{if(j!=null){const K=e.config.binding;K==null?L.value=void 0:u(K,void 0)}j=P.value,W()},{debounce:200,immediate:!0});function te(K,Y){if(K===Y)return!0;if(K==null||Y==null)return!1;if(typeof K=="object"&&typeof Y=="object")try{return JSON.stringify(K)===JSON.stringify(Y)}catch{return!1}return!1}const ie=T(()=>Z.value.find(K=>te(K.value,F.value))),ve=T(()=>ie.value?.key),ge=T(()=>ie.value?.label??""),$e=ue(!1);function le(K){if(typeof K!="string")return;const Y=Z.value.find(R=>R.key===K);Y&&(F.value=Y.value,Vt().then(()=>{$e.value=!1}))}const ee=T(()=>!_.value&&ie.value!==void 0);function oe(){F.value=void 0,$e.value=!1}return(K,Y)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":_.value||void 0},{default:d(()=>[p.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(p.value),1),i(g)?(S(),J("span",B5t," *")):be("",!0)]),_:2},[h.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:h.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),$.value?(S(),J("div",U5t,[ge.value?(S(),B(i(O),{key:0,source:ge.value},null,8,["source"])):(S(),J(Me,{key:1},[D(" — ")],64))])):(S(),B(i(vr),{key:2,open:$e.value,"onUpdate:open":Y[1]||(Y[1]=R=>$e.value=R)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single-remote","data-disabled":_.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[H("button",{id:t.fieldId,type:"button",disabled:_.value,"data-value":!!ge.value,"data-slot":"input-group-control",class:"peer flex h-9 min-w-0 flex-1 cursor-default items-center overflow-hidden rounded-none border-0 bg-transparent px-3 py-1 text-left text-sm text-zinc-700 outline-none disabled:cursor-not-allowed"},[ge.value?(S(),B(i(O),{key:0,source:ge.value,class:"block truncate"},null,8,["source"])):m.value?(S(),J("span",j5t,A(m.value),1)):be("",!0)],8,q5t)]),_:1}),N.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):ee.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single-remote:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-remote-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:Y[0]||(Y[0]=lt(()=>{},["prevent"])),onClick:lt(oe,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":ve.value,disabled:_.value,"selection-behavior":"toggle","onUpdate:modelValue":le},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[Z.value.length===0?(S(),J("div",H5t,A(N.value?i(o)("combobox-single-loading"):i(o)("combobox-single-empty")),1)):(S(),J(Me,{key:1},[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(Z.value,R=>(S(),B(i(Fr),{key:R.key,value:R.key},{default:d(()=>[s(i(O),{source:R.label},null,8,["source"])]),_:2},1032,["value"]))),128))]),_:1})],64))]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"])),i(y)?(S(),B(i(Xr),{key:3,errors:i(b),warnings:i(x)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),ZN=ae({name:"ShwfedFormUnitRenderer",__name:"FormUnitRenderer",props:{unit:{},evaluateMedia:{type:Function},isHidden:{type:Function}},setup(t){const e=t;function n(f){for(const p of f){if(!p.media)return p;try{if(e.evaluateMedia(p.media))return p}catch(m){console.error(`[shwfed-form] failed to evaluate layout media for ${p.name}:`,m)}}return f[f.length-1]}const o=T(()=>n(e.unit.layouts)),r=new Set,l=T(()=>{const f=o.value?.layout;if(!f)return[];const p=[];for(const m of e.unit.fields){const h=f.placements[m.id];if(!h||e.isHidden?.(m))continue;const v=ff(m.type,m.compatibilityDate);if(!v){const g=`${m.type}@${m.compatibilityDate}`;r.has(g)||(r.add(g),console.warn(`[shwfed-form] no registered field type for ${g}`));continue}p.push({field:m,placement:h,entry:v})}return p});function a(f){const[[p,m],[h,v]]=f.area,g=[`grid-column: ${p} / ${h}`,`grid-row: ${m} / ${v}`,"min-width: 0"],b=f.h&&f.h!=="stretch"?f.h:null,x=f.v&&f.v!=="stretch"?f.v:null;if(b||x){g.push("display: flex");const y=_=>_==="start"?"flex-start":_==="end"?"flex-end":"center";b&&g.push(`justify-content: ${y(b)}`),x&&g.push(`align-items: ${y(x)}`)}return g.join("; ")}const u=T(()=>{const f=o.value?.layout;if(!f)return"";const p=`repeat(${f.columns}, minmax(0, 1fr))`;let m="";if(f.rows){const b=Array.from({length:f.rows},()=>!1);for(const x of l.value){if(!x.entry.metadata.h.grow)continue;const[[,y],[,_]]=x.placement.area,k=Math.max(1,y),w=Math.min(f.rows,_-1);for(let $=k;$<=w;$++)b[$-1]=!0}m=b.map(x=>x?"auto":"minmax(auto, 1fr)").join(" ")}const h=`calc(${f.gap??pF} * 0.25rem)`,v=f.columns>1?`min(${h}, calc(100% / ${f.columns-1}))`:h;return["display: grid",`grid-template-columns: ${p}`,m?`grid-template-rows: ${m}`:"",`column-gap: ${v}`,`row-gap: ${h}`,f.style??""].filter(Boolean).join("; ")}),c=T(()=>l.value.map(f=>({key:f.field.id,style:a(f.placement),component:f.entry.runtime,fieldId:f.field.id,config:f.field})));return(f,p)=>(S(),J("div",{style:vn(u.value)},[(S(!0),J(Me,null,Ze(c.value,m=>(S(),J("div",{key:m.key,style:vn(m.style)},[(S(),B(qo(m.component),{"field-id":m.fieldId,config:m.config},null,8,["field-id","config"]))],4))),128))],4))}});function _T(t,e){if(Object.is(t,e))return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object")return!1;if(t instanceof Date||e instanceof Date)return t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime();if(Array.isArray(t)||Array.isArray(e))return!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length?!1:t.every((r,l)=>_T(r,e[l]));const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(e,r)&&_T(t[r],e[r]))}const Lve=Symbol("shwfed-form-derived-quiescence");function Bve(){const t=ue(0);return{inFlight:t,begin:()=>{t.value+=1},end:()=>{t.value-=1},async settled(){for(;;)if(t.value>0&&await new Promise(e=>{const n=Qe(t,o=>{o===0&&(n(),e())})}),await Vt(),t.value===0)return}}}function K5t(){const t=Bve();return Tr(Lve,t),t}function Uve(){return Yn(Lve,null)??Bve()}function eL(t){const{state:e,getAt:n,setAtSilent:o,isDirty:r,markDirty:l}=t.formState,a=t.quiescence,u=T(()=>t.fields().flatMap(g=>{const b=g.binding,x=g.derived;if(typeof b!="string"||!x||typeof x!="object")return[];const y=x.mode,_=x.expression;return y!=="formula"&&y!=="prefill"||typeof _!="string"?[]:[{binding:b,mode:y,expression:_}]}));let c=0,f=!1;function p(g,b){a.begin(),Cn(t.evaluate(g.expression)).then(x=>{b===c&&(g.mode==="prefill"&&r(g.binding)||_T(n(g.binding),x)||o(g.binding,x))},()=>{}).finally(()=>{a.end()})}function m(){const g=c+=1;for(const b of u.value)p(b,g)}Qe([e,u],()=>{f&&m()});function h(){for(const g of u.value)g.mode==="prefill"&&n(g.binding)!==void 0&&l(g.binding)}let v=!1;Um(()=>{v=!0}),t.ready.then(()=>{v||(f=!0,h(),m())},()=>{v||(f=!0,h(),m())})}const vK=ae({name:"ShwfedListFieldRow",__name:"row",props:ml({unit:{},index:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=t,o=VN(e,"row");Ia({item:{type:"dyn",label:"item",description:"当前列表项",value:()=>e.value??{}},index:{type:"number",label:"index",description:"当前列表项索引,从 0 开始",value:()=>n.index}});const r=Ft(),l=(u,c)=>Dt(u,{...Pt(r),...c});eL({fields:()=>n.unit.fields,evaluate:u=>l(u),ready:Promise.resolve(),formState:o,quiescence:Uve()});function a(u){return We(l(u))}return(u,c)=>(S(),B(ZN,{unit:t.unit,"evaluate-media":a},null,8,["unit"]))}}),G5t={key:0,"aria-hidden":"true",class:"text-red-600"},Y5t={class:"flex flex-col gap-3"},J5t=["data-instruction"],X5t={class:"flex items-center gap-2"},Q5t={key:2,class:"min-w-0 flex-1","data-slot":"list-row-summary"},Z5t={key:3,class:"min-w-0 flex-1"},eVt={key:0,class:"mt-3 min-w-0","data-slot":"list-row-content"},jk="shwfed-list-row",tVt=ae({name:"ShwfedListFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(U,V)=>Dt(U,{...Pt(a),...V}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),p=T(()=>Ke(e.config.addLabel,n.value)||"新增"),m=T(()=>Ke(e.config.locale,n.value)),h=T(()=>!!m.value);function v(U,V){if(!U)return!1;try{return We(u(U,{form:o.value??{}}))}catch(q){return console.error(`[shwfed-form] failed to evaluate ${V} for ${e.fieldId}:`,q),!1}}const{isRequired:g,errors:b,warnings:x,visible:y}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),_=T(()=>v(e.config.disabled,"disabled")),k=T(()=>e.config.reorderable??!0),w=T(()=>{const U=e.config.unit.fields;return U.length!==1?!1:U[0].binding===H4}),$=ue([]),C=T(()=>{const U=e.config.binding;if(U==null)return $.value;const V=r(U);return Array.isArray(V)?V:[]}),E=T(()=>{const U=m.value;return U==null?[]:C.value.map((V,q)=>QN(U,ne=>{try{const X=We(u(ne,{form:o.value??{},item:V??{},index:q}));return X==null?"":String(X)}catch(X){return console.error(`[shwfed-form] list field: failed to evaluate summary expression \`${ne}\` for ${e.fieldId}[${q}]:`,X),""}}))});function z(U){const V=e.config.binding;if(V==null){$.value=U;return}l(V,U)}function N(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,U=>{const V=Math.random()*16|0;return(U==="x"?V:V&3|8).toString(16)})}const P=ue([]);Qe(()=>C.value.length,U=>{U!==P.value.length&&(P.value=Array.from({length:U},()=>N()))},{immediate:!0});const Q=ue(new Set);function W(U){return Q.value.has(U)}function Z(U){const V=new Set(Q.value);V.has(U)?V.delete(U):V.add(U),Q.value=V}const L=T(()=>e.config.max!=null&&C.value.length>=e.config.max),F=T(()=>(e.config.min??0)>0&&C.value.length<=(e.config.min??0)),j=T(()=>!_.value&&!L.value),te=T(()=>!_.value&&!F.value),ie=T(()=>!_.value&&k.value);function ve(){if(!j.value)return;const U=w.value?null:{};z([...C.value,U]);const V=N();P.value=[...P.value,V];const q=new Set(Q.value);q.add(V),Q.value=q}function ge(U){if(!te.value||U<0||U>=C.value.length)return;const V=P.value[U];if(z(C.value.filter((q,ne)=>ne!==U)),P.value=P.value.filter((q,ne)=>ne!==U),V!=null&&Q.value.has(V)){const q=new Set(Q.value);q.delete(V),Q.value=q}}function $e(U,V){if(!ie.value||U===V||U<0||V<0||U>=C.value.length||V>=C.value.length)return;const q=[...C.value],[ne]=q.splice(U,1);if(!ne)return;q.splice(V,0,ne),z(q);const X=[...P.value],[fe]=X.splice(U,1);fe&&(X.splice(V,0,fe),P.value=X)}function le(U,V){if(U<0||U>=C.value.length)return;const q=[...C.value];q[U]=V,z(q)}const ee=U=>P.value[U]??`idx-${U}`;function oe(U){if(!ie.value||U.source.kind!==jk||U.target.kind!==jk)return;const V=P.value.findIndex(ne=>ne===U.source.id),q=P.value.findIndex(ne=>ne===U.target.id);V<0||q<0||(U.instruction==="reorder-above"?$e(V,V<q?q-1:q):U.instruction==="reorder-below"&&$e(V,V<=q?q:q+1))}const K=uh({onRowDrop:oe}),Y=U=>U.querySelector(".drag-handle");function R(U){return{kind:jk,canDrop:V=>V.kind===jk,blockInstructions:V=>{const q=["make-child","reparent"];return V.id===ee(U)&&q.push("reorder-above","reorder-below"),q},dragHandle:Y}}return(U,V)=>(S(),B(i(M),{orientation:"vertical","data-disabled":_.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(g)?(S(),J("span",G5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),H("div",Y5t,[(S(!0),J(Me,null,Ze(C.value,(q,ne)=>(S(),J("div",{key:P.value[ne],ref_for:!0,ref:i(K).rowRef(ee(ne),R(ne)),class:"relative rounded border border-zinc-200 bg-zinc-50/40 p-3","data-slot":"list-row","data-instruction":i(K).instructionFor(ee(ne))??void 0},[H("div",X5t,[k.value?(S(),B(i(de),{key:0,icon:"fluent:re-order-dots-vertical-20-regular",class:nt(["drag-handle size-4 shrink-0 text-zinc-400",ie.value?"cursor-grab":"cursor-not-allowed opacity-50"]),"data-slot":"list-row-drag-handle"},null,8,["class"])):be("",!0),h.value?(S(),B(i(ot),{key:1,size:"icon-xs",class:"shrink-0","data-slot":"list-row-collapse","aria-expanded":W(ee(ne)),"aria-label":W(ee(ne))?"折叠":"展开",onClick:X=>Z(ee(ne))},{default:d(()=>[s(i(de),{icon:W(ee(ne))?"fluent:chevron-down-20-regular":"fluent:chevron-right-20-regular"},null,8,["icon"])]),_:2},1032,["aria-expanded","aria-label","onClick"])):be("",!0),h.value?(S(),J("div",Q5t,[s(i(O),{source:E.value[ne]??"",class:"prose prose-xs prose-zinc"},null,8,["source"])])):(S(),J("div",Z5t,[s(vK,{"model-value":q,unit:t.config.unit,index:ne,"onUpdate:modelValue":X=>le(ne,X)},null,8,["model-value","unit","index","onUpdate:modelValue"])])),s(i(ot),{variant:"destructive",size:"icon-xs",class:"shrink-0",disabled:!te.value,"data-slot":"list-row-remove","aria-label":"删除",onClick:X=>ge(ne)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["disabled","onClick"])]),h.value?Ba((S(),J("div",eVt,[s(vK,{"model-value":q,unit:t.config.unit,index:ne,"onUpdate:modelValue":X=>le(ne,X)},null,8,["model-value","unit","index","onUpdate:modelValue"])],512)),[[c5,W(ee(ne))]]):be("",!0)],8,J5t))),128)),s(i(wn),{type:"button",disabled:!j.value,"data-slot":"list-add",class:"w-full justify-center",onClick:ve},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),H("span",null,A(p.value),1)]),_:1},8,["disabled"])]),i(y)?(S(),B(i(Xr),{key:1,errors:i(b),warnings:i(x)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),nVt=Ns(tVt,[["__scopeId","data-v-786923a2"]]),oVt={key:0,"aria-hidden":"true",class:"text-red-600"},rVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},lVt={key:2,class:"min-h-9 py-1.5 text-sm text-zinc-400"},iVt={key:3,class:"flex flex-wrap items-start gap-x-6 gap-y-2 py-1"},aVt={class:"flex flex-col gap-0.5"},sVt={class:"text-sm text-zinc-700"},uVt=ae({name:"ShwfedCheckboxGroupFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"checkbox-group-empty":"无可选项"},en:{"checkbox-group-empty":"No options"},ja:{"checkbox-group-empty":"選択肢なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(Z,L)=>Dt(Z,{...Pt(u),...L}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(Z,L){if(!Z)return!1;try{return We(c(Z,{form:r.value??{}}))}catch(F){return console.error(`[shwfed-form] failed to evaluate ${L} for ${e.fieldId}:`,F),!1}}const{isRequired:h,errors:v,warnings:g,visible:b}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),x=T(()=>m(e.config.disabled,"disabled")),y=kr(),_=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):y.value),k=T(()=>_.value||e.config.derived?.mode==="formula");function w(Z,L){try{return Jn(Z,c,L)}catch(F){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,F),Z}}const $=T(()=>(e.config.items??[]).map(Z=>{const L=Ke(Z.label,n.value)??"",F=Z.tooltip?Ke(Z.tooltip,n.value):void 0,j={form:r.value??{}};return{key:Z.id,value:Z.value.value,label:L?w(L,j):"",tooltip:F?w(F,j):void 0}}));function C(Z){return Array.isArray(Z)?Z:[]}const E=ue([]),z=T({get:()=>{const Z=e.config.binding;return Z==null?E.value:C(l(Z))},set:Z=>{const L=e.config.binding;if(L==null){E.value=Z;return}a(L,Z)}});function N(Z,L){if(Z===L)return!0;if(Z==null||L==null)return!1;if(typeof Z=="object"&&typeof L=="object")try{return JSON.stringify(Z)===JSON.stringify(L)}catch{return!1}return!1}function P(Z){return z.value.some(L=>N(L,Z.value))}function Q(Z){if(x.value)return;const L=z.value;z.value=P(Z)?L.filter(F=>!N(F,Z.value)):[...L,Z.value]}const W=T(()=>$.value.filter(P).map(L=>L.label).filter(L=>L.length>0).join("、")||"—");return(Z,L)=>(S(),B(i(M),{orientation:"vertical","data-disabled":x.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(h)?(S(),J("span",oVt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),k.value?(S(),J("div",rVt,A(W.value),1)):$.value.length===0?(S(),J("div",lVt,A(i(o)("checkbox-group-empty")),1)):(S(),J("div",iVt,[(S(!0),J(Me,null,Ze($.value,F=>(S(),J("label",{key:F.key,"data-slot":"checkbox-group-option",class:nt(["flex items-start gap-2",x.value?"cursor-not-allowed opacity-60":"cursor-pointer"])},[s(i(nN),{"model-value":P(F),disabled:x.value,class:"mt-0.5","onUpdate:modelValue":()=>Q(F)},null,8,["model-value","disabled","onUpdate:modelValue"]),H("span",aVt,[H("span",sVt,A(F.label),1),F.tooltip?(S(),B(i(O),{key:0,source:F.tooltip,block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])],2))),128))])),i(b)?(S(),B(i(Xr),{key:4,errors:i(v),warnings:i(g)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),cVt=ae({name:"UiRadioGroup",__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=Ut(n,"class"),l=co(r,o);return(a,u)=>(S(),B(i(KQe),Be({"data-slot":"radio-group"},i(l),{class:i(dt)("grid gap-3",n.class)}),{default:d(()=>[we(a.$slots,"default")]),_:3},16,["class"]))}}),dVt=ae({name:"UiRadioGroupItem",__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(XQe),Be({"data-slot":"radio-group-item"},i(o),{class:i(dt)("peer cursor-pointer flex items-center justify-center border-zinc-200 data-[state=checked]:border-(--primary) aria-invalid:border-red-400 size-4 shrink-0 rounded-full border shadow-xs hover:shadow transition-shadow outline-none disabled:cursor-not-allowed disabled:opacity-50",e.class)}),{default:d(()=>[s(i(ZQe),{"data-slot":"radio-group-indicator",class:"grid h-full w-full place-content-center"},{default:d(()=>[...l[0]||(l[0]=[H("span",{class:"size-2 rounded-full bg-(--primary)"},null,-1)])]),_:1})]),_:1},16,["class"]))}}),fVt={key:0,"aria-hidden":"true",class:"text-red-600"},pVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},mVt={key:2,class:"min-h-9 py-1.5 text-sm text-zinc-400"},hVt={class:"flex flex-col gap-0.5"},vVt={class:"text-sm text-zinc-700"},gVt=ae({name:"ShwfedRadioGroupFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"radio-group-empty":"无可选项"},en:{"radio-group-empty":"No options"},ja:{"radio-group-empty":"選択肢なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(P,Q)=>Dt(P,{...Pt(u),...Q}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(P,Q){if(!P)return!1;try{return We(c(P,{form:r.value??{}}))}catch(W){return console.error(`[shwfed-form] failed to evaluate ${Q} for ${e.fieldId}:`,W),!1}}const{isRequired:h,errors:v,warnings:g,visible:b}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),x=T(()=>m(e.config.disabled,"disabled")),y=kr(),_=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):y.value),k=T(()=>_.value||e.config.derived?.mode==="formula");function w(P,Q){try{return Jn(P,c,Q)}catch(W){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,W),P}}const $=T(()=>(e.config.items??[]).map(P=>{const Q=Ke(P.label,n.value)??"",W=P.tooltip?Ke(P.tooltip,n.value):void 0,Z={form:r.value??{}};return{key:P.id,value:P.value.value,label:Q?w(Q,Z):"",tooltip:W?w(W,Z):void 0}})),C=ue(void 0),E=T({get:()=>{const P=e.config.binding,Q=P==null?C.value:l(P);return typeof Q=="string"||typeof Q=="number"?Q:void 0},set:P=>{const Q=e.config.binding;if(Q==null){C.value=P;return}a(Q,P)}});function z(P){x.value||(E.value=typeof P=="string"||typeof P=="number"?P:void 0)}const N=T(()=>$.value.find(Q=>Q.value===E.value)?.label||"—");return(P,Q)=>(S(),B(i(M),{orientation:"vertical","data-disabled":x.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(h)?(S(),J("span",fVt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),k.value?(S(),J("div",pVt,A(N.value),1)):$.value.length===0?(S(),J("div",mVt,A(i(o)("radio-group-empty")),1)):(S(),B(i(cVt),{key:3,"model-value":E.value,disabled:x.value,class:"flex flex-wrap items-start gap-x-6 gap-y-2 py-1","onUpdate:modelValue":z},{default:d(()=>[(S(!0),J(Me,null,Ze($.value,W=>(S(),J("label",{key:W.key,"data-slot":"radio-group-option",class:nt(["flex items-start gap-2",x.value?"cursor-not-allowed opacity-60":"cursor-pointer"])},[s(i(dVt),{value:W.value,disabled:x.value,class:"mt-0.5"},null,8,["value","disabled"]),H("span",hVt,[H("span",vVt,A(W.label),1),W.tooltip?(S(),B(i(O),{key:0,source:W.tooltip,block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])],2))),128))]),_:1},8,["model-value","disabled"])),i(b)?(S(),B(i(Xr),{key:4,errors:i(v),warnings:i(g)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),yVt={key:0,"aria-hidden":"true",class:"text-red-600"},bVt=ae({name:"ShwfedTableFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=Gf(()=>ul(()=>import("./index-Bj8xIK5h.js"),[],import.meta.url)),n=t,{locale:o}=Bt(),r=Xn(),l=Ft(),a=(b,x)=>Dt(b,{...Pt(l),...x}),{isRequired:u,errors:c,warnings:f,visible:p}=el({fieldId:()=>n.fieldId,config:()=>n.config,$cel:a,locale:()=>o.value}),m=T(()=>Ke(n.config.label,o.value)),h=T(()=>n.config.tooltip?Ke(n.config.tooltip,o.value):void 0),v=T(()=>{const{dataSource:b,...x}=n.config.table;return x}),g=T({get:()=>{const b=n.config.binding?.trim();if(!b)return[];const x=r.getAt(b);return Array.isArray(x)?x:[]},set:b=>{const x=n.config.binding?.trim();x&&r.setAtSilent(x,b)}});return(b,x)=>(S(),B(i(M),{orientation:"vertical"},{default:d(()=>[m.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(m.value),1),i(u)?(S(),J("span",yVt," *")):be("",!0)]),_:2},[h.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:h.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),s(i(e),{rows:g.value,"onUpdate:rows":x[0]||(x[0]=y=>g.value=y),config:v.value},null,8,["rows","config"]),i(p)?(S(),B(i(Xr),{key:1,errors:i(c),warnings:i(f)},null,8,["errors","warnings"])):be("",!0)]),_:1}))}}),xVt={"data-slot":"collapsible-section",class:"relative rounded border border-zinc-200 bg-zinc-50/40 p-3"},_Vt={class:"flex items-center gap-2"},wVt={class:"min-w-0 flex-1","data-slot":"collapsible-header"},kVt={key:0,"data-slot":"collapsible-error-count",class:"shrink-0 text-xs text-red-600"},SVt={key:1,"data-slot":"collapsible-warning-count",class:"shrink-0 text-xs text-amber-600"},CVt={"data-slot":"collapsible-body",class:"mt-3 min-w-0"},$Vt=ae({name:"ShwfedCollapsibleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),o=ue(e.config.defaultCollapsed??!1);function r(){o.value=!o.value}const l=Ft(),a=(b,x)=>Dt(b,{...Pt(l),...x}),u=T(()=>{const b=Ke(e.config.header,n.value)??"";return b?QN(b,x=>{try{const y=We(a(x));return y==null?"":String(y)}catch(y){return console.error(`[shwfed-form] collapsible: failed to evaluate header expression \`${x}\` for ${e.fieldId}:`,y),""}}):""});function c(b){return We(a(b))}function f(b){const x=b.hidden;if(!x)return!1;try{return We(a(x))}catch(y){return console.error(`[shwfed-form] collapsible: failed to evaluate hidden for ${b.id}:`,y),!1}}const p=Vve();function m(b){const x=[];for(const y of b){x.push(y.id);const _=y.unit;_?.fields&&x.push(...m(_.fields))}return x}const h=T(()=>p?.revealed.value?p.resultsFor(m(e.config.unit.fields)):[]),v=T(()=>h.value.filter(b=>b.severity==="error").length),g=T(()=>h.value.filter(b=>b.severity==="warning").length);return(b,x)=>(S(),J("div",xVt,[H("div",_Vt,[s(i(ot),{size:"icon-xs",class:"shrink-0","data-slot":"collapsible-toggle","aria-expanded":!o.value,"aria-label":o.value?"展开":"折叠",onClick:r},{default:d(()=>[s(i(de),{icon:o.value?"fluent:chevron-right-20-regular":"fluent:chevron-down-20-regular"},null,8,["icon"])]),_:1},8,["aria-expanded","aria-label"]),H("div",wVt,[s(i(O),{source:u.value,class:"prose prose-sm prose-zinc max-w-none"},null,8,["source"])]),v.value>0?(S(),J("span",kVt,A(v.value)+" 个错误",1)):g.value>0?(S(),J("span",SVt,A(g.value)+" 个警告",1)):be("",!0)]),Ba(H("div",CVt,[s(ZN,{unit:t.config.unit,"evaluate-media":c,"is-hidden":f},null,8,["unit"])],512),[[c5,!o.value]])]))}}),TVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},EVt={key:1,class:"min-h-9 py-1.5 text-sm text-red-500"},AVt={key:2,class:"flex flex-col gap-1.5 py-1","aria-busy":"true"},DVt={class:"flex flex-col gap-0.5"},zVt={class:"min-h-9 py-1.5 text-sm text-zinc-400"},OVt=ae({name:"ShwfedTreeMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-multi-search-label":"搜索","tree-multi-search-clear":"清除搜索","tree-multi-load-error":"加载失败","tree-multi-empty":"无可选项","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":"、"},en:{"tree-multi-search-label":"Search","tree-multi-search-clear":"Clear search","tree-multi-load-error":"Failed to load","tree-multi-empty":"No options","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":", "},ja:{"tree-multi-search-label":"検索","tree-multi-search-clear":"検索をクリア","tree-multi-load-error":"読み込みに失敗しました","tree-multi-empty":"選択肢なし","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":"、"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(ge,$e)=>Dt(ge,{...Pt(u),...$e}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(ge,$e){if(!ge)return!1;try{return We(c(ge,{form:r.value??{}}))}catch(le){return console.error(`[shwfed-form] failed to evaluate ${$e} for ${e.fieldId}:`,le),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),x=ue([]),y=T({get:()=>{const ge=e.config.binding,$e=ge==null?x.value:l(ge);return Array.isArray($e)?$e.map(le=>String(le)):[]},set:ge=>{const $e=ge.map(ee=>String(ee)),le=e.config.binding;if(le==null){x.value=$e;return}a(le,$e)}}),_=ue([]),k=ue(!1),w=ue(null);async function $(){const ge=e.config.dataSource;if(!ge){_.value=[];return}const $e=qt(function*(){let ee=pt();ge.request&&(ee=yield*Qr(yield*c(ge.request,{form:r.value??{}})));const oe=yield*c(ge.data,{form:r.value??{},json:ee});return Array.isArray(oe)?oe:[]}),le=qt(function*(){const ee=yield*Vs(on(()=>{k.value=!0}).pipe(Ps("30 millis")));return yield*ir($e,_i(ee))}).pipe(ir(on(()=>{k.value=!1})));try{const ee=await Cn(ao(le,Nr));_.value=ee,w.value=null}catch(ee){console.warn("[shwfed-form] tree dataSource fetch failed",ee),w.value=ee}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{$()},{immediate:!0});function C(ge){return{form:r.value??{},node:ge}}function E(ge){try{const $e=We(c(e.config.nodeKey,C(ge)));return String($e)}catch($e){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,$e),""}}function z(ge){let $e;try{$e=We(c(e.config.nodeChildren,C(ge)))}catch(le){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,le);return}if($e!=null&&Array.isArray($e)&&$e.length!==0)return $e}function N(ge,$e){if(h.value)return!1;const le=e.config.nodeSelectable;if(!le)return!0;try{return We(c(le,C(ge)))}catch(ee){return console.error(`[shwfed-form] failed to evaluate nodeSelectable for ${e.fieldId}:`,ee),!1}}function P(ge,$e){try{return Jn(ge,c,{form:r.value??{},node:$e})}catch(le){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,le),ge}}function Q(ge){const $e=Ke(e.config.nodeLabel,n.value)??"";return $e?P($e,ge):""}function W(ge){if(!e.config.nodeTooltip)return;const $e=Ke(e.config.nodeTooltip,n.value);if($e)return P($e,ge)}const Z=T(()=>{if(!e.config.expandAll)return[];const ge=[],$e=[..._.value];for(;$e.length;){const le=$e.pop(),ee=z(le);ee&&ee.length&&(ge.push(E(le)),$e.push(...ee))}return ge}),L=ue("");function F(ge){const $e=e.config.filter?.keywords;if(!$e)return[];try{const le=We(c($e,C(ge)));return Array.isArray(le)?le.map(ee=>String(ee)):[]}catch{return[]}}const j=$n(new Map);Qe(()=>[_.value,n.value,e.config.nodeLabel,e.config.filter?.keywords],()=>{const ge=new Map,$e=[..._.value];for(;$e.length;){const le=$e.pop(),ee=Q(le).trim().toLowerCase(),oe=F(le).map(Y=>Y.trim().toLowerCase()).join(`
|
|
195
|
+
`).map(K=>K.trim()).filter(Boolean);if(oe.length===0){const K=e.value.options.items[le];if(!K)return;const{keywords:Y,...R}=K,U=[...e.value.options.items];U[le]=R,_({items:U})}else W(le,{keywords:oe})}return(le,ee)=>(S(),J("div",MIt,[H("div",IIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:用户角色","onUpdate:modelValue":ee[0]||(ee[0]=oe=>{const K=String(oe??"");e.value={...e.value,displayName:K.length>0?K:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:"写入表单状态的嵌套键路径,使用 `.` 分隔,例如 `user.role`",block:"",class:"prose prose-sm prose-zinc"})]),default:d(()=>[D(" "+A(o("binding")),1)]),_:1}),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":ee[1]||(ee[1]=oe=>v.value=oe),placeholder:"例:user.role",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",RIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":ee[2]||(ee[2]=oe=>e.value={...e.value,label:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field placeholder","model-value":e.value.placeholder,"onUpdate:modelValue":ee[3]||(ee[3]=oe=>e.value={...e.value,placeholder:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":ee[4]||(ee[4]=oe=>e.value={...e.value,tooltip:oe})},null,8,["model-value"])]),_:1})]),H("div",VIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":ee[5]||(ee[5]=oe=>e.value={...e.value,orientation:oe})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),oe=>(S(),B(i(Fn),{key:oe.value,value:oe.value},{default:d(()=>[D(A(oe.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:"选项可以是静态配置的固定列表,也可以由 CEL 表达式或远程接口产出",block:"",class:"prose prose-sm prose-zinc"})]),default:d(()=>[ee[18]||(ee[18]=D(" 选项来源 ",-1))]),_:1}),s(i(vc),{"model-value":g.value,"onUpdate:modelValue":ee[11]||(ee[11]=oe=>{(oe==="static"||oe==="remote")&&y(oe)})},{default:d(()=>[s(i(gc),null,{default:d(()=>[s(i(jl),{value:"static"},{default:d(()=>[...ee[19]||(ee[19]=[D(" 静态 ",-1)])]),_:1}),s(i(jl),{value:"remote"},{default:d(()=>[...ee[20]||(ee[20]=[D(" 远程 ",-1)])]),_:1})]),_:1}),s(i(ql),{value:"static",class:"outline-none"},{default:d(()=>[H("div",PIt,[(S(!0),J(Me,null,Ze(N.value,(oe,K)=>(S(),J("div",{key:oe.id,"data-slot":"combobox-single-item",class:"relative pt-8 grid grid-cols-2 gap-3 rounded border border-zinc-200 bg-zinc-50/40 p-3"},[s(i(ot),{variant:"destructive",size:"icon-xs","data-slot":"combobox-single-item-delete","aria-label":"删除选项",class:"absolute right-2 top-2 z-10",onClick:Y=>L(K)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["onClick"]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("label")),1)]),_:2},[u("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"combobox option label","model-value":oe.label,"onUpdate:modelValue":Y=>ie(K,Y)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("value")),1)]),_:2},[u("value")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("value"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Ye),{align:"inline-start"},{default:d(()=>[s(i(Wo),null,{default:d(()=>[s(i(Go),{"as-child":""},{default:d(()=>[s(i(ot),{size:"icon-sm","as-child":""},{default:d(()=>[H("button",FIt,[s(i(de),{icon:oe.value.kind==="number"?"fluent:number-symbol-20-regular":"fluent:textbox-20-regular"},null,8,["icon"])])]),_:2},1024)]),_:2},1024),s(i(Ko),{align:"start"},{default:d(()=>[s(i(Mn),{onSelect:Y=>F(K,"text")},{default:d(()=>[s(i(de),{icon:"fluent:textbox-20-regular"}),ee[21]||(ee[21]=H("span",null,"文本",-1))]),_:1},8,["onSelect"]),s(i(Mn),{onSelect:Y=>F(K,"number")},{default:d(()=>[s(i(de),{icon:"fluent:number-symbol-20-regular"}),ee[22]||(ee[22]=H("span",null,"数字",-1))]),_:1},8,["onSelect"])]),_:2},1024)]),_:2},1024)]),_:2},1024),oe.value.kind==="text"?(S(),B(i(Xe),{key:0,"model-value":oe.value.value,placeholder:"例:admin","onUpdate:modelValue":Y=>j(K,String(Y??""))},null,8,["model-value","onUpdate:modelValue"])):(S(),B(i(jt),{key:1,"model-value":oe.value.value,"onUpdate:modelValue":Y=>te(K,Y)},null,8,["model-value","onUpdate:modelValue"]))]),_:2},1024)]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("tooltip")),1)]),_:2},[u("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"combobox option tooltip","model-value":oe.tooltip,"onUpdate:modelValue":Y=>ve(K,Y)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("keywords")),1)]),_:2},[u("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ep),{"data-slot":"combobox-single-item-keywords",placeholder:"每行一个关键词","model-value":ge(oe),"onUpdate:modelValue":Y=>$e(K,String(Y??""))},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024)]))),128)),s(i(wn),{type:"button","data-slot":"combobox-single-add-item",class:"w-full justify-center",onClick:Z},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),ee[23]||(ee[23]=H("span",null,"增加选项",-1))]),_:1})])]),_:1}),s(i(ql),{value:"remote",class:"outline-none"},{default:d(()=>[H("div",NIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("request")),1)]),_:2},[p("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:w.value,"onUpdate:modelValue":ee[6]||(ee[6]=oe=>w.value=oe),placeholder:"如 http.get('/api/roles');留空则不发起请求","result-type":"HttpRequest",multiline:""},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("options")),1)]),_:2},[p("options")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("options"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:$.value,"onUpdate:modelValue":ee[7]||(ee[7]=oe=>$.value=oe),placeholder:"如 json.data 或 [{value: 'a', label: 'A'}]","result-type":"dyn","extra-vars":h,multiline:""},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionValue")),1)]),_:2},[p("optionValue")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionValue"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:C.value,"onUpdate:modelValue":ee[8]||(ee[8]=oe=>C.value=oe),placeholder:"如 option.value","result-type":"dyn","extra-vars":m},null,8,["modelValue"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionLabel")),1)]),_:2},[p("optionLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":E.value,markdown:"","translate-hint":"combobox option label","onUpdate:modelValue":ee[9]||(ee[9]=oe=>E.value=oe)},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("optionKeywords")),1)]),_:2},[p("optionKeywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("optionKeywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:z.value,"onUpdate:modelValue":ee[10]||(ee[10]=oe=>z.value=oe),placeholder:"如 [option.code, option.pinyin]","result-type":"list","extra-vars":m},null,8,["modelValue"])]),_:1})])]),_:1})]),_:1},8,["model-value"])]),_:1}),H("div",LIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[12]||(ee[12]=oe=>e.value={...e.value,required:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[13]||(ee[13]=oe=>e.value={...e.value,hidden:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时下拉框仍然渲染但不可选择",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[14]||(ee[14]=oe=>e.value={...e.value,disabled:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前选项的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":ee[15]||(ee[15]=oe=>e.value={...e.value,readonly:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.category","onUpdate:modelValue":ee[16]||(ee[16]=oe=>e.value={...e.value,derived:oe})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":ee[17]||(ee[17]=oe=>e.value={...e.value,validations:oe.length>0?oe:void 0})},null,8,["model-value"])]),_:1})]))}}),UIt={class:"flex flex-col gap-3"},qIt={class:"grid grid-cols-2 gap-3"},jIt={class:"grid grid-cols-3 gap-3"},HIt={class:"grid grid-cols-3 gap-3"},WIt={class:"text-xs font-medium text-zinc-500"},KIt={class:"grid grid-cols-2 gap-3"},GIt={class:"grid grid-cols-2 gap-3"},YIt={class:"grid grid-cols-3 gap-3"},JIt={key:0,"data-slot":"cascade-description",class:"mt-1 border-t border-zinc-200 px-2 py-1.5 text-xs text-zinc-500"},XIt={class:"grid grid-cols-3 gap-3"},QIt=ae({name:"ShwfedTreeComboboxMultiFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=Sve(()=>{}),o=_=>an(n,_)??_,r=_=>sn(n,_),l=Ei(()=>{}),a=_=>an(l,_)??_,u=_=>sn(l,_),c={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},f={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},p=T({get:()=>e.value.binding??"",set:_=>{const k=_.trim();if(k.length===0){const{binding:w,...$}=e.value;e.value=$}else e.value={...e.value,binding:k}}}),m=[{value:"independent",label:"独立",description:"勾选 / 取消只作用于当前节点;父子互不影响"},{value:"cascade-down",label:"向下级联",description:"勾选父节点自动勾选其全部可选后代;取消时同理。父节点的勾选状态独立追踪"},{value:"cascade-both",label:"双向级联",description:"在向下级联基础上,父节点反映后代勾选状态(全选→选中、部分→半选、全不选→未选)"}],h=ue(!1),v=ue(null);Qe(h,_=>{v.value=_?e.value.cascade??"independent":null});const g=T(()=>m.find(_=>_.value===v.value)?.description);function b(_){e.value={...e.value,dataSource:{...e.value.dataSource,data:_}}}function x(_){if(_.trim().length===0){const{request:w,...$}=e.value.dataSource;e.value={...e.value,dataSource:$}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:_}}}function y(_,k){if(k.length===0){const{[_]:w,...$}=e.value;e.value=$}else e.value={...e.value,[_]:k}}return(_,k)=>(S(),J("div",UIt,[H("div",qIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":k[0]||(k[0]=w=>{const $=String(w??"");e.value={...e.value,displayName:$.length>0?$:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:p.value,"onUpdate:modelValue":k[1]||(k[1]=w=>p.value=w),placeholder:"例:user.departmentIds",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",jIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":k[2]||(k[2]=w=>e.value={...e.value,label:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":e.value.placeholder,"onUpdate:modelValue":k[3]||(k[3]=w=>e.value={...e.value,placeholder:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":k[4]||(k[4]=w=>e.value={...e.value,tooltip:w})},null,8,["model-value"])]),_:1})]),H("div",HIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":k[5]||(k[5]=w=>e.value={...e.value,orientation:w})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),w=>(S(),B(i(Fn),{key:w.value,value:w.value},{default:d(()=>[D(A(w.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),H("h3",WIt,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":x},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":f,"onUpdate:modelValue":b},null,8,["model-value"])]),_:1}),k[21]||(k[21]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",KIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[6]||(k[6]=w=>e.value={...e.value,nodeKey:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[7]||(k[7]=w=>e.value={...e.value,nodeChildren:w})},null,8,["model-value"])]),_:1})]),H("div",GIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":k[8]||(k[8]=w=>e.value={...e.value,nodeLabel:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":k[9]||(k[9]=w=>e.value={...e.value,nodeTooltip:w})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("keywords")),1)]),_:2},[r("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[10]||(k[10]=w=>y("keywords",w))},null,8,["model-value"])]),_:1}),H("div",YIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:!has(node.disabled) || !node.disabled","result-type":"bool","extra-vars":c,class:"min-h-10","onUpdate:modelValue":k[11]||(k[11]=w=>y("nodeSelectable",w))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("cascade")),1)]),_:2},[r("cascade")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("cascade"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{open:h.value,"onUpdate:open":k[12]||(k[12]=w=>h.value=w),"model-value":e.value.cascade??"independent","onUpdate:modelValue":k[13]||(k[13]=w=>e.value={...e.value,cascade:w})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(),J(Me,null,Ze(m,w=>s(i(Fn),{key:w.value,value:w.value,onMouseenter:$=>v.value=w.value,onFocus:$=>v.value=w.value},{default:d(()=>[D(A(w.label),1)]),_:2},1032,["value","onMouseenter","onFocus"])),64)),g.value?(S(),J("div",JIt,A(g.value),1)):be("",!0)]),_:1})]),_:1},8,["open","model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":k[14]||(k[14]=w=>e.value={...e.value,expandAll:w})},null,8,["model-value"])])]),_:1})]),H("div",XIt,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[15]||(k[15]=w=>e.value={...e.value,required:w.length>0?w:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[16]||(k[16]=w=>y("hidden",w))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可勾选",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[17]||(k[17]=w=>y("disabled",w))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已勾选节点的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":k[18]||(k[18]=w=>y("readonly",w))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"list",placeholder:"例:form.defaultDepartmentIds","onUpdate:modelValue":k[19]||(k[19]=w=>e.value={...e.value,derived:w})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":k[20]||(k[20]=w=>e.value={...e.value,validations:w.length>0?w:void 0})},null,8,["model-value"])]),_:1})]))}}),ZIt={class:"flex flex-col gap-3"},e4t={class:"grid grid-cols-2 gap-3"},t4t={class:"grid grid-cols-3 gap-3"},n4t={class:"grid grid-cols-3 gap-3"},o4t={class:"text-xs font-medium text-zinc-500"},r4t={class:"grid grid-cols-2 gap-3"},l4t={class:"grid grid-cols-2 gap-3"},i4t={class:"grid grid-cols-2 gap-3"},a4t={class:"grid grid-cols-3 gap-3"},s4t=ae({name:"ShwfedTreeComboboxSingleFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=$ve(()=>{}),o=g=>an(n,g)??g,r=g=>sn(n,g),l=Ei(()=>{}),a=g=>an(l,g)??g,u=g=>sn(l,g),c={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},f={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},p=T({get:()=>e.value.binding??"",set:g=>{const b=g.trim();if(b.length===0){const{binding:x,...y}=e.value;e.value=y}else e.value={...e.value,binding:b}}});function m(g){e.value={...e.value,dataSource:{...e.value.dataSource,data:g}}}function h(g){if(g.trim().length===0){const{request:x,...y}=e.value.dataSource;e.value={...e.value,dataSource:y}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:g}}}function v(g,b){if(b.length===0){const{[g]:x,...y}=e.value;e.value=y}else e.value={...e.value,[g]:b}}return(g,b)=>(S(),J("div",ZIt,[H("div",e4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":b[0]||(b[0]=x=>{const y=String(x??"");e.value={...e.value,displayName:y.length>0?y:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:p.value,"onUpdate:modelValue":b[1]||(b[1]=x=>p.value=x),placeholder:"例:user.departmentId",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",t4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":b[2]||(b[2]=x=>e.value={...e.value,label:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("placeholder")),1)]),_:2},[r("placeholder")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("placeholder"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":e.value.placeholder,"onUpdate:modelValue":b[3]||(b[3]=x=>e.value={...e.value,placeholder:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":b[4]||(b[4]=x=>e.value={...e.value,tooltip:x})},null,8,["model-value"])]),_:1})]),H("div",n4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("orientation")),1)]),_:2},[r("orientation")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("orientation"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.orientation??i(Kn),"onUpdate:modelValue":b[5]||(b[5]=x=>e.value={...e.value,orientation:x})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(!0),J(Me,null,Ze(i(hl),x=>(S(),B(i(Fn),{key:x.value,value:x.value},{default:d(()=>[D(A(x.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])]),_:1})]),H("h3",o4t,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":h},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":f,"onUpdate:modelValue":m},null,8,["model-value"])]),_:1}),b[19]||(b[19]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",r4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[6]||(b[6]=x=>e.value={...e.value,nodeKey:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[7]||(b[7]=x=>e.value={...e.value,nodeChildren:x})},null,8,["model-value"])]),_:1})]),H("div",l4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":b[8]||(b[8]=x=>e.value={...e.value,nodeLabel:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":b[9]||(b[9]=x=>e.value={...e.value,nodeTooltip:x})},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("keywords")),1)]),_:2},[r("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[10]||(b[10]=x=>v("keywords",x))},null,8,["model-value"])]),_:1}),H("div",i4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:!has(node.disabled) || !node.disabled","result-type":"bool","extra-vars":c,class:"min-h-10","onUpdate:modelValue":b[11]||(b[11]=x=>v("nodeSelectable",x))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":b[12]||(b[12]=x=>e.value={...e.value,expandAll:x})},null,8,["model-value"])])]),_:1})]),H("div",a4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[13]||(b[13]=x=>e.value={...e.value,required:x.length>0?x:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[14]||(b[14]=x=>v("hidden",x))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可选择",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[15]||(b[15]=x=>v("disabled",x))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已选项的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":b[16]||(b[16]=x=>v("readonly",x))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":["string","number","dyn"],placeholder:"例:form.defaultDepartmentId","onUpdate:modelValue":b[17]||(b[17]=x=>e.value={...e.value,derived:x})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":b[18]||(b[18]=x=>e.value={...e.value,validations:x.length>0?x:void 0})},null,8,["model-value"])]),_:1})]))}}),u4t={class:"flex flex-col gap-3"},c4t={class:"grid grid-cols-2 gap-3"},d4t={class:"grid grid-cols-2 gap-3"},f4t={class:"text-xs font-medium text-zinc-500"},p4t={class:"grid grid-cols-2 gap-3"},m4t={class:"grid grid-cols-2 gap-3"},h4t={class:"grid grid-cols-3 gap-3"},v4t={class:"flex items-center gap-2"},g4t={class:"text-xs font-medium text-zinc-500"},y4t={key:0,class:"grid grid-cols-2 gap-3"},b4t={class:"grid grid-cols-3 gap-3"},x4t=ae({name:"ShwfedTreeMultiFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=Eve(()=>{}),o=C=>an(n,C)??C,r=C=>sn(n,C),l=Ei(()=>{}),a=C=>an(l,C)??C,u=C=>sn(l,C),c=n.fields.filter.from,f=C=>an(c,C)??C,p=C=>sn(c,C),m={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},h={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},v=T({get:()=>e.value.binding??"",set:C=>{const E=C.trim();if(E.length===0){const{binding:z,...N}=e.value;e.value=N}else e.value={...e.value,binding:E}}}),g=[{value:"independent",label:"独立"},{value:"cascade-down",label:"向下级联"},{value:"cascade-both",label:"双向级联"}];function b(C){e.value={...e.value,dataSource:{...e.value.dataSource,data:C}}}function x(C){if(C.trim().length===0){const{request:z,...N}=e.value.dataSource;e.value={...e.value,dataSource:N}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:C}}}function y(C,E){if(E.length===0){const{[C]:z,...N}=e.value;e.value=N}else e.value={...e.value,[C]:E}}const _=T(()=>e.value.filter);function k(C){if(C)e.value={...e.value,filter:{...e.value.filter??{},enabled:!0}};else{const{filter:E,...z}=e.value;e.value=z}}function w(C){const E=e.value.filter;if(!E)return;if(!C||C.every(N=>N.message.trim().length===0)){const{label:N,...P}=E;e.value={...e.value,filter:P}}else e.value={...e.value,filter:{...E,label:C}}}function $(C){const E=e.value.filter;if(E)if(C.length===0){const{keywords:z,...N}=E;e.value={...e.value,filter:N}}else e.value={...e.value,filter:{...E,keywords:C}}}return(C,E)=>(S(),J("div",u4t,[H("div",c4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":E[0]||(E[0]=z=>{const N=String(z??"");e.value={...e.value,displayName:N.length>0?N:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":E[1]||(E[1]=z=>v.value=z),placeholder:"例:user.departmentIds",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",d4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":E[2]||(E[2]=z=>e.value={...e.value,label:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":E[3]||(E[3]=z=>e.value={...e.value,tooltip:z})},null,8,["model-value"])]),_:1})]),H("h3",f4t,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":x},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":h,"onUpdate:modelValue":b},null,8,["model-value"])]),_:1}),E[17]||(E[17]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",p4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":m,class:"min-h-10","onUpdate:modelValue":E[4]||(E[4]=z=>e.value={...e.value,nodeKey:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":E[5]||(E[5]=z=>e.value={...e.value,nodeChildren:z})},null,8,["model-value"])]),_:1})]),H("div",m4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":E[6]||(E[6]=z=>e.value={...e.value,nodeLabel:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":E[7]||(E[7]=z=>e.value={...e.value,nodeTooltip:z})},null,8,["model-value"])]),_:1})]),H("div",h4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:node.kind == 'leaf'","result-type":"bool","extra-vars":m,class:"min-h-10","onUpdate:modelValue":E[8]||(E[8]=z=>y("nodeSelectable",z))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("cascade")),1)]),_:2},[r("cascade")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("cascade"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Vn),{"model-value":e.value.cascade??"cascade-both","onUpdate:modelValue":E[9]||(E[9]=z=>e.value={...e.value,cascade:z})},{default:d(()=>[s(i(Nn),{class:"w-full"},{default:d(()=>[s(i(Ln))]),_:1}),s(i(Pn),null,{default:d(()=>[(S(),J(Me,null,Ze(g,z=>s(i(Fn),{key:z.value,value:z.value},{default:d(()=>[D(A(z.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":E[10]||(E[10]=z=>e.value={...e.value,expandAll:z})},null,8,["model-value"])])]),_:1})]),H("div",v4t,[H("h3",g4t,A(o("filter")),1),s(i(Yo),{size:"sm","model-value":_.value?.enabled??!1,"aria-label":f("enabled"),"onUpdate:modelValue":k},null,8,["model-value","aria-label"])]),_.value?.enabled?(S(),J("div",y4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("label")),1)]),_:2},[p("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"tree filter input label","model-value":_.value.label,"onUpdate:modelValue":w},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("keywords")),1)]),_:2},[p("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":_.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":$},null,8,["model-value"])]),_:1})])):be("",!0),H("div",b4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[11]||(E[11]=z=>e.value={...e.value,required:z.length>0?z:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[12]||(E[12]=z=>y("hidden",z))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可勾选",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[13]||(E[13]=z=>y("disabled",z))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已勾选节点的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":E[14]||(E[14]=z=>y("readonly",z))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.defaultDepartmentIds","onUpdate:modelValue":E[15]||(E[15]=z=>e.value={...e.value,derived:z})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":E[16]||(E[16]=z=>e.value={...e.value,validations:z.length>0?z:void 0})},null,8,["model-value"])]),_:1})]))}}),_4t={class:"flex flex-col gap-3"},w4t={class:"grid grid-cols-2 gap-3"},k4t={class:"grid grid-cols-2 gap-3"},S4t={class:"text-xs font-medium text-zinc-500"},C4t={class:"grid grid-cols-2 gap-3"},$4t={class:"grid grid-cols-2 gap-3"},T4t={class:"grid grid-cols-2 gap-3"},E4t={class:"flex items-center gap-2"},A4t={class:"text-xs font-medium text-zinc-500"},D4t={key:0,class:"grid grid-cols-2 gap-3"},z4t={class:"grid grid-cols-3 gap-3"},O4t=ae({name:"ShwfedTreeSingleFieldConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=zve(()=>{}),o=$=>an(n,$)??$,r=$=>sn(n,$),l=Ei(()=>{}),a=$=>an(l,$)??$,u=$=>sn(l,$),c=n.fields.filter.from,f=$=>an(c,$)??$,p=$=>sn(c,$),m={node:{type:"dyn",label:"当前节点",description:"由 `数据` 表达式返回的每一项;类型在配置时未知(`dyn`)"}},h={json:{type:"optional<dyn>",label:"HTTP 响应体",description:"已解析的 JSON 响应;未配置 `request` 时为 `none`"}},v=T({get:()=>e.value.binding??"",set:$=>{const C=$.trim();if(C.length===0){const{binding:E,...z}=e.value;e.value=z}else e.value={...e.value,binding:C}}});function g($){e.value={...e.value,dataSource:{...e.value.dataSource,data:$}}}function b($){if($.trim().length===0){const{request:E,...z}=e.value.dataSource;e.value={...e.value,dataSource:z}}else e.value={...e.value,dataSource:{...e.value.dataSource,request:$}}}function x($,C){if(C.length===0){const{[$]:E,...z}=e.value;e.value=z}else e.value={...e.value,[$]:C}}const y=T(()=>e.value.filter);function _($){if($)e.value={...e.value,filter:{...e.value.filter??{},enabled:!0}};else{const{filter:C,...E}=e.value;e.value=E}}function k($){const C=e.value.filter;if(!C)return;if(!$||$.every(z=>z.message.trim().length===0)){const{label:z,...N}=C;e.value={...e.value,filter:N}}else e.value={...e.value,filter:{...C,label:$}}}function w($){const C=e.value.filter;if(C)if($.length===0){const{keywords:E,...z}=C;e.value={...e.value,filter:z}}else e.value={...e.value,filter:{...C,keywords:$}}}return($,C)=>(S(),J("div",_4t,[H("div",w4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("displayName")),1)]),_:2},[r("displayName")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("displayName"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{"model-value":e.value.displayName??"",placeholder:"例:所属部门","onUpdate:modelValue":C[0]||(C[0]=E=>{const z=String(E??"");e.value={...e.value,displayName:z.length>0?z:void 0}})},null,8,["model-value"])]),_:1})]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("binding")),1)]),_:2},[r("binding")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("binding"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:v.value,"onUpdate:modelValue":C[1]||(C[1]=E=>v.value=E),placeholder:"例:user.departmentId",class:"font-mono"},null,8,["modelValue"])]),_:1})]),_:1})]),H("div",k4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("label")),1)]),_:2},[r("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"form field label","model-value":e.value.label,"onUpdate:modelValue":C[2]||(C[2]=E=>e.value={...e.value,label:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("tooltip")),1)]),_:2},[r("tooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("tooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"form field tooltip","model-value":e.value.tooltip,"onUpdate:modelValue":C[3]||(C[3]=E=>e.value={...e.value,tooltip:E})},null,8,["model-value"])]),_:1})]),H("h3",S4t,A(o("dataSource")),1),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("request")),1)]),_:2},[u("request")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("request"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.request??"",placeholder:"如 http.get('/api/departments/tree')","result-type":"HttpRequest",multiline:"",class:"min-h-20","onUpdate:modelValue":b},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a("data")),1)]),_:2},[u("data")?{name:"tooltip",fn:d(()=>[s(i(O),{source:u("data"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.dataSource.data,placeholder:"如 json.?value.roots.orValue([])","result-type":"list","extra-vars":h,"onUpdate:modelValue":g},null,8,["model-value"])]),_:1}),C[16]||(C[16]=H("h3",{class:"text-xs font-medium text-zinc-500"}," 节点 ",-1)),H("div",C4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeKey")),1)]),_:2},[r("nodeKey")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeKey"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeKey,placeholder:"例:string(node.id)","result-type":["string","number","dyn"],"extra-vars":m,class:"min-h-10","onUpdate:modelValue":C[4]||(C[4]=E=>e.value={...e.value,nodeKey:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeChildren")),1)]),_:2},[r("nodeChildren")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeChildren"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeChildren,placeholder:"例:has(node.children) ? node.children : null","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":C[5]||(C[5]=E=>e.value={...e.value,nodeChildren:E})},null,8,["model-value"])]),_:1})]),H("div",$4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeLabel")),1)]),_:2},[r("nodeLabel")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeLabel"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node label","model-value":e.value.nodeLabel,"onUpdate:modelValue":C[6]||(C[6]=E=>e.value={...e.value,nodeLabel:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeTooltip")),1)]),_:2},[r("nodeTooltip")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeTooltip"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{markdown:"","translate-hint":"tree node tooltip","model-value":e.value.nodeTooltip,"onUpdate:modelValue":C[7]||(C[7]=E=>e.value={...e.value,nodeTooltip:E})},null,8,["model-value"])]),_:1})]),H("div",T4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("nodeSelectable")),1)]),_:2},[r("nodeSelectable")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("nodeSelectable"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":e.value.nodeSelectable??"",placeholder:"例:node.kind == 'leaf'","result-type":"bool","extra-vars":m,class:"min-h-10","onUpdate:modelValue":C[8]||(C[8]=E=>x("nodeSelectable",E))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(o("expandAll")),1)]),_:2},[r("expandAll")?{name:"tooltip",fn:d(()=>[s(i(O),{source:r("expandAll"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),H("div",null,[s(i(Yo),{"model-value":e.value.expandAll??!1,"onUpdate:modelValue":C[9]||(C[9]=E=>e.value={...e.value,expandAll:E})},null,8,["model-value"])])]),_:1})]),H("div",E4t,[H("h3",A4t,A(o("filter")),1),s(i(Yo),{size:"sm","model-value":y.value?.enabled??!1,"aria-label":f("enabled"),"onUpdate:modelValue":_},null,8,["model-value","aria-label"])]),y.value?.enabled?(S(),J("div",D4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("label")),1)]),_:2},[p("label")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("label"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"translate-hint":"tree filter input label","model-value":y.value.label,"onUpdate:modelValue":k},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f("keywords")),1)]),_:2},[p("keywords")?{name:"tooltip",fn:d(()=>[s(i(O),{source:p("keywords"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{"model-value":y.value.keywords??"",placeholder:"例:[node.code, node.alias]","result-type":"list","extra-vars":m,class:"min-h-10","onUpdate:modelValue":w},null,8,["model-value"])]),_:1})])):be("",!0),H("div",z4t,[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("required")??"返回 `true` 时显示必填星号并要求非空",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("required")),1)]),_:1}),s(i(_e),{"model-value":e.value.required??"",placeholder:"例:form.type == 'company'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[10]||(C[10]=E=>e.value={...e.value,required:E.length>0?E:void 0})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("hidden")??"返回 `true` 时字段在所有布局中都不渲染",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("hidden")),1)]),_:1}),s(i(_e),{"model-value":e.value.hidden??"",placeholder:"例:form.role == 'guest'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[11]||(C[11]=E=>x("hidden",E))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("disabled")??"返回 `true` 时仍渲染但不可勾选",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("disabled")),1)]),_:1}),s(i(_e),{"model-value":e.value.disabled??"",placeholder:"例:form.status == 'locked'","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[12]||(C[12]=E=>x("disabled",E))},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("readonly")??"返回 `true` 时仅以纯文本展示当前已勾选节点的标签",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("readonly")),1)]),_:1}),s(i(_e),{"model-value":e.value.readonly??"",placeholder:"例:form.id != null","result-type":"bool",class:"min-h-10","onUpdate:modelValue":C[13]||(C[13]=E=>x("readonly",E))},null,8,["model-value"])]),_:1})]),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("derived"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("derived")),1)]),_:1}),s(po,{"model-value":e.value.derived,"result-type":"dyn",placeholder:"例:form.defaultDepartmentIds","onUpdate:modelValue":C[14]||(C[14]=E=>e.value={...e.value,derived:E})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},{tooltip:d(()=>[s(i(O),{source:r("validations"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:d(()=>[D(" "+A(o("validations")),1)]),_:1}),s(Zr,{"model-value":e.value.validations,"onUpdate:modelValue":C[15]||(C[15]=E=>e.value={...e.value,validations:E.length>0?E:void 0})},null,8,["model-value"])]),_:1})]))}}),M4t=ae({name:"ShwfedMarkdownFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=(u,c)=>Dt(u,{...Pt(r),...c}),a=T(()=>{const u=Ke(e.config.content,n.value)??"";return u?Jn(u,l,{form:o.value??{}}):""});return(u,c)=>a.value?(S(),B(i(O),{key:0,source:a.value,block:"",class:"prose prose-sm prose-zinc max-w-none"},null,8,["source"])):be("",!0)}}),I4t=/\{\{([\s\S]*?)\}\}/g;function QN(t,e){return t.replace(I4t,(n,o)=>{const r=o.trim();return r.length===0?"":e(r)})}const Rve=Symbol("shwfed-form-validation");function R4t(t){const e=ue(!1),n=new Map;function o(){const l=[];for(const a of n.values())l.push(...a.results());return l}const r={revealed:e,reveal:()=>{e.value=!0},register:(l,a)=>{const u=Symbol("field");return n.set(u,{fieldId:l,results:a}),()=>{n.delete(u)}},async validate(){t.flush(),await t.seeded,await t.settled(),await Vt();const l=o();return r.reveal(),l.every(a=>a.severity!=="error")},resultsFor(l){const a=new Set(l),u=[];for(const c of n.values())a.has(c.fieldId())&&u.push(...c.results());return u}};return Tr(Rve,r),r}function Vve(){return Yn(Rve,void 0)}const pK={zh:"请填写此字段",ja:"この項目を入力してください",en:"Please fill in this field",ko:"이 항목을 입력해 주세요"};function V4t(t){return pK[t]??pK.zh}function P4t(t){return t==null||t===""||Array.isArray(t)&&t.length===0}function el(t){const{getAt:e,dirty:n}=Xn(),o=Vve();function r(m){if(!m)return!1;try{return We(t.$cel(m))}catch{return!1}}const l=T(()=>r(t.config().required));function a(m){const h=Ke(m,t.locale())??"";return h?QN(h,v=>{try{const g=We(t.$cel(v));return g==null?"":String(g)}catch{return""}}):""}const u=T(()=>{const m=t.config(),h=[];return typeof m.binding=="string"&&l.value&&P4t(e(m.binding))&&h.push({severity:"error",message:V4t(t.locale()),ruleIndex:-1}),(m.validations??[]).forEach((g,b)=>{if(!r(g.when))return;const x=g.warning?"warning":"error";h.push({severity:x,message:a(g.message),ruleIndex:b})}),h});if(o){const m=o.register(t.fieldId,()=>u.value);Um(m)}const c=T(()=>u.value.filter(m=>m.severity==="error").map(m=>m.message)),f=T(()=>u.value.filter(m=>m.severity==="warning").map(m=>m.message)),p=T(()=>{if(o?.revealed.value)return!0;const m=t.config().binding;return typeof m=="string"&&n.value.has(m)});return{isRequired:l,errors:c,warnings:f,visible:p}}const Pve=Symbol("shwfed-form-readonly"),F4t=ue(!1);function N4t(t){Tr(Pve,t)}function kr(){return Yn(Pve,F4t)}const L4t={key:0,"aria-hidden":"true",class:"text-red-600"},B4t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},U4t=ae({name:"ShwfedTextFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=(C,E)=>Dt(C,{...Pt(r),...E}),a=T(()=>Ke(e.config.label,n.value)),u=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),c=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function f(C,E){if(!C)return!1;try{return We(l(C,{form:o.value??{}}))}catch(z){return console.error(`[shwfed-form] failed to evaluate ${E} for ${e.fieldId}:`,z),!1}}const p=T(()=>f(e.config.disabled,"disabled")),m=kr(),h=T(()=>e.config.readonly!=null?f(e.config.readonly,"readonly"):m.value),v=T(()=>h.value||e.config.derived?.mode==="formula"),{draft:g,commit:b}=Pb({binding:()=>e.config.binding,fromState:C=>C==null?"":String(C),toState:C=>C.length===0?null:C}),{isRequired:x,errors:y,warnings:_,visible:k}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:l,locale:()=>n.value}),w=T(()=>!p.value&&g.value.length>0);function $(){g.value="",b()}return(C,E)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":p.value||void 0},{default:d(()=>[a.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a.value),1),i(x)?(S(),J("span",L4t," *")):be("",!0)]),_:2},[c.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:c.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),v.value?(S(),J("div",B4t,A(i(g)||"—"),1)):(S(),B(i(Fe),{key:2,class:"group/text-field"},{default:d(()=>[s(i(Xe),{id:t.fieldId,modelValue:i(g),"onUpdate:modelValue":E[0]||(E[0]=z=>Kt(g)?g.value=z:null),placeholder:u.value,disabled:p.value,onBlur:i(b),onKeydown:fr(i(b),["enter"])},null,8,["id","modelValue","placeholder","disabled","onBlur","onKeydown"]),w.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/text-field:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"text-field-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:E[1]||(E[1]=lt(()=>{},["prevent"])),onClick:lt($,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1})),i(k)?(S(),B(i(Xr),{key:3,errors:i(y),warnings:i(_)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),q4t={key:0,"aria-hidden":"true",class:"text-red-600"},j4t={key:1,class:"min-h-9 py-1.5 text-sm whitespace-pre-wrap text-zinc-700"},H4t=ae({name:"ShwfedTextareaFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=($,C)=>Dt($,{...Pt(r),...C}),a=T(()=>Ke(e.config.label,n.value)),u=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),c=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),f=T(()=>e.config.maxLength);function p($,C){if(!$)return!1;try{return We(l($,{form:o.value??{}}))}catch(E){return console.error(`[shwfed-form] failed to evaluate ${C} for ${e.fieldId}:`,E),!1}}const m=T(()=>p(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?p(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula"),{draft:b,commit:x}=Pb({binding:()=>e.config.binding,fromState:$=>$==null?"":String($),toState:$=>$}),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:l,locale:()=>n.value});return($,C)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[a.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a.value),1),i(y)?(S(),J("span",q4t," *")):be("",!0)]),_:2},[c.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:c.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",j4t,A(i(b)||"—"),1)):(S(),B(i(Fe),{key:2},{default:d(()=>[s(i(Nue),{id:t.fieldId,modelValue:i(b),"onUpdate:modelValue":C[0]||(C[0]=E=>Kt(b)?b.value=E:null),placeholder:u.value,disabled:m.value,maxlength:f.value,onBlur:i(x)},null,8,["id","modelValue","placeholder","disabled","maxlength","onBlur"]),f.value!=null?(S(),B(i(Ye),{key:0,align:"block-end"},{default:d(()=>[s(i(Vr),{class:"tabular-nums"},{default:d(()=>[D(A(i(b).length)+" / "+A(f.value),1)]),_:1})]),_:1})):be("",!0)]),_:1})),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),W4t=ae({name:"ShwfedActionsFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,n=T(()=>({kind:"shwfed.component.action",size:"default",gap:e.config.gap,style:e.config.style,groups:e.config.groups.map(o=>({...o,variant:o.variant??"default"})),items:e.config.items}));return(o,r)=>(S(),B(Q3,{config:n.value},null,8,["config"]))}}),K4t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},G4t=ae({name:"ShwfedComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-placeholder":"请选择","combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项"},en:{"combobox-single-placeholder":"Select…","combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches"},ja:{"combobox-single-placeholder":"選択してください","combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(L,F)=>Dt(L,{...Pt(u),...F}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-single-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(L,F){if(!L)return!1;try{return We(c(L,{form:r.value??{}}))}catch(j){return console.error(`[shwfed-form] failed to evaluate ${F} for ${e.fieldId}:`,j),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula");function y(L){try{return We(c(e.config.optionValue,{form:r.value??{},option:L}))}catch(F){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,F);return}}function _(L){const F=Ke(e.config.optionLabel,n.value)??"";return F?Jn(F,c,{form:r.value??{},option:L}):""}const k=T(()=>{let L;try{L=We(c(e.config.options,{form:r.value??{}}))}catch(F){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,F),[]}return Array.isArray(L)?L.map((F,j)=>({key:String(j),label:_(F),value:y(F)})):[]}),w=ue(void 0),$=T({get:()=>{const L=e.config.binding;return L==null?w.value:l(L)},set:L=>{const F=e.config.binding;if(F==null){w.value=L;return}a(F,L)}});function C(L,F){if(L===F)return!0;if(L==null||F==null)return!1;if(typeof L=="object"&&typeof F=="object")try{return JSON.stringify(L)===JSON.stringify(F)}catch{return!1}return!1}const E=T(()=>k.value.find(L=>C(L.value,$.value))),z=T(()=>E.value?.key),N=T(()=>E.value?.label??""),P=ue(!1);function Q(L){if(typeof L!="string")return;const F=k.value.find(j=>j.key===L);F&&($.value=F.value,Vt().then(()=>{P.value=!1}))}const W=T(()=>!v.value&&E.value!==void 0);function Z(){$.value=void 0,P.value=!1}return(L,F)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",K4t,A(N.value||"—"),1)):(S(),B(i(vr),{key:2,open:P.value,"onUpdate:open":F[1]||(F[1]=j=>P.value=j)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":N.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),W.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:F[0]||(F[0]=lt(()=>{},["prevent"])),onClick:lt(Z,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":z.value,disabled:v.value,"selection-behavior":"toggle","onUpdate:modelValue":Q},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(k.value,j=>(S(),B(i(Fr),{key:j.key,value:j.key},{default:d(()=>[D(A(j.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),Y4t={class:"w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10"},J4t={key:0,class:"text-sm font-medium",style:{"text-autospace":"normal"}},X4t={key:0,class:"grid grid-cols-4 gap-1 mt-4 w-full"},Q4t=["disabled","onClick"],Z4t={key:1,class:"grid grid-cols-4 gap-1 mt-4 w-full"},eRt=["disabled","onClick"],tRt={key:2,class:"flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"},eA=ae({name:"UiCalendar",__name:"Calendar",props:{defaultValue:{},defaultPlaceholder:{},placeholder:{},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{},isDateUnavailable:{},dir:{},nextPage:{},prevPage:{},modelValue:{default:void 0},multiple:{type:Boolean},disableDaysOutsideCurrentView:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},layout:{default:void 0}},emits:["update:modelValue","update:placeholder"],setup(t,{emit:e}){const n=t,o=e,r=Ut(n,"class","layout","placeholder"),l=zo(n,"placeholder",o,{passive:!0,defaultValue:n.defaultPlaceholder??op(As())}),a=o6(),{locale:u}=Bt({useScope:"global",inheritLocale:!0}),c=T(()=>n.locale??u.value??a.language.value??"en"),f=l2(c.value);Qe(c,g=>{f.setLocale(g)});const p=co(r,o),m=T(()=>{const g=a.language.value;if(!a.isSupported||!g)return;const b=new Intl.Locale(g);if("getWeekInfo"in b&&typeof b.getWeekInfo=="function")return b.getWeekInfo().firstDay}),h=T(()=>Math.floor(l.value.year/12)*12);function v(g){const b=n.isDateDisabled;return typeof b!="function"?!1:b(g)}return(g,b)=>(S(),B(i(oYe),Be(i(p),{placeholder:i(l),"onUpdate:placeholder":b[0]||(b[0]=x=>Kt(l)?l.value=x:null),"data-slot":"calendar","week-starts-on":m.value,"fixed-weeks":"",locale:c.value,class:i(dt)("p-3",n.class)}),{default:d(({grid:x,weekDays:y,date:_})=>[s(i(sRt),{class:nt(t.layout==="year"?"pt-2 pb-2":"pt-0")},{default:d(()=>[H("nav",Y4t,[s(i(dRt),{"prev-page":t.layout==="year"?k=>k.subtract({years:12}):t.layout==="month"?k=>k.subtract({years:1}):void 0},{default:d(()=>[we(g.$slots,"calendar-prev-icon")]),_:3},8,["prev-page"]),s(i(cRt),{"next-page":t.layout==="year"?k=>k.add({years:12}):t.layout==="month"?k=>k.add({years:1}):void 0},{default:d(()=>[we(g.$slots,"calendar-next-icon")]),_:3},8,["next-page"])]),we(g.$slots,"calendar-heading",{date:_},()=>[t.layout==="month"?(S(),J("span",J4t,A(i(f).custom(i(Sl)(_),{year:"numeric"})),1)):t.layout==="year"?(S(),J(Me,{key:1},[],64)):(S(),B(i(uRt),{key:2}))])]),_:2},1032,["class"]),t.layout==="month"?(S(),J("div",X4t,[(S(),J(Me,null,Ze(12,k=>H("button",{key:k,type:"button",disabled:v(new(i(Co))(i(l).year,k,1)),class:nt(i(dt)(i(mc)({variant:"ghost"}),"h-9 w-full rounded-md font-normal",t.modelValue&&!Array.isArray(t.modelValue)&&t.modelValue.year===i(l).year&&t.modelValue.month===k?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary)":"",v(new(i(Co))(i(l).year,k,1))?"text-zinc-500 opacity-50 cursor-default":"cursor-pointer")),onClick:w=>o("update:modelValue",new(i(Co))(i(l).year,k,1))},A(i(f).custom(i(Sl)(new(i(Co))(i(l).year,k,1)),{month:"short"})),11,Q4t)),64))])):t.layout==="year"?(S(),J("div",Z4t,[(S(),J(Me,null,Ze(12,k=>H("button",{key:k,type:"button",disabled:v(new(i(Co))(h.value+k-1,1,1)),class:nt(i(dt)(i(mc)({variant:"ghost"}),"h-9 w-full rounded-md font-normal",t.modelValue&&!Array.isArray(t.modelValue)&&t.modelValue.year===h.value+k-1?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary)":"",v(new(i(Co))(h.value+k-1,1,1))?"text-zinc-500 opacity-50 cursor-default":"cursor-pointer")),onClick:w=>o("update:modelValue",new(i(Co))(h.value+k-1,1,1))},A(h.value+k-1),11,eRt)),64))])):(S(),J("div",tRt,[(S(!0),J(Me,null,Ze(x,k=>(S(),B(i(rRt),{key:k.value.toString()},{default:d(()=>[s(i(iRt),null,{default:d(()=>[s(i(mK),null,{default:d(()=>[(S(!0),J(Me,null,Ze(y,w=>(S(),B(i(aRt),{key:w},{default:d(()=>[D(A(w),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),s(i(lRt),null,{default:d(()=>[(S(!0),J(Me,null,Ze(k.rows,(w,$)=>(S(),B(i(mK),{key:`weekDate-${$}`,class:"mt-2 w-full"},{default:d(()=>[(S(!0),J(Me,null,Ze(w,C=>(S(),B(i(nRt),{key:C.toString(),date:C},{default:d(()=>[s(i(oRt),{day:C,month:k.value},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))]))]),_:3},16,["placeholder","week-starts-on","locale","class"]))}}),nRt=ae({__name:"CalendarCell",props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(lYe),Be({"data-slot":"calendar-cell",class:i(dt)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),oRt=ae({__name:"CalendarCellTrigger",props:{day:{},month:{},asChild:{type:Boolean},as:{default:"button"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(aYe),Be({"data-slot":"calendar-cell-trigger",class:i(dt)(i(mc)({variant:"ghost"}),"size-8 rounded-full p-0 font-normal text-center transition-all duration-180 aria-selected:opacity-100 cursor-pointer","[&[data-today]:not([data-selected])]:font-semibold [&[data-today]:not([data-selected])]:text-(--primary)","data-selected:bg-(--primary) data-selected:opacity-100 data-selected:text-white data-selected:hover:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selected:hover:text-white","data-disabled:text-zinc-500 data-disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:hover:bg-transparent data-disabled:hover:text-zinc-500","data-unavailable:text-zinc-300 data-unavailable:line-through","data-outside-view:text-zinc-300",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),rRt=ae({__name:"CalendarGrid",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(uYe),Be({"data-slot":"calendar-grid",class:i(dt)("w-full border-collapse space-x-1",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),lRt=ae({__name:"CalendarGridBody",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,o)=>(S(),B(i(dYe),Be({"data-slot":"calendar-grid-body"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),iRt=ae({__name:"CalendarGridHead",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),B(i(pYe),Be({"data-slot":"calendar-grid-head"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),mK=ae({__name:"CalendarGridRow",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(hYe),Be({"data-slot":"calendar-grid-row",class:i(dt)("flex",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),aRt=ae({__name:"CalendarHeadCell",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(gYe),Be({"data-slot":"calendar-head-cell",class:i(dt)("text-zinc-700 rounded-md flex-1 font-normal text-[0.8rem]",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),sRt=ae({__name:"CalendarHeader",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(bYe),Be({"data-slot":"calendar-header",class:i(dt)("flex justify-center pt-1 relative items-center w-full px-8",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),uRt=ae({__name:"CalendarHeading",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(_Ye),Be({"data-slot":"calendar-heading",class:i(dt)("text-sm font-medium",e.class),style:{textAutospace:"normal"}},i(o)),{default:d(({headingValue:a})=>[we(r.$slots,"default",{headingValue:a},()=>[D(A(a),1)])]),_:3},16,["class"]))}}),cRt=ae({__name:"CalendarNextButton",props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(kYe),Be({"data-slot":"calendar-next-button",class:i(dt)(i(mc)({variant:"ghost",size:"sm"}),"bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-right-20-regular"})])]),_:3},16,["class"]))}}),dRt=ae({__name:"CalendarPrevButton",props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(CYe),Be({"data-slot":"calendar-prev-button",class:i(dt)(i(mc)({variant:"ghost",size:"sm"}),"bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-left-20-regular"})])]),_:3},16,["class"]))}}),fRt=ae({name:"UiDatePickerDatePanel",__name:"DatePickerDatePanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){if(Array.isArray(l)){o("update:modelValue",l[0]);return}o("update:modelValue",l)}return(l,a)=>(S(),B(i(eA),{"data-slot":"date-picker-date-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":r},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["class","model-value","default-placeholder","is-date-disabled"]))}}),Uc={Root:qXe,Header:tQe,Heading:oQe,Grid:YXe,Cell:HXe,Next:lQe,Prev:aQe,GridBody:XXe,GridRow:ZXe,CellTrigger:KXe},Up={Root:CQe,Ellipsis:wQe,First:TQe,Last:AQe,List:MQe,ListItem:RQe,Next:PQe,Prev:NQe},lu={Input:Het,Root:qet},qc={Root:htt,Header:Ttt,Heading:Att,Grid:_tt,Cell:gtt,Next:ztt,Prev:Mtt,GridBody:ktt,GridRow:Ctt,CellTrigger:btt},pRt={class:"border-zinc-200 flex items-center gap-2 border-t p-3"},mRt={key:1,class:"text-zinc-400 select-none"},hRt=ae({name:"UiDatePickerDateTimePanel",__name:"DatePickerDateTimePanel",props:{modelValue:{},isDateDisabled:{},granularity:{default:"second"},hourCycle:{default:24},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=T(()=>{const c=n.modelValue;if(c)return new Co(c.year,c.month,c.day)}),l=T(()=>{const c=n.modelValue;if(c)return new Ka(c.hour,c.minute,c.second)});function a(c){const f=Array.isArray(c)?c[0]:c;if(!f){o("update:modelValue",void 0);return}const p=n.modelValue,m="day"in f?f.day:1;o("update:modelValue",new xs(f.year,f.month,m,p?.hour??0,p?.minute??0,p?.second??0))}function u(c){if(!c){n.modelValue&&o("update:modelValue",new xs(n.modelValue.year,n.modelValue.month,n.modelValue.day,0,0,0));return}const f=c,p=n.modelValue;if(p){o("update:modelValue",new xs(p.year,p.month,p.day,f.hour,f.minute,f.second));return}const m=op(As());o("update:modelValue",new xs(m.year,m.month,m.day,f.hour,f.minute,f.second))}return(c,f)=>(S(),J("div",{"data-slot":"date-picker-datetime-panel",class:nt(i(dt)("flex flex-col",n.class))},[s(i(eA),{"model-value":r.value,"default-placeholder":r.value,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":a},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["model-value","default-placeholder","is-date-disabled"]),H("div",pRt,[s(i(de),{icon:"lucide:clock",class:"text-zinc-500 size-4 shrink-0"}),s(i(lu).Root,{"model-value":l.value,granularity:n.granularity,"hour-cycle":n.hourCycle,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 text-sm outline-none","onUpdate:modelValue":u},{default:d(({segments:p})=>[Array.isArray(p)?(S(!0),J(Me,{key:0},Ze(p,(m,h)=>(S(),J(Me,{key:`${m.part}-${h}`},[m.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:m.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(m.value),1)]),_:2},1032,["part"])):(S(),J("span",mRt,A(m.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle"])])],2))}}),vRt=ae({name:"UiDatePickerInput",inheritAttrs:!1,__name:"DatePickerInput",props:{modelValue:{},format:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},open:{type:Boolean},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e,l=ue(""),a=ue(!1);function u(){l.value=n.modelValue?Wr(n.modelValue,n.format):""}Qe(()=>[n.modelValue,n.format],()=>{a.value||u()},{immediate:!0});function c(){const v=l.value.trim();if(!v){n.modelValue!==void 0&&r("update:modelValue",void 0);return}const g=T3(v,n.format,n.modelValue??new Date);if(!zb(g)){u();return}r("update:modelValue",g)}function f(v){a.value=!0,r("focus",v)}function p(v){a.value=!1,c(),r("blur",v)}function m(){l.value="",r("update:modelValue",void 0),r("clear")}const h=T(()=>n.clearable&&!n.disabled&&!n.readonly&&n.modelValue!==void 0);return(v,g)=>(S(),B(i(Fe),Be(v.$attrs,{"data-slot":"date-picker-input","data-disabled":n.disabled?"true":void 0,"data-state":n.open?"open":void 0,class:i(dt)("group/date-picker-input",o.value,n.class)}),{default:d(()=>[n.prefixIcon?(S(),B(i(Ye),{key:0,align:"inline-start"},{default:d(()=>[s(i(de),{icon:n.prefixIcon},null,8,["icon"])]),_:1})):be("",!0),s(i(Xe),{"model-value":l.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,"onUpdate:modelValue":g[0]||(g[0]=b=>l.value=String(b)),onFocus:f,onBlur:p,onKeydown:fr(lt(c,["prevent"]),["enter"])},null,8,["model-value","placeholder","disabled","readonly","onKeydown"]),h.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:nt(i(dt)("[@media(hover:hover)]:opacity-0 transition-opacity","group-hover/date-picker-input:opacity-100 focus-within:opacity-100"))},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"date-picker-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:g[1]||(g[1]=lt(()=>{},["prevent"])),onClick:lt(m,["stop"])},{default:d(()=>[s(i(de),{icon:n.clearIcon},null,8,["icon"])]),_:1})]),_:1},8,["class"])):be("",!0)]),_:1},16,["data-disabled","data-state","class"]))}}),gRt=ae({name:"UiDatePickerMonthPanel",__name:"DatePickerMonthPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){if(Array.isArray(l)){o("update:modelValue",l[0]);return}o("update:modelValue",l)}return(l,a)=>(S(),B(i(eA),{layout:"month","data-slot":"date-picker-month-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":r},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["class","model-value","default-placeholder","is-date-disabled"]))}}),yRt={key:1,class:"text-zinc-400 select-none"},bRt=ae({name:"UiDatePickerTimeInput",inheritAttrs:!1,__name:"DatePickerTimeInput",props:{modelValue:{},granularity:{default:"second"},hourCycle:{default:24},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e,l=T(()=>n.clearable&&!n.disabled&&!n.readonly&&n.modelValue!==void 0);function a(c){r("update:modelValue",c??void 0)}function u(){r("update:modelValue",void 0),r("clear")}return(c,f)=>(S(),B(i(Fe),Be(c.$attrs,{"data-slot":"date-picker-time-input","data-disabled":n.disabled?"true":void 0,class:i(dt)("group/date-picker-input",o.value,n.class)}),{default:d(()=>[n.prefixIcon?(S(),B(i(Ye),{key:0,align:"inline-start"},{default:d(()=>[s(i(de),{icon:n.prefixIcon},null,8,["icon"])]),_:1})):be("",!0),s(i(lu).Root,{"data-slot":"input-group-control","model-value":n.modelValue,granularity:n.granularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","onUpdate:modelValue":a},{default:d(({segments:p})=>[Array.isArray(p)?(S(!0),J(Me,{key:0},Ze(p,(m,h)=>(S(),J(Me,{key:`${m.part}-${h}`},[m.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:m.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(m.value),1)]),_:2},1032,["part"])):(S(),J("span",yRt,A(m.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle","disabled","readonly"]),l.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:nt(i(dt)("[@media(hover:hover)]:opacity-0 transition-opacity","group-hover/date-picker-input:opacity-100 focus-within:opacity-100"))},{default:d(()=>[s(i(ot),{size:"icon-xs","as-child":""},{default:d(()=>[H("button",{type:"button","data-slot":"date-picker-clear",class:"text-zinc-500 transition-colors hover:text-zinc-700",tabindex:"-1",onMousedown:f[0]||(f[0]=lt(()=>{},["prevent"])),onClick:lt(u,["stop"])},[s(i(de),{icon:n.clearIcon},null,8,["icon"])],32)]),_:1})]),_:1},8,["class"])):be("",!0)]),_:1},16,["data-disabled","class"]))}}),xRt=ae({name:"UiDatePickerYearPanel",__name:"DatePickerYearPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){if(Array.isArray(l)){o("update:modelValue",l[0]);return}o("update:modelValue",l)}return(l,a)=>(S(),B(i(eA),{layout:"year","data-slot":"date-picker-year-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue,"is-date-disabled":n.isDateDisabled,"onUpdate:modelValue":r},{"calendar-prev-icon":d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),"calendar-next-icon":d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1},8,["class","model-value","default-placeholder","is-date-disabled"]))}}),_Rt=["onClick"],Fve=ae({name:"UiPickerShortcuts",__name:"PickerShortcuts",props:{items:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["select"],setup(t,{emit:e}){const n=t,o=e,r=o6(),l=T(()=>r.language.value?.split("-")[0]??"en");function a(u){return Ke(u,l.value)??""}return(u,c)=>(S(),J("div",{"data-slot":"picker-shortcuts",class:nt(i(dt)("border-zinc-200 flex flex-wrap items-center gap-1 border-t px-2 py-2 text-xs",n.class))},[(S(!0),J(Me,null,Ze(n.items,(f,p)=>(S(),J("button",{key:p,type:"button",class:"text-zinc-700 hover:bg-zinc-100 hover:text-(--primary) cursor-pointer rounded px-2 py-1",onClick:m=>o("select",p)},A(a(f.name)),9,_Rt))),128))],2))}}),K_={date:{display:"yyyy-MM-dd",value:"yyyy-MM-dd"},datetime:{display:"yyyy-MM-dd HH:mm:ss",value:"yyyy-MM-dd HH:mm:ss"},year:{display:"yyyy",value:"yyyy"},month:{display:"yyyy-MM",value:"yyyy-MM"},time:{display:"HH:mm:ss",value:"HH:mm:ss"}},wRt={class:"flex flex-col"},tA=ae({name:"UiDatePicker",inheritAttrs:!1,__name:"DatePicker",props:{modelValue:{},defaultValue:{},type:{default:"date"},format:{},valueFormat:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},disabledDate:{},timeGranularity:{default:"second"},hourCycle:{default:24},class:{type:[Boolean,null,String,Object,Array]},popoverClass:{type:[Boolean,null,String,Object,Array]},prefixIcon:{},clearIcon:{},shortcuts:{},size:{default:"md"}},emits:["update:modelValue","change","clear","focus","blur"],setup(t,{emit:e}){const n=t,o=e,r=zo(n,"modelValue",o,{passive:!0,defaultValue:n.defaultValue}),l=T(()=>n.valueFormat??K_[n.type].value),a=T(()=>n.format??K_[n.type].display);function u(P){if(P instanceof Ka){const Q=new Date(2e3,0,1);return Q.setHours(P.hour,P.minute,P.second,0),Q}return new Date(P.year,P.month-1,"day"in P?P.day:1,"hour"in P?P.hour:0,"hour"in P?P.minute:0,"hour"in P?P.second:0)}function c(P,Q){const W=P.getFullYear(),Z=P.getMonth()+1,L=P.getDate(),F=P.getHours(),j=P.getMinutes(),te=P.getSeconds();switch(Q){case"year":return new Co(W,1,1);case"month":return new Co(W,Z,1);case"datetime":return new xs(W,Z,L,F,j,te);case"time":return new Ka(F,j,te);default:return new Co(W,Z,L)}}const f=T(()=>{const P=r.value;if(!P)return;const Q=T3(P,l.value,new Date);if(zb(Q))return c(Q,n.type)});function p(P){const Q=P?Wr(u(P),l.value):void 0;Q!==r.value&&(r.value=Q,o("change",Q))}const m=T(()=>{const P=f.value;if(!(!P||P instanceof Ka))return u(P)}),h=T(()=>{const P=f.value;return P instanceof Ka?P:void 0}),v=T(()=>{const P=f.value;if(!(!P||P instanceof Ka))return P}),g=T(()=>{const P=f.value;if(!(!P||P instanceof Ka||!("hour"in P)))return P}),b=ue(!1),x=Xv("anchor-el");function y(P){return P instanceof Node?x.value?.contains(P)??!1:!1}function _(P){const W=P.detail?.originalEvent?.target??null;y(W)&&P.preventDefault()}function k(P){!n.disabled&&!n.readonly&&(b.value=!0),o("focus",P)}function w(P){o("blur",P)}function $(){b.value=!1,o("clear")}function C(P){if(!P){p(void 0);return}p(c(P,n.type))}function E(P){p(P)}function z(P,Q){p(P),Q&&(b.value=!1)}function N(P){const Q=n.shortcuts?.[P];if(!Q)return;const W=typeof Q.value=="function"?Q.value():Q.value;if(W===r.value){b.value=!1;return}r.value=W,o("change",W),b.value=!1}return(P,Q)=>(S(),J("div",{ref:"anchor-el","data-slot":"date-picker",class:nt(i(dt)("w-full",n.class))},[n.type==="time"?(S(),B(bRt,Be({key:0},P.$attrs,{"model-value":h.value,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,clearable:n.clearable,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,size:n.size,"onUpdate:modelValue":E,onClear:Q[0]||(Q[0]=W=>o("clear"))}),null,16,["model-value","granularity","hour-cycle","disabled","readonly","clearable","prefix-icon","clear-icon","size"])):(S(),B(i(vr),{key:1,open:b.value,"onUpdate:open":Q[6]||(Q[6]=W=>b.value=W)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(vRt,Be(P.$attrs,{"model-value":m.value,format:a.value,placeholder:n.placeholder,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly,open:b.value,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,size:n.size,"onUpdate:modelValue":C,onFocus:k,onBlur:w,onClear:$}),null,16,["model-value","format","placeholder","clearable","disabled","readonly","open","prefix-icon","clear-icon","size"])]),_:1}),s(i(gr),{align:"start",class:nt(i(dt)("w-auto p-0",n.popoverClass)),onOpenAutoFocus:Q[5]||(Q[5]=W=>W.preventDefault()),onInteractOutside:_},{default:d(()=>[H("div",wRt,[n.type==="date"?(S(),B(fRt,{key:0,"model-value":v.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":Q[1]||(Q[1]=W=>z(W,!0))},null,8,["model-value","is-date-disabled"])):n.type==="month"?(S(),B(gRt,{key:1,"model-value":v.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":Q[2]||(Q[2]=W=>z(W,!0))},null,8,["model-value","is-date-disabled"])):n.type==="year"?(S(),B(xRt,{key:2,"model-value":v.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":Q[3]||(Q[3]=W=>z(W,!0))},null,8,["model-value","is-date-disabled"])):n.type==="datetime"?(S(),B(hRt,{key:3,"model-value":g.value,"is-date-disabled":n.disabledDate,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,"onUpdate:modelValue":Q[4]||(Q[4]=W=>z(W,!1))},null,8,["model-value","is-date-disabled","granularity","hour-cycle"])):be("",!0),n.shortcuts&&n.shortcuts.length>0?(S(),B(Fve,{key:4,items:n.shortcuts,onSelect:N},null,8,["items"])):be("",!0)])]),_:1},8,["class"])]),_:1},8,["open"]))],2))}}),kRt={key:0,"aria-hidden":"true",class:"text-red-600"},SRt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},CRt=ae({name:"ShwfedDateFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),x=T(()=>e.config.valueFormat??K_.date.value),y=T(()=>{const z=e.config.presets;if(!(!z||z.length===0))return z.map(N=>({name:N.label,value:()=>{try{const P=We(u(N.value,{form:o.value??{}}));return Wr(P,x.value)}catch(P){return console.error(`[shwfed-form] failed to evaluate preset "${N.value}" for ${e.fieldId}:`,P),""}}}))}),_=ue(void 0),k=T({get:()=>{const z=e.config.binding;if(z==null)return _.value;const N=r(z);return typeof N=="string"&&N.length>0?N:void 0},set:z=>{const N=e.config.binding;if(N==null){_.value=z;return}l(N,z)}}),{isRequired:w,errors:$,warnings:C,visible:E}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":h.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(w)?(S(),J("span",kRt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),b.value?(S(),J("div",SRt,A(k.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:k.value,"onUpdate:modelValue":N[0]||(N[0]=P=>k.value=P),type:"date",format:t.config.format,"value-format":t.config.valueFormat,placeholder:f.value,disabled:h.value,shortcuts:y.value},null,8,["id","modelValue","format","value-format","placeholder","disabled","shortcuts"])),i(E)?(S(),B(i(Xr),{key:3,errors:i($),warnings:i(C)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),$Rt={class:"flex items-center gap-1"},TRt={class:"flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"},Nve=ae({__name:"RangeCalendar",props:{defaultPlaceholder:{},defaultValue:{},modelValue:{},placeholder:{},allowNonContiguousRanges:{type:Boolean},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},maximumDays:{},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{type:Function},isDateUnavailable:{type:Function},isDateHighlightable:{type:Function},dir:{},nextPage:{type:Function},prevPage:{type:Function},disableDaysOutsideCurrentView:{type:Boolean},fixedDate:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","update:validModelValue","update:placeholder","update:startValue"],setup(t,{emit:e}){const n=t,o=e,r=Ut(n,"class"),l=co(r,o),a=o6(),{locale:u}=Bt({useScope:"global",inheritLocale:!0}),c=T(()=>n.locale??u.value??a.language.value??"en");return(f,p)=>(S(),B(i(tXe),Be({"data-slot":"range-calendar",class:i(dt)("p-3",n.class),"fixed-weeks":""},i(l),{locale:c.value}),{default:d(({grid:m,weekDays:h})=>[s(i(IRt),null,{default:d(()=>[s(i(RRt)),H("div",$Rt,[s(i(PRt)),s(i(VRt))])]),_:1}),H("div",TRt,[(S(!0),J(Me,null,Ze(m,v=>(S(),B(i(DRt),{key:v.value.toString()},{default:d(()=>[s(i(ORt),null,{default:d(()=>[s(i(hK),null,{default:d(()=>[(S(!0),J(Me,null,Ze(h,g=>(S(),B(i(MRt),{key:g},{default:d(()=>[D(A(g),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),s(i(zRt),null,{default:d(()=>[(S(!0),J(Me,null,Ze(v.rows,(g,b)=>(S(),B(i(hK),{key:`weekDate-${b}`,class:"mt-2 w-full"},{default:d(()=>[(S(!0),J(Me,null,Ze(g,x=>(S(),B(i(ERt),{key:x.toString(),date:x},{default:d(()=>[s(i(ARt),{day:x,month:v.value},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))])]),_:1},16,["class","locale"]))}}),ERt=ae({__name:"RangeCalendarCell",props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(oXe),Be({"data-slot":"range-calendar-cell",class:i(dt)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1","[--bar-left:0px] [--bar-right:0px]","[&:has([data-selection-start]):not(:has([data-highlighted]))]:[--bar-left:50%]","[&:has([data-selection-end]):not(:has([data-highlighted]))]:[--bar-right:50%]","[&:has([data-highlighted-start])]:[--bar-left:50%]","[&:has([data-highlighted-end])]:[--bar-right:50%]","before:pointer-events-none before:absolute before:top-1/2 before:-translate-y-1/2","before:h-8 before:z-0","before:left-[var(--bar-left)] before:right-[var(--bar-right)]","before:bg-[color-mix(in_srgb,var(--primary)_15%,white)]","before:hidden","[&:has([data-selected])]:before:block [&:has([data-highlighted])]:before:block","[&:has([data-selection-start][data-selection-end])]:before:hidden","[&:has([data-highlighted-start][data-highlighted-end])]:before:hidden",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),ARt=ae({__name:"RangeCalendarCellTrigger",props:{day:{},month:{},asChild:{type:Boolean},as:{default:"button"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(lXe),Be({"data-slot":"range-calendar-trigger",class:i(dt)(i(mc)({variant:"ghost"}),"relative z-10 size-8 rounded-full p-0 font-normal text-center cursor-pointer data-selected:opacity-100","[&[data-today]:not([data-selected])]:font-semibold [&[data-today]:not([data-selected])]:text-(--primary)","data-selection-start:bg-(--primary) data-selection-start:text-white data-selection-start:hover:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-start:hover:text-white data-selection-start:focus:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-start:focus:text-white","data-selection-end:bg-(--primary) data-selection-end:text-white data-selection-end:hover:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-end:hover:text-white data-selection-end:focus:bg-[color-mix(in_srgb,var(--primary)_80%,white)] data-selection-end:focus:text-white","data-highlighted-start:bg-(--primary) data-highlighted-start:text-white","data-highlighted-end:bg-(--primary) data-highlighted-end:text-white","data-outside-view:text-zinc-300","data-disabled:text-zinc-300 data-disabled:opacity-50","data-unavailable:text-zinc-300 data-unavailable:line-through",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),DRt=ae({__name:"RangeCalendarGrid",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(aXe),Be({"data-slot":"range-calendar-grid",class:i(dt)("w-full border-collapse space-x-1",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),zRt=ae({__name:"RangeCalendarGridBody",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,o)=>(S(),B(i(uXe),Be({"data-slot":"range-calendar-grid-body"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),ORt=ae({__name:"RangeCalendarGridHead",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,o)=>(S(),B(i(dXe),Be({"data-slot":"range-calendar-grid-head"},e),{default:d(()=>[we(n.$slots,"default")]),_:3},16))}}),hK=ae({__name:"RangeCalendarGridRow",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(pXe),Be({"data-slot":"range-calendar-grid-row",class:i(dt)("flex w-full",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),MRt=ae({__name:"RangeCalendarHeadCell",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(hXe),Be({"data-slot":"range-calendar-head-cell",class:i(dt)("flex-1 rounded-md text-[0.8rem] font-normal text-zinc-300",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),IRt=ae({__name:"RangeCalendarHeader",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(gXe),Be({"data-slot":"range-calendar-header",class:i(dt)("flex justify-center pt-1 relative items-center w-full",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),RRt=ae({__name:"RangeCalendarHeading",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(bXe),Be({"data-slot":"range-calendar-heading",class:i(dt)("text-sm font-medium",e.class)},i(o)),{default:d(({headingValue:a})=>[we(r.$slots,"default",{headingValue:a},()=>[D(A(a),1)])]),_:3},16,["class"]))}}),VRt=ae({__name:"RangeCalendarNextButton",props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(_Xe),Be({"data-slot":"range-calendar-next-button",class:i(dt)(i(mc)({variant:"ghost"}),"absolute right-1","size-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-right-20-regular"})])]),_:3},16,["class"]))}}),PRt=ae({__name:"RangeCalendarPrevButton",props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(kXe),Be({"data-slot":"range-calendar-prev-button",class:i(dt)(i(mc)({variant:"ghost"}),"absolute left-1","size-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},i(o)),{default:d(()=>[we(r.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-left-20-regular"})])]),_:3},16,["class"]))}}),FRt=ae({name:"UiDateRangePickerDatePanel",__name:"DateRangePickerDatePanel",props:{modelValue:{},isDateDisabled:{type:Function},numberOfMonths:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(l){o("update:modelValue",l)}return(l,a)=>(S(),B(i(Nve),{"data-slot":"date-range-picker-date-panel",class:nt(i(dt)(n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue?.start,"is-date-disabled":n.isDateDisabled,"number-of-months":n.numberOfMonths??2,"onUpdate:modelValue":r},null,8,["class","model-value","default-placeholder","is-date-disabled","number-of-months"]))}}),NRt={class:"border-zinc-200 flex items-center gap-2 border-t p-3"},LRt={key:1,class:"text-zinc-400 select-none"},BRt={key:1,class:"text-zinc-400 select-none"},URt=ae({name:"UiDateRangePickerDateTimePanel",__name:"DateRangePickerDateTimePanel",props:{modelValue:{},isDateDisabled:{},granularity:{default:"second"},hourCycle:{default:24},numberOfMonths:{default:2},rangeSeparatorIcon:{default:"lucide:arrow-right"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e;function r(v){if(v)return new Co(v.year,v.month,"day"in v?v.day:1)}function l(v){if(!(!v||!("hour"in v)))return new Ka(v.hour,v.minute,v.second)}const a=T(()=>({start:r(n.modelValue?.start),end:r(n.modelValue?.end)})),u=T(()=>l(n.modelValue?.start)),c=T(()=>l(n.modelValue?.end));function f(v,g){if(v)return new xs(v.year,v.month,"day"in v?v.day:1,g?.hour??0,g?.minute??0,g?.second??0)}function p(v){if(!v){o("update:modelValue",void 0);return}o("update:modelValue",{start:f(v.start,u.value),end:f(v.end,c.value)})}function m(v){const g=v??void 0,b=n.modelValue?.start??r(op(As()));b&&o("update:modelValue",{start:f(b,g),end:n.modelValue?.end})}function h(v){const g=v??void 0,b=n.modelValue?.end??r(op(As()));b&&o("update:modelValue",{start:n.modelValue?.start,end:f(b,g)})}return(v,g)=>(S(),J("div",{"data-slot":"date-range-picker-datetime-panel",class:nt(i(dt)("flex flex-col",n.class))},[s(i(Nve),{"model-value":a.value,"default-placeholder":a.value.start,"is-date-disabled":n.isDateDisabled,"number-of-months":n.numberOfMonths,"onUpdate:modelValue":p},null,8,["model-value","default-placeholder","is-date-disabled","number-of-months"]),H("div",NRt,[s(i(de),{icon:"lucide:clock",class:"text-zinc-500 size-4 shrink-0"}),s(i(lu).Root,{"model-value":u.value,granularity:n.granularity,"hour-cycle":n.hourCycle,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 text-sm outline-none","onUpdate:modelValue":m},{default:d(({segments:b})=>[Array.isArray(b)?(S(!0),J(Me,{key:0},Ze(b,(x,y)=>(S(),J(Me,{key:`s-${x.part}-${y}`},[x.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:x.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(x.value),1)]),_:2},1032,["part"])):(S(),J("span",LRt,A(x.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle"]),s(i(de),{icon:n.rangeSeparatorIcon,class:"text-zinc-400 size-3.5 shrink-0"},null,8,["icon"]),s(i(lu).Root,{"model-value":c.value,granularity:n.granularity,"hour-cycle":n.hourCycle,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 text-sm outline-none","onUpdate:modelValue":h},{default:d(({segments:b})=>[Array.isArray(b)?(S(!0),J(Me,{key:0},Ze(b,(x,y)=>(S(),J(Me,{key:`e-${x.part}-${y}`},[x.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:x.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(x.value),1)]),_:2},1032,["part"])):(S(),J("span",BRt,A(x.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle"])])],2))}}),qRt=["data-disabled","data-value","data-state"],jRt=["placeholder","disabled","readonly"],HRt=["placeholder","disabled","readonly"],WRt=ae({name:"UiDateRangePickerInput",inheritAttrs:!1,__name:"DateRangePickerInput",props:{startValue:{},endValue:{},format:{},startPlaceholder:{},endPlaceholder:{},rangeSeparatorIcon:{},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},open:{type:Boolean},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:startValue","update:endValue","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e,l=ue(""),a=ue(""),u=ue(null);function c(){l.value=n.startValue?Wr(n.startValue,n.format):""}function f(){a.value=n.endValue?Wr(n.endValue,n.format):""}Qe(()=>[n.startValue,n.format],()=>{u.value!=="start"&&c()},{immediate:!0}),Qe(()=>[n.endValue,n.format],()=>{u.value!=="end"&&f()},{immediate:!0});function p(x){const y=x==="start"?l:a,_=x==="start"?n.startValue:n.endValue,k=x==="start"?c:f,w=y.value.trim();if(!w){_!==void 0&&r(x==="start"?"update:startValue":"update:endValue",void 0);return}const $=T3(w,n.format,_??new Date);if(!zb($)){k();return}r(x==="start"?"update:startValue":"update:endValue",$)}function m(x,y){u.value=y,r("focus",x,y)}function h(x,y){u.value=null,p(y),r("blur",x,y)}function v(){l.value="",a.value="",r("update:startValue",void 0),r("update:endValue",void 0),r("clear")}const g=T(()=>n.clearable&&!n.disabled&&!n.readonly&&(n.startValue!==void 0||n.endValue!==void 0)),b=T(()=>n.startValue!==void 0||n.endValue!==void 0);return(x,y)=>(S(),J("div",Be(x.$attrs,{"data-slot":"date-range-picker-input","data-disabled":n.disabled?"true":void 0,"data-value":b.value?"true":void 0,"data-state":n.open?"open":void 0,class:i(dt)("group/date-range-input","border-zinc-200 relative flex w-full min-w-0 items-center rounded-md border bg-transparent transition-[color,box-shadow] outline-none","data-[disabled=true]:bg-zinc-100","has-[input:focus-visible]:border-(--primary)","hover:border-zinc-300",o.value,n.class)}),[n.prefixIcon?(S(),B(i(de),{key:0,icon:n.prefixIcon,class:"text-zinc-500 ml-3 mr-1 size-4 shrink-0"},null,8,["icon"])):be("",!0),Ba(H("input",{"onUpdate:modelValue":y[0]||(y[0]=_=>l.value=_),"data-slot":"input-group-control","data-side":"start",placeholder:n.startPlaceholder,disabled:n.disabled,readonly:n.readonly,class:nt(i(dt)("text-zinc-700 placeholder:text-zinc-300 min-w-0 flex-1 bg-transparent px-1 text-sm outline-none disabled:cursor-not-allowed text-center",!n.prefixIcon&&"pl-3")),onFocus:y[1]||(y[1]=_=>m(_,"start")),onBlur:y[2]||(y[2]=_=>h(_,"start")),onKeydown:y[3]||(y[3]=fr(lt(_=>p("start"),["prevent"]),["enter"]))},null,42,jRt),[[mu,l.value]]),n.rangeSeparatorIcon?(S(),B(i(de),{key:1,icon:n.rangeSeparatorIcon,"data-slot":"date-range-picker-input-separator",class:"text-zinc-400 mx-1 size-3.5 shrink-0"},null,8,["icon"])):be("",!0),Ba(H("input",{"onUpdate:modelValue":y[4]||(y[4]=_=>a.value=_),"data-slot":"input-group-control","data-side":"end",placeholder:n.endPlaceholder,disabled:n.disabled,readonly:n.readonly,class:nt(i(dt)("text-zinc-700 placeholder:text-zinc-300 min-w-0 flex-1 bg-transparent px-1 text-sm outline-none disabled:cursor-not-allowed text-center",!g.value&&"pr-3")),onFocus:y[5]||(y[5]=_=>m(_,"end")),onBlur:y[6]||(y[6]=_=>h(_,"end")),onKeydown:y[7]||(y[7]=fr(lt(_=>p("end"),["prevent"]),["enter"]))},null,42,HRt),[[mu,a.value]]),g.value?(S(),B(i(ot),{key:2,size:"icon-xs","data-slot":"date-range-picker-clear",tabindex:"-1",class:nt(i(dt)("mr-2 shrink-0 text-zinc-500 hover:text-zinc-700 transition-opacity","[@media(hover:hover)]:opacity-0","group-hover/date-range-input:opacity-100 focus-within:opacity-100")),onMousedown:y[8]||(y[8]=lt(()=>{},["prevent"])),onClick:lt(v,["stop"])},{default:d(()=>[s(i(de),{icon:n.clearIcon},null,8,["icon"])]),_:1},8,["class"])):be("",!0)],16,qRt))}}),KRt={class:"w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10"},GRt=ae({name:"UiDateRangePickerMonthPanel",__name:"DateRangePickerMonthPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{locale:r}=Bt({useScope:"global",inheritLocale:!0});function l(a){o("update:modelValue",a)}return(a,u)=>(S(),B(i(Uc).Root,{"data-slot":"date-range-picker-month-panel",class:nt(i(dt)("p-3",n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue?.start,"is-month-disabled":n.isDateDisabled,locale:i(r),"onUpdate:modelValue":l},{default:d(({grid:c})=>[s(i(Uc).Header,{class:"pt-2 pb-2 relative"},{default:d(()=>[H("nav",KRt,[s(i(Uc).Prev,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),_:1}),s(i(Uc).Next,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1})]),s(i(Uc).Heading,{class:"text-sm font-medium text-center w-full"})]),_:1}),s(i(Uc).Grid,{class:"mt-4 w-full"},{default:d(()=>[s(i(Uc).GridBody,null,{default:d(()=>[(S(!0),J(Me,null,Ze(c.rows,(f,p)=>(S(),B(i(Uc).GridRow,{key:`mrow-${p}`,class:"grid grid-cols-4 gap-1 mb-1 last:mb-0"},{default:d(()=>[(S(!0),J(Me,null,Ze(f,m=>(S(),B(i(Uc).Cell,{key:m.toString(),date:m},{default:d(()=>[s(i(Uc).CellTrigger,{month:m,class:"block w-full"},{default:d(({monthValue:h,disabled:v,selected:g,selectionStart:b,selectionEnd:x,highlighted:y})=>[H("span",{class:nt(i(dt)("flex h-9 w-full items-center justify-center rounded-md text-sm font-normal cursor-pointer","hover:bg-zinc-100",g||b||x?"bg-(--primary) text-white hover:bg-(--primary)":"",y&&!g?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary) hover:bg-[color-mix(in_srgb,var(--primary)_25%,white)]":"",v?"text-zinc-400 opacity-50 cursor-default":""))},A(h),3)]),_:1},8,["month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:1},8,["class","model-value","default-placeholder","is-month-disabled","locale"]))}}),YRt=["data-disabled"],JRt={key:1,class:"text-zinc-400 select-none"},XRt={key:1,class:"text-zinc-400 select-none"},QRt=ae({name:"UiDateRangePickerTimeInput",inheritAttrs:!1,__name:"DateRangePickerTimeInput",props:{startValue:{},endValue:{},granularity:{default:"second"},hourCycle:{default:24},rangeSeparatorIcon:{default:"lucide:arrow-right"},prefixIcon:{},clearIcon:{default:"fluent:dismiss-20-regular"},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:startValue","update:endValue","clear"],setup(t,{emit:e}){const n=t,o=T(()=>({sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"})[n.size]),r=e;function l(f){r("update:startValue",f??void 0)}function a(f){r("update:endValue",f??void 0)}function u(){r("update:startValue",void 0),r("update:endValue",void 0),r("clear")}const c=T(()=>n.clearable&&!n.disabled&&!n.readonly&&(n.startValue!==void 0||n.endValue!==void 0));return(f,p)=>(S(),J("div",Be(f.$attrs,{"data-slot":"date-range-picker-time-input","data-disabled":n.disabled?"true":void 0,class:i(dt)("group/date-range-time-input","border-zinc-200 relative flex w-full min-w-0 items-center rounded-md border bg-transparent transition-[color,box-shadow] outline-none","data-[disabled=true]:bg-zinc-100","has-[[data-reka-time-field-input]:focus]:border-(--primary)","hover:border-zinc-300",o.value,n.class)}),[n.prefixIcon?(S(),B(i(de),{key:0,icon:n.prefixIcon,class:"text-zinc-500 ml-3 mr-1 size-4 shrink-0"},null,8,["icon"])):be("",!0),s(i(lu).Root,{"data-slot":"date-range-picker-time-start","model-value":n.startValue,granularity:n.granularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","onUpdate:modelValue":l},{default:d(({segments:m})=>[Array.isArray(m)?(S(!0),J(Me,{key:0},Ze(m,(h,v)=>(S(),J(Me,{key:`s-${h.part}-${v}`},[h.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:h.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(h.value),1)]),_:2},1032,["part"])):(S(),J("span",JRt,A(h.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle","disabled","readonly"]),s(i(de),{icon:n.rangeSeparatorIcon,"data-slot":"date-range-picker-time-separator",class:"text-zinc-400 size-3.5 shrink-0"},null,8,["icon"]),s(i(lu).Root,{"data-slot":"date-range-picker-time-end","model-value":n.endValue,granularity:n.granularity,"hour-cycle":n.hourCycle,disabled:n.disabled,readonly:n.readonly,class:"text-zinc-700 flex flex-1 items-center justify-center gap-1.5 px-4 outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","onUpdate:modelValue":a},{default:d(({segments:m})=>[Array.isArray(m)?(S(!0),J(Me,{key:0},Ze(m,(h,v)=>(S(),J(Me,{key:`e-${h.part}-${v}`},[h.part!=="literal"?(S(),B(i(lu).Input,{key:0,part:h.part,class:"rounded-sm px-1 outline-none focus:bg-zinc-100 data-[placeholder]:text-zinc-400"},{default:d(()=>[D(A(h.value),1)]),_:2},1032,["part"])):(S(),J("span",XRt,A(h.value),1))],64))),128)):be("",!0)]),_:1},8,["model-value","granularity","hour-cycle","disabled","readonly"]),c.value?(S(),J("button",{key:1,type:"button","data-slot":"date-range-picker-clear",tabindex:"-1",class:nt(i(dt)("mr-2 size-5 shrink-0 rounded text-zinc-500 transition-opacity hover:text-zinc-700","[@media(hover:hover)]:opacity-0","group-hover/date-range-time-input:opacity-100 focus-within:opacity-100","flex items-center justify-center")),onMousedown:p[0]||(p[0]=lt(()=>{},["prevent"])),onClick:lt(u,["stop"])},[s(i(de),{icon:n.clearIcon,class:"size-3.5"},null,8,["icon"])],34)):be("",!0)],16,YRt))}}),ZRt={class:"w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10"},e5t=ae({name:"UiDateRangePickerYearPanel",__name:"DateRangePickerYearPanel",props:{modelValue:{},isDateDisabled:{type:Function},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{locale:r}=Bt({useScope:"global",inheritLocale:!0});function l(a){o("update:modelValue",a)}return(a,u)=>(S(),B(i(qc).Root,{"data-slot":"date-range-picker-year-panel",class:nt(i(dt)("p-3",n.class)),"model-value":n.modelValue,"default-placeholder":n.modelValue?.start,"is-year-disabled":n.isDateDisabled,locale:i(r),"onUpdate:modelValue":l},{default:d(({grid:c})=>[s(i(qc).Header,{class:"pt-2 pb-2 relative"},{default:d(()=>[H("nav",ZRt,[s(i(qc).Prev,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-left"})]),_:1}),s(i(qc).Next,null,{default:d(()=>[s(i(de),{icon:"lucide:chevron-right"})]),_:1})]),s(i(qc).Heading,{class:"text-sm font-medium text-center w-full"})]),_:1}),s(i(qc).Grid,{class:"mt-4 w-full"},{default:d(()=>[s(i(qc).GridBody,null,{default:d(()=>[(S(!0),J(Me,null,Ze(c.rows,(f,p)=>(S(),B(i(qc).GridRow,{key:`yrow-${p}`,class:"grid grid-cols-4 gap-1 mb-1 last:mb-0"},{default:d(()=>[(S(!0),J(Me,null,Ze(f,m=>(S(),B(i(qc).Cell,{key:m.toString(),date:m},{default:d(()=>[s(i(qc).CellTrigger,{year:m,class:"block w-full"},{default:d(({yearValue:h,disabled:v,selected:g,selectionStart:b,selectionEnd:x,highlighted:y})=>[H("span",{class:nt(i(dt)("flex h-9 w-full items-center justify-center rounded-md text-sm font-normal cursor-pointer","hover:bg-zinc-100",g||b||x?"bg-(--primary) text-white hover:bg-(--primary)":"",y&&!g?"bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary) hover:bg-[color-mix(in_srgb,var(--primary)_25%,white)]":"",v?"text-zinc-400 opacity-50 cursor-default":""))},A(h),3)]),_:1},8,["year"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)]),_:1},8,["class","model-value","default-placeholder","is-year-disabled","locale"]))}}),G_={daterange:{display:"yyyy-MM-dd",value:"yyyy-MM-dd"},datetimerange:{display:"yyyy-MM-dd HH:mm:ss",value:"yyyy-MM-dd HH:mm:ss"},monthrange:{display:"yyyy-MM",value:"yyyy-MM"},yearrange:{display:"yyyy",value:"yyyy"},timerange:{display:"HH:mm:ss",value:"HH:mm:ss"}},t5t={class:"flex flex-col"},nA=ae({name:"UiDateRangePicker",inheritAttrs:!1,__name:"DateRangePicker",props:{modelValue:{},defaultValue:{},type:{default:"daterange"},format:{},valueFormat:{},startPlaceholder:{},endPlaceholder:{},rangeSeparatorIcon:{},prefixIcon:{},clearIcon:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},disabledDate:{},numberOfMonths:{default:2},timeGranularity:{default:"second"},hourCycle:{default:24},shortcuts:{},size:{default:"md"},class:{type:[Boolean,null,String,Object,Array]},popoverClass:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","change","clear","focus","blur"],setup(t,{emit:e}){const n=t,o=e,r=zo(n,"modelValue",o,{passive:!0,defaultValue:n.defaultValue}),l=T(()=>n.valueFormat??G_[n.type].value),a=T(()=>n.format??G_[n.type].display);function u(ie,ve){const ge=ie.getFullYear(),$e=ie.getMonth()+1,le=ie.getDate();switch(ve){case"yearrange":return new Co(ge,1,1);case"monthrange":return new Co(ge,$e,1);case"datetimerange":return new xs(ge,$e,le,ie.getHours(),ie.getMinutes(),ie.getSeconds());default:return new Co(ge,$e,le)}}function c(ie){return new Date(ie.year,ie.month-1,"day"in ie?ie.day:1,"hour"in ie?ie.hour:0,"hour"in ie?ie.minute:0,"hour"in ie?ie.second:0)}function f(ie){return new Ka(ie.getHours(),ie.getMinutes(),ie.getSeconds())}function p(ie){const ve=new Date(2e3,0,1);return ve.setHours(ie.hour,ie.minute,ie.second,0),ve}function m(ie){if(!ie)return;const ve=T3(ie,l.value,new Date);if(zb(ve))return ve}const h=T(()=>m(r.value?.[0])),v=T(()=>m(r.value?.[1])),g=T(()=>h.value?f(h.value):void 0),b=T(()=>v.value?f(v.value):void 0),x=T(()=>{if(h.value)return u(h.value,n.type)}),y=T(()=>{if(v.value)return u(v.value,n.type)}),_=$n(void 0),k=T(()=>_.value?_.value:{start:x.value,end:y.value});function w(ie,ve){if(!ie||!ve){r.value!==void 0&&(r.value=void 0,o("change",void 0));return}const ge=Wr(ie,l.value),$e=Wr(ve,l.value),le=[ge,$e],ee=r.value;ee&&ee[0]===le[0]&&ee[1]===le[1]||(r.value=le,o("change",le))}function $(ie){w(ie,v.value)}function C(ie){w(h.value,ie)}function E(ie){w(ie?p(ie):void 0,v.value)}function z(ie){w(h.value,ie?p(ie):void 0)}function N(){r.value!==void 0&&(r.value=void 0,o("change",void 0)),o("clear")}function P(ie){const ve=n.shortcuts?.[ie];if(!ve)return;const ge=typeof ve.value=="function"?ve.value():ve.value,$e=[ge[0],ge[1]],le=r.value;if(le&&le[0]===$e[0]&&le[1]===$e[1]){W.value=!1;return}r.value=$e,o("change",$e),W.value=!1}function Q(ie,ve){if(!ie||!ie.start&&!ie.end){_.value=void 0,w(void 0,void 0);return}if(!ie.start||!ie.end){_.value=ie;return}_.value=void 0;const ge=c(ie.start),$e=c(ie.end);w(ge,$e),ve&&(W.value=!1)}const W=ue(!1),Z=Xv("anchor-el");Qe(W,ie=>{ie||(_.value=void 0)});function L(ie){return ie instanceof Node?Z.value?.contains(ie)??!1:!1}function F(ie){const ge=ie.detail?.originalEvent?.target??null;L(ge)&&ie.preventDefault()}function j(ie,ve){!n.disabled&&!n.readonly&&(W.value=!0),o("focus",ie,ve)}function te(ie,ve){o("blur",ie,ve)}return(ie,ve)=>(S(),J("div",{ref:"anchor-el","data-slot":"date-range-picker",class:nt(i(dt)("w-full",n.class))},[n.type==="timerange"?(S(),B(QRt,Be({key:0},ie.$attrs,{"start-value":g.value,"end-value":b.value,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,"range-separator-icon":n.rangeSeparatorIcon,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly,size:n.size,"onUpdate:startValue":E,"onUpdate:endValue":z,onClear:N}),null,16,["start-value","end-value","granularity","hour-cycle","range-separator-icon","prefix-icon","clear-icon","clearable","disabled","readonly","size"])):(S(),B(i(vr),{key:1,open:W.value,"onUpdate:open":ve[5]||(ve[5]=ge=>W.value=ge)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(WRt,Be(ie.$attrs,{"start-value":h.value,"end-value":v.value,format:a.value,"start-placeholder":n.startPlaceholder,"end-placeholder":n.endPlaceholder,"range-separator-icon":n.rangeSeparatorIcon,"prefix-icon":n.prefixIcon,"clear-icon":n.clearIcon,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly,open:W.value,size:n.size,"onUpdate:startValue":$,"onUpdate:endValue":C,onFocus:j,onBlur:te,onClear:N}),null,16,["start-value","end-value","format","start-placeholder","end-placeholder","range-separator-icon","prefix-icon","clear-icon","clearable","disabled","readonly","open","size"])]),_:1}),s(i(gr),{align:"start",class:nt(i(dt)("w-auto p-0",n.popoverClass)),style:{minWidth:"var(--reka-popover-trigger-width)"},onOpenAutoFocus:ve[4]||(ve[4]=ge=>ge.preventDefault()),onInteractOutside:F},{default:d(()=>[H("div",t5t,[n.type==="daterange"?(S(),B(FRt,{key:0,"model-value":k.value,"is-date-disabled":n.disabledDate,"number-of-months":n.numberOfMonths,"onUpdate:modelValue":ve[0]||(ve[0]=ge=>Q(ge,!0))},null,8,["model-value","is-date-disabled","number-of-months"])):n.type==="monthrange"?(S(),B(GRt,{key:1,"model-value":k.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":ve[1]||(ve[1]=ge=>Q(ge,!0))},null,8,["model-value","is-date-disabled"])):n.type==="yearrange"?(S(),B(e5t,{key:2,"model-value":k.value,"is-date-disabled":n.disabledDate,"onUpdate:modelValue":ve[2]||(ve[2]=ge=>Q(ge,!0))},null,8,["model-value","is-date-disabled"])):n.type==="datetimerange"?(S(),B(URt,{key:3,"model-value":k.value,"is-date-disabled":n.disabledDate,granularity:n.timeGranularity,"hour-cycle":n.hourCycle,"number-of-months":n.numberOfMonths,"range-separator-icon":n.rangeSeparatorIcon,"onUpdate:modelValue":ve[3]||(ve[3]=ge=>Q(ge,!1))},null,8,["model-value","is-date-disabled","granularity","hour-cycle","number-of-months","range-separator-icon"])):be("",!0),n.shortcuts&&n.shortcuts.length>0?(S(),B(Fve,{key:4,items:n.shortcuts,onSelect:P},null,8,["items"])):be("",!0)])]),_:1},8,["class"])]),_:1},8,["open"]))],2))}}),n5t={key:0,"aria-hidden":"true",class:"text-red-600"},o5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},r5t=ae({name:"ShwfedDateRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(W,Z)=>Dt(W,{...Pt(a),...Z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(W,Z){if(!W)return!1;try{return We(u(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=T(()=>e.config.valueFormat??G_.daterange.value),_=T(()=>{const W=e.config.presets;if(!(!W||W.length===0))return W.map(Z=>({name:Z.label,value:()=>{try{const L=We(u(Z.start,{form:o.value??{}})),F=We(u(Z.end,{form:o.value??{}}));return[Wr(L,y.value),Wr(F,y.value)]}catch(L){return console.error(`[shwfed-form] failed to evaluate preset "${Z.start}" .. "${Z.end}" for ${e.fieldId}:`,L),["",""]}}}))});function k(W){if(!Array.isArray(W)||W.length!==2)return;const[Z,L]=W;if(!(typeof Z!="string"||typeof L!="string")&&!(Z.length===0||L.length===0))return[Z,L]}function w(W){return typeof W=="string"&&W.length>0?W:void 0}const $=ue(void 0),C=T({get:()=>{const W=e.config.binding;if(W==null)return $.value;if(typeof W=="string")return k(r(W));const Z=w(r(W[0])),L=w(r(W[1]));if(!(Z==null||L==null))return[Z,L]},set:W=>{const Z=e.config.binding;if(Z==null){$.value=W;return}if(typeof Z=="string"){l(Z,W);return}l(Z[0],W?.[0]),l(Z[1],W?.[1])}}),{isRequired:E,errors:z,warnings:N,visible:P}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),Q=T(()=>{const W=C.value;return W?`${W[0]} ~ ${W[1]}`:"—"});return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(E)?(S(),J("span",n5t," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",o5t,A(Q.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:C.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>C.value=L),type:"daterange",format:t.config.format,"value-format":t.config.valueFormat,"start-placeholder":f.value,"end-placeholder":p.value,"range-separator-icon":t.config.rangeSeparatorIcon,"number-of-months":t.config.numberOfMonths,disabled:v.value,shortcuts:_.value},null,8,["id","modelValue","format","value-format","start-placeholder","end-placeholder","range-separator-icon","number-of-months","disabled","shortcuts"])),i(P)?(S(),B(i(Xr),{key:3,errors:i(z),warnings:i(N)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),l5t={key:0,"aria-hidden":"true",class:"text-red-600"},i5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},a5t=ae({name:"ShwfedDateTimeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),x=T(()=>e.config.valueFormat??K_.datetime.value),y=T(()=>{const z=e.config.presets;if(!(!z||z.length===0))return z.map(N=>({name:N.label,value:()=>{try{const P=We(u(N.value,{form:o.value??{}}));return Wr(P,x.value)}catch(P){return console.error(`[shwfed-form] failed to evaluate preset "${N.value}" for ${e.fieldId}:`,P),""}}}))}),_=ue(void 0),k=T({get:()=>{const z=e.config.binding;if(z==null)return _.value;const N=r(z);return typeof N=="string"&&N.length>0?N:void 0},set:z=>{const N=e.config.binding;if(N==null){_.value=z;return}l(N,z)}}),{isRequired:w,errors:$,warnings:C,visible:E}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":h.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(w)?(S(),J("span",l5t," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),b.value?(S(),J("div",i5t,A(k.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:k.value,"onUpdate:modelValue":N[0]||(N[0]=P=>k.value=P),type:"datetime",format:t.config.format,"value-format":t.config.valueFormat,placeholder:f.value,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:h.value,shortcuts:y.value},null,8,["id","modelValue","format","value-format","placeholder","time-granularity","hour-cycle","disabled","shortcuts"])),i(E)?(S(),B(i(Xr),{key:3,errors:i($),warnings:i(C)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),s5t={key:0,"aria-hidden":"true",class:"text-red-600"},u5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},c5t=ae({name:"ShwfedDateTimeRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(W,Z)=>Dt(W,{...Pt(a),...Z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(W,Z){if(!W)return!1;try{return We(u(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=T(()=>e.config.valueFormat??G_.datetimerange.value),_=T(()=>{const W=e.config.presets;if(!(!W||W.length===0))return W.map(Z=>({name:Z.label,value:()=>{try{const L=We(u(Z.start,{form:o.value??{}})),F=We(u(Z.end,{form:o.value??{}}));return[Wr(L,y.value),Wr(F,y.value)]}catch(L){return console.error(`[shwfed-form] failed to evaluate preset "${Z.start}" .. "${Z.end}" for ${e.fieldId}:`,L),["",""]}}}))});function k(W){if(!Array.isArray(W)||W.length!==2)return;const[Z,L]=W;if(!(typeof Z!="string"||typeof L!="string")&&!(Z.length===0||L.length===0))return[Z,L]}function w(W){return typeof W=="string"&&W.length>0?W:void 0}const $=ue(void 0),C=T({get:()=>{const W=e.config.binding;if(W==null)return $.value;if(typeof W=="string")return k(r(W));const Z=w(r(W[0])),L=w(r(W[1]));if(!(Z==null||L==null))return[Z,L]},set:W=>{const Z=e.config.binding;if(Z==null){$.value=W;return}if(typeof Z=="string"){l(Z,W);return}l(Z[0],W?.[0]),l(Z[1],W?.[1])}}),{isRequired:E,errors:z,warnings:N,visible:P}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),Q=T(()=>{const W=C.value;return W?`${W[0]} ~ ${W[1]}`:"—"});return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(E)?(S(),J("span",s5t," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",u5t,A(Q.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:C.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>C.value=L),type:"datetimerange",format:t.config.format,"value-format":t.config.valueFormat,"start-placeholder":f.value,"end-placeholder":p.value,"range-separator-icon":t.config.rangeSeparatorIcon,"number-of-months":t.config.numberOfMonths,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:v.value,shortcuts:_.value},null,8,["id","modelValue","format","value-format","start-placeholder","end-placeholder","range-separator-icon","number-of-months","time-granularity","hour-cycle","disabled","shortcuts"])),i(P)?(S(),B(i(Xr),{key:3,errors:i(z),warnings:i(N)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),d5t={key:0,"aria-hidden":"true",class:"text-red-600"},f5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},p5t=ae({name:"ShwfedTimeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=($,C)=>Dt($,{...Pt(a),...C}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function p($,C){if(!$)return!1;try{return We(u($,{form:o.value??{}}))}catch(E){return console.error(`[shwfed-form] failed to evaluate ${C} for ${e.fieldId}:`,E),!1}}const m=T(()=>p(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?p(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula"),b=ue(void 0),x=T({get:()=>{const $=e.config.binding;if($==null)return b.value;const C=r($);return typeof C=="string"&&C.length>0?C:void 0},set:$=>{const C=e.config.binding;if(C==null){b.value=$;return}l(C,$)}}),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value});return($,C)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(y)?(S(),J("span",d5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",f5t,A(x.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:x.value,"onUpdate:modelValue":C[0]||(C[0]=E=>x.value=E),type:"time","value-format":t.config.valueFormat,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:m.value},null,8,["id","modelValue","value-format","time-granularity","hour-cycle","disabled"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),m5t={key:0,"aria-hidden":"true",class:"text-red-600"},h5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},v5t=ae({name:"ShwfedTimeRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function p(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const m=T(()=>p(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?p(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula");function b(z){if(!Array.isArray(z)||z.length!==2)return;const[N,P]=z;if(!(typeof N!="string"||typeof P!="string")&&!(N.length===0||P.length===0))return[N,P]}function x(z){return typeof z=="string"&&z.length>0?z:void 0}const y=ue(void 0),_=T({get:()=>{const z=e.config.binding;if(z==null)return y.value;if(typeof z=="string")return b(r(z));const N=x(r(z[0])),P=x(r(z[1]));if(!(N==null||P==null))return[N,P]},set:z=>{const N=e.config.binding;if(N==null){y.value=z;return}if(typeof N=="string"){l(N,z);return}l(N[0],z?.[0]),l(N[1],z?.[1])}}),{isRequired:k,errors:w,warnings:$,visible:C}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),E=T(()=>{const z=_.value;return z?`${z[0]} ~ ${z[1]}`:"—"});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(k)?(S(),J("span",m5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",h5t,A(E.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:_.value,"onUpdate:modelValue":N[0]||(N[0]=P=>_.value=P),type:"timerange","value-format":t.config.valueFormat,"range-separator-icon":t.config.rangeSeparatorIcon,"time-granularity":t.config.timeGranularity,"hour-cycle":t.config.hourCycle,disabled:m.value},null,8,["id","modelValue","value-format","range-separator-icon","time-granularity","hour-cycle","disabled"])),i(C)?(S(),B(i(Xr),{key:3,errors:i(w),warnings:i($)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),g5t={key:0,"aria-hidden":"true",class:"text-red-600"},y5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},b5t=ae({name:"ShwfedNumberFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o}=Xn(),r=Ft(),l=(W,Z)=>Dt(W,{...Pt(r),...Z}),a=T(()=>Ke(e.config.label,n.value)),u=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),c=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function f(W,Z){if(!W)return!1;try{return We(l(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}function p(W,Z){if(W)try{const L=We(l(W,{form:o.value??{}}));return typeof L=="number"&&Number.isFinite(L)?L:void 0}catch(L){console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L);return}}const m=T(()=>f(e.config.disabled,"disabled")),h=kr(),v=T(()=>e.config.readonly!=null?f(e.config.readonly,"readonly"):h.value),g=T(()=>v.value||e.config.derived?.mode==="formula"),b=T(()=>p(e.config.min,"min")),x=T(()=>p(e.config.max,"max")),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:l,locale:()=>n.value}),$=T(()=>({useGrouping:!1,maximumFractionDigits:20})),{draft:C,commit:E}=Pb({binding:()=>e.config.binding,fromState:W=>{if(typeof W=="number"&&Number.isFinite(W))return W;if(typeof W=="string"&&W.length>0){const Z=Number(W);return Number.isFinite(Z)?Z:void 0}},toState:W=>typeof W!="number"||!Number.isFinite(W)?null:e.config.valueAsString?String(W):W});function z(W,Z,L){const F=10**Z;switch(L){case"floor":return Math.floor(W*F)/F;case"ceil":return Math.ceil(W*F)/F;default:return Math.round(W*F)/F}}const N=T(()=>!m.value&&C.value!==void 0);function P(){C.value=void 0,E()}async function Q(){await Vt();const W=e.config.precision;if(W!==void 0){const Z=C.value;if(Z!==void 0){const L=z(Z,W,e.config.roundingMode??"round");L!==Z&&(C.value=L)}}E()}return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":m.value||void 0},{default:d(()=>[a.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(a.value),1),i(y)?(S(),J("span",g5t," *")):be("",!0)]),_:2},[c.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:c.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),g.value?(S(),J("div",y5t,A(i(C)??"—"),1)):(S(),B(i(Fe),{key:2,class:"group/number-field","data-disabled":m.value?"true":void 0},{default:d(()=>[s(i(jt),{id:t.fieldId,"model-value":i(C),step:t.config.step,"step-snapping":t.config.step!==void 0,min:b.value,max:x.value,"format-options":$.value,disabled:m.value,placeholder:u.value,"input-class":"text-left","onUpdate:modelValue":Z[0]||(Z[0]=L=>C.value=L),onBlur:Q},null,8,["id","model-value","step","step-snapping","min","max","format-options","disabled","placeholder"]),N.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/number-field:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"number-field-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:Z[1]||(Z[1]=lt(()=>{},["prevent"])),onClick:lt(P,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),x5t={key:0,"aria-hidden":"true",class:"text-red-600"},_5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},w5t=ae({name:"ShwfedNumberRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(R,U)=>Dt(R,{...Pt(a),...U}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(R,U){if(!R)return!1;try{return We(u(R,{form:o.value??{}}))}catch(V){return console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V),!1}}function v(R,U){if(R)try{const V=We(u(R,{form:o.value??{}}));return typeof V=="number"&&Number.isFinite(V)?V:void 0}catch(V){console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V);return}}const g=T(()=>h(e.config.disabled,"disabled")),b=kr(),x=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):b.value),y=T(()=>x.value||e.config.derived?.mode==="formula"),_=T(()=>v(e.config.min,"min")),k=T(()=>v(e.config.max,"max")),{isRequired:w,errors:$,warnings:C,visible:E}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),z=T(()=>({useGrouping:!1,maximumFractionDigits:20}));function N(R){if(typeof R=="number"&&Number.isFinite(R))return R;if(typeof R=="string"&&R.length>0){const U=Number(R);return Number.isFinite(U)?U:void 0}}function P(R){if(!Array.isArray(R)||R.length!==2)return;const U=N(R[0]),V=N(R[1]);if(!(U==null||V==null))return[U,V]}function Q(R){return e.config.valueAsString?String(R):R}const W=ue(void 0),Z=T({get:()=>{const R=e.config.binding;if(R==null)return W.value;if(typeof R=="string")return P(r(R));const U=N(r(R[0])),V=N(r(R[1]));if(!(U==null||V==null))return[U,V]},set:R=>{const U=e.config.binding;if(U==null){W.value=R;return}if(typeof U=="string"){l(U,R?[Q(R[0]),Q(R[1])]:null);return}l(U[0],R?Q(R[0]):null),l(U[1],R?Q(R[1]):null)}}),L=ue(Z.value?.[0]),F=ue(Z.value?.[1]);Qe(Z,R=>{L.value=R?.[0],F.value=R?.[1]});function j(){const R=L.value,U=F.value;if(typeof R=="number"&&Number.isFinite(R)&&typeof U=="number"&&Number.isFinite(U)){const V=Z.value;if(V&&V[0]===R&&V[1]===U)return;Z.value=[R,U]}else Z.value!==void 0&&(Z.value=void 0)}const te=Mhe().register(j);_r(()=>{te(),j()});function ie(R){L.value=typeof R=="number"&&Number.isFinite(R)?R:void 0}function ve(R){F.value=typeof R=="number"&&Number.isFinite(R)?R:void 0}const ge=T(()=>{const R=F.value,U=k.value;return typeof R=="number"&&typeof U=="number"?Math.min(R,U):typeof R=="number"?R:U}),$e=T(()=>{const R=L.value,U=_.value;return typeof R=="number"&&typeof U=="number"?Math.max(R,U):typeof R=="number"?R:U});function le(R,U,V){const q=10**U;switch(V){case"floor":return Math.floor(R*q)/q;case"ceil":return Math.ceil(R*q)/q;default:return Math.round(R*q)/q}}async function ee(R){await Vt();const U=e.config.precision;if(U!==void 0){const V=R==="start"?L:F,q=V.value;if(q!==void 0){const ne=le(q,U,e.config.roundingMode??"round");ne!==q&&(V.value=ne)}}j()}const oe=T(()=>!g.value&&(L.value!==void 0||F.value!==void 0));function K(){L.value=void 0,F.value=void 0,Z.value!==void 0&&(Z.value=void 0)}const Y=T(()=>{const R=Z.value;return R?`${R[0]} ~ ${R[1]}`:"—"});return(R,U)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":g.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(w)?(S(),J("span",x5t," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),y.value?(S(),J("div",_5t,A(Y.value),1)):(S(),B(i(Fe),{key:2,class:"group/number-range-field","data-disabled":g.value?"true":void 0},{default:d(()=>[s(i(jt),{id:t.fieldId,"model-value":L.value,step:t.config.step,"step-snapping":t.config.step!==void 0,min:_.value,max:ge.value,"format-options":z.value,disabled:g.value,placeholder:f.value,"onUpdate:modelValue":ie,onBlur:U[0]||(U[0]=V=>ee("start"))},null,8,["id","model-value","step","step-snapping","min","max","format-options","disabled","placeholder"]),s(i(de),{icon:t.config.rangeSeparatorIcon??"lucide:arrow-right",class:"mx-1 size-3.5 shrink-0 text-zinc-400"},null,8,["icon"]),s(i(jt),{"model-value":F.value,step:t.config.step,"step-snapping":t.config.step!==void 0,min:$e.value,max:k.value,"format-options":z.value,disabled:g.value,placeholder:p.value,"onUpdate:modelValue":ve,onBlur:U[1]||(U[1]=V=>ee("end"))},null,8,["model-value","step","step-snapping","min","max","format-options","disabled","placeholder"]),oe.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/number-range-field:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"number-range-field-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:U[2]||(U[2]=lt(()=>{},["prevent"])),onClick:lt(K,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])),i(E)?(S(),B(i(Xr),{key:3,errors:i($),warnings:i(C)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),k5t={key:0,"aria-hidden":"true",class:"text-red-600"},S5t={key:1,class:"text-sm text-zinc-700"},C5t=ae({name:"ShwfedSwitchFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(E,z)=>Dt(E,{...Pt(a),...z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),p=T(()=>Ke(e.config.trueLabel,n.value)||"是"),m=T(()=>Ke(e.config.falseLabel,n.value)||"否");function h(E,z){if(!E)return!1;try{return We(u(E,{form:o.value??{}}))}catch(N){return console.error(`[shwfed-form] failed to evaluate ${z} for ${e.fieldId}:`,N),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),$=ue(!1),C=T({get:()=>{const E=e.config.binding;return E==null?$.value:r(E)===!0},set:E=>{const z=E===!0,N=e.config.binding;if(N==null){$.value=z;return}l(N,z)}});return(E,z)=>(S(),B(i(M),{orientation:"horizontal",class:"h-full","data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(y)?(S(),J("span",k5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",S5t,A(C.value?p.value:m.value),1)):(S(),B(i(Yo),{key:2,id:t.fieldId,modelValue:C.value,"onUpdate:modelValue":z[0]||(z[0]=N=>C.value=N),disabled:v.value},null,8,["id","modelValue","disabled"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),$5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},T5t={key:0,class:"border-t border-zinc-200 px-3 py-2"},E5t=ae({name:"ShwfedComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-placeholder":"请选择","combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项"},en:{"combobox-single-placeholder":"Select…","combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches"},ja:{"combobox-single-placeholder":"選択してください","combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(te,ie)=>Dt(te,{...Pt(u),...ie}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-single-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(te,ie){if(!te)return!1;try{return We(c(te,{form:r.value??{}}))}catch(ve){return console.error(`[shwfed-form] failed to evaluate ${ie} for ${e.fieldId}:`,ve),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula");function y(te,ie){try{return Jn(te,c,ie)}catch(ve){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,ve),te}}const _=T(()=>(e.config.items??[]).map(te=>{const ie=Ke(te.label,n.value)??"",ve=te.tooltip?Ke(te.tooltip,n.value):void 0,ge={form:r.value??{}};return{key:te.id,value:te.value.value,label:ie?y(ie,ge):"",tooltip:ve?y(ve,ge):void 0}})),k=ue(void 0),w=T({get:()=>{const te=e.config.binding;return te==null?k.value:l(te)},set:te=>{const ie=e.config.binding;if(ie==null){k.value=te;return}a(ie,te)}});function $(te,ie){if(te===ie)return!0;if(te==null||ie==null)return!1;if(typeof te=="object"&&typeof ie=="object")try{return JSON.stringify(te)===JSON.stringify(ie)}catch{return!1}return!1}const C=T(()=>_.value.find(te=>$(te.value,w.value))),E=T(()=>C.value?.key),z=T(()=>C.value?.label??""),N=ue(!1);function P(te){if(typeof te!="string")return;const ie=_.value.find(ve=>ve.key===te);ie&&(w.value=ie.value,Vt().then(()=>{N.value=!1}))}const Q=T(()=>!v.value&&C.value!==void 0);function W(){w.value=void 0,N.value=!1}const Z=ue(null);Qe(N,te=>{Z.value=te?_.value[0]?.key??null:null});const L=T(()=>_.value.find(te=>te.key===Z.value)),F=T(()=>L.value?.tooltip),j=T(()=>_.value.some(te=>te.tooltip!=null&&te.tooltip.length>0));return(te,ie)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",$5t,A(z.value||"—"),1)):(S(),B(i(vr),{key:2,open:N.value,"onUpdate:open":ie[1]||(ie[1]=ve=>N.value=ve)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":z.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Q.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:ie[0]||(ie[0]=lt(()=>{},["prevent"])),onClick:lt(W,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":E.value,disabled:v.value,"selection-behavior":"toggle","onUpdate:modelValue":P},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(_.value,ve=>(S(),B(i(Fr),{key:ve.key,value:ve.key,onMouseenter:ge=>Z.value=ve.key,onFocus:ge=>Z.value=ve.key},{default:d(()=>[D(A(ve.label),1)]),_:2},1032,["value","onMouseenter","onFocus"]))),128))]),_:1})]),_:1}),j.value&&F.value?(S(),J("div",T5t,[s(i(O),{source:F.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),A5t={key:0,"aria-hidden":"true",class:"text-red-600"},D5t=["id","data-disabled","data-readonly"],z5t=["tabindex","data-disabled","data-readonly","aria-disabled"],O5t={class:"flex flex-1 flex-col items-center justify-center gap-2"},M5t={key:1,class:"text-xs text-zinc-500"},I5t={key:1,class:"flex w-full flex-col gap-2"},R5t={"data-slot":"upload-zone-list",class:"flex flex-col gap-1"},V5t={class:"flex min-w-0 items-center gap-2"},P5t={class:"truncate text-zinc-700"},F5t=["accept","multiple","disabled"],N5t={key:2,class:"flex justify-end"},L5t=ae({name:"ShwfedUploadFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"vscode-icons:file-type-excel","application/vnd.ms-excel":"vscode-icons:file-type-excel","application/vnd.openxmlformats-officedocument.presentationml.presentation":"vscode-icons:file-type-powerpoint","application/vnd.ms-powerpoint":"vscode-icons:file-type-powerpoint","application/zip":"vscode-icons:file-type-zip","application/x-zip-compressed":"vscode-icons:file-type-zip","application/vnd.rar":"vscode-icons:file-type-zip","application/x-rar-compressed":"vscode-icons:file-type-zip","application/pdf":"vscode-icons:file-type-pdf2","application/ofd":"vscode-icons:file-type-ofd","application/xml":"vscode-icons:file-type-xml","image/png":"vscode-icons:file-type-image","image/jpg":"vscode-icons:file-type-image","image/jpeg":"vscode-icons:file-type-image","application/msword":"vscode-icons:file-type-word","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"vscode-icons:file-type-word"},n={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/vnd.ms-powerpoint":"PPT","application/zip":"ZIP","application/x-zip-compressed":"ZIP","application/vnd.rar":"RAR","application/x-rar-compressed":"RAR","application/pdf":"PDF","application/ofd":"OFD","application/xml":"XML","image/png":"PNG","image/jpg":"JPG","image/jpeg":"JPEG","application/msword":"DOC","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX"},o=t,{locale:r,t:l}=Bt({inheritLocale:!0,messages:{zh:{"upload-add-file":"添加文件","upload-accept-hint":"仅接受 {types}","upload-rejected-mime":"「{name}」类型不被允许","upload-rejected-size":"「{name}」超出单文件大小限制","upload-rejected-total":"「{name}」加入后将超出总大小限制","upload-rejected-count":"已达到文件数量上限,「{name}」未添加"},en:{"upload-add-file":"Add file","upload-accept-hint":"Only {types} are accepted","upload-rejected-mime":"{name} is not an allowed file type","upload-rejected-size":"{name} exceeds the maximum file size","upload-rejected-total":"{name} would exceed the total size limit","upload-rejected-count":"File count limit reached; {name} was not added"},ja:{"upload-add-file":"ファイルを追加","upload-accept-hint":"{types} のみ受け付けます","upload-rejected-mime":"「{name}」は許可されたファイル形式ではありません","upload-rejected-size":"「{name}」はファイルサイズの上限を超えています","upload-rejected-total":"「{name}」を追加すると合計サイズの上限を超えます","upload-rejected-count":"ファイル数の上限に達したため「{name}」は追加されません"}}}),{state:a,getAt:u,setAt:c}=Xn(),f=Ft(),p=(oe,K)=>Dt(oe,{...Pt(f),...K}),m=T(()=>o.config.label?Ke(o.config.label,r.value):void 0),h=T(()=>o.config.description?Ke(o.config.description,r.value):void 0),v=T(()=>o.config.tooltip?Ke(o.config.tooltip,r.value):void 0),g=T(()=>(o.config.templateLabel?Ke(o.config.templateLabel,r.value):void 0)??"下载模板");function b(oe,K){if(!oe)return!1;try{return We(p(oe,{form:a.value??{}}))}catch(Y){return console.error(`[shwfed-form] failed to evaluate ${K} for ${o.fieldId}:`,Y),!1}}const x=T(()=>b(o.config.disabled,"disabled")),y=kr(),_=T(()=>o.config.readonly!=null?b(o.config.readonly,"readonly"):y.value),{isRequired:k,errors:w,warnings:$,visible:C}=el({fieldId:()=>o.fieldId,config:()=>o.config,$cel:p,locale:()=>r.value}),E=ue([]),z=T({get:()=>{const oe=o.config.binding;if(oe==null)return E.value;const K=u(oe);return Array.isArray(K)?K.filter(Y=>Y instanceof File):[]},set:oe=>{const K=o.config.binding;if(K==null){E.value=oe;return}c(K,oe.length===0?null:oe)}}),N=ue(),P=T(()=>{const oe=o.config.accept;return oe&&oe.length>0?oe.join(","):void 0}),Q=T(()=>{const oe=o.config.accept;if(!(!oe||oe.length===0))return Array.from(new Set(oe.map(K=>n[K]??K))).join("、")}),W=T(()=>o.config.maxFiles!==void 0&&z.value.length>=o.config.maxFiles),Z=T(()=>!x.value&&!_.value&&!W.value);function L(oe){const K=o.config.accept;return!K||K.length===0?!0:K.includes(oe.type)}function F(oe){const K=[],Y=[];let R=z.value.reduce((V,q)=>V+q.size,0),U=z.value.length;for(const V of oe){if(!L(V)){Y.push({file:V,reason:"mime"});continue}if(o.config.maxFileSize!==void 0&&V.size>o.config.maxFileSize){Y.push({file:V,reason:"size"});continue}if(o.config.maxFiles!==void 0&&U>=o.config.maxFiles){Y.push({file:V,reason:"count"});continue}if(o.config.maxTotalSize!==void 0&&R+V.size>o.config.maxTotalSize){Y.push({file:V,reason:"total"});continue}K.push(V),R+=V.size,U+=1}return{accepted:K,rejected:Y}}function j(oe){if(!oe||oe.length===0)return;const K=o.config.multiple??!1,Y=K?Array.from(oe):Array.from(oe).slice(0,1),{accepted:R,rejected:U}=F(Y);for(const V of U)Io.error(l(`upload-rejected-${V.reason}`,{name:V.file.name}));R.length>0&&(z.value=K?[...z.value,...R]:R),N.value&&(N.value.value="")}function te(oe){j(oe.target.files)}function ie(){Z.value&&N.value?.click()}function ve(oe){Z.value&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),N.value?.click())}function ge(oe){if(x.value||_.value)return;const K=[...z.value];K.splice(oe,1),z.value=K}function $e(oe){return e[oe.type]??"fluent:document-20-regular"}const le=T(()=>o.config.templateIcon??"fluent:arrow-download-20-regular");async function ee(){const oe=o.config.template;if(!oe)return;const K={form:a.value??{}},Y=qt(function*(){const R=yield*p(oe.request,K);if(!oe.download)return yield*R.file();const U=yield*R.json();return yield*(yield*p(oe.download,{...K,json:U})).file()});try{const R=await Cn(ao(Y,Nr));if(!(R instanceof File)){console.error(`[shwfed-form] template request for ${o.fieldId} did not produce a File`);return}const U=URL.createObjectURL(R),V=document.createElement("a");V.href=U,V.download=R.name,document.body.appendChild(V),V.click(),V.remove(),URL.revokeObjectURL(U)}catch(R){console.error(`[shwfed-form] failed to download template for ${o.fieldId}:`,R)}}return(oe,K)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":x.value||void 0},{default:d(()=>[m.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(m.value),1),i(k)?(S(),J("span",A5t," *")):be("",!0)]),_:2},[v.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:v.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),H("div",{id:t.fieldId,class:"flex flex-col gap-2","data-disabled":x.value||void 0,"data-readonly":_.value||void 0},[z.value.length===0?(S(),J("div",{key:0,role:"button",tabindex:Z.value?0:-1,"data-slot":"upload-zone","data-disabled":x.value||void 0,"data-readonly":_.value||void 0,"aria-disabled":x.value||void 0,class:nt(["flex min-h-40 w-full flex-col gap-3 rounded border-2 border-dashed border-zinc-200 bg-zinc-50 p-4 outline-none transition-colors duration-180 ease-out focus-visible:border-(--primary) data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-60",[Z.value&&"cursor-pointer hover:border-zinc-400 hover:bg-zinc-100",_.value&&"cursor-default"]]),onClick:ie,onKeydown:ve},[H("div",O5t,[s(i(de),{icon:"fluent:cloud-arrow-up-20-regular",class:"size-8 text-zinc-400"}),h.value?(S(),B(i(O),{key:0,source:h.value,block:"",class:"prose prose-sm prose-zinc max-w-none text-center text-zinc-500"},null,8,["source"])):be("",!0),Q.value?(S(),J("p",M5t,A(i(l)("upload-accept-hint",{types:Q.value})),1)):be("",!0)])],42,z5t)):(S(),J("div",I5t,[H("ul",R5t,[(S(!0),J(Me,null,Ze(z.value,(Y,R)=>(S(),J("li",{key:`${Y.name}-${R}`,"data-slot":"upload-zone-item",class:"flex items-center justify-between gap-2 rounded px-2 py-1.5 text-sm leading-snug transition-[background-color] duration-180 ease-out hover:bg-zinc-50"},[H("span",V5t,[s(i(de),{icon:$e(Y),class:"size-4 shrink-0"},null,8,["icon"]),H("span",P5t,A(Y.name),1)]),!x.value&&!_.value?(S(),B(i(wn),{key:0,type:"button",variant:"ghost",size:"sm","data-slot":"upload-zone-delete",class:"size-6 p-0 text-zinc-500 hover:bg-red-50 hover:text-red-600","aria-label":`删除:${Y.name}`,onClick:U=>ge(R)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["aria-label","onClick"])):be("",!0)]))),128))]),Z.value?(S(),B(i(wn),{key:0,type:"button",variant:"default","data-slot":"upload-zone-add",class:"w-full shrink-0",onClick:ie},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),D(" "+A(i(l)("upload-add-file")),1)]),_:1})):be("",!0)])),H("input",{ref_key:"inputRef",ref:N,type:"file",class:"hidden",accept:P.value,multiple:t.config.multiple,disabled:x.value||_.value,onChange:te},null,40,F5t),t.config.template&&!_.value?(S(),J("div",N5t,[s(i(wn),{type:"button",variant:"link",size:"sm","data-slot":"upload-zone-template",onClick:ee},{default:d(()=>[s(i(de),{icon:le.value},null,8,["icon"]),D(" "+A(g.value),1)]),_:1})])):be("",!0)],8,D5t),i(C)?(S(),B(i(Xr),{key:1,errors:i(w),warnings:i($)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),B5t={key:0,"aria-hidden":"true",class:"text-red-600"},U5t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},q5t=["id","disabled","data-value"],j5t={key:1,class:"block truncate text-zinc-300"},H5t={key:0,"data-slot":"combobox-single-remote-empty",class:"py-6 text-center text-sm text-zinc-500"},W5t=ae({name:"ShwfedComboboxSingleRemoteFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项","combobox-single-loading":"加载中…"},en:{"combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches","combobox-single-loading":"Loading…"},ja:{"combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし","combobox-single-loading":"読み込み中…"}}}),{state:r,getAt:l,setAt:a,setAtSilent:u}=Xn(),c=Ft(),f=(K,Y)=>Dt(K,{...Pt(c),...Y}),p=T(()=>Ke(e.config.label,n.value)),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),h=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function v(K,Y){if(!K)return!1;try{return We(f(K,{form:r.value??{}}))}catch(R){return console.error(`[shwfed-form] failed to evaluate ${Y} for ${e.fieldId}:`,R),!1}}const{isRequired:g,errors:b,warnings:x,visible:y}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:f,locale:()=>n.value}),_=T(()=>v(e.config.disabled,"disabled")),k=kr(),w=T(()=>e.config.readonly!=null?v(e.config.readonly,"readonly"):k.value),$=T(()=>w.value||e.config.derived?.mode==="formula");function C(K){try{return We(f(e.config.optionValue,{form:r.value??{},option:K}))}catch(Y){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,Y);return}}function E(K){const Y=Ke(e.config.optionLabel,n.value)??"";return Y?Jn(Y,f,{form:r.value??{},option:K}):""}const z=ue(null),N=ue(!1),P=T(()=>{const K=e.config.request;if(!K)return null;try{const Y=$u(We(f(K,{form:r.value??{}})));return cn(Y)?JSON.stringify(Y.value.describe()):null}catch{return null}});let Q=0;async function W(){const K=++Q;if(P.value==null){z.value=null,N.value=!1;return}const Y=e.config.request;N.value=!0;const R=qt(function*(){const U=yield*Qr(yield*f(Y,{form:r.value??{}}));return bc(U)});try{const U=await Cn(ao(R,Nr));K===Q&&(z.value=U)}catch{K===Q&&(z.value=null)}finally{K===Q&&(N.value=!1)}}const Z=T(()=>{let K;try{K=We(f(e.config.options,{form:r.value??{},json:z.value}))}catch(Y){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,Y),[]}return Array.isArray(K)?K.map((Y,R)=>({key:String(R),label:E(Y),value:C(Y)})):[]}),L=ue(void 0),F=T({get:()=>{const K=e.config.binding;return K==null?L.value:l(K)},set:K=>{const Y=e.config.binding;if(Y==null){L.value=K;return}a(Y,K)}});let j;wc(P,()=>{if(j!=null){const K=e.config.binding;K==null?L.value=void 0:u(K,void 0)}j=P.value,W()},{debounce:200,immediate:!0});function te(K,Y){if(K===Y)return!0;if(K==null||Y==null)return!1;if(typeof K=="object"&&typeof Y=="object")try{return JSON.stringify(K)===JSON.stringify(Y)}catch{return!1}return!1}const ie=T(()=>Z.value.find(K=>te(K.value,F.value))),ve=T(()=>ie.value?.key),ge=T(()=>ie.value?.label??""),$e=ue(!1);function le(K){if(typeof K!="string")return;const Y=Z.value.find(R=>R.key===K);Y&&(F.value=Y.value,Vt().then(()=>{$e.value=!1}))}const ee=T(()=>!_.value&&ie.value!==void 0);function oe(){F.value=void 0,$e.value=!1}return(K,Y)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":_.value||void 0},{default:d(()=>[p.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(p.value),1),i(g)?(S(),J("span",B5t," *")):be("",!0)]),_:2},[h.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:h.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),$.value?(S(),J("div",U5t,[ge.value?(S(),B(i(O),{key:0,source:ge.value},null,8,["source"])):(S(),J(Me,{key:1},[D(" — ")],64))])):(S(),B(i(vr),{key:2,open:$e.value,"onUpdate:open":Y[1]||(Y[1]=R=>$e.value=R)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single-remote","data-disabled":_.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[H("button",{id:t.fieldId,type:"button",disabled:_.value,"data-value":!!ge.value,"data-slot":"input-group-control",class:"peer flex h-9 min-w-0 flex-1 cursor-default items-center overflow-hidden rounded-none border-0 bg-transparent px-3 py-1 text-left text-sm text-zinc-700 outline-none disabled:cursor-not-allowed"},[ge.value?(S(),B(i(O),{key:0,source:ge.value,class:"block truncate"},null,8,["source"])):m.value?(S(),J("span",j5t,A(m.value),1)):be("",!0)],8,q5t)]),_:1}),N.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):ee.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single-remote:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-remote-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:Y[0]||(Y[0]=lt(()=>{},["prevent"])),onClick:lt(oe,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":ve.value,disabled:_.value,"selection-behavior":"toggle","onUpdate:modelValue":le},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[Z.value.length===0?(S(),J("div",H5t,A(N.value?i(o)("combobox-single-loading"):i(o)("combobox-single-empty")),1)):(S(),J(Me,{key:1},[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(Z.value,R=>(S(),B(i(Fr),{key:R.key,value:R.key},{default:d(()=>[s(i(O),{source:R.label},null,8,["source"])]),_:2},1032,["value"]))),128))]),_:1})],64))]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"])),i(y)?(S(),B(i(Xr),{key:3,errors:i(b),warnings:i(x)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),ZN=ae({name:"ShwfedFormUnitRenderer",__name:"FormUnitRenderer",props:{unit:{},evaluateMedia:{type:Function},isHidden:{type:Function}},setup(t){const e=t;function n(f){for(const p of f){if(!p.media)return p;try{if(e.evaluateMedia(p.media))return p}catch(m){console.error(`[shwfed-form] failed to evaluate layout media for ${p.name}:`,m)}}return f[f.length-1]}const o=T(()=>n(e.unit.layouts)),r=new Set,l=T(()=>{const f=o.value?.layout;if(!f)return[];const p=[];for(const m of e.unit.fields){const h=f.placements[m.id];if(!h||e.isHidden?.(m))continue;const v=ff(m.type,m.compatibilityDate);if(!v){const g=`${m.type}@${m.compatibilityDate}`;r.has(g)||(r.add(g),console.warn(`[shwfed-form] no registered field type for ${g}`));continue}p.push({field:m,placement:h,entry:v})}return p});function a(f){const[[p,m],[h,v]]=f.area,g=[`grid-column: ${p} / ${h}`,`grid-row: ${m} / ${v}`,"min-width: 0"],b=f.h&&f.h!=="stretch"?f.h:null,x=f.v&&f.v!=="stretch"?f.v:null;if(b||x){g.push("display: flex");const y=_=>_==="start"?"flex-start":_==="end"?"flex-end":"center";b&&g.push(`justify-content: ${y(b)}`),x&&g.push(`align-items: ${y(x)}`)}return g.join("; ")}const u=T(()=>{const f=o.value?.layout;if(!f)return"";const p=`repeat(${f.columns}, minmax(0, 1fr))`;let m="";if(f.rows){const b=Array.from({length:f.rows},()=>!1);for(const x of l.value){if(!x.entry.metadata.h.grow)continue;const[[,y],[,_]]=x.placement.area,k=Math.max(1,y),w=Math.min(f.rows,_-1);for(let $=k;$<=w;$++)b[$-1]=!0}m=b.map(x=>x?"auto":"minmax(auto, 1fr)").join(" ")}const h=`calc(${f.gap??pF} * 0.25rem)`,v=f.columns>1?`min(${h}, calc(100% / ${f.columns-1}))`:h;return["display: grid",`grid-template-columns: ${p}`,m?`grid-template-rows: ${m}`:"",`column-gap: ${v}`,`row-gap: ${h}`,f.style??""].filter(Boolean).join("; ")}),c=T(()=>l.value.map(f=>({key:f.field.id,style:a(f.placement),component:f.entry.runtime,fieldId:f.field.id,config:f.field})));return(f,p)=>(S(),J("div",{style:vn(u.value)},[(S(!0),J(Me,null,Ze(c.value,m=>(S(),J("div",{key:m.key,style:vn(m.style)},[(S(),B(qo(m.component),{"field-id":m.fieldId,config:m.config},null,8,["field-id","config"]))],4))),128))],4))}});function _T(t,e){if(Object.is(t,e))return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object")return!1;if(t instanceof Date||e instanceof Date)return t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime();if(Array.isArray(t)||Array.isArray(e))return!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length?!1:t.every((r,l)=>_T(r,e[l]));const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(e,r)&&_T(t[r],e[r]))}const Lve=Symbol("shwfed-form-derived-quiescence");function Bve(){const t=ue(0);return{inFlight:t,begin:()=>{t.value+=1},end:()=>{t.value-=1},async settled(){for(;;)if(t.value>0&&await new Promise(e=>{const n=Qe(t,o=>{o===0&&(n(),e())})}),await Vt(),t.value===0)return}}}function K5t(){const t=Bve();return Tr(Lve,t),t}function Uve(){return Yn(Lve,null)??Bve()}function eL(t){const{state:e,getAt:n,setAtSilent:o,isDirty:r,markDirty:l}=t.formState,a=t.quiescence,u=T(()=>t.fields().flatMap(g=>{const b=g.binding,x=g.derived;if(typeof b!="string"||!x||typeof x!="object")return[];const y=x.mode,_=x.expression;return y!=="formula"&&y!=="prefill"||typeof _!="string"?[]:[{binding:b,mode:y,expression:_}]}));let c=0,f=!1;function p(g,b){a.begin(),Cn(t.evaluate(g.expression)).then(x=>{if(b!==c||g.mode==="prefill"&&r(g.binding))return;const y=x===void 0?null:x;_T(n(g.binding),y)||o(g.binding,y)},()=>{}).finally(()=>{a.end()})}function m(){const g=c+=1;for(const b of u.value)p(b,g)}Qe([e,u],()=>{f&&m()});function h(){for(const g of u.value)g.mode==="prefill"&&n(g.binding)!==void 0&&l(g.binding)}let v=!1;Um(()=>{v=!0}),t.ready.then(()=>{v||(f=!0,h(),m())},()=>{v||(f=!0,h(),m())})}const vK=ae({name:"ShwfedListFieldRow",__name:"row",props:ml({unit:{},index:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=xt(t,"modelValue"),n=t,o=VN(e,"row");Ia({item:{type:"dyn",label:"item",description:"当前列表项",value:()=>e.value??{}},index:{type:"number",label:"index",description:"当前列表项索引,从 0 开始",value:()=>n.index}});const r=Ft(),l=(u,c)=>Dt(u,{...Pt(r),...c});eL({fields:()=>n.unit.fields,evaluate:u=>l(u),ready:Promise.resolve(),formState:o,quiescence:Uve()});function a(u){return We(l(u))}return(u,c)=>(S(),B(ZN,{unit:t.unit,"evaluate-media":a},null,8,["unit"]))}}),G5t={key:0,"aria-hidden":"true",class:"text-red-600"},Y5t={class:"flex flex-col gap-3"},J5t=["data-instruction"],X5t={class:"flex items-center gap-2"},Q5t={key:2,class:"min-w-0 flex-1","data-slot":"list-row-summary"},Z5t={key:3,class:"min-w-0 flex-1"},eVt={key:0,class:"mt-3 min-w-0","data-slot":"list-row-content"},jk="shwfed-list-row",tVt=ae({name:"ShwfedListFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(U,V)=>Dt(U,{...Pt(a),...V}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),p=T(()=>Ke(e.config.addLabel,n.value)||"新增"),m=T(()=>Ke(e.config.locale,n.value)),h=T(()=>!!m.value);function v(U,V){if(!U)return!1;try{return We(u(U,{form:o.value??{}}))}catch(q){return console.error(`[shwfed-form] failed to evaluate ${V} for ${e.fieldId}:`,q),!1}}const{isRequired:g,errors:b,warnings:x,visible:y}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),_=T(()=>v(e.config.disabled,"disabled")),k=T(()=>e.config.reorderable??!0),w=T(()=>{const U=e.config.unit.fields;return U.length!==1?!1:U[0].binding===H4}),$=ue([]),C=T(()=>{const U=e.config.binding;if(U==null)return $.value;const V=r(U);return Array.isArray(V)?V:[]}),E=T(()=>{const U=m.value;return U==null?[]:C.value.map((V,q)=>QN(U,ne=>{try{const X=We(u(ne,{form:o.value??{},item:V??{},index:q}));return X==null?"":String(X)}catch(X){return console.error(`[shwfed-form] list field: failed to evaluate summary expression \`${ne}\` for ${e.fieldId}[${q}]:`,X),""}}))});function z(U){const V=e.config.binding;if(V==null){$.value=U;return}l(V,U)}function N(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,U=>{const V=Math.random()*16|0;return(U==="x"?V:V&3|8).toString(16)})}const P=ue([]);Qe(()=>C.value.length,U=>{U!==P.value.length&&(P.value=Array.from({length:U},()=>N()))},{immediate:!0});const Q=ue(new Set);function W(U){return Q.value.has(U)}function Z(U){const V=new Set(Q.value);V.has(U)?V.delete(U):V.add(U),Q.value=V}const L=T(()=>e.config.max!=null&&C.value.length>=e.config.max),F=T(()=>(e.config.min??0)>0&&C.value.length<=(e.config.min??0)),j=T(()=>!_.value&&!L.value),te=T(()=>!_.value&&!F.value),ie=T(()=>!_.value&&k.value);function ve(){if(!j.value)return;const U=w.value?null:{};z([...C.value,U]);const V=N();P.value=[...P.value,V];const q=new Set(Q.value);q.add(V),Q.value=q}function ge(U){if(!te.value||U<0||U>=C.value.length)return;const V=P.value[U];if(z(C.value.filter((q,ne)=>ne!==U)),P.value=P.value.filter((q,ne)=>ne!==U),V!=null&&Q.value.has(V)){const q=new Set(Q.value);q.delete(V),Q.value=q}}function $e(U,V){if(!ie.value||U===V||U<0||V<0||U>=C.value.length||V>=C.value.length)return;const q=[...C.value],[ne]=q.splice(U,1);if(!ne)return;q.splice(V,0,ne),z(q);const X=[...P.value],[fe]=X.splice(U,1);fe&&(X.splice(V,0,fe),P.value=X)}function le(U,V){if(U<0||U>=C.value.length)return;const q=[...C.value];q[U]=V,z(q)}const ee=U=>P.value[U]??`idx-${U}`;function oe(U){if(!ie.value||U.source.kind!==jk||U.target.kind!==jk)return;const V=P.value.findIndex(ne=>ne===U.source.id),q=P.value.findIndex(ne=>ne===U.target.id);V<0||q<0||(U.instruction==="reorder-above"?$e(V,V<q?q-1:q):U.instruction==="reorder-below"&&$e(V,V<=q?q:q+1))}const K=uh({onRowDrop:oe}),Y=U=>U.querySelector(".drag-handle");function R(U){return{kind:jk,canDrop:V=>V.kind===jk,blockInstructions:V=>{const q=["make-child","reparent"];return V.id===ee(U)&&q.push("reorder-above","reorder-below"),q},dragHandle:Y}}return(U,V)=>(S(),B(i(M),{orientation:"vertical","data-disabled":_.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(g)?(S(),J("span",G5t," *")):be("",!0)]),_:2},[f.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:f.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),H("div",Y5t,[(S(!0),J(Me,null,Ze(C.value,(q,ne)=>(S(),J("div",{key:P.value[ne],ref_for:!0,ref:i(K).rowRef(ee(ne),R(ne)),class:"relative rounded border border-zinc-200 bg-zinc-50/40 p-3","data-slot":"list-row","data-instruction":i(K).instructionFor(ee(ne))??void 0},[H("div",X5t,[k.value?(S(),B(i(de),{key:0,icon:"fluent:re-order-dots-vertical-20-regular",class:nt(["drag-handle size-4 shrink-0 text-zinc-400",ie.value?"cursor-grab":"cursor-not-allowed opacity-50"]),"data-slot":"list-row-drag-handle"},null,8,["class"])):be("",!0),h.value?(S(),B(i(ot),{key:1,size:"icon-xs",class:"shrink-0","data-slot":"list-row-collapse","aria-expanded":W(ee(ne)),"aria-label":W(ee(ne))?"折叠":"展开",onClick:X=>Z(ee(ne))},{default:d(()=>[s(i(de),{icon:W(ee(ne))?"fluent:chevron-down-20-regular":"fluent:chevron-right-20-regular"},null,8,["icon"])]),_:2},1032,["aria-expanded","aria-label","onClick"])):be("",!0),h.value?(S(),J("div",Q5t,[s(i(O),{source:E.value[ne]??"",class:"prose prose-xs prose-zinc"},null,8,["source"])])):(S(),J("div",Z5t,[s(vK,{"model-value":q,unit:t.config.unit,index:ne,"onUpdate:modelValue":X=>le(ne,X)},null,8,["model-value","unit","index","onUpdate:modelValue"])])),s(i(ot),{variant:"destructive",size:"icon-xs",class:"shrink-0",disabled:!te.value,"data-slot":"list-row-remove","aria-label":"删除",onClick:X=>ge(ne)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["disabled","onClick"])]),h.value?Ba((S(),J("div",eVt,[s(vK,{"model-value":q,unit:t.config.unit,index:ne,"onUpdate:modelValue":X=>le(ne,X)},null,8,["model-value","unit","index","onUpdate:modelValue"])],512)),[[c5,W(ee(ne))]]):be("",!0)],8,J5t))),128)),s(i(wn),{type:"button",disabled:!j.value,"data-slot":"list-add",class:"w-full justify-center",onClick:ve},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),H("span",null,A(p.value),1)]),_:1},8,["disabled"])]),i(y)?(S(),B(i(Xr),{key:1,errors:i(b),warnings:i(x)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),nVt=Ns(tVt,[["__scopeId","data-v-786923a2"]]),oVt={key:0,"aria-hidden":"true",class:"text-red-600"},rVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},lVt={key:2,class:"min-h-9 py-1.5 text-sm text-zinc-400"},iVt={key:3,class:"flex flex-wrap items-start gap-x-6 gap-y-2 py-1"},aVt={class:"flex flex-col gap-0.5"},sVt={class:"text-sm text-zinc-700"},uVt=ae({name:"ShwfedCheckboxGroupFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"checkbox-group-empty":"无可选项"},en:{"checkbox-group-empty":"No options"},ja:{"checkbox-group-empty":"選択肢なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(Z,L)=>Dt(Z,{...Pt(u),...L}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(Z,L){if(!Z)return!1;try{return We(c(Z,{form:r.value??{}}))}catch(F){return console.error(`[shwfed-form] failed to evaluate ${L} for ${e.fieldId}:`,F),!1}}const{isRequired:h,errors:v,warnings:g,visible:b}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),x=T(()=>m(e.config.disabled,"disabled")),y=kr(),_=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):y.value),k=T(()=>_.value||e.config.derived?.mode==="formula");function w(Z,L){try{return Jn(Z,c,L)}catch(F){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,F),Z}}const $=T(()=>(e.config.items??[]).map(Z=>{const L=Ke(Z.label,n.value)??"",F=Z.tooltip?Ke(Z.tooltip,n.value):void 0,j={form:r.value??{}};return{key:Z.id,value:Z.value.value,label:L?w(L,j):"",tooltip:F?w(F,j):void 0}}));function C(Z){return Array.isArray(Z)?Z:[]}const E=ue([]),z=T({get:()=>{const Z=e.config.binding;return Z==null?E.value:C(l(Z))},set:Z=>{const L=e.config.binding;if(L==null){E.value=Z;return}a(L,Z)}});function N(Z,L){if(Z===L)return!0;if(Z==null||L==null)return!1;if(typeof Z=="object"&&typeof L=="object")try{return JSON.stringify(Z)===JSON.stringify(L)}catch{return!1}return!1}function P(Z){return z.value.some(L=>N(L,Z.value))}function Q(Z){if(x.value)return;const L=z.value;z.value=P(Z)?L.filter(F=>!N(F,Z.value)):[...L,Z.value]}const W=T(()=>$.value.filter(P).map(L=>L.label).filter(L=>L.length>0).join("、")||"—");return(Z,L)=>(S(),B(i(M),{orientation:"vertical","data-disabled":x.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(h)?(S(),J("span",oVt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),k.value?(S(),J("div",rVt,A(W.value),1)):$.value.length===0?(S(),J("div",lVt,A(i(o)("checkbox-group-empty")),1)):(S(),J("div",iVt,[(S(!0),J(Me,null,Ze($.value,F=>(S(),J("label",{key:F.key,"data-slot":"checkbox-group-option",class:nt(["flex items-start gap-2",x.value?"cursor-not-allowed opacity-60":"cursor-pointer"])},[s(i(nN),{"model-value":P(F),disabled:x.value,class:"mt-0.5","onUpdate:modelValue":()=>Q(F)},null,8,["model-value","disabled","onUpdate:modelValue"]),H("span",aVt,[H("span",sVt,A(F.label),1),F.tooltip?(S(),B(i(O),{key:0,source:F.tooltip,block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])],2))),128))])),i(b)?(S(),B(i(Xr),{key:4,errors:i(v),warnings:i(g)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),cVt=ae({name:"UiRadioGroup",__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=Ut(n,"class"),l=co(r,o);return(a,u)=>(S(),B(i(KQe),Be({"data-slot":"radio-group"},i(l),{class:i(dt)("grid gap-3",n.class)}),{default:d(()=>[we(a.$slots,"default")]),_:3},16,["class"]))}}),dVt=ae({name:"UiRadioGroupItem",__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(XQe),Be({"data-slot":"radio-group-item"},i(o),{class:i(dt)("peer cursor-pointer flex items-center justify-center border-zinc-200 data-[state=checked]:border-(--primary) aria-invalid:border-red-400 size-4 shrink-0 rounded-full border shadow-xs hover:shadow transition-shadow outline-none disabled:cursor-not-allowed disabled:opacity-50",e.class)}),{default:d(()=>[s(i(ZQe),{"data-slot":"radio-group-indicator",class:"grid h-full w-full place-content-center"},{default:d(()=>[...l[0]||(l[0]=[H("span",{class:"size-2 rounded-full bg-(--primary)"},null,-1)])]),_:1})]),_:1},16,["class"]))}}),fVt={key:0,"aria-hidden":"true",class:"text-red-600"},pVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},mVt={key:2,class:"min-h-9 py-1.5 text-sm text-zinc-400"},hVt={class:"flex flex-col gap-0.5"},vVt={class:"text-sm text-zinc-700"},gVt=ae({name:"ShwfedRadioGroupFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"radio-group-empty":"无可选项"},en:{"radio-group-empty":"No options"},ja:{"radio-group-empty":"選択肢なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(P,Q)=>Dt(P,{...Pt(u),...Q}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(P,Q){if(!P)return!1;try{return We(c(P,{form:r.value??{}}))}catch(W){return console.error(`[shwfed-form] failed to evaluate ${Q} for ${e.fieldId}:`,W),!1}}const{isRequired:h,errors:v,warnings:g,visible:b}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),x=T(()=>m(e.config.disabled,"disabled")),y=kr(),_=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):y.value),k=T(()=>_.value||e.config.derived?.mode==="formula");function w(P,Q){try{return Jn(P,c,Q)}catch(W){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,W),P}}const $=T(()=>(e.config.items??[]).map(P=>{const Q=Ke(P.label,n.value)??"",W=P.tooltip?Ke(P.tooltip,n.value):void 0,Z={form:r.value??{}};return{key:P.id,value:P.value.value,label:Q?w(Q,Z):"",tooltip:W?w(W,Z):void 0}})),C=ue(void 0),E=T({get:()=>{const P=e.config.binding,Q=P==null?C.value:l(P);return typeof Q=="string"||typeof Q=="number"?Q:void 0},set:P=>{const Q=e.config.binding;if(Q==null){C.value=P;return}a(Q,P)}});function z(P){x.value||(E.value=typeof P=="string"||typeof P=="number"?P:void 0)}const N=T(()=>$.value.find(Q=>Q.value===E.value)?.label||"—");return(P,Q)=>(S(),B(i(M),{orientation:"vertical","data-disabled":x.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(h)?(S(),J("span",fVt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),k.value?(S(),J("div",pVt,A(N.value),1)):$.value.length===0?(S(),J("div",mVt,A(i(o)("radio-group-empty")),1)):(S(),B(i(cVt),{key:3,"model-value":E.value,disabled:x.value,class:"flex flex-wrap items-start gap-x-6 gap-y-2 py-1","onUpdate:modelValue":z},{default:d(()=>[(S(!0),J(Me,null,Ze($.value,W=>(S(),J("label",{key:W.key,"data-slot":"radio-group-option",class:nt(["flex items-start gap-2",x.value?"cursor-not-allowed opacity-60":"cursor-pointer"])},[s(i(dVt),{value:W.value,disabled:x.value,class:"mt-0.5"},null,8,["value","disabled"]),H("span",hVt,[H("span",vVt,A(W.label),1),W.tooltip?(S(),B(i(O),{key:0,source:W.tooltip,block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])],2))),128))]),_:1},8,["model-value","disabled"])),i(b)?(S(),B(i(Xr),{key:4,errors:i(v),warnings:i(g)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),yVt={key:0,"aria-hidden":"true",class:"text-red-600"},bVt=ae({name:"ShwfedTableFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=Gf(()=>ul(()=>import("./index-Cw2peSCr.js"),[],import.meta.url)),n=t,{locale:o}=Bt(),r=Xn(),l=Ft(),a=(b,x)=>Dt(b,{...Pt(l),...x}),{isRequired:u,errors:c,warnings:f,visible:p}=el({fieldId:()=>n.fieldId,config:()=>n.config,$cel:a,locale:()=>o.value}),m=T(()=>Ke(n.config.label,o.value)),h=T(()=>n.config.tooltip?Ke(n.config.tooltip,o.value):void 0),v=T(()=>{const{dataSource:b,...x}=n.config.table;return x}),g=T({get:()=>{const b=n.config.binding?.trim();if(!b)return[];const x=r.getAt(b);return Array.isArray(x)?x:[]},set:b=>{const x=n.config.binding?.trim();x&&r.setAtSilent(x,b)}});return(b,x)=>(S(),B(i(M),{orientation:"vertical"},{default:d(()=>[m.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(m.value),1),i(u)?(S(),J("span",yVt," *")):be("",!0)]),_:2},[h.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:h.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),s(i(e),{rows:g.value,"onUpdate:rows":x[0]||(x[0]=y=>g.value=y),config:v.value},null,8,["rows","config"]),i(p)?(S(),B(i(Xr),{key:1,errors:i(c),warnings:i(f)},null,8,["errors","warnings"])):be("",!0)]),_:1}))}}),xVt={"data-slot":"collapsible-section",class:"relative rounded border border-zinc-200 bg-zinc-50/40 p-3"},_Vt={class:"flex items-center gap-2"},wVt={class:"min-w-0 flex-1","data-slot":"collapsible-header"},kVt={key:0,"data-slot":"collapsible-error-count",class:"shrink-0 text-xs text-red-600"},SVt={key:1,"data-slot":"collapsible-warning-count",class:"shrink-0 text-xs text-amber-600"},CVt={"data-slot":"collapsible-body",class:"mt-3 min-w-0"},$Vt=ae({name:"ShwfedCollapsibleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),o=ue(e.config.defaultCollapsed??!1);function r(){o.value=!o.value}const l=Ft(),a=(b,x)=>Dt(b,{...Pt(l),...x}),u=T(()=>{const b=Ke(e.config.header,n.value)??"";return b?QN(b,x=>{try{const y=We(a(x));return y==null?"":String(y)}catch(y){return console.error(`[shwfed-form] collapsible: failed to evaluate header expression \`${x}\` for ${e.fieldId}:`,y),""}}):""});function c(b){return We(a(b))}function f(b){const x=b.hidden;if(!x)return!1;try{return We(a(x))}catch(y){return console.error(`[shwfed-form] collapsible: failed to evaluate hidden for ${b.id}:`,y),!1}}const p=Vve();function m(b){const x=[];for(const y of b){x.push(y.id);const _=y.unit;_?.fields&&x.push(...m(_.fields))}return x}const h=T(()=>p?.revealed.value?p.resultsFor(m(e.config.unit.fields)):[]),v=T(()=>h.value.filter(b=>b.severity==="error").length),g=T(()=>h.value.filter(b=>b.severity==="warning").length);return(b,x)=>(S(),J("div",xVt,[H("div",_Vt,[s(i(ot),{size:"icon-xs",class:"shrink-0","data-slot":"collapsible-toggle","aria-expanded":!o.value,"aria-label":o.value?"展开":"折叠",onClick:r},{default:d(()=>[s(i(de),{icon:o.value?"fluent:chevron-right-20-regular":"fluent:chevron-down-20-regular"},null,8,["icon"])]),_:1},8,["aria-expanded","aria-label"]),H("div",wVt,[s(i(O),{source:u.value,class:"prose prose-sm prose-zinc max-w-none"},null,8,["source"])]),v.value>0?(S(),J("span",kVt,A(v.value)+" 个错误",1)):g.value>0?(S(),J("span",SVt,A(g.value)+" 个警告",1)):be("",!0)]),Ba(H("div",CVt,[s(ZN,{unit:t.config.unit,"evaluate-media":c,"is-hidden":f},null,8,["unit"])],512),[[c5,!o.value]])]))}}),TVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},EVt={key:1,class:"min-h-9 py-1.5 text-sm text-red-500"},AVt={key:2,class:"flex flex-col gap-1.5 py-1","aria-busy":"true"},DVt={class:"flex flex-col gap-0.5"},zVt={class:"min-h-9 py-1.5 text-sm text-zinc-400"},OVt=ae({name:"ShwfedTreeMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-multi-search-label":"搜索","tree-multi-search-clear":"清除搜索","tree-multi-load-error":"加载失败","tree-multi-empty":"无可选项","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":"、"},en:{"tree-multi-search-label":"Search","tree-multi-search-clear":"Clear search","tree-multi-load-error":"Failed to load","tree-multi-empty":"No options","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":", "},ja:{"tree-multi-search-label":"検索","tree-multi-search-clear":"検索をクリア","tree-multi-load-error":"読み込みに失敗しました","tree-multi-empty":"選択肢なし","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":"、"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(ge,$e)=>Dt(ge,{...Pt(u),...$e}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(ge,$e){if(!ge)return!1;try{return We(c(ge,{form:r.value??{}}))}catch(le){return console.error(`[shwfed-form] failed to evaluate ${$e} for ${e.fieldId}:`,le),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),x=ue([]),y=T({get:()=>{const ge=e.config.binding,$e=ge==null?x.value:l(ge);return Array.isArray($e)?$e.map(le=>String(le)):[]},set:ge=>{const $e=ge.map(ee=>String(ee)),le=e.config.binding;if(le==null){x.value=$e;return}a(le,$e)}}),_=ue([]),k=ue(!1),w=ue(null);async function $(){const ge=e.config.dataSource;if(!ge){_.value=[];return}const $e=qt(function*(){let ee=pt();ge.request&&(ee=yield*Qr(yield*c(ge.request,{form:r.value??{}})));const oe=yield*c(ge.data,{form:r.value??{},json:ee});return Array.isArray(oe)?oe:[]}),le=qt(function*(){const ee=yield*Vs(on(()=>{k.value=!0}).pipe(Ps("30 millis")));return yield*ir($e,_i(ee))}).pipe(ir(on(()=>{k.value=!1})));try{const ee=await Cn(ao(le,Nr));_.value=ee,w.value=null}catch(ee){console.warn("[shwfed-form] tree dataSource fetch failed",ee),w.value=ee}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{$()},{immediate:!0});function C(ge){return{form:r.value??{},node:ge}}function E(ge){try{const $e=We(c(e.config.nodeKey,C(ge)));return String($e)}catch($e){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,$e),""}}function z(ge){let $e;try{$e=We(c(e.config.nodeChildren,C(ge)))}catch(le){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,le);return}if($e!=null&&Array.isArray($e)&&$e.length!==0)return $e}function N(ge,$e){if(h.value)return!1;const le=e.config.nodeSelectable;if(!le)return!0;try{return We(c(le,C(ge)))}catch(ee){return console.error(`[shwfed-form] failed to evaluate nodeSelectable for ${e.fieldId}:`,ee),!1}}function P(ge,$e){try{return Jn(ge,c,{form:r.value??{},node:$e})}catch(le){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,le),ge}}function Q(ge){const $e=Ke(e.config.nodeLabel,n.value)??"";return $e?P($e,ge):""}function W(ge){if(!e.config.nodeTooltip)return;const $e=Ke(e.config.nodeTooltip,n.value);if($e)return P($e,ge)}const Z=T(()=>{if(!e.config.expandAll)return[];const ge=[],$e=[..._.value];for(;$e.length;){const le=$e.pop(),ee=z(le);ee&&ee.length&&(ge.push(E(le)),$e.push(...ee))}return ge}),L=ue("");function F(ge){const $e=e.config.filter?.keywords;if(!$e)return[];try{const le=We(c($e,C(ge)));return Array.isArray(le)?le.map(ee=>String(ee)):[]}catch{return[]}}const j=$n(new Map);Qe(()=>[_.value,n.value,e.config.nodeLabel,e.config.filter?.keywords],()=>{const ge=new Map,$e=[..._.value];for(;$e.length;){const le=$e.pop(),ee=Q(le).trim().toLowerCase(),oe=F(le).map(Y=>Y.trim().toLowerCase()).join(`
|
|
198
196
|
`);ge.set(E(le),oe?`${ee}
|
|
199
|
-
${oe}`:ee);const K=z(le);K&&K.length&&$e.push(...K)}j.value=ge},{immediate:!0});function te(ge,$e){const le=$e.trim().toLowerCase();if(!le)return!0;const ee=j.value.get(E(ge));return ee!==void 0?ee.includes(le):Q(ge).trim().toLowerCase().includes(le)}const ie=T(()=>{const ge=e.config.filter?.label?Ke(e.config.filter.label,n.value):void 0;return ge&&ge.length>0?ge:o("tree-multi-search-label")}),ve=T(()=>{const ge=new Set(y.value),$e=o("tree-multi-readonly-empty");if(ge.size===0)return $e;const le=new Map,ee=[..._.value];for(;ee.length;){const K=ee.pop(),Y=E(K);ge.has(Y)&&le.set(Y,Q(K));const R=z(K);R&&R.length&&ee.push(...R)}const oe=y.value.map(K=>le.get(K)??K).filter(K=>K.length>0);return oe.length>0?oe.join(o("tree-multi-readonly-separator")):$e});return(ge,$e)=>(S(),B(i(M),{orientation:"vertical","data-disabled":h.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),b.value?(S(),J("div",TVt,A(ve.value),1)):(S(),J(Me,{key:2},[t.config.filter?.enabled?(S(),B(i(M),{key:0,orientation:"floating"},{default:d(()=>[s(i(I),null,{default:d(()=>[D(A(ie.value),1)]),_:1}),s(i(Fe),null,{default:d(()=>[s(i(Ye),{align:"inline-start"},{default:d(()=>[s(i(de),{icon:"lucide:search"})]),_:1}),s(i(Xe),{modelValue:L.value,"onUpdate:modelValue":$e[0]||($e[0]=le=>L.value=le),disabled:h.value},null,8,["modelValue","disabled"]),L.value.length>0?(S(),B(i(Ye),{key:0,align:"inline-end"},{default:d(()=>[s(i(ot),{size:"icon-xs","aria-label":i(o)("tree-multi-search-clear"),onClick:$e[1]||($e[1]=le=>L.value="")},{default:d(()=>[s(i(de),{icon:"lucide:x"})]),_:1},8,["aria-label"])]),_:1})):be("",!0)]),_:1})]),_:1})):be("",!0),w.value&&_.value.length===0?(S(),J("div",EVt,A(i(o)("tree-multi-load-error")),1)):k.value&&_.value.length===0?(S(),J("div",AVt,[s(i($o),{class:"h-6 w-2/3"}),s(i($o),{class:"h-6 w-1/2"}),s(i($o),{class:"h-6 w-3/5"}),s(i($o),{class:"h-6 w-2/5"})])):(S(),B(i(Ec),{key:3,modelValue:y.value,"onUpdate:modelValue":$e[2]||($e[2]=le=>y.value=le),roots:_.value,"get-key":E,"get-children":z,"selection-mode":"multi",cascade:t.config.cascade??"cascade-both",selectable:N,"filter-predicate":te,"filter-query":L.value,"initial-expanded":Z.value,"show-focused-row":!1,class:nt(h.value?"pointer-events-none opacity-60":void 0)},{node:d(({node:le})=>[H("span",DVt,[s(i(O),{source:Q(le),class:"prose prose-sm prose-zinc text-zinc-700"},null,8,["source"]),W(le)?(S(),B(i(O),{key:0,source:W(le),block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])]),empty:d(()=>[H("div",zVt,A(i(o)("tree-multi-empty")),1)]),_:1},8,["modelValue","roots","cascade","filter-query","initial-expanded","class"]))],64))]),_:1},8,["data-disabled"]))}}),MVt={key:0,"aria-hidden":"true",class:"text-red-600"},IVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},RVt=ae({name:"ShwfedMonthFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),{isRequired:x,errors:y,warnings:_,visible:k}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),w=T(()=>e.config.valueFormat??K_.month.value),$=T(()=>{const z=e.config.presets;if(!(!z||z.length===0))return z.map(N=>({name:N.label,value:()=>{try{const P=We(u(N.value,{form:o.value??{}}));return Wr(P,w.value)}catch(P){return console.error(`[shwfed-form] failed to evaluate preset "${N.value}" for ${e.fieldId}:`,P),""}}}))}),C=ue(void 0),E=T({get:()=>{const z=e.config.binding;if(z==null)return C.value;const N=r(z);return typeof N=="string"&&N.length>0?N:void 0},set:z=>{const N=e.config.binding;if(N==null){C.value=z;return}l(N,z)}});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":h.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(x)?(S(),J("span",MVt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),b.value?(S(),J("div",IVt,A(E.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:E.value,"onUpdate:modelValue":N[0]||(N[0]=P=>E.value=P),type:"month",format:t.config.format,"value-format":t.config.valueFormat,placeholder:f.value,disabled:h.value,shortcuts:$.value},null,8,["id","modelValue","format","value-format","placeholder","disabled","shortcuts"])),i(k)?(S(),B(i(Xr),{key:3,errors:i(y),warnings:i(_)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),VVt={key:0,"aria-hidden":"true",class:"text-red-600"},PVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},FVt=ae({name:"ShwfedMonthRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(W,Z)=>Dt(W,{...Pt(a),...Z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(W,Z){if(!W)return!1;try{return We(u(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),$=T(()=>e.config.valueFormat??G_.monthrange.value),C=T(()=>{const W=e.config.presets;if(!(!W||W.length===0))return W.map(Z=>({name:Z.label,value:()=>{try{const L=We(u(Z.start,{form:o.value??{}})),F=We(u(Z.end,{form:o.value??{}}));return[Wr(L,$.value),Wr(F,$.value)]}catch(L){return console.error(`[shwfed-form] failed to evaluate preset "${Z.start}" .. "${Z.end}" for ${e.fieldId}:`,L),["",""]}}}))});function E(W){if(!Array.isArray(W)||W.length!==2)return;const[Z,L]=W;if(!(typeof Z!="string"||typeof L!="string")&&!(Z.length===0||L.length===0))return[Z,L]}function z(W){return typeof W=="string"&&W.length>0?W:void 0}const N=ue(void 0),P=T({get:()=>{const W=e.config.binding;if(W==null)return N.value;if(typeof W=="string")return E(r(W));const Z=z(r(W[0])),L=z(r(W[1]));if(!(Z==null||L==null))return[Z,L]},set:W=>{const Z=e.config.binding;if(Z==null){N.value=W;return}if(typeof Z=="string"){l(Z,W);return}l(Z[0],W?.[0]),l(Z[1],W?.[1])}}),Q=T(()=>{const W=P.value;return W?`${W[0]} ~ ${W[1]}`:"—"});return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(y)?(S(),J("span",VVt," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",PVt,A(Q.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:P.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>P.value=L),type:"monthrange",format:t.config.format,"value-format":t.config.valueFormat,"start-placeholder":f.value,"end-placeholder":p.value,"range-separator-icon":t.config.rangeSeparatorIcon,disabled:v.value,shortcuts:C.value},null,8,["id","modelValue","format","value-format","start-placeholder","end-placeholder","range-separator-icon","disabled","shortcuts"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),NVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},LVt={class:"flex-1"},BVt=ae({name:"ShwfedComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-multi-placeholder":"请选择","combobox-multi-search-placeholder":"搜索…","combobox-multi-empty":"无匹配项"},en:{"combobox-multi-placeholder":"Select…","combobox-multi-search-placeholder":"Search…","combobox-multi-empty":"No matches"},ja:{"combobox-multi-placeholder":"選択してください","combobox-multi-search-placeholder":"検索…","combobox-multi-empty":"一致なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(F,j)=>Dt(F,{...Pt(u),...j}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-multi-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(F,j){if(!F)return!1;try{return We(c(F,{form:r.value??{}}))}catch(te){return console.error(`[shwfed-form] failed to evaluate ${j} for ${e.fieldId}:`,te),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula");function y(F){try{return We(c(e.config.optionValue,{form:r.value??{},option:F}))}catch(j){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,j);return}}function _(F){const j=Ke(e.config.optionLabel,n.value)??"";return j?Jn(j,c,{form:r.value??{},option:F}):""}const k=T(()=>{let F;try{F=We(c(e.config.options,{form:r.value??{}}))}catch(j){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,j),[]}return Array.isArray(F)?F.map((j,te)=>({key:String(te),label:_(j),value:y(j)})):[]}),w=ue([]),$=T({get:()=>{const F=e.config.binding,j=F==null?w.value:l(F);return Array.isArray(j)?j:[]},set:F=>{const j=Array.isArray(F)?F:[],te=e.config.binding;if(te==null){w.value=j;return}a(te,j)}});function C(F,j){if(F===j)return!0;if(F==null||j==null)return!1;if(typeof F=="object"&&typeof j=="object")try{return JSON.stringify(F)===JSON.stringify(j)}catch{return!1}return!1}const E=T(()=>{const F=[];for(const j of $.value){const te=k.value.find(ie=>C(ie.value,j));te&&F.push(te)}return F}),z=T(()=>E.value.map(F=>F.key)),N=T(()=>new Set(z.value)),P=T(()=>{const F=E.value;return F.length===0?"":F.length===1?F[0].label:`${F[0].label} +${F.length-1}`}),Q=ue(!1);function W(F){const j=Array.isArray(F)?F.filter(ie=>typeof ie=="string"):[],te=[];for(const ie of j){const ve=k.value.find(ge=>ge.key===ie);ve&&te.push(ve.value)}$.value=te}const Z=T(()=>!v.value&&E.value.length>0);function L(){$.value=[],Q.value=!1}return(F,j)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",NVt,A(P.value||"—"),1)):(S(),B(i(vr),{key:2,open:Q.value,"onUpdate:open":j[1]||(j[1]=te=>Q.value=te)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":P.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Z.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:j[0]||(j[0]=lt(()=>{},["prevent"])),onClick:lt(L,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":z.value,multiple:!0,disabled:v.value,"onUpdate:modelValue":W},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-multi-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-multi-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(k.value,te=>(S(),B(i(Fr),{key:te.key,value:te.key},{default:d(()=>[H("span",LVt,A(te.label),1),N.value.has(te.key)?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-4 text-zinc-700"})):be("",!0)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}});function qve(t,e){const n=e.nodeChildren(t);return!n||n.length===0?{kind:"terminal",raw:t,key:e.nodeKey(t)}:{kind:"branch",raw:t,key:e.nodeKey(t),children:n.map(o=>qve(o,e))}}function jve(t,e){return t.map(n=>qve(n,e))}function Hve(t){return t.kind==="branch"?t.children:void 0}function wT(t,e){const n=[];function o(r){for(const l of r){if(n.push(l),l.key===e||l.kind==="branch"&&l.children.length>0&&o(l.children))return!0;n.pop()}return!1}return o(t)?n.slice():null}const UVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},qVt={"data-slot":"tree-combobox-multi-search",class:"flex h-9 items-center gap-2 border-b border-zinc-200 px-3"},jVt=["disabled","placeholder"],HVt={class:"flex flex-col p-1"},WVt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},KVt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},GVt=["onMouseenter","onFocusin"],YVt={class:"min-h-9 px-2 py-1.5 text-sm text-zinc-400"},JVt={class:"inline-flex items-center gap-1 text-xs text-red-500"},XVt=["onClick"],QVt={class:"sr-only"},ZVt={key:0,"data-slot":"tree-combobox-multi-tooltip",class:"border-t border-zinc-200 px-3 py-2"},ePt=ae({name:"ShwfedTreeComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-multi-placeholder":"请选择","tree-combobox-multi-search-placeholder":"搜索…","tree-combobox-multi-search-clear":"清除搜索","tree-combobox-multi-empty":"无可选项","tree-combobox-multi-load-error":"加载失败","tree-combobox-multi-retry":"重试","tree-combobox-multi-readonly-empty":"—"},en:{"tree-combobox-multi-placeholder":"Select…","tree-combobox-multi-search-placeholder":"Search…","tree-combobox-multi-search-clear":"Clear search","tree-combobox-multi-empty":"No options","tree-combobox-multi-load-error":"Failed to load","tree-combobox-multi-retry":"Retry","tree-combobox-multi-readonly-empty":"—"},ja:{"tree-combobox-multi-placeholder":"選択してください","tree-combobox-multi-search-placeholder":"検索…","tree-combobox-multi-search-clear":"検索をクリア","tree-combobox-multi-empty":"選択肢なし","tree-combobox-multi-load-error":"読み込みに失敗しました","tree-combobox-multi-retry":"再試行","tree-combobox-multi-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(U,V)=>Dt(U,{...Pt(u),...V}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-multi-placeholder"));function h(U,V){if(!U)return!1;try{return We(c(U,{form:r.value??{}}))}catch(q){return console.error(`[shwfed-form] failed to evaluate ${V} for ${e.fieldId}:`,q),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=ue([]),_=T({get:()=>{const U=e.config.binding,V=U==null?y.value:l(U);return Array.isArray(V)?V.map(q=>String(q)):[]},set:U=>{const V=U.map(ne=>String(ne)),q=e.config.binding;if(q==null){y.value=V;return}a(q,V)}});function k(U){return{form:r.value??{},node:U}}function w(U){try{return String(We(c(e.config.nodeKey,k(U))))}catch(V){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,V),""}}function $(U){let V;try{V=We(c(e.config.nodeChildren,k(U)))}catch(q){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,q);return}if(V!=null&&Array.isArray(V))return V}function C(U,V){try{return Jn(U,c,k(V))}catch(q){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,q),U}}function E(U){const V=Ke(e.config.nodeLabel,n.value)??"";return V?C(V,U.raw):""}function z(U){if(!e.config.nodeTooltip)return;const V=Ke(e.config.nodeTooltip,n.value);return V?C(V,U.raw):void 0}function N(U,V){if(v.value)return!1;const q=e.config.nodeSelectable;if(!q)return!0;try{return We(c(q,k(U.raw)))}catch{return!1}}const P=$n([]),Q=ue(!1),W=ue(null);async function Z(){const U=e.config.dataSource;if(!U){P.value=[];return}const V=qt(function*(){let ne=pt();U.request&&(ne=yield*Qr(yield*c(U.request,{form:r.value??{}})));const X=yield*c(U.data,{form:r.value??{},json:ne});return Array.isArray(X)?X:[]}),q=qt(function*(){const ne=yield*Vs(on(()=>{Q.value=!0}).pipe(Ps("30 millis")));return yield*ir(V,_i(ne))}).pipe(ir(on(()=>{Q.value=!1})));try{const ne=await Cn(ao(q,Nr));P.value=ne,W.value=null}catch(ne){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",ne),W.value=ne}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{Z()},{immediate:!0});const L=T(()=>jve(P.value,{nodeKey:w,nodeChildren:$}));function F(U){const V=wT(L.value,U);if(!V||V.length===0)return null;const q=V[V.length-1];return E(q)}const j=T(()=>{const U=_.value;if(U.length===0)return"";const V=F(U[0]);return V===null||V.length===0?"":U.length===1?V:`${V} + ${U.length-1}`}),te=T(()=>{if(!e.config.expandAll)return[];const U=[],V=[...L.value];for(;V.length;){const q=V.pop();q.kind==="branch"&&(U.push(q.key),V.push(...q.children))}return U}),ie=ue("");function ve(U,V){const q=V.trim().toLowerCase();return q?E(U).trim().toLowerCase().includes(q):!0}const ge=ue(!1);function $e(U){const V=Array.isArray(U)?U:[];_.value=V}const le=T(()=>!v.value&&!Q.value&&_.value.length>0);function ee(){_.value=[],ge.value=!1}const oe=ue(null);Qe(ge,U=>{U||(oe.value=null)});function K(U,V){for(const q of V)z(q)&&U.push(q.key),q.kind==="branch"&&K(U,q.children)}const Y=T(()=>{if(!e.config.nodeTooltip)return!1;const U=[];return K(U,L.value),U.length>0}),R=T(()=>{const U=oe.value;if(!U)return;const V=wT(L.value,U);if(!(!V||V.length===0))return z(V[V.length-1])});return(U,V)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",UVt,A(j.value||i(o)("tree-combobox-multi-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:ge.value,"onUpdate:open":V[2]||(V[2]=q=>ge.value=q)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":j.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Q.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-multi-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):le.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:V[0]||(V[0]=lt(()=>{},["prevent"])),onClick:lt(ee,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",qVt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-3.5 shrink-0 opacity-50"}),Ba(H("input",{"onUpdate:modelValue":V[1]||(V[1]=q=>ie.value=q),disabled:v.value,placeholder:i(o)("tree-combobox-multi-search-placeholder"),class:"flex h-9 w-full bg-transparent text-sm outline-hidden placeholder:text-zinc-500 disabled:cursor-not-allowed disabled:opacity-50"},null,8,jVt),[[mu,ie.value]])]),H("div",HVt,[W.value&&L.value.length===0?(S(),J("div",WVt,A(i(o)("tree-combobox-multi-load-error")),1)):Q.value&&L.value.length===0?(S(),J("div",KVt,[s(i($o),{class:"h-5 w-2/3"}),s(i($o),{class:"h-5 w-1/2"}),s(i($o),{class:"h-5 w-3/5"})])):(S(),B(i(Ec),{key:2,roots:L.value,"get-key":q=>q.key,"get-children":i(Hve),"selection-mode":"multi",cascade:t.config.cascade??"independent","model-value":_.value,selectable:N,"filter-predicate":ve,"filter-query":ie.value,"initial-expanded":te.value,"show-focused-row":!1,class:nt([v.value?"pointer-events-none opacity-60":void 0,"max-h-72 overflow-y-auto"]),"onUpdate:modelValue":$e},{node:d(({node:q,selected:ne})=>[H("span",{class:"flex flex-1 min-w-0 items-center justify-between gap-2",onMouseenter:X=>oe.value=q.key,onFocusin:X=>oe.value=q.key},[s(i(O),{source:E(q),class:"prose prose-sm prose-zinc text-zinc-700 min-w-0"},null,8,["source"]),ne?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-3 shrink-0 text-zinc-700"})):be("",!0)],40,GVt)]),empty:d(()=>[H("div",YVt,A(i(o)("tree-combobox-multi-empty")),1)]),error:d(({error:q,retry:ne})=>[H("span",JVt,[D(A(i(o)("tree-combobox-multi-load-error"))+" ",1),H("button",{type:"button",class:"underline hover:text-red-600",onClick:lt(ne,["stop"])},A(i(o)("tree-combobox-multi-retry")),9,XVt),H("span",QVt,A(String(q)),1)])]),_:1},8,["roots","get-key","get-children","cascade","model-value","filter-query","initial-expanded","class"]))]),Y.value&&R.value?(S(),J("div",ZVt,[s(i(O),{source:R.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),tPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},nPt={"data-slot":"tree-combobox-single-search",class:"flex h-9 items-center gap-2 border-b border-zinc-200 px-3"},oPt=["disabled","placeholder"],rPt={class:"flex flex-col p-1"},lPt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},iPt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},aPt=["onMouseenter","onFocusin"],sPt={class:"min-h-9 px-2 py-1.5 text-sm text-zinc-400"},uPt={class:"inline-flex items-center gap-1 text-xs text-red-500"},cPt=["onClick"],dPt={class:"sr-only"},fPt={key:0,"data-slot":"tree-combobox-single-tooltip",class:"border-t border-zinc-200 px-3 py-2"},pPt=ae({name:"ShwfedTreeComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-single-placeholder":"请选择","tree-combobox-single-search-placeholder":"搜索…","tree-combobox-single-search-clear":"清除搜索","tree-combobox-single-empty":"无可选项","tree-combobox-single-load-error":"加载失败","tree-combobox-single-retry":"重试","tree-combobox-single-readonly-empty":"—"},en:{"tree-combobox-single-placeholder":"Select…","tree-combobox-single-search-placeholder":"Search…","tree-combobox-single-search-clear":"Clear search","tree-combobox-single-empty":"No options","tree-combobox-single-load-error":"Failed to load","tree-combobox-single-retry":"Retry","tree-combobox-single-readonly-empty":"—"},ja:{"tree-combobox-single-placeholder":"選択してください","tree-combobox-single-search-placeholder":"検索…","tree-combobox-single-search-clear":"検索をクリア","tree-combobox-single-empty":"選択肢なし","tree-combobox-single-load-error":"読み込みに失敗しました","tree-combobox-single-retry":"再試行","tree-combobox-single-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(R,U)=>Dt(R,{...Pt(u),...U}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-single-placeholder"));function h(R,U){if(!R)return!1;try{return We(c(R,{form:r.value??{}}))}catch(V){return console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=ue(void 0),_=T({get:()=>{const R=e.config.binding,U=R==null?y.value:l(R);if(U!=null)return String(U)},set:R=>{const U=R==null?void 0:String(R),V=e.config.binding;if(V==null){y.value=U;return}a(V,U)}});function k(R){return{form:r.value??{},node:R}}function w(R){try{return String(We(c(e.config.nodeKey,k(R))))}catch(U){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,U),""}}function $(R){let U;try{U=We(c(e.config.nodeChildren,k(R)))}catch(V){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,V);return}if(U!=null&&Array.isArray(U))return U}function C(R,U){try{return Jn(R,c,k(U))}catch(V){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,V),R}}function E(R){const U=Ke(e.config.nodeLabel,n.value)??"";return U?C(U,R.raw):""}function z(R){if(!e.config.nodeTooltip)return;const U=Ke(e.config.nodeTooltip,n.value);return U?C(U,R.raw):void 0}function N(R,U){if(v.value)return!1;const V=e.config.nodeSelectable;if(!V)return!0;try{return We(c(V,k(R.raw)))}catch{return!1}}const P=$n([]),Q=ue(!1),W=ue(null);async function Z(){const R=e.config.dataSource;if(!R){P.value=[];return}const U=qt(function*(){let q=pt();R.request&&(q=yield*Qr(yield*c(R.request,{form:r.value??{}})));const ne=yield*c(R.data,{form:r.value??{},json:q});return Array.isArray(ne)?ne:[]}),V=qt(function*(){const q=yield*Vs(on(()=>{Q.value=!0}).pipe(Ps("30 millis")));return yield*ir(U,_i(q))}).pipe(ir(on(()=>{Q.value=!1})));try{const q=await Cn(ao(V,Nr));P.value=q,W.value=null}catch(q){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",q),W.value=q}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{Z()},{immediate:!0});const L=T(()=>jve(P.value,{nodeKey:w,nodeChildren:$})),F=T(()=>{const R=_.value;if(!R)return"";const U=wT(L.value,R);if(!U||U.length===0)return"";const V=U[U.length-1];return E(V)}),j=T(()=>{if(!e.config.expandAll)return[];const R=[],U=[...L.value];for(;U.length;){const V=U.pop();V.kind==="branch"&&(R.push(V.key),U.push(...V.children))}return R}),te=ue("");function ie(R,U){const V=U.trim().toLowerCase();return V?E(R).trim().toLowerCase().includes(V):!0}const ve=ue(!1);function ge(R){const U=typeof R=="string"?R:void 0;_.value=U,U&&(ve.value=!1)}const $e=T(()=>!v.value&&!Q.value&&!!_.value);function le(){_.value=void 0,ve.value=!1}const ee=ue(null);Qe(ve,R=>{R||(ee.value=null)});function oe(R,U){for(const V of U)z(V)&&R.push(V.key),V.kind==="branch"&&oe(R,V.children)}const K=T(()=>{if(!e.config.nodeTooltip)return!1;const R=[];return oe(R,L.value),R.length>0}),Y=T(()=>{const R=ee.value;if(!R)return;const U=wT(L.value,R);if(!(!U||U.length===0))return z(U[U.length-1])});return(R,U)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",tPt,A(F.value||i(o)("tree-combobox-single-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:ve.value,"onUpdate:open":U[2]||(U[2]=V=>ve.value=V)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":F.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Q.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-single-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):$e.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:U[0]||(U[0]=lt(()=>{},["prevent"])),onClick:lt(le,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",nPt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-3.5 shrink-0 opacity-50"}),Ba(H("input",{"onUpdate:modelValue":U[1]||(U[1]=V=>te.value=V),disabled:v.value,placeholder:i(o)("tree-combobox-single-search-placeholder"),class:"flex h-9 w-full bg-transparent text-sm outline-hidden placeholder:text-zinc-500 disabled:cursor-not-allowed disabled:opacity-50"},null,8,oPt),[[mu,te.value]])]),H("div",rPt,[W.value&&L.value.length===0?(S(),J("div",lPt,A(i(o)("tree-combobox-single-load-error")),1)):Q.value&&L.value.length===0?(S(),J("div",iPt,[s(i($o),{class:"h-5 w-2/3"}),s(i($o),{class:"h-5 w-1/2"}),s(i($o),{class:"h-5 w-3/5"})])):(S(),B(i(Ec),{key:2,roots:L.value,"get-key":V=>V.key,"get-children":i(Hve),"selection-mode":"single","model-value":_.value,selectable:N,"filter-predicate":ie,"filter-query":te.value,"initial-expanded":j.value,"show-focused-row":!1,class:nt([v.value?"pointer-events-none opacity-60":void 0,"max-h-72 overflow-y-auto"]),"onUpdate:modelValue":ge},{node:d(({node:V,selected:q})=>[H("span",{class:"flex flex-1 min-w-0 items-center justify-between gap-2",onMouseenter:ne=>ee.value=V.key,onFocusin:ne=>ee.value=V.key},[s(i(O),{source:E(V),class:"prose prose-sm prose-zinc text-zinc-700 min-w-0"},null,8,["source"]),q?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-3 shrink-0 text-zinc-700"})):be("",!0)],40,aPt)]),empty:d(()=>[H("div",sPt,A(i(o)("tree-combobox-single-empty")),1)]),error:d(({error:V,retry:q})=>[H("span",uPt,[D(A(i(o)("tree-combobox-single-load-error"))+" ",1),H("button",{type:"button",class:"underline hover:text-red-600",onClick:lt(q,["stop"])},A(i(o)("tree-combobox-single-retry")),9,cPt),H("span",dPt,A(String(V)),1)])]),_:1},8,["roots","get-key","get-children","model-value","filter-query","initial-expanded","class"]))]),K.value&&Y.value?(S(),J("div",fPt,[s(i(O),{source:Y.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),mPt={key:0,"aria-hidden":"true",class:"text-red-600"},hPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},vPt={key:0,"data-slot":"combobox-multi-empty",class:"py-6 text-center text-sm text-zinc-500"},gPt={class:"flex-1"},yPt=ae({name:"ShwfedComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-multi-placeholder":"请选择","combobox-multi-search-placeholder":"搜索…","combobox-multi-empty":"无匹配项","combobox-multi-loading":"加载中…"},en:{"combobox-multi-placeholder":"Select…","combobox-multi-search-placeholder":"Search…","combobox-multi-empty":"No matches","combobox-multi-loading":"Loading…"},ja:{"combobox-multi-placeholder":"選択してください","combobox-multi-search-placeholder":"検索…","combobox-multi-empty":"一致なし","combobox-multi-loading":"読み込み中…"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(R,U)=>Dt(R,{...Pt(u),...U}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-multi-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(R,U){if(!R)return!1;try{return We(c(R,{form:r.value??{}}))}catch(V){return console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),$=T(()=>e.config.options.kind==="static");function C(R,U){try{return Jn(R,c,U)}catch(V){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,V),R}}const E=ue(null),z=ue(!1),N=T(()=>{const R=e.config.options;if(R.kind!=="remote")return null;const U=R.request;if(!U)return null;try{const V=$u(We(c(U,{form:r.value??{}})));return cn(V)?JSON.stringify(V.value.describe()):null}catch{return null}});let P=0;async function Q(){const R=++P;if(N.value==null){E.value=null,z.value=!1;return}const U=e.config.options,V=U.kind==="remote"?U.request:void 0;if(!V){E.value=null,z.value=!1;return}z.value=!0;const q=qt(function*(){const ne=yield*Qr(yield*c(V,{form:r.value??{}}));return bc(ne)});try{const ne=await Cn(ao(q,Nr));R===P&&(E.value=ne)}catch{R===P&&(E.value=null)}finally{R===P&&(z.value=!1)}}function W(R){const U=e.config.options;if(U.kind==="remote")try{return We(c(U.optionValue,{form:r.value??{},option:R}))}catch(V){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,V);return}}function Z(R){const U=e.config.options;if(U.kind!=="remote")return"";const V=Ke(U.optionLabel,n.value)??"";return V?Jn(V,c,{form:r.value??{},option:R}):""}function L(R){const U=e.config.options;if(!(U.kind!=="remote"||!U.optionKeywords))try{const V=We(c(U.optionKeywords,{form:r.value??{},option:R}));if(!Array.isArray(V))return;const q=V.map(ne=>ne==null?"":String(ne)).filter(Boolean).join(" ");return q.length>0?q:void 0}catch(V){console.error(`[shwfed-form] failed to evaluate optionKeywords for ${e.fieldId}:`,V);return}}const F=T(()=>{const R=e.config.options;if(R.kind==="static")return(R.items??[]).map(V=>{const q=Ke(V.label,n.value)??"",ne={form:r.value??{}},X=(V.keywords??[]).filter(Boolean).join(" ");return{key:V.id,value:V.value.value,label:q?C(q,ne):"",keywords:X.length>0?X:void 0,raw:V}});let U;try{U=We(c(R.options,{form:r.value??{},json:E.value}))}catch(V){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,V),[]}return Array.isArray(U)?U.map((V,q)=>({key:String(q),value:W(V),label:Z(V),keywords:L(V),raw:V})):[]}),j=ue([]),te=T({get:()=>{const R=e.config.binding,U=R==null?j.value:l(R);return Array.isArray(U)?U:[]},set:R=>{const U=Array.isArray(R)?R:[],V=e.config.binding;if(V==null){j.value=U;return}a(V,U)}});wc(N,()=>{Q()},{debounce:200,immediate:!0});function ie(R,U){if(R===U)return!0;if(R==null||U==null)return!1;if(typeof R=="object"&&typeof U=="object")try{return JSON.stringify(R)===JSON.stringify(U)}catch{return!1}return!1}const ve=T(()=>{const R=[];for(const U of te.value){const V=F.value.find(q=>ie(q.value,U));V&&R.push(V)}return R}),ge=T(()=>ve.value.map(R=>R.key)),$e=T(()=>new Set(ge.value));Qd(e.fieldId,()=>ve.value.length>0?ve.value:void 0,{identity:R=>R.map(U=>U.key).join("\0"),raw:R=>R.map(U=>U.raw)});const le=T(()=>{const R=ve.value;return R.length===0?"":R.length===1?R[0].label:`${R[0].label} +${R.length-1}`}),ee=ue(!1);function oe(R){const U=Array.isArray(R)?R.filter(q=>typeof q=="string"):[],V=[];for(const q of U){const ne=F.value.find(X=>X.key===q);ne&&V.push(ne.value)}te.value=V}const K=T(()=>!v.value&&ve.value.length>0);function Y(){te.value=[],ee.value=!1}return(R,U)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(y)?(S(),J("span",mPt," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",hPt,A(le.value||"—"),1)):(S(),B(i(vr),{key:2,open:ee.value,"onUpdate:open":U[1]||(U[1]=V=>ee.value=V)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":le.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),z.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):K.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:U[0]||(U[0]=lt(()=>{},["prevent"])),onClick:lt(Y,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":ge.value,multiple:!0,disabled:v.value,"onUpdate:modelValue":oe},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-multi-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[!$.value&&F.value.length===0?(S(),J("div",vPt,A(z.value?i(o)("combobox-multi-loading"):i(o)("combobox-multi-empty")),1)):(S(),J(Me,{key:1},[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-multi-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(F.value,V=>(S(),B(i(Fr),{key:V.key,value:V.key,keywords:V.keywords},{default:d(()=>[H("span",gPt,[s(i(O),{source:V.label},null,8,["source"])]),$e.value.has(V.key)?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-4 text-zinc-700"})):be("",!0)]),_:2},1032,["value","keywords"]))),128))]),_:1})],64))]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),bPt={key:0,"aria-hidden":"true",class:"text-red-600"},xPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},_Pt={key:0,"data-slot":"combobox-single-empty",class:"py-6 text-center text-sm text-zinc-500"},wPt={key:0,class:"border-t border-zinc-200 px-3 py-2"},kPt=ae({name:"ShwfedComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-placeholder":"请选择","combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项","combobox-single-loading":"加载中…"},en:{"combobox-single-placeholder":"Select…","combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches","combobox-single-loading":"Loading…"},ja:{"combobox-single-placeholder":"選択してください","combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし","combobox-single-loading":"読み込み中…"}}}),{state:r,getAt:l,setAt:a,setAtSilent:u}=Xn(),c=Ft(),f=(X,fe)=>Dt(X,{...Pt(c),...fe}),p=T(()=>Ke(e.config.label,n.value)),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-single-placeholder")),h=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function v(X,fe){if(!X)return!1;try{return We(f(X,{form:r.value??{}}))}catch(ye){return console.error(`[shwfed-form] failed to evaluate ${fe} for ${e.fieldId}:`,ye),!1}}const g=T(()=>v(e.config.disabled,"disabled")),b=kr(),x=T(()=>e.config.readonly!=null?v(e.config.readonly,"readonly"):b.value),y=T(()=>x.value||e.config.derived?.mode==="formula"),{isRequired:_,errors:k,warnings:w,visible:$}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:f,locale:()=>n.value}),C=T(()=>e.config.options.kind==="static");function E(X,fe){try{return Jn(X,f,fe)}catch(ye){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,ye),X}}const z=ue(null),N=ue(!1),P=T(()=>{const X=e.config.options;if(X.kind!=="remote")return null;const fe=X.request;if(!fe)return null;try{const ye=$u(We(f(fe,{form:r.value??{}})));return cn(ye)?JSON.stringify(ye.value.describe()):null}catch{return null}});let Q=0;async function W(){const X=++Q;if(P.value==null){z.value=null,N.value=!1;return}const fe=e.config.options,ye=fe.kind==="remote"?fe.request:void 0;if(!ye){z.value=null,N.value=!1;return}N.value=!0;const ce=qt(function*(){const pe=yield*Qr(yield*f(ye,{form:r.value??{}}));return bc(pe)});try{const pe=await Cn(ao(ce,Nr));X===Q&&(z.value=pe)}catch{X===Q&&(z.value=null)}finally{X===Q&&(N.value=!1)}}function Z(X){const fe=e.config.options;if(fe.kind==="remote")try{return We(f(fe.optionValue,{form:r.value??{},option:X}))}catch(ye){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,ye);return}}function L(X){const fe=e.config.options;if(fe.kind!=="remote")return"";const ye=Ke(fe.optionLabel,n.value)??"";return ye?Jn(ye,f,{form:r.value??{},option:X}):""}function F(X){const fe=e.config.options;if(!(fe.kind!=="remote"||!fe.optionKeywords))try{const ye=We(f(fe.optionKeywords,{form:r.value??{},option:X}));if(!Array.isArray(ye))return;const ce=ye.map(pe=>pe==null?"":String(pe)).filter(Boolean).join(" ");return ce.length>0?ce:void 0}catch(ye){console.error(`[shwfed-form] failed to evaluate optionKeywords for ${e.fieldId}:`,ye);return}}const j=T(()=>{const X=e.config.options;if(X.kind==="static")return(X.items??[]).map(ye=>{const ce=Ke(ye.label,n.value)??"",pe=ye.tooltip?Ke(ye.tooltip,n.value):void 0,ke={form:r.value??{}},se=(ye.keywords??[]).filter(Boolean).join(" ");return{key:ye.id,value:ye.value.value,label:ce?E(ce,ke):"",tooltip:pe?E(pe,ke):void 0,keywords:se.length>0?se:void 0,raw:ye}});let fe;try{fe=We(f(X.options,{form:r.value??{},json:z.value}))}catch(ye){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,ye),[]}return Array.isArray(fe)?fe.map((ye,ce)=>({key:String(ce),value:Z(ye),label:L(ye),keywords:F(ye),raw:ye})):[]}),te=ue(void 0),ie=T({get:()=>{const X=e.config.binding;return X==null?te.value:l(X)},set:X=>{const fe=e.config.binding;if(fe==null){te.value=X;return}a(fe,X)}});let ve;wc(P,()=>{if(ve!=null){const X=e.config.binding;X==null?te.value=void 0:u(X,void 0)}ve=P.value,W()},{debounce:200,immediate:!0});function ge(X,fe){if(X===fe)return!0;if(X==null||fe==null)return!1;if(typeof X=="object"&&typeof fe=="object")try{return JSON.stringify(X)===JSON.stringify(fe)}catch{return!1}return!1}const $e=T(()=>j.value.find(X=>ge(X.value,ie.value))),le=T(()=>$e.value?.key),ee=T(()=>$e.value?.label??"");Qd(e.fieldId,()=>$e.value,{identity:X=>X.key,raw:X=>X.raw});const oe=ue(!1);function K(X){if(typeof X!="string")return;const fe=j.value.find(ye=>ye.key===X);fe&&(ie.value=fe.value,Vt().then(()=>{oe.value=!1}))}const Y=T(()=>!g.value&&$e.value!==void 0);function R(){ie.value=void 0,oe.value=!1}const U=ue(null);Qe(oe,X=>{U.value=X?j.value[0]?.key??null:null});const V=T(()=>j.value.find(X=>X.key===U.value)),q=T(()=>V.value?.tooltip),ne=T(()=>j.value.some(X=>X.tooltip!=null&&X.tooltip.length>0));return(X,fe)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":g.value||void 0},{default:d(()=>[p.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(p.value),1),i(_)?(S(),J("span",bPt," *")):be("",!0)]),_:2},[h.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:h.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),y.value?(S(),J("div",xPt,[ee.value?(S(),B(i(O),{key:0,source:ee.value},null,8,["source"])):(S(),J(Me,{key:1},[D(" — ")],64))])):(S(),B(i(vr),{key:2,open:oe.value,"onUpdate:open":fe[1]||(fe[1]=ye=>oe.value=ye)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single","data-disabled":g.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":ee.value,disabled:g.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),N.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):Y.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:fe[0]||(fe[0]=lt(()=>{},["prevent"])),onClick:lt(R,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":le.value,disabled:g.value,"selection-behavior":"toggle","onUpdate:modelValue":K},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[!C.value&&j.value.length===0?(S(),J("div",_Pt,A(N.value?i(o)("combobox-single-loading"):i(o)("combobox-single-empty")),1)):(S(),J(Me,{key:1},[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(j.value,ye=>(S(),B(i(Fr),{key:ye.key,value:ye.key,keywords:ye.keywords,onMouseenter:ce=>U.value=ye.key,onFocus:ce=>U.value=ye.key},{default:d(()=>[s(i(O),{source:ye.label},null,8,["source"])]),_:2},1032,["value","keywords","onMouseenter","onFocus"]))),128))]),_:1})],64))]),_:1}),ne.value&&q.value?(S(),J("div",wPt,[s(i(O),{source:q.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"])),i($)?(S(),B(i(Xr),{key:3,errors:i(k),warnings:i(w)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}});function Wve(t,e){const n=e.nodeChildren(t);return!n||n.length===0?{kind:"terminal",raw:t,key:e.nodeKey(t)}:{kind:"branch",raw:t,key:e.nodeKey(t),children:n.map(o=>Wve(o,e))}}function Kve(t,e){return t.map(n=>Wve(n,e))}function Gve(t){return t.kind==="branch"?t.children:void 0}function Ox(t,e){const n=[];function o(r){for(const l of r){if(n.push(l),l.key===e||l.kind==="branch"&&l.children.length>0&&o(l.children))return!0;n.pop()}return!1}return o(t)?n.slice():null}const SPt={key:0,"aria-hidden":"true",class:"text-red-600"},CPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},$Pt={"data-slot":"tree-combobox-multi-search",class:"flex h-9 items-center gap-2 border-b border-zinc-200 px-3"},TPt=["disabled","placeholder"],EPt={class:"flex flex-col p-1"},APt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},DPt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},zPt=["onMouseenter","onFocusin"],OPt={class:"min-h-9 px-2 py-1.5 text-sm text-zinc-400"},MPt={class:"inline-flex items-center gap-1 text-xs text-red-500"},IPt=["onClick"],RPt={class:"sr-only"},VPt={key:0,"data-slot":"tree-combobox-multi-tooltip",class:"border-t border-zinc-200 px-3 py-2"},PPt=ae({name:"ShwfedTreeComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-multi-placeholder":"请选择","tree-combobox-multi-search-placeholder":"搜索…","tree-combobox-multi-search-clear":"清除搜索","tree-combobox-multi-empty":"无可选项","tree-combobox-multi-load-error":"加载失败","tree-combobox-multi-retry":"重试","tree-combobox-multi-readonly-empty":"—"},en:{"tree-combobox-multi-placeholder":"Select…","tree-combobox-multi-search-placeholder":"Search…","tree-combobox-multi-search-clear":"Clear search","tree-combobox-multi-empty":"No options","tree-combobox-multi-load-error":"Failed to load","tree-combobox-multi-retry":"Retry","tree-combobox-multi-readonly-empty":"—"},ja:{"tree-combobox-multi-placeholder":"選択してください","tree-combobox-multi-search-placeholder":"検索…","tree-combobox-multi-search-clear":"検索をクリア","tree-combobox-multi-empty":"選択肢なし","tree-combobox-multi-load-error":"読み込みに失敗しました","tree-combobox-multi-retry":"再試行","tree-combobox-multi-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(ce,pe)=>Dt(ce,{...Pt(u),...pe}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-multi-placeholder"));function h(ce,pe){if(!ce)return!1;try{return We(c(ce,{form:r.value??{}}))}catch(ke){return console.error(`[shwfed-form] failed to evaluate ${pe} for ${e.fieldId}:`,ke),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),$=ue([]),C=T({get:()=>{const ce=e.config.binding,pe=ce==null?$.value:l(ce);return Array.isArray(pe)?pe.map(ke=>String(ke)):[]},set:ce=>{const pe=ce.map(se=>String(se)),ke=e.config.binding;if(ke==null){$.value=pe;return}a(ke,pe)}});function E(ce){return{form:r.value??{},node:ce}}function z(ce){try{return String(We(c(e.config.nodeKey,E(ce))))}catch(pe){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,pe),""}}function N(ce){let pe;try{pe=We(c(e.config.nodeChildren,E(ce)))}catch(ke){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,ke);return}if(pe!=null&&Array.isArray(pe))return pe}function P(ce,pe){try{return Jn(ce,c,E(pe))}catch(ke){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,ke),ce}}function Q(ce){const pe=Ke(e.config.nodeLabel,n.value)??"";return pe?P(pe,ce.raw):""}function W(ce){if(!e.config.nodeTooltip)return;const pe=Ke(e.config.nodeTooltip,n.value);return pe?P(pe,ce.raw):void 0}function Z(ce,pe){if(v.value)return!1;const ke=e.config.nodeSelectable;if(!ke)return!0;try{return We(c(ke,E(ce.raw)))}catch{return!1}}function L(ce){const pe=e.config.keywords;if(!pe)return[];try{const ke=We(c(pe,E(ce)));return Array.isArray(ke)?ke.map(se=>String(se)):[]}catch{return[]}}const F=$n([]),j=ue(!1),te=ue(null);async function ie(){const ce=e.config.dataSource;if(!ce){F.value=[];return}const pe=qt(function*(){let se=pt();ce.request&&(se=yield*Qr(yield*c(ce.request,{form:r.value??{}})));const me=yield*c(ce.data,{form:r.value??{},json:se});return Array.isArray(me)?me:[]}),ke=qt(function*(){const se=yield*Vs(on(()=>{j.value=!0}).pipe(Ps("30 millis")));return yield*ir(pe,_i(se))}).pipe(ir(on(()=>{j.value=!1})));try{const se=await Cn(ao(ke,Nr));F.value=se,te.value=null}catch(se){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",se),te.value=se}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{ie()},{immediate:!0});const ve=T(()=>Kve(F.value,{nodeKey:z,nodeChildren:N}));function ge(ce){const pe=Ox(ve.value,ce);if(!pe||pe.length===0)return null;const ke=pe[pe.length-1];return Q(ke)}const $e=T(()=>{const ce=C.value;if(ce.length===0)return"";const pe=ge(ce[0]);return pe===null||pe.length===0?"":ce.length===1?pe:`${pe} + ${ce.length-1}`}),le=T(()=>C.value.map(ce=>{const pe=Ox(ve.value,ce);if(!(!pe||pe.length===0))return pe[pe.length-1]}).filter(ce=>ce!==void 0));Qd(e.fieldId,()=>le.value.length>0?le.value:void 0,{identity:ce=>ce.map(pe=>pe.key).join(" "),raw:ce=>ce.map(pe=>pe.raw)});const ee=T(()=>{if(!e.config.expandAll)return[];const ce=[],pe=[...ve.value];for(;pe.length;){const ke=pe.pop();ke.kind==="branch"&&(ce.push(ke.key),pe.push(...ke.children))}return ce}),oe=ue(""),K=$n(new Map);Qe(()=>[ve.value,n.value,e.config.nodeLabel,e.config.keywords],()=>{const ce=new Map,pe=[...ve.value];for(;pe.length;){const ke=pe.pop(),se=Q(ke).trim().toLowerCase(),me=L(ke.raw).map(ze=>ze.trim().toLowerCase()).join(`
|
|
197
|
+
${oe}`:ee);const K=z(le);K&&K.length&&$e.push(...K)}j.value=ge},{immediate:!0});function te(ge,$e){const le=$e.trim().toLowerCase();if(!le)return!0;const ee=j.value.get(E(ge));return ee!==void 0?ee.includes(le):Q(ge).trim().toLowerCase().includes(le)}const ie=T(()=>{const ge=e.config.filter?.label?Ke(e.config.filter.label,n.value):void 0;return ge&&ge.length>0?ge:o("tree-multi-search-label")}),ve=T(()=>{const ge=new Set(y.value),$e=o("tree-multi-readonly-empty");if(ge.size===0)return $e;const le=new Map,ee=[..._.value];for(;ee.length;){const K=ee.pop(),Y=E(K);ge.has(Y)&&le.set(Y,Q(K));const R=z(K);R&&R.length&&ee.push(...R)}const oe=y.value.map(K=>le.get(K)??K).filter(K=>K.length>0);return oe.length>0?oe.join(o("tree-multi-readonly-separator")):$e});return(ge,$e)=>(S(),B(i(M),{orientation:"vertical","data-disabled":h.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),b.value?(S(),J("div",TVt,A(ve.value),1)):(S(),J(Me,{key:2},[t.config.filter?.enabled?(S(),B(i(M),{key:0,orientation:"floating"},{default:d(()=>[s(i(I),null,{default:d(()=>[D(A(ie.value),1)]),_:1}),s(i(Fe),null,{default:d(()=>[s(i(Ye),{align:"inline-start"},{default:d(()=>[s(i(de),{icon:"lucide:search"})]),_:1}),s(i(Xe),{modelValue:L.value,"onUpdate:modelValue":$e[0]||($e[0]=le=>L.value=le),disabled:h.value},null,8,["modelValue","disabled"]),L.value.length>0?(S(),B(i(Ye),{key:0,align:"inline-end"},{default:d(()=>[s(i(ot),{size:"icon-xs","aria-label":i(o)("tree-multi-search-clear"),onClick:$e[1]||($e[1]=le=>L.value="")},{default:d(()=>[s(i(de),{icon:"lucide:x"})]),_:1},8,["aria-label"])]),_:1})):be("",!0)]),_:1})]),_:1})):be("",!0),w.value&&_.value.length===0?(S(),J("div",EVt,A(i(o)("tree-multi-load-error")),1)):k.value&&_.value.length===0?(S(),J("div",AVt,[s(i($o),{class:"h-6 w-2/3"}),s(i($o),{class:"h-6 w-1/2"}),s(i($o),{class:"h-6 w-3/5"}),s(i($o),{class:"h-6 w-2/5"})])):(S(),B(i(Ec),{key:3,modelValue:y.value,"onUpdate:modelValue":$e[2]||($e[2]=le=>y.value=le),roots:_.value,"get-key":E,"get-children":z,"selection-mode":"multi",cascade:t.config.cascade??"cascade-both",selectable:N,"filter-predicate":te,"filter-query":L.value,"initial-expanded":Z.value,"show-focused-row":!1,class:nt(h.value?"pointer-events-none opacity-60":void 0)},{node:d(({node:le})=>[H("span",DVt,[s(i(O),{source:Q(le),class:"prose prose-sm prose-zinc text-zinc-700"},null,8,["source"]),W(le)?(S(),B(i(O),{key:0,source:W(le),block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])]),empty:d(()=>[H("div",zVt,A(i(o)("tree-multi-empty")),1)]),_:1},8,["modelValue","roots","cascade","filter-query","initial-expanded","class"]))],64))]),_:1},8,["data-disabled"]))}}),MVt={key:0,"aria-hidden":"true",class:"text-red-600"},IVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},RVt=ae({name:"ShwfedMonthFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(z,N)=>Dt(z,{...Pt(a),...N}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):void 0),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(z,N){if(!z)return!1;try{return We(u(z,{form:o.value??{}}))}catch(P){return console.error(`[shwfed-form] failed to evaluate ${N} for ${e.fieldId}:`,P),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),{isRequired:x,errors:y,warnings:_,visible:k}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),w=T(()=>e.config.valueFormat??K_.month.value),$=T(()=>{const z=e.config.presets;if(!(!z||z.length===0))return z.map(N=>({name:N.label,value:()=>{try{const P=We(u(N.value,{form:o.value??{}}));return Wr(P,w.value)}catch(P){return console.error(`[shwfed-form] failed to evaluate preset "${N.value}" for ${e.fieldId}:`,P),""}}}))}),C=ue(void 0),E=T({get:()=>{const z=e.config.binding;if(z==null)return C.value;const N=r(z);return typeof N=="string"&&N.length>0?N:void 0},set:z=>{const N=e.config.binding;if(N==null){C.value=z;return}l(N,z)}});return(z,N)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":h.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(x)?(S(),J("span",MVt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),b.value?(S(),J("div",IVt,A(E.value||"—"),1)):(S(),B(i(tA),{key:2,id:t.fieldId,modelValue:E.value,"onUpdate:modelValue":N[0]||(N[0]=P=>E.value=P),type:"month",format:t.config.format,"value-format":t.config.valueFormat,placeholder:f.value,disabled:h.value,shortcuts:$.value},null,8,["id","modelValue","format","value-format","placeholder","disabled","shortcuts"])),i(k)?(S(),B(i(Xr),{key:3,errors:i(y),warnings:i(_)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),VVt={key:0,"aria-hidden":"true",class:"text-red-600"},PVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},FVt=ae({name:"ShwfedMonthRangeFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n}=Bt(),{state:o,getAt:r,setAt:l}=Xn(),a=Ft(),u=(W,Z)=>Dt(W,{...Pt(a),...Z}),c=T(()=>Ke(e.config.label,n.value)),f=T(()=>e.config.startPlaceholder?Ke(e.config.startPlaceholder,n.value):void 0),p=T(()=>e.config.endPlaceholder?Ke(e.config.endPlaceholder,n.value):void 0),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(W,Z){if(!W)return!1;try{return We(u(W,{form:o.value??{}}))}catch(L){return console.error(`[shwfed-form] failed to evaluate ${Z} for ${e.fieldId}:`,L),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:u,locale:()=>n.value}),$=T(()=>e.config.valueFormat??G_.monthrange.value),C=T(()=>{const W=e.config.presets;if(!(!W||W.length===0))return W.map(Z=>({name:Z.label,value:()=>{try{const L=We(u(Z.start,{form:o.value??{}})),F=We(u(Z.end,{form:o.value??{}}));return[Wr(L,$.value),Wr(F,$.value)]}catch(L){return console.error(`[shwfed-form] failed to evaluate preset "${Z.start}" .. "${Z.end}" for ${e.fieldId}:`,L),["",""]}}}))});function E(W){if(!Array.isArray(W)||W.length!==2)return;const[Z,L]=W;if(!(typeof Z!="string"||typeof L!="string")&&!(Z.length===0||L.length===0))return[Z,L]}function z(W){return typeof W=="string"&&W.length>0?W:void 0}const N=ue(void 0),P=T({get:()=>{const W=e.config.binding;if(W==null)return N.value;if(typeof W=="string")return E(r(W));const Z=z(r(W[0])),L=z(r(W[1]));if(!(Z==null||L==null))return[Z,L]},set:W=>{const Z=e.config.binding;if(Z==null){N.value=W;return}if(typeof Z=="string"){l(Z,W);return}l(Z[0],W?.[0]),l(Z[1],W?.[1])}}),Q=T(()=>{const W=P.value;return W?`${W[0]} ~ ${W[1]}`:"—"});return(W,Z)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[c.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(c.value),1),i(y)?(S(),J("span",VVt," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",PVt,A(Q.value),1)):(S(),B(i(nA),{key:2,id:t.fieldId,modelValue:P.value,"onUpdate:modelValue":Z[0]||(Z[0]=L=>P.value=L),type:"monthrange",format:t.config.format,"value-format":t.config.valueFormat,"start-placeholder":f.value,"end-placeholder":p.value,"range-separator-icon":t.config.rangeSeparatorIcon,disabled:v.value,shortcuts:C.value},null,8,["id","modelValue","format","value-format","start-placeholder","end-placeholder","range-separator-icon","disabled","shortcuts"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),NVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},LVt={class:"flex-1"},BVt=ae({name:"ShwfedComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-multi-placeholder":"请选择","combobox-multi-search-placeholder":"搜索…","combobox-multi-empty":"无匹配项"},en:{"combobox-multi-placeholder":"Select…","combobox-multi-search-placeholder":"Search…","combobox-multi-empty":"No matches"},ja:{"combobox-multi-placeholder":"選択してください","combobox-multi-search-placeholder":"検索…","combobox-multi-empty":"一致なし"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(F,j)=>Dt(F,{...Pt(u),...j}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-multi-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(F,j){if(!F)return!1;try{return We(c(F,{form:r.value??{}}))}catch(te){return console.error(`[shwfed-form] failed to evaluate ${j} for ${e.fieldId}:`,te),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula");function y(F){try{return We(c(e.config.optionValue,{form:r.value??{},option:F}))}catch(j){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,j);return}}function _(F){const j=Ke(e.config.optionLabel,n.value)??"";return j?Jn(j,c,{form:r.value??{},option:F}):""}const k=T(()=>{let F;try{F=We(c(e.config.options,{form:r.value??{}}))}catch(j){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,j),[]}return Array.isArray(F)?F.map((j,te)=>({key:String(te),label:_(j),value:y(j)})):[]}),w=ue([]),$=T({get:()=>{const F=e.config.binding,j=F==null?w.value:l(F);return Array.isArray(j)?j:[]},set:F=>{const j=Array.isArray(F)?F:[],te=e.config.binding;if(te==null){w.value=j;return}a(te,j)}});function C(F,j){if(F===j)return!0;if(F==null||j==null)return!1;if(typeof F=="object"&&typeof j=="object")try{return JSON.stringify(F)===JSON.stringify(j)}catch{return!1}return!1}const E=T(()=>{const F=[];for(const j of $.value){const te=k.value.find(ie=>C(ie.value,j));te&&F.push(te)}return F}),z=T(()=>E.value.map(F=>F.key)),N=T(()=>new Set(z.value)),P=T(()=>{const F=E.value;return F.length===0?"":F.length===1?F[0].label:`${F[0].label} +${F.length-1}`}),Q=ue(!1);function W(F){const j=Array.isArray(F)?F.filter(ie=>typeof ie=="string"):[],te=[];for(const ie of j){const ve=k.value.find(ge=>ge.key===ie);ve&&te.push(ve.value)}$.value=te}const Z=T(()=>!v.value&&E.value.length>0);function L(){$.value=[],Q.value=!1}return(F,j)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",NVt,A(P.value||"—"),1)):(S(),B(i(vr),{key:2,open:Q.value,"onUpdate:open":j[1]||(j[1]=te=>Q.value=te)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":P.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Z.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:j[0]||(j[0]=lt(()=>{},["prevent"])),onClick:lt(L,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":z.value,multiple:!0,disabled:v.value,"onUpdate:modelValue":W},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-multi-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-multi-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(k.value,te=>(S(),B(i(Fr),{key:te.key,value:te.key},{default:d(()=>[H("span",LVt,A(te.label),1),N.value.has(te.key)?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-4 text-zinc-700"})):be("",!0)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}});function qve(t,e){const n=e.nodeChildren(t);return!n||n.length===0?{kind:"terminal",raw:t,key:e.nodeKey(t)}:{kind:"branch",raw:t,key:e.nodeKey(t),children:n.map(o=>qve(o,e))}}function jve(t,e){return t.map(n=>qve(n,e))}function Hve(t){return t.kind==="branch"?t.children:void 0}function wT(t,e){const n=[];function o(r){for(const l of r){if(n.push(l),l.key===e||l.kind==="branch"&&l.children.length>0&&o(l.children))return!0;n.pop()}return!1}return o(t)?n.slice():null}const UVt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},qVt={"data-slot":"tree-combobox-multi-search",class:"flex h-9 items-center gap-2 border-b border-zinc-200 px-3"},jVt=["disabled","placeholder"],HVt={class:"flex flex-col p-1"},WVt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},KVt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},GVt=["onMouseenter","onFocusin"],YVt={class:"min-h-9 px-2 py-1.5 text-sm text-zinc-400"},JVt={class:"inline-flex items-center gap-1 text-xs text-red-500"},XVt=["onClick"],QVt={class:"sr-only"},ZVt={key:0,"data-slot":"tree-combobox-multi-tooltip",class:"border-t border-zinc-200 px-3 py-2"},ePt=ae({name:"ShwfedTreeComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-multi-placeholder":"请选择","tree-combobox-multi-search-placeholder":"搜索…","tree-combobox-multi-search-clear":"清除搜索","tree-combobox-multi-empty":"无可选项","tree-combobox-multi-load-error":"加载失败","tree-combobox-multi-retry":"重试","tree-combobox-multi-readonly-empty":"—"},en:{"tree-combobox-multi-placeholder":"Select…","tree-combobox-multi-search-placeholder":"Search…","tree-combobox-multi-search-clear":"Clear search","tree-combobox-multi-empty":"No options","tree-combobox-multi-load-error":"Failed to load","tree-combobox-multi-retry":"Retry","tree-combobox-multi-readonly-empty":"—"},ja:{"tree-combobox-multi-placeholder":"選択してください","tree-combobox-multi-search-placeholder":"検索…","tree-combobox-multi-search-clear":"検索をクリア","tree-combobox-multi-empty":"選択肢なし","tree-combobox-multi-load-error":"読み込みに失敗しました","tree-combobox-multi-retry":"再試行","tree-combobox-multi-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(U,V)=>Dt(U,{...Pt(u),...V}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-multi-placeholder"));function h(U,V){if(!U)return!1;try{return We(c(U,{form:r.value??{}}))}catch(q){return console.error(`[shwfed-form] failed to evaluate ${V} for ${e.fieldId}:`,q),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=ue([]),_=T({get:()=>{const U=e.config.binding,V=U==null?y.value:l(U);return Array.isArray(V)?V.map(q=>String(q)):[]},set:U=>{const V=U.map(ne=>String(ne)),q=e.config.binding;if(q==null){y.value=V;return}a(q,V)}});function k(U){return{form:r.value??{},node:U}}function w(U){try{return String(We(c(e.config.nodeKey,k(U))))}catch(V){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,V),""}}function $(U){let V;try{V=We(c(e.config.nodeChildren,k(U)))}catch(q){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,q);return}if(V!=null&&Array.isArray(V))return V}function C(U,V){try{return Jn(U,c,k(V))}catch(q){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,q),U}}function E(U){const V=Ke(e.config.nodeLabel,n.value)??"";return V?C(V,U.raw):""}function z(U){if(!e.config.nodeTooltip)return;const V=Ke(e.config.nodeTooltip,n.value);return V?C(V,U.raw):void 0}function N(U,V){if(v.value)return!1;const q=e.config.nodeSelectable;if(!q)return!0;try{return We(c(q,k(U.raw)))}catch{return!1}}const P=$n([]),Q=ue(!1),W=ue(null);async function Z(){const U=e.config.dataSource;if(!U){P.value=[];return}const V=qt(function*(){let ne=pt();U.request&&(ne=yield*Qr(yield*c(U.request,{form:r.value??{}})));const X=yield*c(U.data,{form:r.value??{},json:ne});return Array.isArray(X)?X:[]}),q=qt(function*(){const ne=yield*Vs(on(()=>{Q.value=!0}).pipe(Ps("30 millis")));return yield*ir(V,_i(ne))}).pipe(ir(on(()=>{Q.value=!1})));try{const ne=await Cn(ao(q,Nr));P.value=ne,W.value=null}catch(ne){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",ne),W.value=ne}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{Z()},{immediate:!0});const L=T(()=>jve(P.value,{nodeKey:w,nodeChildren:$}));function F(U){const V=wT(L.value,U);if(!V||V.length===0)return null;const q=V[V.length-1];return E(q)}const j=T(()=>{const U=_.value;if(U.length===0)return"";const V=F(U[0]);return V===null||V.length===0?"":U.length===1?V:`${V} + ${U.length-1}`}),te=T(()=>{if(!e.config.expandAll)return[];const U=[],V=[...L.value];for(;V.length;){const q=V.pop();q.kind==="branch"&&(U.push(q.key),V.push(...q.children))}return U}),ie=ue("");function ve(U,V){const q=V.trim().toLowerCase();return q?E(U).trim().toLowerCase().includes(q):!0}const ge=ue(!1);function $e(U){const V=Array.isArray(U)?U:[];_.value=V}const le=T(()=>!v.value&&!Q.value&&_.value.length>0);function ee(){_.value=[],ge.value=!1}const oe=ue(null);Qe(ge,U=>{U||(oe.value=null)});function K(U,V){for(const q of V)z(q)&&U.push(q.key),q.kind==="branch"&&K(U,q.children)}const Y=T(()=>{if(!e.config.nodeTooltip)return!1;const U=[];return K(U,L.value),U.length>0}),R=T(()=>{const U=oe.value;if(!U)return;const V=wT(L.value,U);if(!(!V||V.length===0))return z(V[V.length-1])});return(U,V)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",UVt,A(j.value||i(o)("tree-combobox-multi-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:ge.value,"onUpdate:open":V[2]||(V[2]=q=>ge.value=q)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":j.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Q.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-multi-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):le.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:V[0]||(V[0]=lt(()=>{},["prevent"])),onClick:lt(ee,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",qVt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-3.5 shrink-0 opacity-50"}),Ba(H("input",{"onUpdate:modelValue":V[1]||(V[1]=q=>ie.value=q),disabled:v.value,placeholder:i(o)("tree-combobox-multi-search-placeholder"),class:"flex h-9 w-full bg-transparent text-sm outline-hidden placeholder:text-zinc-500 disabled:cursor-not-allowed disabled:opacity-50"},null,8,jVt),[[mu,ie.value]])]),H("div",HVt,[W.value&&L.value.length===0?(S(),J("div",WVt,A(i(o)("tree-combobox-multi-load-error")),1)):Q.value&&L.value.length===0?(S(),J("div",KVt,[s(i($o),{class:"h-5 w-2/3"}),s(i($o),{class:"h-5 w-1/2"}),s(i($o),{class:"h-5 w-3/5"})])):(S(),B(i(Ec),{key:2,roots:L.value,"get-key":q=>q.key,"get-children":i(Hve),"selection-mode":"multi",cascade:t.config.cascade??"independent","model-value":_.value,selectable:N,"filter-predicate":ve,"filter-query":ie.value,"initial-expanded":te.value,"show-focused-row":!1,class:nt([v.value?"pointer-events-none opacity-60":void 0,"max-h-72 overflow-y-auto"]),"onUpdate:modelValue":$e},{node:d(({node:q,selected:ne})=>[H("span",{class:"flex flex-1 min-w-0 items-center justify-between gap-2",onMouseenter:X=>oe.value=q.key,onFocusin:X=>oe.value=q.key},[s(i(O),{source:E(q),class:"prose prose-sm prose-zinc text-zinc-700 min-w-0"},null,8,["source"]),ne?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-3 shrink-0 text-zinc-700"})):be("",!0)],40,GVt)]),empty:d(()=>[H("div",YVt,A(i(o)("tree-combobox-multi-empty")),1)]),error:d(({error:q,retry:ne})=>[H("span",JVt,[D(A(i(o)("tree-combobox-multi-load-error"))+" ",1),H("button",{type:"button",class:"underline hover:text-red-600",onClick:lt(ne,["stop"])},A(i(o)("tree-combobox-multi-retry")),9,XVt),H("span",QVt,A(String(q)),1)])]),_:1},8,["roots","get-key","get-children","cascade","model-value","filter-query","initial-expanded","class"]))]),Y.value&&R.value?(S(),J("div",ZVt,[s(i(O),{source:R.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),tPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},nPt={"data-slot":"tree-combobox-single-search",class:"flex h-9 items-center gap-2 border-b border-zinc-200 px-3"},oPt=["disabled","placeholder"],rPt={class:"flex flex-col p-1"},lPt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},iPt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},aPt=["onMouseenter","onFocusin"],sPt={class:"min-h-9 px-2 py-1.5 text-sm text-zinc-400"},uPt={class:"inline-flex items-center gap-1 text-xs text-red-500"},cPt=["onClick"],dPt={class:"sr-only"},fPt={key:0,"data-slot":"tree-combobox-single-tooltip",class:"border-t border-zinc-200 px-3 py-2"},pPt=ae({name:"ShwfedTreeComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-single-placeholder":"请选择","tree-combobox-single-search-placeholder":"搜索…","tree-combobox-single-search-clear":"清除搜索","tree-combobox-single-empty":"无可选项","tree-combobox-single-load-error":"加载失败","tree-combobox-single-retry":"重试","tree-combobox-single-readonly-empty":"—"},en:{"tree-combobox-single-placeholder":"Select…","tree-combobox-single-search-placeholder":"Search…","tree-combobox-single-search-clear":"Clear search","tree-combobox-single-empty":"No options","tree-combobox-single-load-error":"Failed to load","tree-combobox-single-retry":"Retry","tree-combobox-single-readonly-empty":"—"},ja:{"tree-combobox-single-placeholder":"選択してください","tree-combobox-single-search-placeholder":"検索…","tree-combobox-single-search-clear":"検索をクリア","tree-combobox-single-empty":"選択肢なし","tree-combobox-single-load-error":"読み込みに失敗しました","tree-combobox-single-retry":"再試行","tree-combobox-single-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(R,U)=>Dt(R,{...Pt(u),...U}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-single-placeholder"));function h(R,U){if(!R)return!1;try{return We(c(R,{form:r.value??{}}))}catch(V){return console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),y=ue(void 0),_=T({get:()=>{const R=e.config.binding,U=R==null?y.value:l(R);if(U!=null)return String(U)},set:R=>{const U=R==null?void 0:String(R),V=e.config.binding;if(V==null){y.value=U;return}a(V,U)}});function k(R){return{form:r.value??{},node:R}}function w(R){try{return String(We(c(e.config.nodeKey,k(R))))}catch(U){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,U),""}}function $(R){let U;try{U=We(c(e.config.nodeChildren,k(R)))}catch(V){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,V);return}if(U!=null&&Array.isArray(U))return U}function C(R,U){try{return Jn(R,c,k(U))}catch(V){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,V),R}}function E(R){const U=Ke(e.config.nodeLabel,n.value)??"";return U?C(U,R.raw):""}function z(R){if(!e.config.nodeTooltip)return;const U=Ke(e.config.nodeTooltip,n.value);return U?C(U,R.raw):void 0}function N(R,U){if(v.value)return!1;const V=e.config.nodeSelectable;if(!V)return!0;try{return We(c(V,k(R.raw)))}catch{return!1}}const P=$n([]),Q=ue(!1),W=ue(null);async function Z(){const R=e.config.dataSource;if(!R){P.value=[];return}const U=qt(function*(){let q=pt();R.request&&(q=yield*Qr(yield*c(R.request,{form:r.value??{}})));const ne=yield*c(R.data,{form:r.value??{},json:q});return Array.isArray(ne)?ne:[]}),V=qt(function*(){const q=yield*Vs(on(()=>{Q.value=!0}).pipe(Ps("30 millis")));return yield*ir(U,_i(q))}).pipe(ir(on(()=>{Q.value=!1})));try{const q=await Cn(ao(V,Nr));P.value=q,W.value=null}catch(q){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",q),W.value=q}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{Z()},{immediate:!0});const L=T(()=>jve(P.value,{nodeKey:w,nodeChildren:$})),F=T(()=>{const R=_.value;if(!R)return"";const U=wT(L.value,R);if(!U||U.length===0)return"";const V=U[U.length-1];return E(V)}),j=T(()=>{if(!e.config.expandAll)return[];const R=[],U=[...L.value];for(;U.length;){const V=U.pop();V.kind==="branch"&&(R.push(V.key),U.push(...V.children))}return R}),te=ue("");function ie(R,U){const V=U.trim().toLowerCase();return V?E(R).trim().toLowerCase().includes(V):!0}const ve=ue(!1);function ge(R){const U=typeof R=="string"?R:void 0;_.value=U,U&&(ve.value=!1)}const $e=T(()=>!v.value&&!Q.value&&!!_.value);function le(){_.value=void 0,ve.value=!1}const ee=ue(null);Qe(ve,R=>{R||(ee.value=null)});function oe(R,U){for(const V of U)z(V)&&R.push(V.key),V.kind==="branch"&&oe(R,V.children)}const K=T(()=>{if(!e.config.nodeTooltip)return!1;const R=[];return oe(R,L.value),R.length>0}),Y=T(()=>{const R=ee.value;if(!R)return;const U=wT(L.value,R);if(!(!U||U.length===0))return z(U[U.length-1])});return(R,U)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",tPt,A(F.value||i(o)("tree-combobox-single-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:ve.value,"onUpdate:open":U[2]||(U[2]=V=>ve.value=V)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":F.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),Q.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-single-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):$e.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:U[0]||(U[0]=lt(()=>{},["prevent"])),onClick:lt(le,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",nPt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-3.5 shrink-0 opacity-50"}),Ba(H("input",{"onUpdate:modelValue":U[1]||(U[1]=V=>te.value=V),disabled:v.value,placeholder:i(o)("tree-combobox-single-search-placeholder"),class:"flex h-9 w-full bg-transparent text-sm outline-hidden placeholder:text-zinc-500 disabled:cursor-not-allowed disabled:opacity-50"},null,8,oPt),[[mu,te.value]])]),H("div",rPt,[W.value&&L.value.length===0?(S(),J("div",lPt,A(i(o)("tree-combobox-single-load-error")),1)):Q.value&&L.value.length===0?(S(),J("div",iPt,[s(i($o),{class:"h-5 w-2/3"}),s(i($o),{class:"h-5 w-1/2"}),s(i($o),{class:"h-5 w-3/5"})])):(S(),B(i(Ec),{key:2,roots:L.value,"get-key":V=>V.key,"get-children":i(Hve),"selection-mode":"single","model-value":_.value,selectable:N,"filter-predicate":ie,"filter-query":te.value,"initial-expanded":j.value,"show-focused-row":!1,class:nt([v.value?"pointer-events-none opacity-60":void 0,"max-h-72 overflow-y-auto"]),"onUpdate:modelValue":ge},{node:d(({node:V,selected:q})=>[H("span",{class:"flex flex-1 min-w-0 items-center justify-between gap-2",onMouseenter:ne=>ee.value=V.key,onFocusin:ne=>ee.value=V.key},[s(i(O),{source:E(V),class:"prose prose-sm prose-zinc text-zinc-700 min-w-0"},null,8,["source"]),q?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-3 shrink-0 text-zinc-700"})):be("",!0)],40,aPt)]),empty:d(()=>[H("div",sPt,A(i(o)("tree-combobox-single-empty")),1)]),error:d(({error:V,retry:q})=>[H("span",uPt,[D(A(i(o)("tree-combobox-single-load-error"))+" ",1),H("button",{type:"button",class:"underline hover:text-red-600",onClick:lt(q,["stop"])},A(i(o)("tree-combobox-single-retry")),9,cPt),H("span",dPt,A(String(V)),1)])]),_:1},8,["roots","get-key","get-children","model-value","filter-query","initial-expanded","class"]))]),K.value&&Y.value?(S(),J("div",fPt,[s(i(O),{source:Y.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1})]),_:1},8,["open"]))]),_:1},8,["orientation","data-disabled"]))}}),mPt={key:0,"aria-hidden":"true",class:"text-red-600"},hPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},vPt={key:0,"data-slot":"combobox-multi-empty",class:"py-6 text-center text-sm text-zinc-500"},gPt={class:"flex-1"},yPt=ae({name:"ShwfedComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-multi-placeholder":"请选择","combobox-multi-search-placeholder":"搜索…","combobox-multi-empty":"无匹配项","combobox-multi-loading":"加载中…"},en:{"combobox-multi-placeholder":"Select…","combobox-multi-search-placeholder":"Search…","combobox-multi-empty":"No matches","combobox-multi-loading":"Loading…"},ja:{"combobox-multi-placeholder":"選択してください","combobox-multi-search-placeholder":"検索…","combobox-multi-empty":"一致なし","combobox-multi-loading":"読み込み中…"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(R,U)=>Dt(R,{...Pt(u),...U}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-multi-placeholder")),m=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function h(R,U){if(!R)return!1;try{return We(c(R,{form:r.value??{}}))}catch(V){return console.error(`[shwfed-form] failed to evaluate ${U} for ${e.fieldId}:`,V),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),$=T(()=>e.config.options.kind==="static");function C(R,U){try{return Jn(R,c,U)}catch(V){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,V),R}}const E=ue(null),z=ue(!1),N=T(()=>{const R=e.config.options;if(R.kind!=="remote")return null;const U=R.request;if(!U)return null;try{const V=$u(We(c(U,{form:r.value??{}})));return cn(V)?JSON.stringify(V.value.describe()):null}catch{return null}});let P=0;async function Q(){const R=++P;if(N.value==null){E.value=null,z.value=!1;return}const U=e.config.options,V=U.kind==="remote"?U.request:void 0;if(!V){E.value=null,z.value=!1;return}z.value=!0;const q=qt(function*(){const ne=yield*Qr(yield*c(V,{form:r.value??{}}));return bc(ne)});try{const ne=await Cn(ao(q,Nr));R===P&&(E.value=ne)}catch{R===P&&(E.value=null)}finally{R===P&&(z.value=!1)}}function W(R){const U=e.config.options;if(U.kind==="remote")try{return We(c(U.optionValue,{form:r.value??{},option:R}))}catch(V){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,V);return}}function Z(R){const U=e.config.options;if(U.kind!=="remote")return"";const V=Ke(U.optionLabel,n.value)??"";return V?Jn(V,c,{form:r.value??{},option:R}):""}function L(R){const U=e.config.options;if(!(U.kind!=="remote"||!U.optionKeywords))try{const V=We(c(U.optionKeywords,{form:r.value??{},option:R}));if(!Array.isArray(V))return;const q=V.map(ne=>ne==null?"":String(ne)).filter(Boolean).join(" ");return q.length>0?q:void 0}catch(V){console.error(`[shwfed-form] failed to evaluate optionKeywords for ${e.fieldId}:`,V);return}}const F=T(()=>{const R=e.config.options;if(R.kind==="static")return(R.items??[]).map(V=>{const q=Ke(V.label,n.value)??"",ne={form:r.value??{}},X=(V.keywords??[]).filter(Boolean).join(" ");return{key:V.id,value:V.value.value,label:q?C(q,ne):"",keywords:X.length>0?X:void 0,raw:V}});let U;try{U=We(c(R.options,{form:r.value??{},json:E.value}))}catch(V){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,V),[]}return Array.isArray(U)?U.map((V,q)=>({key:String(q),value:W(V),label:Z(V),keywords:L(V),raw:V})):[]}),j=ue([]),te=T({get:()=>{const R=e.config.binding,U=R==null?j.value:l(R);return Array.isArray(U)?U:[]},set:R=>{const U=Array.isArray(R)?R:[],V=e.config.binding;if(V==null){j.value=U;return}a(V,U)}});wc(N,()=>{Q()},{debounce:200,immediate:!0});function ie(R,U){if(R===U)return!0;if(R==null||U==null)return!1;if(typeof R=="object"&&typeof U=="object")try{return JSON.stringify(R)===JSON.stringify(U)}catch{return!1}return!1}const ve=T(()=>{const R=[];for(const U of te.value){const V=F.value.find(q=>ie(q.value,U));V&&R.push(V)}return R}),ge=T(()=>ve.value.map(R=>R.key)),$e=T(()=>new Set(ge.value));Qd(e.fieldId,()=>ve.value.length>0?ve.value:void 0,{identity:R=>R.map(U=>U.key).join("\0"),raw:R=>R.map(U=>U.raw)});const le=T(()=>{const R=ve.value;return R.length===0?"":R.length===1?R[0].label:`${R[0].label} +${R.length-1}`}),ee=ue(!1);function oe(R){const U=Array.isArray(R)?R.filter(q=>typeof q=="string"):[],V=[];for(const q of U){const ne=F.value.find(X=>X.key===q);ne&&V.push(ne.value)}te.value=V}const K=T(()=>!v.value&&ve.value.length>0);function Y(){te.value=[],ee.value=!1}return(R,U)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(y)?(S(),J("span",mPt," *")):be("",!0)]),_:2},[m.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:m.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",hPt,A(le.value||"—"),1)):(S(),B(i(vr),{key:2,open:ee.value,"onUpdate:open":U[1]||(U[1]=V=>ee.value=V)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":le.value,disabled:v.value,placeholder:p.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),z.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):K.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:U[0]||(U[0]=lt(()=>{},["prevent"])),onClick:lt(Y,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":ge.value,multiple:!0,disabled:v.value,"onUpdate:modelValue":oe},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-multi-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[!$.value&&F.value.length===0?(S(),J("div",vPt,A(z.value?i(o)("combobox-multi-loading"):i(o)("combobox-multi-empty")),1)):(S(),J(Me,{key:1},[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-multi-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(F.value,V=>(S(),B(i(Fr),{key:V.key,value:V.key,keywords:V.keywords},{default:d(()=>[H("span",gPt,[s(i(O),{source:V.label},null,8,["source"])]),$e.value.has(V.key)?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-4 text-zinc-700"})):be("",!0)]),_:2},1032,["value","keywords"]))),128))]),_:1})],64))]),_:1})]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),bPt={key:0,"aria-hidden":"true",class:"text-red-600"},xPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},_Pt={key:0,"data-slot":"combobox-single-empty",class:"py-6 text-center text-sm text-zinc-500"},wPt={key:0,class:"border-t border-zinc-200 px-3 py-2"},kPt=ae({name:"ShwfedComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"combobox-single-placeholder":"请选择","combobox-single-search-placeholder":"搜索…","combobox-single-empty":"无匹配项","combobox-single-loading":"加载中…"},en:{"combobox-single-placeholder":"Select…","combobox-single-search-placeholder":"Search…","combobox-single-empty":"No matches","combobox-single-loading":"Loading…"},ja:{"combobox-single-placeholder":"選択してください","combobox-single-search-placeholder":"検索…","combobox-single-empty":"一致なし","combobox-single-loading":"読み込み中…"}}}),{state:r,getAt:l,setAt:a,setAtSilent:u}=Xn(),c=Ft(),f=(X,fe)=>Dt(X,{...Pt(c),...fe}),p=T(()=>Ke(e.config.label,n.value)),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("combobox-single-placeholder")),h=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function v(X,fe){if(!X)return!1;try{return We(f(X,{form:r.value??{}}))}catch(ye){return console.error(`[shwfed-form] failed to evaluate ${fe} for ${e.fieldId}:`,ye),!1}}const g=T(()=>v(e.config.disabled,"disabled")),b=kr(),x=T(()=>e.config.readonly!=null?v(e.config.readonly,"readonly"):b.value),y=T(()=>x.value||e.config.derived?.mode==="formula"),{isRequired:_,errors:k,warnings:w,visible:$}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:f,locale:()=>n.value}),C=T(()=>e.config.options.kind==="static");function E(X,fe){try{return Jn(X,f,fe)}catch(ye){return console.error(`[shwfed-form] failed to interpolate option text for ${e.fieldId}:`,ye),X}}const z=ue(null),N=ue(!1),P=T(()=>{const X=e.config.options;if(X.kind!=="remote")return null;const fe=X.request;if(!fe)return null;try{const ye=$u(We(f(fe,{form:r.value??{}})));return cn(ye)?JSON.stringify(ye.value.describe()):null}catch{return null}});let Q=0;async function W(){const X=++Q;if(P.value==null){z.value=null,N.value=!1;return}const fe=e.config.options,ye=fe.kind==="remote"?fe.request:void 0;if(!ye){z.value=null,N.value=!1;return}N.value=!0;const ce=qt(function*(){const pe=yield*Qr(yield*f(ye,{form:r.value??{}}));return bc(pe)});try{const pe=await Cn(ao(ce,Nr));X===Q&&(z.value=pe)}catch{X===Q&&(z.value=null)}finally{X===Q&&(N.value=!1)}}function Z(X){const fe=e.config.options;if(fe.kind==="remote")try{return We(f(fe.optionValue,{form:r.value??{},option:X}))}catch(ye){console.error(`[shwfed-form] failed to evaluate optionValue for ${e.fieldId}:`,ye);return}}function L(X){const fe=e.config.options;if(fe.kind!=="remote")return"";const ye=Ke(fe.optionLabel,n.value)??"";return ye?Jn(ye,f,{form:r.value??{},option:X}):""}function F(X){const fe=e.config.options;if(!(fe.kind!=="remote"||!fe.optionKeywords))try{const ye=We(f(fe.optionKeywords,{form:r.value??{},option:X}));if(!Array.isArray(ye))return;const ce=ye.map(pe=>pe==null?"":String(pe)).filter(Boolean).join(" ");return ce.length>0?ce:void 0}catch(ye){console.error(`[shwfed-form] failed to evaluate optionKeywords for ${e.fieldId}:`,ye);return}}const j=T(()=>{const X=e.config.options;if(X.kind==="static")return(X.items??[]).map(ye=>{const ce=Ke(ye.label,n.value)??"",pe=ye.tooltip?Ke(ye.tooltip,n.value):void 0,ke={form:r.value??{}},se=(ye.keywords??[]).filter(Boolean).join(" ");return{key:ye.id,value:ye.value.value,label:ce?E(ce,ke):"",tooltip:pe?E(pe,ke):void 0,keywords:se.length>0?se:void 0,raw:ye}});let fe;try{fe=We(f(X.options,{form:r.value??{},json:z.value}))}catch(ye){return console.error(`[shwfed-form] failed to evaluate options for ${e.fieldId}:`,ye),[]}return Array.isArray(fe)?fe.map((ye,ce)=>({key:String(ce),value:Z(ye),label:L(ye),keywords:F(ye),raw:ye})):[]}),te=ue(void 0),ie=T({get:()=>{const X=e.config.binding;return X==null?te.value:l(X)},set:X=>{const fe=e.config.binding;if(fe==null){te.value=X;return}a(fe,X)}});let ve;wc(P,()=>{if(ve!=null){const X=e.config.binding;X==null?te.value=void 0:u(X,void 0)}ve=P.value,W()},{debounce:200,immediate:!0});function ge(X,fe){if(X===fe)return!0;if(X==null||fe==null)return!1;if(typeof X=="object"&&typeof fe=="object")try{return JSON.stringify(X)===JSON.stringify(fe)}catch{return!1}return!1}const $e=T(()=>j.value.find(X=>ge(X.value,ie.value))),le=T(()=>$e.value?.key),ee=T(()=>$e.value?.label??"");Qd(e.fieldId,()=>$e.value,{identity:X=>X.key,raw:X=>X.raw});const oe=ue(!1);function K(X){if(typeof X!="string")return;const fe=j.value.find(ye=>ye.key===X);fe&&(ie.value=fe.value,Vt().then(()=>{oe.value=!1}))}const Y=T(()=>!g.value&&$e.value!==void 0);function R(){ie.value=void 0,oe.value=!1}const U=ue(null);Qe(oe,X=>{U.value=X?j.value[0]?.key??null:null});const V=T(()=>j.value.find(X=>X.key===U.value)),q=T(()=>V.value?.tooltip),ne=T(()=>j.value.some(X=>X.tooltip!=null&&X.tooltip.length>0));return(X,fe)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":g.value||void 0},{default:d(()=>[p.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(p.value),1),i(_)?(S(),J("span",bPt," *")):be("",!0)]),_:2},[h.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:h.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),y.value?(S(),J("div",xPt,[ee.value?(S(),B(i(O),{key:0,source:ee.value},null,8,["source"])):(S(),J(Me,{key:1},[D(" — ")],64))])):(S(),B(i(vr),{key:2,open:oe.value,"onUpdate:open":fe[1]||(fe[1]=ye=>oe.value=ye)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/combobox-single","data-disabled":g.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":ee.value,disabled:g.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),N.value?(S(),B(i(Ye),{key:0,align:"inline-end",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):Y.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:fe[0]||(fe[0]=lt(()=>{},["prevent"])),onClick:lt(R,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[s(i(ii),{"model-value":le.value,disabled:g.value,"selection-behavior":"toggle","onUpdate:modelValue":K},{default:d(()=>[s(i(Ti),{placeholder:i(o)("combobox-single-search-placeholder")},null,8,["placeholder"]),s(i(si),null,{default:d(()=>[!C.value&&j.value.length===0?(S(),J("div",_Pt,A(N.value?i(o)("combobox-single-loading"):i(o)("combobox-single-empty")),1)):(S(),J(Me,{key:1},[s(i(ai),{class:"py-6 text-center text-sm text-zinc-500"},{default:d(()=>[D(A(i(o)("combobox-single-empty")),1)]),_:1}),s(i(Hr),null,{default:d(()=>[(S(!0),J(Me,null,Ze(j.value,ye=>(S(),B(i(Fr),{key:ye.key,value:ye.key,keywords:ye.keywords,onMouseenter:ce=>U.value=ye.key,onFocus:ce=>U.value=ye.key},{default:d(()=>[s(i(O),{source:ye.label},null,8,["source"])]),_:2},1032,["value","keywords","onMouseenter","onFocus"]))),128))]),_:1})],64))]),_:1}),ne.value&&q.value?(S(),J("div",wPt,[s(i(O),{source:q.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1},8,["model-value","disabled"])]),_:1})]),_:1},8,["open"])),i($)?(S(),B(i(Xr),{key:3,errors:i(k),warnings:i(w)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}});function Wve(t,e){const n=e.nodeChildren(t);return!n||n.length===0?{kind:"terminal",raw:t,key:e.nodeKey(t)}:{kind:"branch",raw:t,key:e.nodeKey(t),children:n.map(o=>Wve(o,e))}}function Kve(t,e){return t.map(n=>Wve(n,e))}function Gve(t){return t.kind==="branch"?t.children:void 0}function Ox(t,e){const n=[];function o(r){for(const l of r){if(n.push(l),l.key===e||l.kind==="branch"&&l.children.length>0&&o(l.children))return!0;n.pop()}return!1}return o(t)?n.slice():null}const SPt={key:0,"aria-hidden":"true",class:"text-red-600"},CPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},$Pt={"data-slot":"tree-combobox-multi-search",class:"flex h-10 items-center gap-2 border-b border-zinc-200 px-3"},TPt=["disabled","placeholder"],EPt={class:"flex flex-col p-1"},APt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},DPt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},zPt=["onMouseenter","onFocusin"],OPt={class:"py-6 text-center text-sm text-zinc-500"},MPt={class:"inline-flex items-center gap-1 text-xs text-red-500"},IPt=["onClick"],RPt={class:"sr-only"},VPt={key:0,"data-slot":"tree-combobox-multi-tooltip",class:"border-t border-zinc-200 px-3 py-2"},PPt=ae({name:"ShwfedTreeComboboxMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-multi-placeholder":"请选择","tree-combobox-multi-search-placeholder":"搜索…","tree-combobox-multi-search-clear":"清除搜索","tree-combobox-multi-empty":"无可选项","tree-combobox-multi-load-error":"加载失败","tree-combobox-multi-retry":"重试","tree-combobox-multi-readonly-empty":"—"},en:{"tree-combobox-multi-placeholder":"Select…","tree-combobox-multi-search-placeholder":"Search…","tree-combobox-multi-search-clear":"Clear search","tree-combobox-multi-empty":"No options","tree-combobox-multi-load-error":"Failed to load","tree-combobox-multi-retry":"Retry","tree-combobox-multi-readonly-empty":"—"},ja:{"tree-combobox-multi-placeholder":"選択してください","tree-combobox-multi-search-placeholder":"検索…","tree-combobox-multi-search-clear":"検索をクリア","tree-combobox-multi-empty":"選択肢なし","tree-combobox-multi-load-error":"読み込みに失敗しました","tree-combobox-multi-retry":"再試行","tree-combobox-multi-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(ce,pe)=>Dt(ce,{...Pt(u),...pe}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-multi-placeholder"));function h(ce,pe){if(!ce)return!1;try{return We(c(ce,{form:r.value??{}}))}catch(ke){return console.error(`[shwfed-form] failed to evaluate ${pe} for ${e.fieldId}:`,ke),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),$=ue([]),C=T({get:()=>{const ce=e.config.binding,pe=ce==null?$.value:l(ce);return Array.isArray(pe)?pe.map(ke=>String(ke)):[]},set:ce=>{const pe=ce.map(se=>String(se)),ke=e.config.binding;if(ke==null){$.value=pe;return}a(ke,pe)}});function E(ce){return{form:r.value??{},node:ce}}function z(ce){try{return String(We(c(e.config.nodeKey,E(ce))))}catch(pe){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,pe),""}}function N(ce){let pe;try{pe=We(c(e.config.nodeChildren,E(ce)))}catch(ke){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,ke);return}if(pe!=null&&Array.isArray(pe))return pe}function P(ce,pe){try{return Jn(ce,c,E(pe))}catch(ke){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,ke),ce}}function Q(ce){const pe=Ke(e.config.nodeLabel,n.value)??"";return pe?P(pe,ce.raw):""}function W(ce){if(!e.config.nodeTooltip)return;const pe=Ke(e.config.nodeTooltip,n.value);return pe?P(pe,ce.raw):void 0}function Z(ce,pe){if(v.value)return!1;const ke=e.config.nodeSelectable;if(!ke)return!0;try{return We(c(ke,E(ce.raw)))}catch{return!1}}function L(ce){const pe=e.config.keywords;if(!pe)return[];try{const ke=We(c(pe,E(ce)));return Array.isArray(ke)?ke.map(se=>String(se)):[]}catch{return[]}}const F=$n([]),j=ue(!1),te=ue(null);async function ie(){const ce=e.config.dataSource;if(!ce){F.value=[];return}const pe=qt(function*(){let se=pt();ce.request&&(se=yield*Qr(yield*c(ce.request,{form:r.value??{}})));const me=yield*c(ce.data,{form:r.value??{},json:se});return Array.isArray(me)?me:[]}),ke=qt(function*(){const se=yield*Vs(on(()=>{j.value=!0}).pipe(Ps("30 millis")));return yield*ir(pe,_i(se))}).pipe(ir(on(()=>{j.value=!1})));try{const se=await Cn(ao(ke,Nr));F.value=se,te.value=null}catch(se){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",se),te.value=se}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{ie()},{immediate:!0});const ve=T(()=>Kve(F.value,{nodeKey:z,nodeChildren:N}));function ge(ce){const pe=Ox(ve.value,ce);if(!pe||pe.length===0)return null;const ke=pe[pe.length-1];return Q(ke)}const $e=T(()=>{const ce=C.value;if(ce.length===0)return"";const pe=ge(ce[0]);return pe===null||pe.length===0?"":ce.length===1?pe:`${pe} + ${ce.length-1}`}),le=T(()=>C.value.map(ce=>{const pe=Ox(ve.value,ce);if(!(!pe||pe.length===0))return pe[pe.length-1]}).filter(ce=>ce!==void 0));Qd(e.fieldId,()=>le.value.length>0?le.value:void 0,{identity:ce=>ce.map(pe=>pe.key).join(" "),raw:ce=>ce.map(pe=>pe.raw)});const ee=T(()=>{if(!e.config.expandAll)return[];const ce=[],pe=[...ve.value];for(;pe.length;){const ke=pe.pop();ke.kind==="branch"&&(ce.push(ke.key),pe.push(...ke.children))}return ce}),oe=ue(""),K=$n(new Map);Qe(()=>[ve.value,n.value,e.config.nodeLabel,e.config.keywords],()=>{const ce=new Map,pe=[...ve.value];for(;pe.length;){const ke=pe.pop(),se=Q(ke).trim().toLowerCase(),me=L(ke.raw).map(ze=>ze.trim().toLowerCase()).join(`
|
|
200
198
|
`);ce.set(ke.key,me?`${se}
|
|
201
|
-
${me}`:se),ke.kind==="branch"&&pe.push(...ke.children)}K.value=ce},{immediate:!0});function Y(ce,pe){const ke=pe.trim().toLowerCase();if(!ke)return!0;const se=K.value.get(ce.key);return se!==void 0?se.includes(ke):Q(ce).trim().toLowerCase().includes(ke)}const R=ue(!1);function U(ce){const pe=Array.isArray(ce)?ce:[];C.value=pe}const V=T(()=>!v.value&&!j.value&&C.value.length>0);function q(){C.value=[],R.value=!1}const ne=ue(null);Qe(R,ce=>{ce||(ne.value=null)});function X(ce,pe){for(const ke of pe)W(ke)&&ce.push(ke.key),ke.kind==="branch"&&X(ce,ke.children)}const fe=T(()=>{if(!e.config.nodeTooltip)return!1;const ce=[];return X(ce,ve.value),ce.length>0}),ye=T(()=>{const ce=ne.value;if(!ce)return;const pe=Ox(ve.value,ce);if(!(!pe||pe.length===0))return W(pe[pe.length-1])});return(ce,pe)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(y)?(S(),J("span",SPt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",CPt,A($e.value||i(o)("tree-combobox-multi-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:R.value,"onUpdate:open":pe[2]||(pe[2]=ke=>R.value=ke)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":$e.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),j.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-multi-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):V.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:pe[0]||(pe[0]=lt(()=>{},["prevent"])),onClick:lt(q,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",$Pt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-
|
|
199
|
+
${me}`:se),ke.kind==="branch"&&pe.push(...ke.children)}K.value=ce},{immediate:!0});function Y(ce,pe){const ke=pe.trim().toLowerCase();if(!ke)return!0;const se=K.value.get(ce.key);return se!==void 0?se.includes(ke):Q(ce).trim().toLowerCase().includes(ke)}const R=ue(!1);function U(ce){const pe=Array.isArray(ce)?ce:[];C.value=pe}const V=T(()=>!v.value&&!j.value&&C.value.length>0);function q(){C.value=[],R.value=!1}const ne=ue(null);Qe(R,ce=>{ce||(ne.value=null)});function X(ce,pe){for(const ke of pe)W(ke)&&ce.push(ke.key),ke.kind==="branch"&&X(ce,ke.children)}const fe=T(()=>{if(!e.config.nodeTooltip)return!1;const ce=[];return X(ce,ve.value),ce.length>0}),ye=T(()=>{const ce=ne.value;if(!ce)return;const pe=Ox(ve.value,ce);if(!(!pe||pe.length===0))return W(pe[pe.length-1])});return(ce,pe)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(y)?(S(),J("span",SPt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",CPt,A($e.value||i(o)("tree-combobox-multi-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:R.value,"onUpdate:open":pe[2]||(pe[2]=ke=>R.value=ke)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-multi","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":$e.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),j.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-multi-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):V.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-multi:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-multi-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:pe[0]||(pe[0]=lt(()=>{},["prevent"])),onClick:lt(q,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",$Pt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-4 shrink-0 opacity-50"}),Ba(H("input",{"onUpdate:modelValue":pe[1]||(pe[1]=ke=>oe.value=ke),disabled:v.value,placeholder:i(o)("tree-combobox-multi-search-placeholder"),class:"flex h-10 w-full bg-transparent py-3 text-sm outline-hidden placeholder:text-zinc-700 disabled:cursor-not-allowed disabled:opacity-50"},null,8,TPt),[[mu,oe.value]])]),H("div",EPt,[te.value&&ve.value.length===0?(S(),J("div",APt,A(i(o)("tree-combobox-multi-load-error")),1)):j.value&&ve.value.length===0?(S(),J("div",DPt,[s(i($o),{class:"h-5 w-2/3"}),s(i($o),{class:"h-5 w-1/2"}),s(i($o),{class:"h-5 w-3/5"})])):(S(),B(i(Ec),{key:2,roots:ve.value,"get-key":ke=>ke.key,"get-children":i(Gve),"selection-mode":"multi",cascade:t.config.cascade??"independent","model-value":C.value,selectable:Z,"filter-predicate":Y,"filter-query":oe.value,"initial-expanded":ee.value,"show-focused-row":!1,class:nt([v.value?"pointer-events-none opacity-60":void 0,"max-h-72 overflow-y-auto"]),"onUpdate:modelValue":U},{node:d(({node:ke,selected:se})=>[H("span",{class:"flex flex-1 min-w-0 items-center justify-between gap-2",onMouseenter:me=>ne.value=ke.key,onFocusin:me=>ne.value=ke.key},[s(i(O),{source:Q(ke),class:"prose prose-sm prose-zinc text-zinc-700 min-w-0"},null,8,["source"]),se?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-3 shrink-0 text-zinc-700"})):be("",!0)],40,zPt)]),empty:d(()=>[H("div",OPt,A(i(o)("tree-combobox-multi-empty")),1)]),error:d(({error:ke,retry:se})=>[H("span",MPt,[D(A(i(o)("tree-combobox-multi-load-error"))+" ",1),H("button",{type:"button",class:"underline hover:text-red-600",onClick:lt(se,["stop"])},A(i(o)("tree-combobox-multi-retry")),9,IPt),H("span",RPt,A(String(ke)),1)])]),_:1},8,["roots","get-key","get-children","cascade","model-value","filter-query","initial-expanded","class"]))]),fe.value&&ye.value?(S(),J("div",VPt,[s(i(O),{source:ye.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1})]),_:1},8,["open"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),FPt={key:0,"aria-hidden":"true",class:"text-red-600"},NPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},LPt={"data-slot":"tree-combobox-single-search",class:"flex h-10 items-center gap-2 border-b border-zinc-200 px-3"},BPt=["disabled","placeholder"],UPt={class:"flex flex-col p-1"},qPt={key:0,class:"min-h-9 px-2 py-1.5 text-sm text-red-500"},jPt={key:1,class:"flex flex-col gap-1.5 px-2 py-1","aria-busy":"true"},HPt=["onMouseenter","onFocusin"],WPt={class:"py-6 text-center text-sm text-zinc-500"},KPt={class:"inline-flex items-center gap-1 text-xs text-red-500"},GPt=["onClick"],YPt={class:"sr-only"},JPt={key:0,"data-slot":"tree-combobox-single-tooltip",class:"border-t border-zinc-200 px-3 py-2"},XPt=ae({name:"ShwfedTreeComboboxSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-combobox-single-placeholder":"请选择","tree-combobox-single-search-placeholder":"搜索…","tree-combobox-single-search-clear":"清除搜索","tree-combobox-single-empty":"无可选项","tree-combobox-single-load-error":"加载失败","tree-combobox-single-retry":"重试","tree-combobox-single-readonly-empty":"—"},en:{"tree-combobox-single-placeholder":"Select…","tree-combobox-single-search-placeholder":"Search…","tree-combobox-single-search-clear":"Clear search","tree-combobox-single-empty":"No options","tree-combobox-single-load-error":"Failed to load","tree-combobox-single-retry":"Retry","tree-combobox-single-readonly-empty":"—"},ja:{"tree-combobox-single-placeholder":"選択してください","tree-combobox-single-search-placeholder":"検索…","tree-combobox-single-search-clear":"検索をクリア","tree-combobox-single-empty":"選択肢なし","tree-combobox-single-load-error":"読み込みに失敗しました","tree-combobox-single-retry":"再試行","tree-combobox-single-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(ye,ce)=>Dt(ye,{...Pt(u),...ce}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0),m=T(()=>e.config.placeholder?Ke(e.config.placeholder,n.value):o("tree-combobox-single-placeholder"));function h(ye,ce){if(!ye)return!1;try{return We(c(ye,{form:r.value??{}}))}catch(pe){return console.error(`[shwfed-form] failed to evaluate ${ce} for ${e.fieldId}:`,pe),!1}}const v=T(()=>h(e.config.disabled,"disabled")),g=kr(),b=T(()=>e.config.readonly!=null?h(e.config.readonly,"readonly"):g.value),x=T(()=>b.value||e.config.derived?.mode==="formula"),{isRequired:y,errors:_,warnings:k,visible:w}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),$=ue(void 0),C=T({get:()=>{const ye=e.config.binding,ce=ye==null?$.value:l(ye);if(ce!=null)return String(ce)},set:ye=>{const ce=ye==null?void 0:String(ye),pe=e.config.binding;if(pe==null){$.value=ce;return}a(pe,ce)}});function E(ye){return{form:r.value??{},node:ye}}function z(ye){try{return String(We(c(e.config.nodeKey,E(ye))))}catch(ce){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,ce),""}}function N(ye){let ce;try{ce=We(c(e.config.nodeChildren,E(ye)))}catch(pe){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,pe);return}if(ce!=null&&Array.isArray(ce))return ce}function P(ye,ce){try{return Jn(ye,c,E(ce))}catch(pe){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,pe),ye}}function Q(ye){const ce=Ke(e.config.nodeLabel,n.value)??"";return ce?P(ce,ye.raw):""}function W(ye){if(!e.config.nodeTooltip)return;const ce=Ke(e.config.nodeTooltip,n.value);return ce?P(ce,ye.raw):void 0}function Z(ye,ce){if(v.value)return!1;const pe=e.config.nodeSelectable;if(!pe)return!0;try{return We(c(pe,E(ye.raw)))}catch{return!1}}function L(ye){const ce=e.config.keywords;if(!ce)return[];try{const pe=We(c(ce,E(ye)));return Array.isArray(pe)?pe.map(ke=>String(ke)):[]}catch{return[]}}const F=$n([]),j=ue(!1),te=ue(null);async function ie(){const ye=e.config.dataSource;if(!ye){F.value=[];return}const ce=qt(function*(){let ke=pt();ye.request&&(ke=yield*Qr(yield*c(ye.request,{form:r.value??{}})));const se=yield*c(ye.data,{form:r.value??{},json:ke});return Array.isArray(se)?se:[]}),pe=qt(function*(){const ke=yield*Vs(on(()=>{j.value=!0}).pipe(Ps("30 millis")));return yield*ir(ce,_i(ke))}).pipe(ir(on(()=>{j.value=!1})));try{const ke=await Cn(ao(pe,Nr));F.value=ke,te.value=null}catch(ke){console.warn("[shwfed-form] tree-combobox dataSource fetch failed",ke),te.value=ke}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{ie()},{immediate:!0});const ve=T(()=>Kve(F.value,{nodeKey:z,nodeChildren:N})),ge=T(()=>{const ye=C.value;if(!ye)return;const ce=Ox(ve.value,ye);if(!(!ce||ce.length===0))return ce[ce.length-1]}),$e=T(()=>ge.value?Q(ge.value):"");Qd(e.fieldId,()=>ge.value,{identity:ye=>ye.key,raw:ye=>ye.raw});const le=T(()=>{if(!e.config.expandAll)return[];const ye=[],ce=[...ve.value];for(;ce.length;){const pe=ce.pop();pe.kind==="branch"&&(ye.push(pe.key),ce.push(...pe.children))}return ye}),ee=ue(""),oe=$n(new Map);Qe(()=>[ve.value,n.value,e.config.nodeLabel,e.config.keywords],()=>{const ye=new Map,ce=[...ve.value];for(;ce.length;){const pe=ce.pop(),ke=Q(pe).trim().toLowerCase(),se=L(pe.raw).map(me=>me.trim().toLowerCase()).join(`
|
|
202
200
|
`);ye.set(pe.key,se?`${ke}
|
|
203
|
-
${se}`:ke),pe.kind==="branch"&&ce.push(...pe.children)}oe.value=ye},{immediate:!0});function K(ye,ce){const pe=ce.trim().toLowerCase();if(!pe)return!0;const ke=oe.value.get(ye.key);return ke!==void 0?ke.includes(pe):Q(ye).trim().toLowerCase().includes(pe)}const Y=ue(!1);function R(ye){const ce=typeof ye=="string"?ye:void 0;C.value=ce,ce&&(Y.value=!1)}const U=T(()=>!v.value&&!j.value&&!!C.value);function V(){C.value=void 0,Y.value=!1}const q=ue(null);Qe(Y,ye=>{ye||(q.value=null)});function ne(ye,ce){for(const pe of ce)W(pe)&&ye.push(pe.key),pe.kind==="branch"&&ne(ye,pe.children)}const X=T(()=>{if(!e.config.nodeTooltip)return!1;const ye=[];return ne(ye,ve.value),ye.length>0}),fe=T(()=>{const ye=q.value;if(!ye)return;const ce=Ox(ve.value,ye);if(!(!ce||ce.length===0))return W(ce[ce.length-1])});return(ye,ce)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(y)?(S(),J("span",FPt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",NPt,A($e.value||i(o)("tree-combobox-single-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:Y.value,"onUpdate:open":ce[2]||(ce[2]=pe=>Y.value=pe)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":$e.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),j.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-single-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):U.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:ce[0]||(ce[0]=lt(()=>{},["prevent"])),onClick:lt(V,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",LPt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-
|
|
201
|
+
${se}`:ke),pe.kind==="branch"&&ce.push(...pe.children)}oe.value=ye},{immediate:!0});function K(ye,ce){const pe=ce.trim().toLowerCase();if(!pe)return!0;const ke=oe.value.get(ye.key);return ke!==void 0?ke.includes(pe):Q(ye).trim().toLowerCase().includes(pe)}const Y=ue(!1);function R(ye){const ce=typeof ye=="string"?ye:void 0;C.value=ce,ce&&(Y.value=!1)}const U=T(()=>!v.value&&!j.value&&!!C.value);function V(){C.value=void 0,Y.value=!1}const q=ue(null);Qe(Y,ye=>{ye||(q.value=null)});function ne(ye,ce){for(const pe of ce)W(pe)&&ye.push(pe.key),pe.kind==="branch"&&ne(ye,pe.children)}const X=T(()=>{if(!e.config.nodeTooltip)return!1;const ye=[];return ne(ye,ve.value),ye.length>0}),fe=T(()=>{const ye=q.value;if(!ye)return;const ce=Ox(ve.value,ye);if(!(!ce||ce.length===0))return W(ce[ce.length-1])});return(ye,ce)=>(S(),B(i(M),{orientation:t.config.orientation??i(Kn),"data-disabled":v.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,for:t.fieldId,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(y)?(S(),J("span",FPt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1032,["for"])):be("",!0),x.value?(S(),J("div",NPt,A($e.value||i(o)("tree-combobox-single-readonly-empty")),1)):(S(),B(i(vr),{key:2,open:Y.value,"onUpdate:open":ce[2]||(ce[2]=pe=>Y.value=pe)},{default:d(()=>[s(i(zr),{"as-child":""},{default:d(()=>[s(i(Fe),{class:"group/tree-combobox-single","data-disabled":v.value?"true":void 0},{default:d(()=>[s(i(Or),{"as-child":""},{default:d(()=>[s(i(Xe),{id:t.fieldId,"model-value":$e.value,disabled:v.value,placeholder:m.value,class:"cursor-pointer text-left",readonly:""},null,8,["id","model-value","disabled","placeholder"])]),_:1}),j.value?(S(),B(i(Ye),{key:0,align:"inline-end","data-slot":"tree-combobox-single-loading",class:"text-zinc-400"},{default:d(()=>[s(i(de),{icon:"fluent:spinner-ios-20-regular",class:"animate-spin"})]),_:1})):U.value?(S(),B(i(Ye),{key:1,align:"inline-end",class:"[@media(hover:hover)]:opacity-0 transition-opacity group-hover/tree-combobox-single:opacity-100 focus-within:opacity-100"},{default:d(()=>[s(i(ot),{size:"icon-xs","data-slot":"tree-combobox-single-clear",class:"text-zinc-500 hover:text-zinc-700",tabindex:"-1",onMousedown:ce[0]||(ce[0]=lt(()=>{},["prevent"])),onClick:lt(V,["stop"])},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"})]),_:1})]),_:1})):be("",!0)]),_:1},8,["data-disabled"])]),_:1}),s(i(gr),{class:"p-0",style:{width:"var(--reka-popover-trigger-width)"}},{default:d(()=>[H("div",LPt,[s(i(de),{icon:"fluent:search-20-filled",class:"size-4 shrink-0 opacity-50"}),Ba(H("input",{"onUpdate:modelValue":ce[1]||(ce[1]=pe=>ee.value=pe),disabled:v.value,placeholder:i(o)("tree-combobox-single-search-placeholder"),class:"flex h-10 w-full bg-transparent py-3 text-sm outline-hidden placeholder:text-zinc-700 disabled:cursor-not-allowed disabled:opacity-50"},null,8,BPt),[[mu,ee.value]])]),H("div",UPt,[te.value&&ve.value.length===0?(S(),J("div",qPt,A(i(o)("tree-combobox-single-load-error")),1)):j.value&&ve.value.length===0?(S(),J("div",jPt,[s(i($o),{class:"h-5 w-2/3"}),s(i($o),{class:"h-5 w-1/2"}),s(i($o),{class:"h-5 w-3/5"})])):(S(),B(i(Ec),{key:2,roots:ve.value,"get-key":pe=>pe.key,"get-children":i(Gve),"selection-mode":"single","model-value":C.value,selectable:Z,"filter-predicate":K,"filter-query":ee.value,"initial-expanded":le.value,"show-focused-row":!1,class:nt([v.value?"pointer-events-none opacity-60":void 0,"max-h-72 overflow-y-auto"]),"onUpdate:modelValue":R},{node:d(({node:pe,selected:ke})=>[H("span",{class:"flex flex-1 min-w-0 items-center justify-between gap-2",onMouseenter:se=>q.value=pe.key,onFocusin:se=>q.value=pe.key},[s(i(O),{source:Q(pe),class:"prose prose-sm prose-zinc text-zinc-700 min-w-0"},null,8,["source"]),ke?(S(),B(i(de),{key:0,icon:"fluent:checkmark-20-regular",class:"size-3 shrink-0 text-zinc-700"})):be("",!0)],40,HPt)]),empty:d(()=>[H("div",WPt,A(i(o)("tree-combobox-single-empty")),1)]),error:d(({error:pe,retry:ke})=>[H("span",KPt,[D(A(i(o)("tree-combobox-single-load-error"))+" ",1),H("button",{type:"button",class:"underline hover:text-red-600",onClick:lt(ke,["stop"])},A(i(o)("tree-combobox-single-retry")),9,GPt),H("span",YPt,A(String(pe)),1)])]),_:1},8,["roots","get-key","get-children","model-value","filter-query","initial-expanded","class"]))]),X.value&&fe.value?(S(),J("div",JPt,[s(i(O),{source:fe.value,block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])])):be("",!0)]),_:1})]),_:1},8,["open"])),i(w)?(S(),B(i(Xr),{key:3,errors:i(_),warnings:i(k)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["orientation","data-disabled"]))}}),QPt={key:0,"aria-hidden":"true",class:"text-red-600"},ZPt={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},e6t={key:1,class:"min-h-9 py-1.5 text-sm text-red-500"},t6t={key:2,class:"flex flex-col gap-1.5 py-1","aria-busy":"true"},n6t={class:"flex items-start gap-2"},o6t={class:"flex flex-col gap-0.5"},r6t={class:"min-h-9 py-1.5 text-sm text-zinc-400"},l6t=ae({name:"ShwfedTreeMultiFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-multi-search-label":"搜索","tree-multi-search-clear":"清除搜索","tree-multi-load-error":"加载失败","tree-multi-empty":"无可选项","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":"、"},en:{"tree-multi-search-label":"Search","tree-multi-search-clear":"Clear search","tree-multi-load-error":"Failed to load","tree-multi-empty":"No options","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":", "},ja:{"tree-multi-search-label":"検索","tree-multi-search-clear":"検索をクリア","tree-multi-load-error":"読み込みに失敗しました","tree-multi-empty":"選択肢なし","tree-multi-readonly-empty":"—","tree-multi-readonly-separator":"、"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(Y,R)=>Dt(Y,{...Pt(u),...R}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(Y,R){if(!Y)return!1;try{return We(c(Y,{form:r.value??{}}))}catch(U){return console.error(`[shwfed-form] failed to evaluate ${R} for ${e.fieldId}:`,U),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),{isRequired:x,errors:y,warnings:_,visible:k}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),w=ue([]),$=T({get:()=>{const Y=e.config.binding,R=Y==null?w.value:l(Y);return Array.isArray(R)?R.map(U=>String(U)):[]},set:Y=>{const R=Y.map(V=>String(V)),U=e.config.binding;if(U==null){w.value=R;return}a(U,R)}}),C=ue([]),E=ue(!1),z=ue(null);async function N(){const Y=e.config.dataSource;if(!Y){C.value=[];return}const R=qt(function*(){let V=pt();Y.request&&(V=yield*Qr(yield*c(Y.request,{form:r.value??{}})));const q=yield*c(Y.data,{form:r.value??{},json:V});return Array.isArray(q)?q:[]}),U=qt(function*(){const V=yield*Vs(on(()=>{E.value=!0}).pipe(Ps("30 millis")));return yield*ir(R,_i(V))}).pipe(ir(on(()=>{E.value=!1})));try{const V=await Cn(ao(U,Nr));C.value=V,z.value=null}catch(V){console.warn("[shwfed-form] tree dataSource fetch failed",V),z.value=V}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{N()},{immediate:!0});function P(Y){return{form:r.value??{},node:Y}}function Q(Y){try{const R=We(c(e.config.nodeKey,P(Y)));return String(R)}catch(R){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,R),""}}function W(Y){let R;try{R=We(c(e.config.nodeChildren,P(Y)))}catch(U){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,U);return}if(R!=null&&Array.isArray(R)&&R.length!==0)return R}function Z(Y,R){if(h.value)return!1;const U=e.config.nodeSelectable;if(!U)return!0;try{return We(c(U,P(Y)))}catch(V){return console.error(`[shwfed-form] failed to evaluate nodeSelectable for ${e.fieldId}:`,V),!1}}function L(Y,R){try{return Jn(Y,c,{form:r.value??{},node:R})}catch(U){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,U),Y}}function F(Y){const R=Ke(e.config.nodeLabel,n.value)??"";return R?L(R,Y):""}function j(Y){if(!e.config.nodeTooltip)return;const R=Ke(e.config.nodeTooltip,n.value);if(R)return L(R,Y)}const te=T(()=>{if(!e.config.expandAll)return[];const Y=[],R=[...C.value];for(;R.length;){const U=R.pop(),V=W(U);V&&V.length&&(Y.push(Q(U)),R.push(...V))}return Y}),ie=ue("");function ve(Y){const R=e.config.filter?.keywords;if(!R)return[];try{const U=We(c(R,P(Y)));return Array.isArray(U)?U.map(V=>String(V)):[]}catch{return[]}}const ge=$n(new Map);Qe(()=>[C.value,n.value,e.config.nodeLabel,e.config.filter?.keywords],()=>{const Y=new Map,R=[...C.value];for(;R.length;){const U=R.pop(),V=F(U).trim().toLowerCase(),q=ve(U).map(X=>X.trim().toLowerCase()).join(`
|
|
204
202
|
`);Y.set(Q(U),q?`${V}
|
|
205
203
|
${q}`:V);const ne=W(U);ne&&ne.length&&R.push(...ne)}ge.value=Y},{immediate:!0});function $e(Y,R){const U=R.trim().toLowerCase();if(!U)return!0;const V=ge.value.get(Q(Y));return V!==void 0?V.includes(U):F(Y).trim().toLowerCase().includes(U)}const le=T(()=>{const Y=e.config.filter?.label?Ke(e.config.filter.label,n.value):void 0;return Y&&Y.length>0?Y:o("tree-multi-search-label")}),ee=T(()=>{const Y=new Set($.value),R=new Map;if(Y.size===0)return R;const U=[...C.value];for(;U.length;){const V=U.pop(),q=Q(V);Y.has(q)&&R.set(q,V);const ne=W(V);ne&&ne.length&&U.push(...ne)}return R}),oe=T(()=>$.value.map(Y=>ee.value.get(Y)).filter(Y=>Y!==void 0));Qd(e.fieldId,()=>oe.value.length>0?oe.value:void 0,{identity:Y=>Y.map(R=>Q(R)).join(" "),raw:Y=>Y});const K=T(()=>{const Y=o("tree-multi-readonly-empty");if($.value.length===0)return Y;const R=ee.value,U=$.value.map(V=>{const q=R.get(V);return q!==void 0?F(q):V}).filter(V=>V.length>0);return U.length>0?U.join(o("tree-multi-readonly-separator")):Y});return(Y,R)=>(S(),B(i(M),{orientation:"vertical","data-disabled":h.value||void 0},{default:d(()=>[f.value?(S(),B(i(I),{key:0,class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(f.value),1),i(x)?(S(),J("span",QPt," *")):be("",!0)]),_:2},[p.value?{name:"tooltip",fn:d(()=>[s(i(O),{source:p.value,class:"prose prose-xs prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024)):be("",!0),b.value?(S(),J("div",ZPt,A(K.value),1)):(S(),J(Me,{key:2},[t.config.filter?.enabled?(S(),B(i(M),{key:0,orientation:"floating"},{default:d(()=>[s(i(I),null,{default:d(()=>[D(A(le.value),1)]),_:1}),s(i(Fe),null,{default:d(()=>[s(i(Ye),{align:"inline-start"},{default:d(()=>[s(i(de),{icon:"lucide:search"})]),_:1}),s(i(Xe),{modelValue:ie.value,"onUpdate:modelValue":R[0]||(R[0]=U=>ie.value=U),disabled:h.value},null,8,["modelValue","disabled"]),ie.value.length>0?(S(),B(i(Ye),{key:0,align:"inline-end"},{default:d(()=>[s(i(ot),{size:"icon-xs","aria-label":i(o)("tree-multi-search-clear"),onClick:R[1]||(R[1]=U=>ie.value="")},{default:d(()=>[s(i(de),{icon:"lucide:x"})]),_:1},8,["aria-label"])]),_:1})):be("",!0)]),_:1})]),_:1})):be("",!0),z.value&&C.value.length===0?(S(),J("div",e6t,A(i(o)("tree-multi-load-error")),1)):E.value&&C.value.length===0?(S(),J("div",t6t,[s(i($o),{class:"h-6 w-2/3"}),s(i($o),{class:"h-6 w-1/2"}),s(i($o),{class:"h-6 w-3/5"}),s(i($o),{class:"h-6 w-2/5"})])):(S(),B(i(Ec),{key:3,modelValue:$.value,"onUpdate:modelValue":R[2]||(R[2]=U=>$.value=U),roots:C.value,"get-key":Q,"get-children":W,"selection-mode":"multi",cascade:t.config.cascade??"cascade-both",selectable:Z,"filter-predicate":$e,"filter-query":ie.value,"initial-expanded":te.value,"show-focused-row":!1,class:nt(h.value?"pointer-events-none opacity-60":void 0)},{node:d(({node:U,selected:V,indeterminate:q})=>[H("span",n6t,[s(i(nN),{"model-value":q?"indeterminate":V,class:"pointer-events-none mt-0.5 shrink-0",tabindex:"-1","aria-hidden":"true"},null,8,["model-value"]),H("span",o6t,[s(i(O),{source:F(U),class:"prose prose-sm prose-zinc text-zinc-700"},null,8,["source"]),j(U)?(S(),B(i(O),{key:0,source:j(U),block:"",class:"prose prose-xs prose-zinc text-zinc-400"},null,8,["source"])):be("",!0)])])]),empty:d(()=>[H("div",r6t,A(i(o)("tree-multi-empty")),1)]),_:1},8,["modelValue","roots","cascade","filter-query","initial-expanded","class"]))],64)),i(k)?(S(),B(i(Xr),{key:3,errors:i(y),warnings:i(_)},null,8,["errors","warnings"])):be("",!0)]),_:1},8,["data-disabled"]))}}),i6t={key:0,"aria-hidden":"true",class:"text-red-600"},a6t={key:1,class:"min-h-9 py-1.5 text-sm text-zinc-700"},s6t={key:1,class:"min-h-9 py-1.5 text-sm text-red-500"},u6t={key:2,class:"flex flex-col gap-1.5 py-1","aria-busy":"true"},c6t={class:"flex items-start gap-2"},d6t={class:"flex flex-col gap-0.5"},f6t={class:"min-h-9 py-1.5 text-sm text-zinc-400"},p6t=ae({name:"ShwfedTreeSingleFieldRuntime",__name:"runtime",props:{fieldId:{},config:{}},setup(t){const e=t,{locale:n,t:o}=Bt({inheritLocale:!0,messages:{zh:{"tree-single-search-label":"搜索","tree-single-search-clear":"清除搜索","tree-single-load-error":"加载失败","tree-single-empty":"无可选项","tree-single-readonly-empty":"—"},en:{"tree-single-search-label":"Search","tree-single-search-clear":"Clear search","tree-single-load-error":"Failed to load","tree-single-empty":"No options","tree-single-readonly-empty":"—"},ja:{"tree-single-search-label":"検索","tree-single-search-clear":"検索をクリア","tree-single-load-error":"読み込みに失敗しました","tree-single-empty":"選択肢なし","tree-single-readonly-empty":"—"}}}),{state:r,getAt:l,setAt:a}=Xn(),u=Ft(),c=(K,Y)=>Dt(K,{...Pt(u),...Y}),f=T(()=>Ke(e.config.label,n.value)),p=T(()=>e.config.tooltip?Ke(e.config.tooltip,n.value):void 0);function m(K,Y){if(!K)return!1;try{return We(c(K,{form:r.value??{}}))}catch(R){return console.error(`[shwfed-form] failed to evaluate ${Y} for ${e.fieldId}:`,R),!1}}const h=T(()=>m(e.config.disabled,"disabled")),v=kr(),g=T(()=>e.config.readonly!=null?m(e.config.readonly,"readonly"):v.value),b=T(()=>g.value||e.config.derived?.mode==="formula"),{isRequired:x,errors:y,warnings:_,visible:k}=el({fieldId:()=>e.fieldId,config:()=>e.config,$cel:c,locale:()=>n.value}),w=ue(void 0),$=T({get:()=>{const K=e.config.binding,Y=K==null?w.value:l(K);return Y==null||Y===""?void 0:String(Y)},set:K=>{const Y=K==null?void 0:String(K),R=e.config.binding;if(R==null){w.value=Y;return}a(R,Y??"")}}),C=ue([]),E=ue(!1),z=ue(null);async function N(){const K=e.config.dataSource;if(!K){C.value=[];return}const Y=qt(function*(){let U=pt();K.request&&(U=yield*Qr(yield*c(K.request,{form:r.value??{}})));const V=yield*c(K.data,{form:r.value??{},json:U});return Array.isArray(V)?V:[]}),R=qt(function*(){const U=yield*Vs(on(()=>{E.value=!0}).pipe(Ps("30 millis")));return yield*ir(Y,_i(U))}).pipe(ir(on(()=>{E.value=!1})));try{const U=await Cn(ao(R,Nr));C.value=U,z.value=null}catch(U){console.warn("[shwfed-form] tree dataSource fetch failed",U),z.value=U}}Qe(()=>[e.config.dataSource?.request,e.config.dataSource?.data],()=>{N()},{immediate:!0});function P(K){return{form:r.value??{},node:K}}function Q(K){try{const Y=We(c(e.config.nodeKey,P(K)));return String(Y)}catch(Y){return console.error(`[shwfed-form] failed to evaluate nodeKey for ${e.fieldId}:`,Y),""}}function W(K){let Y;try{Y=We(c(e.config.nodeChildren,P(K)))}catch(R){console.error(`[shwfed-form] failed to evaluate nodeChildren for ${e.fieldId}:`,R);return}if(Y!=null&&Array.isArray(Y)&&Y.length!==0)return Y}function Z(K,Y){if(h.value)return!1;const R=e.config.nodeSelectable;if(!R)return!0;try{return We(c(R,P(K)))}catch(U){return console.error(`[shwfed-form] failed to evaluate nodeSelectable for ${e.fieldId}:`,U),!1}}function L(K,Y){try{return Jn(K,c,{form:r.value??{},node:Y})}catch(R){return console.error(`[shwfed-form] failed to interpolate node text for ${e.fieldId}:`,R),K}}function F(K){const Y=Ke(e.config.nodeLabel,n.value)??"";return Y?L(Y,K):""}function j(K){if(!e.config.nodeTooltip)return;const Y=Ke(e.config.nodeTooltip,n.value);if(Y)return L(Y,K)}const te=T(()=>{if(!e.config.expandAll)return[];const K=[],Y=[...C.value];for(;Y.length;){const R=Y.pop(),U=W(R);U&&U.length&&(K.push(Q(R)),Y.push(...U))}return K}),ie=ue("");function ve(K){const Y=e.config.filter?.keywords;if(!Y)return[];try{const R=We(c(Y,P(K)));return Array.isArray(R)?R.map(U=>String(U)):[]}catch{return[]}}const ge=$n(new Map);Qe(()=>[C.value,n.value,e.config.nodeLabel,e.config.filter?.keywords],()=>{const K=new Map,Y=[...C.value];for(;Y.length;){const R=Y.pop(),U=F(R).trim().toLowerCase(),V=ve(R).map(ne=>ne.trim().toLowerCase()).join(`
|
|
206
204
|
`);K.set(Q(R),V?`${U}
|
|
@@ -685,4 +683,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
685
683
|
stroke-dasharray: var(--vis-line-stroke-dasharray);
|
|
686
684
|
stroke-dashoffset: var(--vis-line-stroke-dashoffset);
|
|
687
685
|
`,IGt=Object.freeze(Object.defineProperty({__proto__:null,area:dC,areaLinePath:WR,globalStyles:MGt,root:dbe},Symbol.toStringTag,{value:"Module"}));class kA extends Sg{constructor(e){super(),this._defaultConfig=OGt,this.config=this._defaultConfig,this.stacked=!0,this.events={[kA.selectors.area]:{}},e&&this.setConfig(e),this.stacked=Array.isArray(this.config.y)}get bleed(){const{config:{line:e,lineWidth:n}}=this;if(!e)return{top:0,bottom:0,left:0,right:0};const o=this.yScale.domain(),l=(this.yScale.range()[0]>this.yScale.range()[1]?es.North:es.South)===es.South,a=n>3,u=n>=10;return{top:!u&&(!l&&o[1]===0||l&&o[0]===0)?0:n/2,bottom:!u&&(!l&&o[0]===0||l&&o[1]===0)?0:n/2,left:a?n/2:0,right:a?n/2:0}}_render(e){super._render(e);const{config:n,datamodel:{data:o}}=this,r=La(e)?e:n.duration,l=JT[n.curveType];this._areaGen=PWt().x(x=>x.x).y0(x=>x.y0).y1(x=>x.y1).curve(l);const a=yc(n.y)?n.y:[n.y],u=o.map((x,y)=>this.xScale(xo(x,n.x,y))),c=o0e(o,n.baseline,a,this._prevNegative);this._prevNegative=c.map(x=>!!x.isMostlyNegative);const f=[],p=c.map(x=>x.map((y,_)=>{var k,w;const $=u[_],C=this.yScale(y[0]),E=this.yScale(y[1]),z=E>C,N=n.stackMinHeight&&f[_]||0,P=z?C+N:C-N,Q=z?E+N:E-N;let W=0;return(n.minHeight||n.minHeight1Px)&&Math.abs(Q-P)<((k=n.minHeight)!==null&&k!==void 0?k:1)&&(W=((w=n.minHeight)!==null&&w!==void 0?w:1)-Math.abs(Q-P),n.stackMinHeight&&(f[_]=N+W)),{x:$,y0:P,y1:z?Q+W:Q-W}})),m=p.length-1,h=[...p].reverse(),v=this.g.selectAll(`.${dC}`).data(h),g=v.enter().append("path").attr("class",dC).attr("d",x=>this._areaGen(x)||this._emptyPath()).style("opacity",0).style("fill",(x,y)=>bi(o,n.color,m-y)),b=pr(g.merge(v),r).style("opacity",(x,y)=>x.some(k=>k.y0-k.y1!==0)?xo(o,n.opacity,m-y):0).style("fill",(x,y)=>bi(o,n.color,m-y)).style("cursor",(x,y)=>_s(o,n.cursor,m-y));r?b.attrTween("d",(y,_,k)=>{const w=Tl(k[_]).attr("d"),$=this._areaGen(y)||this._emptyPath();return zR(w,$)}):b.attr("d",x=>this._areaGen(x)||this._emptyPath()),pr(v.exit(),r).style("opacity",0).remove(),n.line&&this._renderLines(r,p)}_renderLines(e,n){var o;const{config:r,datamodel:{data:l}}=this,a=n.length-1,u=[...n].reverse(),c=(o=r.lineColor)!==null&&o!==void 0?o:r.color,f=this.g.selectAll(`.${WR}`).data(u),p=this.g.selectAll(`.${dC}`).nodes(),m=f.enter().insert("path",(g,b)=>p[b+1]).attr("class",WR).attr("stroke",(g,b)=>bi(l,c,a-b)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",0),h=pr(m.merge(f),e).attr("stroke",(g,b)=>bi(l,c,a-b)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",1).attr("cursor",(g,b)=>_s(l,r.cursor,a-b)).style("stroke-dasharray",(g,b)=>{var x,y;return(y=(x=Gv(l,r.lineDashArray,b))===null||x===void 0?void 0:x.join(" "))!==null&&y!==void 0?y:null}),v=JT[r.curveType];this._lineGen=KL().x(g=>g.x).y(g=>g.y1).curve(v),e?h.attrTween("d",(b,x,y)=>{const _=Tl(y[x]).attr("d")||this._emptyLinePath(),k=this._lineGen(b)||this._emptyLinePath();return zR(_,k)}):h.attr("d",g=>this._lineGen(g)||this._emptyLinePath()),pr(f.exit(),e).style("opacity",0).remove()}getYDataExtent(e){const{config:n,datamodel:o}=this,r=yc(n.y)?n.y:[n.y],l=this.xScale.domain(),a=e?i0e(o.data,l,n.x,!0):o.data;return n0e(a,n.baseline,...r)}_emptyPath(){const e=this.xScale.range(),n=this.yScale.domain(),o=this.yScale((n[0]+n[1])/2),r=o;return this._areaGen([{y0:o,y1:r,x:e[0]},{y0:o,y1:r,x:e[1]}])}_emptyLinePath(){const e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}}kA.selectors=IGt;function Ap(t,e){return Wv(t,e)}function tf(t){const e=Yr(),n=e.attrs;return T(()=>{const o={},r=e?.vnode.props??{};return Object.keys(r).forEach(l=>{o[Hl(l)]=t[Hl(l)]}),{...o,...n}})}const Lb=Symbol("componentAccessorKey"),fbe=Symbol("tooltipAccessorKey"),pbe=Symbol("crosshairAccessorKey"),mbe=Symbol("axisAccessorKey"),RGt=Symbol("annotationsAccessorKey"),VGt={"data-vis-component":""},PGt=ae({__name:"index",props:{color:{type:[Function,String,Array,null]},curveType:{},baseline:{type:[Function,Number,null]},opacity:{type:[Function,Number,null]},cursor:{type:[Function,String,null]},line:{type:Boolean},lineColor:{type:[Function,String,Array,null]},lineWidth:{},lineDashArray:{type:[Function,Array,null]},minHeight1Px:{type:Boolean},minHeight:{},stackMinHeight:{type:Boolean},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Yn(Lb),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new kA(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy()}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",VGt))}}),FGt={"data-vis-axis":""},YG=ae({__name:"index",props:{position:{},type:{},fullSize:{type:Boolean},label:{},labelFontSize:{},labelMargin:{},labelTextFitMode:{},labelTextTrimType:{},labelColor:{},gridLine:{type:Boolean},tickLine:{type:Boolean},domainLine:{type:Boolean},minMaxTicksOnly:{type:Boolean},minMaxTicksOnlyShowGridLines:{type:Boolean},minMaxTicksOnlyWhenWidthIsLess:{},tickFormat:{type:Function},tickValues:{},numTicks:{},tickTextFitMode:{},tickTextWidth:{},tickTextSeparator:{},tickTextForceWordBreak:{type:Boolean},tickTextTrimType:{},tickTextFontSize:{},tickTextAlign:{},tickTextColor:{},tickTextAngle:{},tickTextHideOverlapping:{type:Boolean},tickPadding:{},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},color:{type:[Function,String,Array,null]},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Yn(mbe),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new Qye(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy(o.type)}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",FGt))}}),NGt=ae({__name:"index",props:{items:{},labelClassName:{},onLegendItemClick:{type:Function},labelFontSize:{},labelMaxWidth:{},bulletSize:{},bulletSpacing:{},bulletShape:{type:[Function,null]},orientation:{},renderIntoProvidedDomNode:{type:Boolean},data:{}},setup(t,{expose:e}){const o=tf(t),r=ue(),l=ue();return Ht(()=>{Vt(()=>{l.value&&(r.value=new abe(l.value,{...o.value,renderIntoProvidedDomNode:!0}))})}),Xo(()=>{var a;(a=r.value)==null||a.destroy()}),Qe(o,(a,u)=>{var c;Ap(a,u)||(c=r.value)==null||c.setConfig(o.value)}),e({component:r}),(a,u)=>(S(),J("div",{"data-vis-bullet-legend":"",ref_key:"elRef",ref:l},null,512))}}),LGt={"data-vis-crosshair":""},BGt=ae({__name:"index",setup(t,{expose:e}){const n=Yn(pbe),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new cbe(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy()}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",LGt))}}),UGt={"data-vis-component":""},qGt=ae({__name:"index",props:{color:{type:[Function,String,Array,null]},groupWidth:{},groupMaxWidth:{},dataStep:{},groupPadding:{},barPadding:{},roundedCorners:{type:[Number,Boolean]},barMinHeight:{},cursor:{type:[Function,String,null]},orientation:{},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Yn(Lb),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new jye(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy()}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",UGt))}}),jGt={"data-vis-component":""},HGt=ae({__name:"index",props:{color:{type:[Function,String,Array,null]},curveType:{},lineWidth:{},lineDashArray:{type:[Function,Array,null]},fallbackValue:{},highlightOnHover:{type:Boolean},cursor:{type:[Function,String,null]},interpolateMissingData:{type:Boolean},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Yn(Lb),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new xA(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy()}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",jGt))}}),WGt={"data-vis-component":""},KGt=ae({__name:"index",props:{color:{type:[Function,String,Array,null]},size:{type:[Function,Number,null]},sizeScale:{type:[Object,Function]},sizeRange:{},shape:{type:[Function,String]},label:{type:[Function,String,null]},labelColor:{type:[Function,String,Array,null]},labelHideOverlapping:{type:Boolean},cursor:{type:[Function,String,null]},labelTextBrightnessRatio:{},labelPosition:{type:[Function,String,null]},strokeColor:{type:[Function,String,Array,null]},strokeWidth:{type:[Function,Number,null]},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Yn(Lb),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new wA(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy()}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",WGt))}}),GGt={"data-vis-component":""},YGt=ae({__name:"index",props:{color:{type:[Function,String,Array,null]},barWidth:{},barMaxWidth:{},dataStep:{},barPadding:{},roundedCorners:{type:[Number,Boolean]},cursor:{type:[Function,String,null]},barMinHeight1Px:{type:Boolean},barMinHeightZeroValue:{},orientation:{},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Yn(Lb),o=t,r=T(()=>n.data.value??o.data),l=tf(o),a=ue();return Ht(()=>{Vt(()=>{var u;a.value=new Bye(l.value),(u=a.value)==null||u.setData(r.value),n.update(a.value)})}),Xo(()=>{var u;(u=a.value)==null||u.destroy(),n.destroy()}),Qe(l,(u,c)=>{var f;Ap(u,c)||(f=a.value)==null||f.setConfig(l.value)}),Qe(r,()=>{var u;(u=a.value)==null||u.setData(r.value)}),e({component:a}),(u,c)=>(S(),J("div",GGt))}}),JGt={"data-vis-tooltip":""},XGt=ae({__name:"index",props:{components:{},container:{},followCursor:{type:Boolean},allowHover:{type:Boolean},horizontalPlacement:{},horizontalShift:{},verticalPlacement:{},verticalShift:{},triggers:{},attributes:{},className:{},hideDelay:{},showDelay:{},data:{}},setup(t,{expose:e}){const n=Yn(fbe),o=tf(t),r=ue();return Ht(()=>{Vt(()=>{r.value=new vye(o.value),n.update(r.value)})}),Xo(()=>{var l;(l=r.value)==null||l.destroy(),n.destroy()}),Qe(o,(l,a)=>{var u;Ap(l,a)||(u=r.value)==null||u.setConfig(o.value)}),e({component:r}),(l,a)=>(S(),J("div",JGt))}}),QGt=ae({__name:"index",props:{components:{},xScale:{type:[Object,Function]},xDomain:{},xDomainMinConstraint:{},xDomainMaxConstraint:{},xRange:{},yScale:{type:[Object,Function]},yDomain:{},yDomainMinConstraint:{},yDomainMaxConstraint:{},yRange:{},yDirection:{},xAxis:{},yAxis:{},autoMargin:{type:Boolean},tooltip:{},crosshair:{},preventEmptyDomain:{type:[Boolean,null]},scaleByDomain:{type:Boolean},annotations:{},clipPathExtend:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(t,{expose:e}){const n=t,{data:o}=wo(n),r=tf(n),l=ue(),a=ta({components:[],annotations:void 0,crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0}),u=ue();return Qe(o,()=>{l.value&&l.value.setData(o.value,!0)}),Hn(()=>{var c;a.components.map(f=>f.config),(c=l.value)==null||c.updateContainer({...bo(r.value),...bo(a)})}),Ht(()=>{u.value&&(l.value=new TWt(u.value,{...bo(a)},o.value))}),Xo(()=>{var c;return(c=l.value)==null?void 0:c.destroy()}),Tr(Lb,{data:o,update:c=>a.components=[...a.components,c],destroy:()=>{var c;return a.components=(c=a.components)==null?void 0:c.filter(f=>!f.isDestroyed())}}),Tr(mbe,{data:o,update:c=>a[`${c.config.type}Axis`]=c,destroy:c=>{a[`${c}Axis`]=void 0}}),Tr(pbe,{data:o,update:c=>a.crosshair=c,destroy:()=>{a.crosshair=void 0}}),Tr(fbe,{data:o,update:c=>a.tooltip=c,destroy:()=>{a.tooltip=void 0}}),Tr(RGt,{data:o,update:c=>a.annotations=c,destroy:()=>{a.annotations=void 0}}),e({component:l}),(c,f)=>(S(),J("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:u,class:"unovis-xy-container"},[we(c.$slots,"default")],512))}});(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("[data-vis-bullet-legend],[data-vis-flow-legend]{display:block}[data-vis-leaflet-flow-map],[data-vis-leaflet-map]{display:block;position:relative}[data-vis-rolling-pin-legend]{display:block}.unovis-single-container,.unovis-xy-container{display:block;position:relative;width:100%}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const ZGt={class:"flex h-full min-h-[200px] w-full flex-col gap-2"},eYt={key:0,class:"flex flex-1 items-center justify-center text-sm text-zinc-400"},tYt=ae({name:"ShwfedBlockChartXyRuntime",__name:"runtime",props:{block:{required:!0},blockModifiers:{}},emits:["update:block"],setup(t){const e=xt(t,"block"),{locale:n}=Bt(),o=Ft(),r=ue(!1),l=ue({}),a=ue(null),u={linear:Bo.Linear,monotoneX:Bo.MonotoneX,natural:Bo.Natural,basis:Bo.Basis,cardinal:Bo.Cardinal,catmullRom:Bo.CatmullRom,step:Bo.Step,stepAfter:Bo.StepAfter,stepBefore:Bo.StepBefore},c=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],f=T(()=>e.value.y.map((ee,oe)=>ee.color&&ee.color.length>0?ee.color:c[oe%c.length])),p=T(()=>Ke(e.value.caption,n.value)||"");function m(ee){return Ke(ee.label,n.value)||null}function h(){return Pt(o)}async function v(){const ee=h(),oe={},K=[];for(const Y of e.value.dataSources){const R=qt(function*(){let U=pt();return Y.request&&(U=yield*Qr(yield*Dt(Y.request,ee))),yield*Dt(Y.data,{...ee,json:U})});try{oe[Y.name]=await Cn(ao(R,Nr))}catch(U){console.warn("[shwfed-chart-xy] data source failed",Y.name,U),K.push(Y.name),oe[Y.name]=[]}}l.value=oe,a.value=K.length>0?`数据源加载失败:${K.join("、")}`:null}Ht(()=>{r.value=!0,v()}),Qe(()=>e.value.dataSources.map(ee=>`${ee.name}|${ee.request??""}|${ee.data}`).join(`
|
|
688
|
-
`),()=>{v()});function g(ee){return typeof ee=="number"&&Number.isFinite(ee)}function b(ee){if(g(ee))return ee;if(typeof ee=="string"&&ee.trim()!==""){const oe=Number(ee);return Number.isFinite(oe)?oe:void 0}}function x(ee,oe){try{const K=We(Dt(ee,oe));return Array.isArray(K)?K:[]}catch{return[]}}function y(ee,oe){try{return b(We(Dt(ee,oe)))}catch{return}}const _=T(()=>({...h(),...l.value})),k=T(()=>{const ee=_.value,oe=x(e.value.x,ee),K=e.value.y.map(q=>x(q.value,ee)),Y=e.value.y.map(q=>q.size?x(q.size,ee):null),R=oe.length===0?"ordinal":oe.every(q=>q instanceof Date)?"time":oe.every(q=>g(q))?"number":"ordinal",U=new Map;return{records:oe.map((q,ne)=>{const X={__x:ne};return R==="time"?X.__x=q.getTime():R==="number"?X.__x=q:U.set(ne,q==null?"":String(q)),K.forEach((fe,ye)=>{X[`y${ye}`]=b(fe[ne])}),Y.forEach((fe,ye)=>{fe&&(X[`sz${ye}`]=b(fe[ne]))}),X}),xMode:R,xLabels:U}}),w=T(()=>e.value.y.map(ee=>{if(!ee.dash)return;const oe=x(ee.dash,_.value).filter(g);return oe.length>0?oe:void 0})),$=T(()=>e.value.y.map(ee=>ee.width?y(ee.width,_.value):void 0)),C=ee=>ee.__x,E=T(()=>e.value.y.map((ee,oe)=>K=>K[`y${oe}`])),z=T(()=>e.value.y.map((ee,oe)=>ee.size?K=>K[`sz${oe}`]:void 0)),N=T(()=>e.value.y.map((ee,oe)=>({k:oe,s:ee,color:f.value[oe]}))),P=T(()=>N.value.filter(ee=>ee.s.chart==="line")),Q=T(()=>N.value.filter(ee=>ee.s.chart==="area")),W=T(()=>N.value.filter(ee=>ee.s.chart==="scatter"));function Z(ee){const oe=N.value.filter(K=>K.s.chart===ee);return{entries:oe,accessors:oe.map(K=>E.value[K.k]),colors:oe.map(K=>K.color),width:oe[0]?$.value[oe[0].k]:void 0}}const L=T(()=>Z("groupedBar")),F=T(()=>Z("stackedBar")),j=T(()=>{const ee=[];return e.value.y.forEach((oe,K)=>{const Y=m(oe);Y&&ee.push({name:Y,color:f.value[K]})}),ee}),te=T(()=>{const ee=k.value.xMode;if(ee==="ordinal"){const oe=k.value.xLabels;return K=>oe.get(K)??""}if(ee==="time")return oe=>new Date(oe).toLocaleDateString()}),ie=T(()=>{if(k.value.xMode!=="ordinal")return;const ee=[...k.value.xLabels.keys()];if(ee.length<=12)return ee;const oe=Math.ceil(ee.length/10);return ee.filter((K,Y)=>Y%oe===0)});function ve(ee){return Number.isInteger(ee)?String(ee):ee.toFixed(2)}function ge(ee){return ee.replace(/[&<>"]/g,oe=>({"&":"&","<":"<",">":">",'"':"""})[oe]??oe)}function $e(ee){const oe=k.value.xMode,K=oe==="ordinal"?k.value.xLabels.get(ee.__x)??"":oe==="time"?new Date(ee.__x).toLocaleDateString():String(ee.__x),Y=[];e.value.y.forEach((U,V)=>{const q=m(U);if(!q)return;const ne=ee[`y${V}`];Y.push(`<div style="display:flex;align-items:center;gap:6px;padding:1px 0"><span style="width:8px;height:8px;border-radius:9999px;background:${f.value[V]}"></span><span style="color:#3f3f46">${ge(q)}</span><span style="margin-left:auto;font-variant-numeric:tabular-nums;color:#18181b">${ne===void 0?"—":ve(ne)}</span></div>`)});const R=Y.join("");return`<div style="font-size:12px;min-width:160px"><div style="font-weight:600;color:#18181b;margin-bottom:4px">${ge(K)}</div>${R}</div>`}const le=T(()=>a.value?a.value:k.value.records.length===0?"暂无数据":null);return(ee,oe)=>(S(),J("div",ZGt,[le.value?(S(),J("div",eYt,A(le.value),1)):r.value?(S(),J(Me,{key:1},[s(i(QGt),{data:k.value.records,margin:{top:8,right:16,bottom:4,left:8},class:"min-h-0 flex-1"},{default:d(()=>[F.value.entries.length>0?(S(),B(i(YGt),{key:0,x:C,y:F.value.accessors,color:F.value.colors,"bar-width":F.value.width},null,8,["y","color","bar-width"])):be("",!0),L.value.entries.length>0?(S(),B(i(qGt),{key:1,x:C,y:L.value.accessors,color:L.value.colors,"group-width":L.value.width},null,8,["y","color","group-width"])):be("",!0),(S(!0),J(Me,null,Ze(Q.value,K=>(S(),B(i(PGt),{key:K.s.id,x:C,y:E.value[K.k],color:K.color,line:!0,"line-color":K.s.lineColor||K.color,"line-width":K.s.lineWidth},null,8,["y","color","line-color","line-width"]))),128)),(S(!0),J(Me,null,Ze(P.value,K=>(S(),B(i(HGt),{key:K.s.id,x:C,y:E.value[K.k],color:K.color,"curve-type":u[K.s.curveType],"line-width":K.s.lineWidth,"line-dash-array":w.value[K.k]},null,8,["y","color","curve-type","line-width","line-dash-array"]))),128)),(S(!0),J(Me,null,Ze(W.value,K=>(S(),B(i(KGt),{key:K.s.id,x:C,y:E.value[K.k],color:K.color,size:z.value[K.k]},null,8,["y","color","size"]))),128)),s(i(YG),{type:"x","tick-format":te.value,"tick-values":ie.value,"tick-text-hide-overlapping":!0,"grid-line":!1},null,8,["tick-format","tick-values"]),s(i(YG),{type:"y"}),s(i(BGt),{x:C,y:E.value,color:f.value,template:$e},null,8,["y","color"]),s(i(XGt))]),_:1},8,["data"]),j.value.length>0?(S(),B(i(NGt),{key:0,items:j.value,class:"mx-auto w-fit shrink-0 text-xs"},null,8,["items"])):be("",!0),p.value?(S(),B(i(O),{key:1,source:p.value,block:"",class:"prose prose-sm prose-zinc max-w-none shrink-0 text-center"},null,8,["source"])):be("",!0)],64)):be("",!0)]))}}),nYt={class:"flex h-full w-full flex-col items-center justify-center gap-2 text-center"},oYt={class:"flex flex-wrap items-center justify-center gap-4 font-semibold text-zinc-900"},rYt=ae({name:"ShwfedBlockAnimatedNumberRuntime",__name:"runtime",props:{block:{required:!0},blockModifiers:{}},emits:["update:block"],setup(t){const e=Gf(()=>ul(()=>import("./index-CzWhSvDG.js"),[],import.meta.url).then(c=>c.NumberFlowGroup)),n=Gf(()=>ul(()=>import("./item-DHarupON.js"),__vite__mapDeps([9,10]),import.meta.url)),o=xt(t,"block"),{locale:r}=Bt(),l=Ft(),a=ue(!1);Ht(()=>{a.value=!0});const u=T(()=>{const c=Ke(o.value.locale,r.value)||"";return c?Jn(c,Dt,Pt(l)):""});return(c,f)=>(S(),J("div",nYt,[a.value?(S(),B(i(e),{key:0},{default:d(()=>[H("div",oYt,[(S(!0),J(Me,null,Ze(o.value.items,p=>(S(),B(i(n),{key:p.id,item:p},null,8,["item"]))),128))])]),_:1})):be("",!0),u.value?(S(),B(i(O),{key:1,source:u.value,class:"prose prose-sm prose-zinc max-w-none text-xs text-zinc-500"},null,8,["source"])):be("",!0)]))}}),lYt=["onClick"],iYt=ae({name:"ShwfedBlockCardRuntime",__name:"runtime",props:ml({configure:{type:Function}},{block:{required:!0},blockModifiers:{}}),emits:["update:block"],setup(t){const e=Gf(()=>ul(()=>import("./badge-Ddz0ExD-.js"),[],import.meta.url)),n=xt(t,"block"),o=t,r=T(()=>o.configure??(()=>{})),l=Ft();function a(){return Pt(l)}function u(v){if(v)try{const g=We(Dt(v,a()));return g==null?void 0:typeof g=="string"||typeof g=="object"?g:String(g)}catch{return}}const c=T(()=>u(n.value.style)),f=T(()=>{const v=n.value.url;if(!(!v||v.trim().length===0))try{const g=We(Dt(v,a()));return typeof g=="string"&&g?g:void 0}catch(g){console.warn("[shwfed-card] url evaluation failed",g);return}}),p=T(()=>!!n.value.url&&n.value.url.trim().length>0);function m(v,g){!f.value||v.target?.closest('a, button, input, select, textarea, label, [role="button"]')||g(v)}function h(v){n.value={...n.value,slot:v}}return(v,g)=>{const b=Md("ClientOnly"),x=Md("NuxtLink");return S(),B(x,{to:f.value??"",custom:""},{default:d(({navigate:y})=>[H("div",{class:nt(["relative h-full rounded-sm border border-zinc-200 bg-white p-4",p.value?"cursor-pointer":""]),style:vn(c.value),onClick:_=>m(_,y)},[s(b,null,{default:d(()=>[n.value.badge?(S(),B(i(e),{key:0,badge:n.value.badge,class:"absolute -right-2 -top-2 z-10"},null,8,["badge"])):be("",!0)]),_:1}),s(hF,{"slot-value":n.value.slot,configure:r.value,"find-entry":i(zd),"onUpdate:slotValue":g[0]||(g[0]=_=>h(_))},null,8,["slot-value","configure","find-entry"])],14,lYt)]),_:1},8,["to"])}}}),aYt={class:"flex h-full w-full items-center justify-center"},sYt=8,uYt=ae({name:"ShwfedBlockIconRuntime",__name:"runtime",props:ml({configure:{type:Function}},{block:{required:!0},blockModifiers:{}}),emits:["update:block"],setup(t){const e=xt(t,"block"),n=T(()=>e.value.size??sYt),o=T(()=>{const l={fontSize:`calc(${n.value} * 0.25rem)`};return e.value.color&&(l.color=e.value.color),l}),r=T(()=>({padding:`calc(${n.value} * 0.125rem)`,backgroundColor:`color-mix(in srgb, ${e.value.color||"currentColor"} 20%, white)`}));return(l,a)=>(S(),J("div",aYt,[e.value.circle?(S(),J("div",{key:0,class:"flex items-center justify-center rounded-full",style:vn(r.value)},[e.value.icon?(S(),B(i(de),{key:0,icon:e.value.icon,style:vn(o.value)},null,8,["icon","style"])):be("",!0)],4)):e.value.icon?(S(),B(i(de),{key:1,icon:e.value.icon,style:vn(o.value)},null,8,["icon","style"])):be("",!0)]))}}),cYt=Object.assign({"../blocks/2026-05-06/com.shwfed.block.actions/schema.ts":Ubt,"../blocks/2026-05-06/com.shwfed.block.form/schema.ts":k6t,"../blocks/2026-05-06/com.shwfed.block.markdown/schema.ts":$6t,"../blocks/2026-05-06/com.shwfed.block.table/schema.ts":D6t,"../blocks/2026-05-06/com.shwfed.block.tabs/schema.ts":R6t,"../blocks/2026-05-17/com.shwfed.block.chart.xy/schema.ts":B6t,"../blocks/2026-06-01/com.shwfed.block.animated.number/schema.ts":j6t,"../blocks/2026-06-02/com.shwfed.block.card/schema.ts":K6t,"../blocks/2026-06-02/com.shwfed.block.icon/schema.ts":J6t}),dYt=Object.assign({"../blocks/2026-05-06/com.shwfed.block.actions/config.vue":X6t,"../blocks/2026-05-06/com.shwfed.block.form/config.vue":tFt,"../blocks/2026-05-06/com.shwfed.block.markdown/config.vue":oFt,"../blocks/2026-05-06/com.shwfed.block.table/config.vue":jFt,"../blocks/2026-05-06/com.shwfed.block.tabs/config.vue":uNt,"../blocks/2026-05-17/com.shwfed.block.chart.xy/config.vue":CNt,"../blocks/2026-06-01/com.shwfed.block.animated.number/config.vue":FNt,"../blocks/2026-06-02/com.shwfed.block.card/config.vue":YNt,"../blocks/2026-06-02/com.shwfed.block.icon/config.vue":QNt}),fYt=Object.assign({"../blocks/2026-05-06/com.shwfed.block.actions/runtime.vue":ZNt,"../blocks/2026-05-06/com.shwfed.block.form/runtime.vue":nLt,"../blocks/2026-05-06/com.shwfed.block.markdown/runtime.vue":oLt,"../blocks/2026-05-06/com.shwfed.block.table/runtime.vue":zBt,"../blocks/2026-05-06/com.shwfed.block.tabs/runtime.vue":IBt,"../blocks/2026-05-17/com.shwfed.block.chart.xy/runtime.vue":tYt,"../blocks/2026-06-01/com.shwfed.block.animated.number/runtime.vue":rYt,"../blocks/2026-06-02/com.shwfed.block.card/runtime.vue":iYt,"../blocks/2026-06-02/com.shwfed.block.icon/runtime.vue":uYt}),pYt=_2({hostName:"shwfed-config",dirSegment:"blocks",schemaModules:cYt,configModules:dYt,runtimeModules:fYt}),nB=pYt.ENTRIES.map(t=>({type:t.type,compatibilityDate:t.compatibilityDate,metadata:t.module.metadata,schema:t.module.schema,defaultBody:t.module.defaultBody,config:t.config,runtime:t.runtime})),JG=new WeakMap;function mYt(t){const e=JG.get(t);if(e)return e;const n={blockRef:null,members:null,union:null};return n.blockRef=HE(()=>{if(!n.union)throw new Error("[shwfed-config] BlockRef resolved before union built — circular factory init");return n.union}).annotations({identifier:"PageBlock"}),JG.set(t,n),Zyt(t,n.blockRef),n.members=nB.map(o=>o.schema(t,n.blockRef).annotations({identifier:`${o.type}@${o.compatibilityDate}`})),n.union=n.members.length===1?n.members[0]:oo(...n.members),n}function hYt(t){return mYt(t).blockRef}function zd(t,e){return nB.find(n=>n.type===t&&n.compatibilityDate===e)}tbt(zd);const hbe="shwfed.component.page",vbe="00000000-0000-0000-0000-000000000000",sO={name:"页面",icon:"fluent:document-20-regular",operations:[{id:"close",name:"关闭标签页",icon:"fluent:dismiss-20-regular"}]};function gbe(t){const e=hYt(t).annotations({identifier:"PageBlock",description:"页面块,由 `type` 字段区分类型"}),n=D3(e,t),o=et({configure:t,resultType:r=>r==="string"||r==="dyn"||r.startsWith("map")||r.startsWith("optional")});return Ge({kind:Al(hbe),title:re(at).annotations({title:"标题",description:"页面标题(内联本地化文本,无 Markdown);设置后用于浏览器标签页标题,按当前语言取对应文案,留空则不设置"}),style:re(o).annotations({title:"样式",description:"返回应用在页面根元素上的样式的 CEL 表达式,可返回 CSS 字符串(如 `'padding: 2rem'`)或样式对象(如 `{'padding': '2rem'}`);留空则不设额外样式"}),slot:n}).annotations({title:"PageConfig",description:"页面组件完整配置"})}function vYt(){return{slot:_y()}}function gYt(t){return{kind:hbe,...vYt(),...t}}const yYt={class:"relative flex min-w-0 flex-col"},bYt={class:"flex gap-2 min-h-128"},xYt={class:"flex w-64 shrink-0 flex-col"},_Yt={class:"flex flex-1 flex-col gap-2"},wYt={class:"flex-1"},kYt={key:0},SYt={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},CYt={key:1},$Yt={key:2,class:"p-6 text-sm text-red-500"},TYt=ae({name:"ShwfedConfigConfig",__name:"config",props:{state:{}},setup(t){const e=t,n=ue("content");function o(){n.value="general"}function r(F){b.value=F,n.value="content"}const l=gbe(()=>{}),a=Nt(l,"title")??"标题",u=Lt(l,"title"),c=Nt(l,"style")??"样式",f=Lt(l,"style");function p(F){return!F||F.every(j=>j.message.trim().length===0)}const m=T({get:()=>e.state.draft.value.title,set:F=>{e.state.draft.value={...e.state.draft.value,title:p(F)?void 0:F}}}),h=T({get:()=>e.state.draft.value.style??"",set:F=>{const j=F.trim();e.state.draft.value={...e.state.draft.value,style:j.length>0?F:void 0}}}),v=T({get:()=>e.state.layouts.value,set:F=>{e.state.layouts.value=F}}),g=T({get:()=>e.state.selectedBlockIds.value,set:F=>{e.state.selectedBlockIds.value=F}}),b=T({get:()=>e.state.activeLayoutIndex.value,set:F=>{e.state.activeLayoutIndex.value=F}}),x=nm(()=>e.state.blocks.value),y=nm(()=>e.state.top.value),_=nm(()=>e.state.activeBlock.value),k=nm(()=>e.state.activeBlockEntry.value),w=nm(()=>e.state.pickerEntries.value);Tr(Vb,{add:e.state.addCrumb,addParentSuffix:e.state.addParentSuffix});const $=T(()=>({instanceId:vbe,typeName:sO.name,typeIcon:sO.icon,operations:sO.operations}));K3($);const C=Xv("sidebarRef");function E(){C.value?.addLayout()}function z(F,j){e.state.addBlock(F,j)}function N(F){e.state.onDrillDown(F)}async function P(F){const j=new Set(F),te=e.state.blocks.value.filter(ge=>j.has(ge.id));if(te.length===0)return;const ie=v.value[b.value],ve={};if(ie)for(const ge of F){const $e=ie.layout.placements[ge];$e&&(ve[ge]=$e)}if(!await Pue("block",te,ve)){Io.error("复制失败");return}Io.success(`已复制 ${te.length} 个块`)}async function Q(F){const j=await Fue();if(!j||j.surface!=="block")return;const{items:te,placements:ie}=Vue(j.items,j.placements),ve=te;ve.length!==0&&(ie&&Object.keys(ie).length>0?e.state.addBlocksWithPlacements(ve,ie,F):e.state.addBlocks(ve),Io.success(`已粘贴 ${ve.length} 个块`))}function W(F){e.state.updateActiveBlock(F)}function Z(F){return e.state.getBlockLabel(F)}function L(F,j){return e.state.findBlockMeta(F,j)}return(F,j)=>(S(),J("div",yYt,[Ba(H("div",bYt,[H("div",xYt,[H("div",{class:nt(["row pl-2",n.value==="general"?"bg-[color-mix(in_srgb,var(--primary)_10%,white)] text-(--primary)":"text-zinc-700 hover:bg-zinc-50"]),onClick:j[0]||(j[0]=te=>o())},[s(i(de),{icon:"fluent:settings-20-regular",class:"size-4 shrink-0"}),j[13]||(j[13]=H("span",{class:"flex-1 truncate"},"通用配置",-1))],2),s(i(jn),{class:"my-2"}),s(i(Xa),{class:"flex-1"},{default:d(()=>[s(I_,{ref_key:"sidebarRef",ref:C,modelValue:v.value,"onUpdate:modelValue":j[1]||(j[1]=te=>v.value=te),"active-index":b.value,"onUpdate:activeIndex":j[2]||(j[2]=te=>b.value=te),active:n.value!=="general",onSelect:r},null,8,["modelValue","active-index","active"])]),_:1}),s(i(wn),{variant:"ghost",size:"sm",onClick:j[3]||(j[3]=te=>E())},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular",class:"size-4"}),j[14]||(j[14]=H("span",null,"新增布局",-1))]),_:1})]),H("div",_Yt,[n.value==="general"?(S(),J(Me,{key:0},[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(i(a)),1)]),_:2},[i(u)?{name:"tooltip",fn:d(()=>[s(i(O),{source:i(u),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":m.value,"translate-hint":"page tab title","onUpdate:modelValue":j[4]||(j[4]=te=>{m.value=te})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(i(c)),1)]),_:2},[i(f)?{name:"tooltip",fn:d(()=>[s(i(O),{source:i(f),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:h.value,"onUpdate:modelValue":j[5]||(j[5]=te=>h.value=te),placeholder:"返回 CSS 字符串或样式对象的表达式,如 'padding: 2rem'",multiline:"",class:"min-h-16"},null,8,["modelValue"])]),_:1})],64)):(S(),J(Me,{key:1},[s(W3,{modelValue:v.value,"onUpdate:modelValue":j[6]||(j[6]=te=>v.value=te),index:b.value},null,8,["modelValue","index"]),H("div",wYt,[s(O3,{modelValue:v.value,"onUpdate:modelValue":j[7]||(j[7]=te=>v.value=te),"active-index":b.value,"onUpdate:activeIndex":j[8]||(j[8]=te=>b.value=te),"selected-item-ids":g.value,"onUpdate:selectedItemIds":j[9]||(j[9]=te=>g.value=te),items:x.value,"find-entry":L,"get-item-label":Z,"picker-entries":w.value,"can-delete":!0,"item-noun":"块",onAddNew:z,onDrillDown:N,onDeleteItem:j[10]||(j[10]=te=>e.state.removeBlock(te)),onDeleteItems:j[11]||(j[11]=te=>e.state.removeBlocks(te)),onCopyItems:P,onPaste:Q},null,8,["modelValue","active-index","selected-item-ids","items","picker-entries"])])],64))])],512),[[c5,y.value.kind==="layout"]]),y.value.kind==="block"?(S(),J("div",kYt,[_.value?k.value?(S(),J("div",CYt,[(S(),B(qo(k.value.config),{"model-value":_.value,configure:e.state.configure,"onUpdate:modelValue":j[12]||(j[12]=te=>W(te))},null,8,["model-value","configure"]))])):(S(),J("div",$Yt," 未注册的块类型:"+A(_.value.type)+"@"+A(_.value.compatibilityDate),1)):(S(),J("div",SYt," 块已不存在 "))])):be("",!0)]))}}),EYt=Ns(TYt,[["__scopeId","data-v-37d1bedd"]]),AYt=ae({name:"UiBreadcrumb",__name:"Breadcrumb",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("nav",{"data-slot":"breadcrumb","aria-label":"breadcrumb",class:nt(i(dt)("",e.class))},[we(n.$slots,"default")],2))}}),DYt=ae({name:"UiBreadcrumbItem",__name:"BreadcrumbItem",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("li",{"data-slot":"breadcrumb-item",class:nt(i(dt)("inline-flex items-center gap-1.5",e.class))},[we(n.$slots,"default")],2))}}),XG=ae({name:"UiBreadcrumbLink",__name:"BreadcrumbLink",props:{asChild:{type:Boolean},as:{default:"a"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(vt),Be({"data-slot":"breadcrumb-link"},i(o),{class:i(dt)("cursor-default transition-colors duration-180 hover:text-(--primary)",e.class)}),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),zYt=ae({name:"UiBreadcrumbList",__name:"BreadcrumbList",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("ol",{"data-slot":"breadcrumb-list",class:nt(i(dt)("flex flex-wrap items-center gap-1.5 text-sm text-zinc-500 break-words sm:gap-2.5",e.class))},[we(n.$slots,"default")],2))}}),OYt=ae({name:"UiBreadcrumbPage",__name:"BreadcrumbPage",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",class:nt(i(dt)("text-zinc-900 font-normal",e.class))},[we(n.$slots,"default")],2))}}),MYt=ae({name:"UiBreadcrumbSeparator",__name:"BreadcrumbSeparator",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",class:nt(i(dt)("text-zinc-400 [&>svg]:size-3.5",e.class))},[we(n.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-right-20-regular"})])],2))}}),IYt={key:3,class:"text-zinc-500"},RYt=ae({name:"ShwfedConfigEditorBreadcrumb",__name:"breadcrumb",props:{state:{}},setup(t){const e=t,n=nm(()=>e.state.breadcrumbs.value);return(o,r)=>(S(),B(i(AYt),null,{default:d(()=>[s(i(zYt),null,{default:d(()=>[(S(!0),J(Me,null,Ze(n.value,(l,a)=>(S(),J(Me,{key:a},[s(i(DYt),null,{default:d(()=>[a===n.value.length-1?(S(),B(i(OYt),{key:0,class:"font-bold"},{default:d(()=>[D(A(l.label),1)]),_:2},1024)):l.kind!=="sub"?(S(),B(i(XG),{key:1,as:"button",type:"button",class:"cursor-pointer text-zinc-500",onClick:u=>e.state.goTo(l.index)},{default:d(()=>[D(A(l.label),1)]),_:2},1032,["onClick"])):l.clickable?(S(),B(i(XG),{key:2,as:"button",type:"button",class:"cursor-pointer text-zinc-500",onClick:u=>e.state.goToSub(l.subIndex)},{default:d(()=>[D(A(l.label),1)]),_:2},1032,["onClick"])):(S(),J("span",IYt,A(l.label),1))]),_:2},1024),a<n.value.length-1?(S(),B(i(MYt),{key:0})):be("",!0)],64))),128))]),_:1})]),_:1}))}}),VYt={class:"flex w-full items-center justify-between gap-3"},PYt={class:"flex flex-1 flex-col gap-1 text-xs"},FYt={key:0,class:"text-red-500 break-all"},NYt=ae({name:"ShwfedConfigEditorFooter",__name:"footer",props:{state:{}},emits:["close"],setup(t,{emit:e}){const n=t,o=e;function r(){n.state.dismiss(),o("close")}function l(){const a=n.state.isDirty.value,u=n.state.validationError.value;n.state.confirm();const c=n.state.validationError.value;c&&c!==u||(!a||!c)&&o("close")}return(a,u)=>(S(),J("div",VYt,[H("div",PYt,[n.state.validationError.value?(S(),J("span",FYt,A(n.state.validationError.value),1)):be("",!0)]),n.state.stack.value.length>1?(S(),B(i(wn),{key:0,type:"button",variant:"default",size:"sm",onClick:u[0]||(u[0]=c=>n.state.popOne())},{default:d(()=>[s(i(de),{icon:"fluent:arrow-left-20-regular"}),u[1]||(u[1]=D(" 返回 ",-1))]),_:1})):(S(),J(Me,{key:1},[s(i(wn),{type:"button",variant:"default",size:"sm",onClick:r},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"}),u[2]||(u[2]=D(" 取消 ",-1))]),_:1}),s(i(wn),{type:"button",variant:"primary",size:"sm",onClick:l},{default:d(()=>[s(i(de),{icon:"fluent:checkmark-20-regular"}),u[3]||(u[3]=D(" 确认 ",-1))]),_:1})],64))]))}}),LYt=ae({name:"ShwfedConfig",__name:"index",props:ml({configure:{type:Function},editable:{type:Boolean}},{config:{},configModifiers:{}}),emits:["update:config"],setup(t){const e=xt(t,"config"),n=T({get:()=>e.value??gYt(),set:g=>{e.value=g}}),o=t,r=Ft(),l=o.configure??(()=>{}),a=g=>{l(g);const b=new Set(g.getDefinitions().variables.map(x=>x.name));for(const[x,y]of Object.entries(r))b.has(x)||g.registerVariable(x,y.type,{description:y.description,label:y.label})};class u{_tag="PageClosed"}jF(vbe,{close:()=>qt(function*(){return window.close(),yield*y_(new u)})});const c=ue(!1),f=KFt(n,{configure:a,onClose:()=>{c.value=!1}});Qe(c,(g,b)=>{g&&!b&&f.reset()});function p(g){o.editable&&(!g.metaKey&&!g.ctrlKey||(g.preventDefault(),g.stopPropagation(),c.value=!0))}function m(g){n.value={...n.value,slot:g}}const h=T(()=>{const g=n.value.style;if(g)try{const b=We(Dt(g,Pt(r)));return b==null?void 0:typeof b=="string"||typeof b=="object"?b:String(b)}catch{return}}),{locale:v}=Bt({useScope:"global",inheritLocale:!0});return(g,b)=>{const x=Md("ClientOnly");return S(),B(x,null,{default:d(()=>[H("div",{class:nt(h.value?"":"contents"),style:vn(h.value),onClickCapture:p},[s(hF,{"slot-value":n.value.slot,configure:a,"find-entry":i(zd),"onUpdate:slotValue":m},G({_:2},[t.editable?{name:"empty",fn:d(()=>[b[2]||(b[2]=D(" meta+click 进入编辑 ",-1))]),key:"0"}:void 0]),1032,["slot-value","find-entry"])],38),t.editable?(S(),B(_se,{key:0,open:c.value,"onUpdate:open":b[1]||(b[1]=y=>c.value=y),"content-width":"90vw",dismissible:!0},{title:d(()=>[s(RYt,{state:i(f)},null,8,["state"])]),description:d(()=>[...b[3]||(b[3]=[H("span",{class:"sr-only"},"编辑页面布局与块配置",-1)])]),footer:d(()=>[s(NYt,{state:i(f),onClose:b[0]||(b[0]=y=>c.value=!1)},null,8,["state"])]),default:d(()=>[s(EYt,{state:i(f)},null,8,["state"])]),_:1},8,["open"])):be("",!0)]),_:1})}}}),ybe="shwfed:preview:cel-vars";function BYt(){try{const t=localStorage.getItem(ybe);if(!t)return{};const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function UYt(t){try{localStorage.setItem(ybe,JSON.stringify(t))}catch{}}const QT=ue(BYt());function qYt(t){QT.value=t,UYt(t)}const jYt=T(()=>{const t={};for(const[e,n]of Object.entries(QT.value))t[e]={type:HYt(n),label:e,value:n};return t});function HYt(t){if(t===null)return"null";if(Array.isArray(t))return"list";switch(typeof t){case"string":return"string";case"number":return Number.isInteger(t)?"int":"double";case"boolean":return"bool";case"object":return"map";default:return"dyn"}}const WYt={class:"fixed bottom-4 right-4 z-50 pointer-events-auto","data-slot":"cel-vars-affix"},KYt={key:0,class:"rounded bg-zinc-100 px-1.5 py-0.5 font-mono text-[10px] leading-none text-zinc-600"},GYt={class:"flex flex-col gap-2 max-h-[60vh] overflow-y-auto"},YYt={key:0,class:"mt-1 pl-28 text-xs text-red-500"},JYt={class:"flex justify-end gap-2 pt-2"},XYt=ae({name:"CelVarsAffix",__name:"cel-vars-affix",setup(t){let e=0;function n(h="",v=void 0){return{id:e++,key:h,valueText:v===void 0?"":JSON.stringify(v),error:null}}const o=ue(!1),r=ue([]);Qe(o,h=>{h&&(r.value=Object.entries(QT.value).map(([v,g])=>n(v,g)))});const l=T(()=>{const h=new Map,v=new Set;for(const g of r.value){if(!g.key)continue;const b=(h.get(g.key)??0)+1;h.set(g.key,b),b>1&&v.add(g.key)}return v});function a(h){if(h.valueText.length===0){h.error=null;return}try{JSON.parse(h.valueText),h.error=null}catch(v){h.error=v instanceof Error?v.message:String(v)}}function u(){r.value.push(n())}function c(h){r.value=r.value.filter(v=>v.id!==h)}const f=T(()=>r.value.every(h=>!h.error));function p(){if(!f.value)return;const h={};for(const v of r.value)if(v.key&&v.valueText.length!==0)try{h[v.key]=JSON.parse(v.valueText)}catch{return}qYt(h),window.location.reload()}const m=T(()=>Object.keys(QT.value).length);return(h,v)=>(S(),J("div",WYt,[s(i(wn),{variant:"default",size:"sm","aria-label":"Edit CEL variables",onClick:v[0]||(v[0]=g=>o.value=!0)},{default:d(()=>[s(i(de),{icon:"fluent:braces-variable-20-regular"}),v[3]||(v[3]=D(" CEL 变量 ",-1)),m.value>0?(S(),J("span",KYt,A(m.value),1)):be("",!0)]),_:1}),s(i(qae),{open:o.value,"onUpdate:open":v[2]||(v[2]=g=>o.value=g)},{default:d(()=>[s(i(xot),{class:"max-w-xl"},{default:d(()=>[s(i(ase),null,{default:d(()=>[s(i(sse),null,{default:d(()=>[...v[4]||(v[4]=[D("CEL 变量",-1)])]),_:1}),s(i(ise),null,{default:d(()=>[...v[5]||(v[5]=[D(" 键名是 CEL 表达式中引用的变量名,值是合法的 JSON。仅在此浏览器本地保存。 ",-1)])]),_:1})]),_:1}),H("div",GYt,[(S(!0),J(Me,null,Ze(r.value,g=>(S(),J("div",{key:g.id},[s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:g.key,"onUpdate:modelValue":b=>g.key=b,placeholder:"token",class:"w-28 max-w-28 font-mono","aria-invalid":l.value.has(g.key)||void 0},null,8,["modelValue","onUpdate:modelValue","aria-invalid"]),v[6]||(v[6]=H("div",{"aria-hidden":"true",class:"self-stretch w-px my-1.5 bg-zinc-200"},null,-1)),s(i(Xe),{modelValue:g.valueText,"onUpdate:modelValue":b=>g.valueText=b,placeholder:'"..." | 42 | { ... }',class:"font-mono text-xs","aria-invalid":!!g.error||void 0,onBlur:b=>a(g)},null,8,["modelValue","onUpdate:modelValue","aria-invalid","onBlur"]),s(i(Ye),{align:"inline-end"},{default:d(()=>[s(i(ot),{size:"icon-xs","aria-label":"Remove",onClick:b=>c(g.id)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024),g.error?(S(),J("div",YYt,A(g.error),1)):be("",!0)]))),128)),s(i(wn),{variant:"default",class:"w-full",onClick:u},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),v[7]||(v[7]=D(" 添加 ",-1))]),_:1})]),H("div",JYt,[s(i(wn),{variant:"default",onClick:v[1]||(v[1]=g=>o.value=!1)},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"}),v[8]||(v[8]=D(" 取消 ",-1))]),_:1}),s(i(wn),{variant:"primary",disabled:!f.value,onClick:p},{default:d(()=>[s(i(de),{icon:"fluent:checkmark-20-regular"}),v[9]||(v[9]=D(" 应用 ",-1))]),_:1},8,["disabled"])])]),_:1})]),_:1},8,["open"])]))}}),QYt={class:"min-h-screen p-4"},ZYt=ae({__name:"App",setup(t){const e=J7e("shwfed:preview:page-config",null,{serializer:Gle.object});return l5(()=>{const n=globalThis.__SHWFED_PREVIEW_CONFIG__;n!==void 0&&(e.value=n??null)}),Ia(jYt.value),(n,o)=>(S(),B(cst,null,{default:d(()=>[H("div",QYt,[s(LYt,{config:i(e),"onUpdate:config":o[0]||(o[0]=r=>Kt(e)?e.value=r:null),editable:!0},null,8,["config"])]),s(XYt)]),_:1}))}}),bbe=Rwe({locale:navigator?.language,fallbackWarn:!1,fallbackLocale:"zh",globalInjection:!1});Fu.setDefaultHeader("Accept-Language",()=>bbe.global.locale.value);Fxe(ZYt).use(bbe).mount("#app");export{Xd as $,Be as A,Hn as B,fo as C,Tr as D,Vt as E,Xo as F,Bt as G,d as H,s as I,O as J,Me as K,be as L,Ke as M,Jn as N,nt as O,dt as P,xt as Q,Byt as R,H as S,M as T,I as U,G as V,D as W,A as X,_e as Y,Ve as Z,rFt as _,S as a,J$t as a$,Ed as a0,Z4 as a1,Ze as a2,p1 as a3,m1 as a4,jyt as a5,HF as a6,bfe as a7,Ye as a8,de as a9,abt as aA,cbt as aB,V4 as aC,pbt as aD,$c as aE,NJt as aF,zJt as aG,LJt as aH,Jd as aI,Fl as aJ,$P as aK,So as aL,Zt as aM,y0 as aN,Vyt as aO,DJt as aP,on as aQ,hF as aR,Ia as aS,W4 as aT,I4 as aU,Zn as aV,Io as aW,Xn as aX,tje as aY,f8 as aZ,d8 as a_,z3 as aa,Hr as ab,Fr as ac,Fe as ad,Xyt as ae,Vn as af,Nn as ag,Ln as ah,Pn as ai,Fn as aj,obt as ak,uL as al,_r as am,uw as an,qo as ao,W3 as ap,O3 as aq,ml as ar,I_ as as,Xa as at,wn as au,Mb as av,_y as aw,FJt as ax,Vb as ay,j4 as az,i as b,vbt as b0,DBt as b1,NN as b2,BJt as b3,UJt as b4,B as c,ae as d,T as e,Qr as f,qt as g,Dt as h,Vl as i,Cn as j,TJt as k,Nr as l,Pt as m,vn as n,Ht as o,ao as p,pt as q,ue as r,Ft as s,We as t,$Jt as u,bt as v,Qe as w,we as x,Yn as y,J as z};
|
|
686
|
+
`),()=>{v()});function g(ee){return typeof ee=="number"&&Number.isFinite(ee)}function b(ee){if(g(ee))return ee;if(typeof ee=="string"&&ee.trim()!==""){const oe=Number(ee);return Number.isFinite(oe)?oe:void 0}}function x(ee,oe){try{const K=We(Dt(ee,oe));return Array.isArray(K)?K:[]}catch{return[]}}function y(ee,oe){try{return b(We(Dt(ee,oe)))}catch{return}}const _=T(()=>({...h(),...l.value})),k=T(()=>{const ee=_.value,oe=x(e.value.x,ee),K=e.value.y.map(q=>x(q.value,ee)),Y=e.value.y.map(q=>q.size?x(q.size,ee):null),R=oe.length===0?"ordinal":oe.every(q=>q instanceof Date)?"time":oe.every(q=>g(q))?"number":"ordinal",U=new Map;return{records:oe.map((q,ne)=>{const X={__x:ne};return R==="time"?X.__x=q.getTime():R==="number"?X.__x=q:U.set(ne,q==null?"":String(q)),K.forEach((fe,ye)=>{X[`y${ye}`]=b(fe[ne])}),Y.forEach((fe,ye)=>{fe&&(X[`sz${ye}`]=b(fe[ne]))}),X}),xMode:R,xLabels:U}}),w=T(()=>e.value.y.map(ee=>{if(!ee.dash)return;const oe=x(ee.dash,_.value).filter(g);return oe.length>0?oe:void 0})),$=T(()=>e.value.y.map(ee=>ee.width?y(ee.width,_.value):void 0)),C=ee=>ee.__x,E=T(()=>e.value.y.map((ee,oe)=>K=>K[`y${oe}`])),z=T(()=>e.value.y.map((ee,oe)=>ee.size?K=>K[`sz${oe}`]:void 0)),N=T(()=>e.value.y.map((ee,oe)=>({k:oe,s:ee,color:f.value[oe]}))),P=T(()=>N.value.filter(ee=>ee.s.chart==="line")),Q=T(()=>N.value.filter(ee=>ee.s.chart==="area")),W=T(()=>N.value.filter(ee=>ee.s.chart==="scatter"));function Z(ee){const oe=N.value.filter(K=>K.s.chart===ee);return{entries:oe,accessors:oe.map(K=>E.value[K.k]),colors:oe.map(K=>K.color),width:oe[0]?$.value[oe[0].k]:void 0}}const L=T(()=>Z("groupedBar")),F=T(()=>Z("stackedBar")),j=T(()=>{const ee=[];return e.value.y.forEach((oe,K)=>{const Y=m(oe);Y&&ee.push({name:Y,color:f.value[K]})}),ee}),te=T(()=>{const ee=k.value.xMode;if(ee==="ordinal"){const oe=k.value.xLabels;return K=>oe.get(K)??""}if(ee==="time")return oe=>new Date(oe).toLocaleDateString()}),ie=T(()=>{if(k.value.xMode!=="ordinal")return;const ee=[...k.value.xLabels.keys()];if(ee.length<=12)return ee;const oe=Math.ceil(ee.length/10);return ee.filter((K,Y)=>Y%oe===0)});function ve(ee){return Number.isInteger(ee)?String(ee):ee.toFixed(2)}function ge(ee){return ee.replace(/[&<>"]/g,oe=>({"&":"&","<":"<",">":">",'"':"""})[oe]??oe)}function $e(ee){const oe=k.value.xMode,K=oe==="ordinal"?k.value.xLabels.get(ee.__x)??"":oe==="time"?new Date(ee.__x).toLocaleDateString():String(ee.__x),Y=[];e.value.y.forEach((U,V)=>{const q=m(U);if(!q)return;const ne=ee[`y${V}`];Y.push(`<div style="display:flex;align-items:center;gap:6px;padding:1px 0"><span style="width:8px;height:8px;border-radius:9999px;background:${f.value[V]}"></span><span style="color:#3f3f46">${ge(q)}</span><span style="margin-left:auto;font-variant-numeric:tabular-nums;color:#18181b">${ne===void 0?"—":ve(ne)}</span></div>`)});const R=Y.join("");return`<div style="font-size:12px;min-width:160px"><div style="font-weight:600;color:#18181b;margin-bottom:4px">${ge(K)}</div>${R}</div>`}const le=T(()=>a.value?a.value:k.value.records.length===0?"暂无数据":null);return(ee,oe)=>(S(),J("div",ZGt,[le.value?(S(),J("div",eYt,A(le.value),1)):r.value?(S(),J(Me,{key:1},[s(i(QGt),{data:k.value.records,margin:{top:8,right:16,bottom:4,left:8},class:"min-h-0 flex-1"},{default:d(()=>[F.value.entries.length>0?(S(),B(i(YGt),{key:0,x:C,y:F.value.accessors,color:F.value.colors,"bar-width":F.value.width},null,8,["y","color","bar-width"])):be("",!0),L.value.entries.length>0?(S(),B(i(qGt),{key:1,x:C,y:L.value.accessors,color:L.value.colors,"group-width":L.value.width},null,8,["y","color","group-width"])):be("",!0),(S(!0),J(Me,null,Ze(Q.value,K=>(S(),B(i(PGt),{key:K.s.id,x:C,y:E.value[K.k],color:K.color,line:!0,"line-color":K.s.lineColor||K.color,"line-width":K.s.lineWidth},null,8,["y","color","line-color","line-width"]))),128)),(S(!0),J(Me,null,Ze(P.value,K=>(S(),B(i(HGt),{key:K.s.id,x:C,y:E.value[K.k],color:K.color,"curve-type":u[K.s.curveType],"line-width":K.s.lineWidth,"line-dash-array":w.value[K.k]},null,8,["y","color","curve-type","line-width","line-dash-array"]))),128)),(S(!0),J(Me,null,Ze(W.value,K=>(S(),B(i(KGt),{key:K.s.id,x:C,y:E.value[K.k],color:K.color,size:z.value[K.k]},null,8,["y","color","size"]))),128)),s(i(YG),{type:"x","tick-format":te.value,"tick-values":ie.value,"tick-text-hide-overlapping":!0,"grid-line":!1},null,8,["tick-format","tick-values"]),s(i(YG),{type:"y"}),s(i(BGt),{x:C,y:E.value,color:f.value,template:$e},null,8,["y","color"]),s(i(XGt))]),_:1},8,["data"]),j.value.length>0?(S(),B(i(NGt),{key:0,items:j.value,class:"mx-auto w-fit shrink-0 text-xs"},null,8,["items"])):be("",!0),p.value?(S(),B(i(O),{key:1,source:p.value,block:"",class:"prose prose-sm prose-zinc max-w-none shrink-0 text-center"},null,8,["source"])):be("",!0)],64)):be("",!0)]))}}),nYt={class:"flex h-full w-full flex-col items-center justify-center gap-2 text-center"},oYt={class:"flex flex-wrap items-center justify-center gap-4 font-semibold text-zinc-900"},rYt=ae({name:"ShwfedBlockAnimatedNumberRuntime",__name:"runtime",props:{block:{required:!0},blockModifiers:{}},emits:["update:block"],setup(t){const e=Gf(()=>ul(()=>import("./index-BZ2cMq0s.js"),[],import.meta.url).then(c=>c.NumberFlowGroup)),n=Gf(()=>ul(()=>import("./item-BTENoFeS.js"),__vite__mapDeps([9,10]),import.meta.url)),o=xt(t,"block"),{locale:r}=Bt(),l=Ft(),a=ue(!1);Ht(()=>{a.value=!0});const u=T(()=>{const c=Ke(o.value.locale,r.value)||"";return c?Jn(c,Dt,Pt(l)):""});return(c,f)=>(S(),J("div",nYt,[a.value?(S(),B(i(e),{key:0},{default:d(()=>[H("div",oYt,[(S(!0),J(Me,null,Ze(o.value.items,p=>(S(),B(i(n),{key:p.id,item:p},null,8,["item"]))),128))])]),_:1})):be("",!0),u.value?(S(),B(i(O),{key:1,source:u.value,class:"prose prose-sm prose-zinc max-w-none text-xs text-zinc-500"},null,8,["source"])):be("",!0)]))}}),lYt=["onClick"],iYt=ae({name:"ShwfedBlockCardRuntime",__name:"runtime",props:ml({configure:{type:Function}},{block:{required:!0},blockModifiers:{}}),emits:["update:block"],setup(t){const e=Gf(()=>ul(()=>import("./badge-BfeJsmpt.js"),[],import.meta.url)),n=xt(t,"block"),o=t,r=T(()=>o.configure??(()=>{})),l=Ft();function a(){return Pt(l)}function u(v){if(v)try{const g=We(Dt(v,a()));return g==null?void 0:typeof g=="string"||typeof g=="object"?g:String(g)}catch{return}}const c=T(()=>u(n.value.style)),f=T(()=>{const v=n.value.url;if(!(!v||v.trim().length===0))try{const g=We(Dt(v,a()));return typeof g=="string"&&g?g:void 0}catch(g){console.warn("[shwfed-card] url evaluation failed",g);return}}),p=T(()=>!!n.value.url&&n.value.url.trim().length>0);function m(v,g){!f.value||v.target?.closest('a, button, input, select, textarea, label, [role="button"]')||g(v)}function h(v){n.value={...n.value,slot:v}}return(v,g)=>{const b=Md("ClientOnly"),x=Md("NuxtLink");return S(),B(x,{to:f.value??"",custom:""},{default:d(({navigate:y})=>[H("div",{class:nt(["relative h-full rounded-sm border border-zinc-200 bg-white p-4",p.value?"cursor-pointer":""]),style:vn(c.value),onClick:_=>m(_,y)},[s(b,null,{default:d(()=>[n.value.badge?(S(),B(i(e),{key:0,badge:n.value.badge,class:"absolute -right-2 -top-2 z-10"},null,8,["badge"])):be("",!0)]),_:1}),s(hF,{"slot-value":n.value.slot,configure:r.value,"find-entry":i(zd),"onUpdate:slotValue":g[0]||(g[0]=_=>h(_))},null,8,["slot-value","configure","find-entry"])],14,lYt)]),_:1},8,["to"])}}}),aYt={class:"flex h-full w-full items-center justify-center"},sYt=8,uYt=ae({name:"ShwfedBlockIconRuntime",__name:"runtime",props:ml({configure:{type:Function}},{block:{required:!0},blockModifiers:{}}),emits:["update:block"],setup(t){const e=xt(t,"block"),n=T(()=>e.value.size??sYt),o=T(()=>{const l={fontSize:`calc(${n.value} * 0.25rem)`};return e.value.color&&(l.color=e.value.color),l}),r=T(()=>({padding:`calc(${n.value} * 0.125rem)`,backgroundColor:`color-mix(in srgb, ${e.value.color||"currentColor"} 20%, white)`}));return(l,a)=>(S(),J("div",aYt,[e.value.circle?(S(),J("div",{key:0,class:"flex items-center justify-center rounded-full",style:vn(r.value)},[e.value.icon?(S(),B(i(de),{key:0,icon:e.value.icon,style:vn(o.value)},null,8,["icon","style"])):be("",!0)],4)):e.value.icon?(S(),B(i(de),{key:1,icon:e.value.icon,style:vn(o.value)},null,8,["icon","style"])):be("",!0)]))}}),cYt=Object.assign({"../blocks/2026-05-06/com.shwfed.block.actions/schema.ts":Ubt,"../blocks/2026-05-06/com.shwfed.block.form/schema.ts":k6t,"../blocks/2026-05-06/com.shwfed.block.markdown/schema.ts":$6t,"../blocks/2026-05-06/com.shwfed.block.table/schema.ts":D6t,"../blocks/2026-05-06/com.shwfed.block.tabs/schema.ts":R6t,"../blocks/2026-05-17/com.shwfed.block.chart.xy/schema.ts":B6t,"../blocks/2026-06-01/com.shwfed.block.animated.number/schema.ts":j6t,"../blocks/2026-06-02/com.shwfed.block.card/schema.ts":K6t,"../blocks/2026-06-02/com.shwfed.block.icon/schema.ts":J6t}),dYt=Object.assign({"../blocks/2026-05-06/com.shwfed.block.actions/config.vue":X6t,"../blocks/2026-05-06/com.shwfed.block.form/config.vue":tFt,"../blocks/2026-05-06/com.shwfed.block.markdown/config.vue":oFt,"../blocks/2026-05-06/com.shwfed.block.table/config.vue":jFt,"../blocks/2026-05-06/com.shwfed.block.tabs/config.vue":uNt,"../blocks/2026-05-17/com.shwfed.block.chart.xy/config.vue":CNt,"../blocks/2026-06-01/com.shwfed.block.animated.number/config.vue":FNt,"../blocks/2026-06-02/com.shwfed.block.card/config.vue":YNt,"../blocks/2026-06-02/com.shwfed.block.icon/config.vue":QNt}),fYt=Object.assign({"../blocks/2026-05-06/com.shwfed.block.actions/runtime.vue":ZNt,"../blocks/2026-05-06/com.shwfed.block.form/runtime.vue":nLt,"../blocks/2026-05-06/com.shwfed.block.markdown/runtime.vue":oLt,"../blocks/2026-05-06/com.shwfed.block.table/runtime.vue":zBt,"../blocks/2026-05-06/com.shwfed.block.tabs/runtime.vue":IBt,"../blocks/2026-05-17/com.shwfed.block.chart.xy/runtime.vue":tYt,"../blocks/2026-06-01/com.shwfed.block.animated.number/runtime.vue":rYt,"../blocks/2026-06-02/com.shwfed.block.card/runtime.vue":iYt,"../blocks/2026-06-02/com.shwfed.block.icon/runtime.vue":uYt}),pYt=_2({hostName:"shwfed-config",dirSegment:"blocks",schemaModules:cYt,configModules:dYt,runtimeModules:fYt}),nB=pYt.ENTRIES.map(t=>({type:t.type,compatibilityDate:t.compatibilityDate,metadata:t.module.metadata,schema:t.module.schema,defaultBody:t.module.defaultBody,config:t.config,runtime:t.runtime})),JG=new WeakMap;function mYt(t){const e=JG.get(t);if(e)return e;const n={blockRef:null,members:null,union:null};return n.blockRef=HE(()=>{if(!n.union)throw new Error("[shwfed-config] BlockRef resolved before union built — circular factory init");return n.union}).annotations({identifier:"PageBlock"}),JG.set(t,n),Zyt(t,n.blockRef),n.members=nB.map(o=>o.schema(t,n.blockRef).annotations({identifier:`${o.type}@${o.compatibilityDate}`})),n.union=n.members.length===1?n.members[0]:oo(...n.members),n}function hYt(t){return mYt(t).blockRef}function zd(t,e){return nB.find(n=>n.type===t&&n.compatibilityDate===e)}tbt(zd);const hbe="shwfed.component.page",vbe="00000000-0000-0000-0000-000000000000",sO={name:"页面",icon:"fluent:document-20-regular",operations:[{id:"close",name:"关闭标签页",icon:"fluent:dismiss-20-regular"}]};function gbe(t){const e=hYt(t).annotations({identifier:"PageBlock",description:"页面块,由 `type` 字段区分类型"}),n=D3(e,t),o=et({configure:t,resultType:r=>r==="string"||r==="dyn"||r.startsWith("map")||r.startsWith("optional")});return Ge({kind:Al(hbe),title:re(at).annotations({title:"标题",description:"页面标题(内联本地化文本,无 Markdown);设置后用于浏览器标签页标题,按当前语言取对应文案,留空则不设置"}),style:re(o).annotations({title:"样式",description:"返回应用在页面根元素上的样式的 CEL 表达式,可返回 CSS 字符串(如 `'padding: 2rem'`)或样式对象(如 `{'padding': '2rem'}`);留空则不设额外样式"}),slot:n}).annotations({title:"PageConfig",description:"页面组件完整配置"})}function vYt(){return{slot:_y()}}function gYt(t){return{kind:hbe,...vYt(),...t}}const yYt={class:"relative flex min-w-0 flex-col"},bYt={class:"flex gap-2 min-h-128"},xYt={class:"flex w-64 shrink-0 flex-col"},_Yt={class:"flex flex-1 flex-col gap-2"},wYt={class:"flex-1"},kYt={key:0},SYt={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},CYt={key:1},$Yt={key:2,class:"p-6 text-sm text-red-500"},TYt=ae({name:"ShwfedConfigConfig",__name:"config",props:{state:{}},setup(t){const e=t,n=ue("content");function o(){n.value="general"}function r(F){b.value=F,n.value="content"}const l=gbe(()=>{}),a=Nt(l,"title")??"标题",u=Lt(l,"title"),c=Nt(l,"style")??"样式",f=Lt(l,"style");function p(F){return!F||F.every(j=>j.message.trim().length===0)}const m=T({get:()=>e.state.draft.value.title,set:F=>{e.state.draft.value={...e.state.draft.value,title:p(F)?void 0:F}}}),h=T({get:()=>e.state.draft.value.style??"",set:F=>{const j=F.trim();e.state.draft.value={...e.state.draft.value,style:j.length>0?F:void 0}}}),v=T({get:()=>e.state.layouts.value,set:F=>{e.state.layouts.value=F}}),g=T({get:()=>e.state.selectedBlockIds.value,set:F=>{e.state.selectedBlockIds.value=F}}),b=T({get:()=>e.state.activeLayoutIndex.value,set:F=>{e.state.activeLayoutIndex.value=F}}),x=nm(()=>e.state.blocks.value),y=nm(()=>e.state.top.value),_=nm(()=>e.state.activeBlock.value),k=nm(()=>e.state.activeBlockEntry.value),w=nm(()=>e.state.pickerEntries.value);Tr(Vb,{add:e.state.addCrumb,addParentSuffix:e.state.addParentSuffix});const $=T(()=>({instanceId:vbe,typeName:sO.name,typeIcon:sO.icon,operations:sO.operations}));K3($);const C=Xv("sidebarRef");function E(){C.value?.addLayout()}function z(F,j){e.state.addBlock(F,j)}function N(F){e.state.onDrillDown(F)}async function P(F){const j=new Set(F),te=e.state.blocks.value.filter(ge=>j.has(ge.id));if(te.length===0)return;const ie=v.value[b.value],ve={};if(ie)for(const ge of F){const $e=ie.layout.placements[ge];$e&&(ve[ge]=$e)}if(!await Pue("block",te,ve)){Io.error("复制失败");return}Io.success(`已复制 ${te.length} 个块`)}async function Q(F){const j=await Fue();if(!j||j.surface!=="block")return;const{items:te,placements:ie}=Vue(j.items,j.placements),ve=te;ve.length!==0&&(ie&&Object.keys(ie).length>0?e.state.addBlocksWithPlacements(ve,ie,F):e.state.addBlocks(ve),Io.success(`已粘贴 ${ve.length} 个块`))}function W(F){e.state.updateActiveBlock(F)}function Z(F){return e.state.getBlockLabel(F)}function L(F,j){return e.state.findBlockMeta(F,j)}return(F,j)=>(S(),J("div",yYt,[Ba(H("div",bYt,[H("div",xYt,[H("div",{class:nt(["row pl-2",n.value==="general"?"bg-[color-mix(in_srgb,var(--primary)_10%,white)] text-(--primary)":"text-zinc-700 hover:bg-zinc-50"]),onClick:j[0]||(j[0]=te=>o())},[s(i(de),{icon:"fluent:settings-20-regular",class:"size-4 shrink-0"}),j[13]||(j[13]=H("span",{class:"flex-1 truncate"},"通用配置",-1))],2),s(i(jn),{class:"my-2"}),s(i(Xa),{class:"flex-1"},{default:d(()=>[s(I_,{ref_key:"sidebarRef",ref:C,modelValue:v.value,"onUpdate:modelValue":j[1]||(j[1]=te=>v.value=te),"active-index":b.value,"onUpdate:activeIndex":j[2]||(j[2]=te=>b.value=te),active:n.value!=="general",onSelect:r},null,8,["modelValue","active-index","active"])]),_:1}),s(i(wn),{variant:"ghost",size:"sm",onClick:j[3]||(j[3]=te=>E())},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular",class:"size-4"}),j[14]||(j[14]=H("span",null,"新增布局",-1))]),_:1})]),H("div",_Yt,[n.value==="general"?(S(),J(Me,{key:0},[s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(i(a)),1)]),_:2},[i(u)?{name:"tooltip",fn:d(()=>[s(i(O),{source:i(u),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(Ve),{"model-value":m.value,"translate-hint":"page tab title","onUpdate:modelValue":j[4]||(j[4]=te=>{m.value=te})},null,8,["model-value"])]),_:1}),s(i(M),{orientation:"vertical"},{default:d(()=>[s(i(I),{class:"text-xs text-zinc-500"},G({default:d(()=>[D(" "+A(i(c)),1)]),_:2},[i(f)?{name:"tooltip",fn:d(()=>[s(i(O),{source:i(f),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(i(_e),{modelValue:h.value,"onUpdate:modelValue":j[5]||(j[5]=te=>h.value=te),placeholder:"返回 CSS 字符串或样式对象的表达式,如 'padding: 2rem'",multiline:"",class:"min-h-16"},null,8,["modelValue"])]),_:1})],64)):(S(),J(Me,{key:1},[s(W3,{modelValue:v.value,"onUpdate:modelValue":j[6]||(j[6]=te=>v.value=te),index:b.value},null,8,["modelValue","index"]),H("div",wYt,[s(O3,{modelValue:v.value,"onUpdate:modelValue":j[7]||(j[7]=te=>v.value=te),"active-index":b.value,"onUpdate:activeIndex":j[8]||(j[8]=te=>b.value=te),"selected-item-ids":g.value,"onUpdate:selectedItemIds":j[9]||(j[9]=te=>g.value=te),items:x.value,"find-entry":L,"get-item-label":Z,"picker-entries":w.value,"can-delete":!0,"item-noun":"块",onAddNew:z,onDrillDown:N,onDeleteItem:j[10]||(j[10]=te=>e.state.removeBlock(te)),onDeleteItems:j[11]||(j[11]=te=>e.state.removeBlocks(te)),onCopyItems:P,onPaste:Q},null,8,["modelValue","active-index","selected-item-ids","items","picker-entries"])])],64))])],512),[[c5,y.value.kind==="layout"]]),y.value.kind==="block"?(S(),J("div",kYt,[_.value?k.value?(S(),J("div",CYt,[(S(),B(qo(k.value.config),{"model-value":_.value,configure:e.state.configure,"onUpdate:modelValue":j[12]||(j[12]=te=>W(te))},null,8,["model-value","configure"]))])):(S(),J("div",$Yt," 未注册的块类型:"+A(_.value.type)+"@"+A(_.value.compatibilityDate),1)):(S(),J("div",SYt," 块已不存在 "))])):be("",!0)]))}}),EYt=Ns(TYt,[["__scopeId","data-v-37d1bedd"]]),AYt=ae({name:"UiBreadcrumb",__name:"Breadcrumb",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("nav",{"data-slot":"breadcrumb","aria-label":"breadcrumb",class:nt(i(dt)("",e.class))},[we(n.$slots,"default")],2))}}),DYt=ae({name:"UiBreadcrumbItem",__name:"BreadcrumbItem",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("li",{"data-slot":"breadcrumb-item",class:nt(i(dt)("inline-flex items-center gap-1.5",e.class))},[we(n.$slots,"default")],2))}}),XG=ae({name:"UiBreadcrumbLink",__name:"BreadcrumbLink",props:{asChild:{type:Boolean},as:{default:"a"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=Ut(e,"class"),o=eo(n);return(r,l)=>(S(),B(i(vt),Be({"data-slot":"breadcrumb-link"},i(o),{class:i(dt)("cursor-default transition-colors duration-180 hover:text-(--primary)",e.class)}),{default:d(()=>[we(r.$slots,"default")]),_:3},16,["class"]))}}),zYt=ae({name:"UiBreadcrumbList",__name:"BreadcrumbList",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("ol",{"data-slot":"breadcrumb-list",class:nt(i(dt)("flex flex-wrap items-center gap-1.5 text-sm text-zinc-500 break-words sm:gap-2.5",e.class))},[we(n.$slots,"default")],2))}}),OYt=ae({name:"UiBreadcrumbPage",__name:"BreadcrumbPage",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",class:nt(i(dt)("text-zinc-900 font-normal",e.class))},[we(n.$slots,"default")],2))}}),MYt=ae({name:"UiBreadcrumbSeparator",__name:"BreadcrumbSeparator",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,o)=>(S(),J("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",class:nt(i(dt)("text-zinc-400 [&>svg]:size-3.5",e.class))},[we(n.$slots,"default",{},()=>[s(i(de),{icon:"fluent:chevron-right-20-regular"})])],2))}}),IYt={key:3,class:"text-zinc-500"},RYt=ae({name:"ShwfedConfigEditorBreadcrumb",__name:"breadcrumb",props:{state:{}},setup(t){const e=t,n=nm(()=>e.state.breadcrumbs.value);return(o,r)=>(S(),B(i(AYt),null,{default:d(()=>[s(i(zYt),null,{default:d(()=>[(S(!0),J(Me,null,Ze(n.value,(l,a)=>(S(),J(Me,{key:a},[s(i(DYt),null,{default:d(()=>[a===n.value.length-1?(S(),B(i(OYt),{key:0,class:"font-bold"},{default:d(()=>[D(A(l.label),1)]),_:2},1024)):l.kind!=="sub"?(S(),B(i(XG),{key:1,as:"button",type:"button",class:"cursor-pointer text-zinc-500",onClick:u=>e.state.goTo(l.index)},{default:d(()=>[D(A(l.label),1)]),_:2},1032,["onClick"])):l.clickable?(S(),B(i(XG),{key:2,as:"button",type:"button",class:"cursor-pointer text-zinc-500",onClick:u=>e.state.goToSub(l.subIndex)},{default:d(()=>[D(A(l.label),1)]),_:2},1032,["onClick"])):(S(),J("span",IYt,A(l.label),1))]),_:2},1024),a<n.value.length-1?(S(),B(i(MYt),{key:0})):be("",!0)],64))),128))]),_:1})]),_:1}))}}),VYt={class:"flex w-full items-center justify-between gap-3"},PYt={class:"flex flex-1 flex-col gap-1 text-xs"},FYt={key:0,class:"text-red-500 break-all"},NYt=ae({name:"ShwfedConfigEditorFooter",__name:"footer",props:{state:{}},emits:["close"],setup(t,{emit:e}){const n=t,o=e;function r(){n.state.dismiss(),o("close")}function l(){const a=n.state.isDirty.value,u=n.state.validationError.value;n.state.confirm();const c=n.state.validationError.value;c&&c!==u||(!a||!c)&&o("close")}return(a,u)=>(S(),J("div",VYt,[H("div",PYt,[n.state.validationError.value?(S(),J("span",FYt,A(n.state.validationError.value),1)):be("",!0)]),n.state.stack.value.length>1?(S(),B(i(wn),{key:0,type:"button",variant:"default",size:"sm",onClick:u[0]||(u[0]=c=>n.state.popOne())},{default:d(()=>[s(i(de),{icon:"fluent:arrow-left-20-regular"}),u[1]||(u[1]=D(" 返回 ",-1))]),_:1})):(S(),J(Me,{key:1},[s(i(wn),{type:"button",variant:"default",size:"sm",onClick:r},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"}),u[2]||(u[2]=D(" 取消 ",-1))]),_:1}),s(i(wn),{type:"button",variant:"primary",size:"sm",onClick:l},{default:d(()=>[s(i(de),{icon:"fluent:checkmark-20-regular"}),u[3]||(u[3]=D(" 确认 ",-1))]),_:1})],64))]))}}),LYt=ae({name:"ShwfedConfig",__name:"index",props:ml({configure:{type:Function},editable:{type:Boolean}},{config:{},configModifiers:{}}),emits:["update:config"],setup(t){const e=xt(t,"config"),n=T({get:()=>e.value??gYt(),set:g=>{e.value=g}}),o=t,r=Ft(),l=o.configure??(()=>{}),a=g=>{l(g);const b=new Set(g.getDefinitions().variables.map(x=>x.name));for(const[x,y]of Object.entries(r))b.has(x)||g.registerVariable(x,y.type,{description:y.description,label:y.label})};class u{_tag="PageClosed"}jF(vbe,{close:()=>qt(function*(){return window.close(),yield*y_(new u)})});const c=ue(!1),f=KFt(n,{configure:a,onClose:()=>{c.value=!1}});Qe(c,(g,b)=>{g&&!b&&f.reset()});function p(g){o.editable&&(!g.metaKey&&!g.ctrlKey||(g.preventDefault(),g.stopPropagation(),c.value=!0))}function m(g){n.value={...n.value,slot:g}}const h=T(()=>{const g=n.value.style;if(g)try{const b=We(Dt(g,Pt(r)));return b==null?void 0:typeof b=="string"||typeof b=="object"?b:String(b)}catch{return}}),{locale:v}=Bt({useScope:"global",inheritLocale:!0});return(g,b)=>{const x=Md("ClientOnly");return S(),B(x,null,{default:d(()=>[H("div",{class:nt(h.value?"":"contents"),style:vn(h.value),onClickCapture:p},[s(hF,{"slot-value":n.value.slot,configure:a,"find-entry":i(zd),"onUpdate:slotValue":m},G({_:2},[t.editable?{name:"empty",fn:d(()=>[b[2]||(b[2]=D(" meta+click 进入编辑 ",-1))]),key:"0"}:void 0]),1032,["slot-value","find-entry"])],38),t.editable?(S(),B(_se,{key:0,open:c.value,"onUpdate:open":b[1]||(b[1]=y=>c.value=y),"content-width":"90vw",dismissible:!0},{title:d(()=>[s(RYt,{state:i(f)},null,8,["state"])]),description:d(()=>[...b[3]||(b[3]=[H("span",{class:"sr-only"},"编辑页面布局与块配置",-1)])]),footer:d(()=>[s(NYt,{state:i(f),onClose:b[0]||(b[0]=y=>c.value=!1)},null,8,["state"])]),default:d(()=>[s(EYt,{state:i(f)},null,8,["state"])]),_:1},8,["open"])):be("",!0)]),_:1})}}}),ybe="shwfed:preview:cel-vars";function BYt(){try{const t=localStorage.getItem(ybe);if(!t)return{};const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function UYt(t){try{localStorage.setItem(ybe,JSON.stringify(t))}catch{}}const QT=ue(BYt());function qYt(t){QT.value=t,UYt(t)}const jYt=T(()=>{const t={};for(const[e,n]of Object.entries(QT.value))t[e]={type:HYt(n),label:e,value:n};return t});function HYt(t){if(t===null)return"null";if(Array.isArray(t))return"list";switch(typeof t){case"string":return"string";case"number":return Number.isInteger(t)?"int":"double";case"boolean":return"bool";case"object":return"map";default:return"dyn"}}const WYt={class:"fixed bottom-4 right-4 z-50 pointer-events-auto","data-slot":"cel-vars-affix"},KYt={key:0,class:"rounded bg-zinc-100 px-1.5 py-0.5 font-mono text-[10px] leading-none text-zinc-600"},GYt={class:"flex flex-col gap-2 max-h-[60vh] overflow-y-auto"},YYt={key:0,class:"mt-1 pl-28 text-xs text-red-500"},JYt={class:"flex justify-end gap-2 pt-2"},XYt=ae({name:"CelVarsAffix",__name:"cel-vars-affix",setup(t){let e=0;function n(h="",v=void 0){return{id:e++,key:h,valueText:v===void 0?"":JSON.stringify(v),error:null}}const o=ue(!1),r=ue([]);Qe(o,h=>{h&&(r.value=Object.entries(QT.value).map(([v,g])=>n(v,g)))});const l=T(()=>{const h=new Map,v=new Set;for(const g of r.value){if(!g.key)continue;const b=(h.get(g.key)??0)+1;h.set(g.key,b),b>1&&v.add(g.key)}return v});function a(h){if(h.valueText.length===0){h.error=null;return}try{JSON.parse(h.valueText),h.error=null}catch(v){h.error=v instanceof Error?v.message:String(v)}}function u(){r.value.push(n())}function c(h){r.value=r.value.filter(v=>v.id!==h)}const f=T(()=>r.value.every(h=>!h.error));function p(){if(!f.value)return;const h={};for(const v of r.value)if(v.key&&v.valueText.length!==0)try{h[v.key]=JSON.parse(v.valueText)}catch{return}qYt(h),window.location.reload()}const m=T(()=>Object.keys(QT.value).length);return(h,v)=>(S(),J("div",WYt,[s(i(wn),{variant:"default",size:"sm","aria-label":"Edit CEL variables",onClick:v[0]||(v[0]=g=>o.value=!0)},{default:d(()=>[s(i(de),{icon:"fluent:braces-variable-20-regular"}),v[3]||(v[3]=D(" CEL 变量 ",-1)),m.value>0?(S(),J("span",KYt,A(m.value),1)):be("",!0)]),_:1}),s(i(qae),{open:o.value,"onUpdate:open":v[2]||(v[2]=g=>o.value=g)},{default:d(()=>[s(i(xot),{class:"max-w-xl"},{default:d(()=>[s(i(ase),null,{default:d(()=>[s(i(sse),null,{default:d(()=>[...v[4]||(v[4]=[D("CEL 变量",-1)])]),_:1}),s(i(ise),null,{default:d(()=>[...v[5]||(v[5]=[D(" 键名是 CEL 表达式中引用的变量名,值是合法的 JSON。仅在此浏览器本地保存。 ",-1)])]),_:1})]),_:1}),H("div",GYt,[(S(!0),J(Me,null,Ze(r.value,g=>(S(),J("div",{key:g.id},[s(i(Fe),null,{default:d(()=>[s(i(Xe),{modelValue:g.key,"onUpdate:modelValue":b=>g.key=b,placeholder:"token",class:"w-28 max-w-28 font-mono","aria-invalid":l.value.has(g.key)||void 0},null,8,["modelValue","onUpdate:modelValue","aria-invalid"]),v[6]||(v[6]=H("div",{"aria-hidden":"true",class:"self-stretch w-px my-1.5 bg-zinc-200"},null,-1)),s(i(Xe),{modelValue:g.valueText,"onUpdate:modelValue":b=>g.valueText=b,placeholder:'"..." | 42 | { ... }',class:"font-mono text-xs","aria-invalid":!!g.error||void 0,onBlur:b=>a(g)},null,8,["modelValue","onUpdate:modelValue","aria-invalid","onBlur"]),s(i(Ye),{align:"inline-end"},{default:d(()=>[s(i(ot),{size:"icon-xs","aria-label":"Remove",onClick:b=>c(g.id)},{default:d(()=>[s(i(de),{icon:"fluent:delete-20-regular"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024),g.error?(S(),J("div",YYt,A(g.error),1)):be("",!0)]))),128)),s(i(wn),{variant:"default",class:"w-full",onClick:u},{default:d(()=>[s(i(de),{icon:"fluent:add-20-regular"}),v[7]||(v[7]=D(" 添加 ",-1))]),_:1})]),H("div",JYt,[s(i(wn),{variant:"default",onClick:v[1]||(v[1]=g=>o.value=!1)},{default:d(()=>[s(i(de),{icon:"fluent:dismiss-20-regular"}),v[8]||(v[8]=D(" 取消 ",-1))]),_:1}),s(i(wn),{variant:"primary",disabled:!f.value,onClick:p},{default:d(()=>[s(i(de),{icon:"fluent:checkmark-20-regular"}),v[9]||(v[9]=D(" 应用 ",-1))]),_:1},8,["disabled"])])]),_:1})]),_:1},8,["open"])]))}}),QYt={class:"min-h-screen p-4"},ZYt=ae({__name:"App",setup(t){const e=J7e("shwfed:preview:page-config",null,{serializer:Gle.object});return l5(()=>{const n=globalThis.__SHWFED_PREVIEW_CONFIG__;n!==void 0&&(e.value=n??null)}),Ia(jYt.value),(n,o)=>(S(),B(cst,null,{default:d(()=>[H("div",QYt,[s(LYt,{config:i(e),"onUpdate:config":o[0]||(o[0]=r=>Kt(e)?e.value=r:null),editable:!0},null,8,["config"])]),s(XYt)]),_:1}))}}),bbe=Rwe({locale:navigator?.language,fallbackWarn:!1,fallbackLocale:"zh",globalInjection:!1});Fu.setDefaultHeader("Accept-Language",()=>bbe.global.locale.value);Fxe(ZYt).use(bbe).mount("#app");export{Xd as $,Be as A,Hn as B,fo as C,Tr as D,Vt as E,Xo as F,Bt as G,d as H,s as I,O as J,Me as K,be as L,Ke as M,Jn as N,nt as O,dt as P,xt as Q,Byt as R,H as S,M as T,I as U,G as V,D as W,A as X,_e as Y,Ve as Z,rFt as _,S as a,J$t as a$,Ed as a0,Z4 as a1,Ze as a2,p1 as a3,m1 as a4,jyt as a5,HF as a6,bfe as a7,Ye as a8,de as a9,abt as aA,cbt as aB,V4 as aC,pbt as aD,$c as aE,NJt as aF,zJt as aG,LJt as aH,Jd as aI,Fl as aJ,$P as aK,So as aL,Zt as aM,y0 as aN,Vyt as aO,DJt as aP,on as aQ,hF as aR,Ia as aS,W4 as aT,I4 as aU,Zn as aV,Io as aW,Xn as aX,tje as aY,f8 as aZ,d8 as a_,z3 as aa,Hr as ab,Fr as ac,Fe as ad,Xyt as ae,Vn as af,Nn as ag,Ln as ah,Pn as ai,Fn as aj,obt as ak,uL as al,_r as am,uw as an,qo as ao,W3 as ap,O3 as aq,ml as ar,I_ as as,Xa as at,wn as au,Mb as av,_y as aw,FJt as ax,Vb as ay,j4 as az,i as b,vbt as b0,DBt as b1,NN as b2,BJt as b3,UJt as b4,B as c,ae as d,T as e,Qr as f,qt as g,Dt as h,Vl as i,Cn as j,TJt as k,Nr as l,Pt as m,vn as n,Ht as o,ao as p,pt as q,ue as r,Ft as s,We as t,$Jt as u,bt as v,Qe as w,we as x,Yn as y,J as z};
|