weifuwu 0.81.0 → 0.81.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.
@@ -6,4 +6,13 @@ export interface SearchInputProps {
6
6
  onInput?: (e: Event) => void;
7
7
  onClear?: () => void;
8
8
  }
9
+ /**
10
+ * SearchInput —— 搜索输入框(受控/非受控统一 + IME 门控)
11
+ *
12
+ * - 受控(value 显式传入):input.value 由 value 回写,清除按钮随 value 显隐;
13
+ * 非受控(不传 value):DOM 值透传 onInput,组件不回写(§5.3 输入态不依赖受控回流)
14
+ * - IME 组合(中文拼音):组合期间跳过 onInput(composing + e.isComposing 门控)——
15
+ * 避免受控 value 重置打断输入法(AutoComplete/Mentions/TagsInput 同款纪律);
16
+ * 组合结束 onCompositionEnd 处理最终中文值
17
+ */
9
18
  export declare const SearchInput: Component<SearchInputProps>;
@@ -1,4 +1,4 @@
1
- import{h as Zn}from"weifuwu/ui-dom";var pr={"chevron-down":["M6 9l6 6 6-6"],"chevron-up":["M6 15l6-6 6 6"],"chevron-left":["M15 18l-6-6 6-6"],"chevron-right":["M9 18l6-6-6-6"],"arrow-left":["M19 12H5","M12 19l-7-7 7-7"],"arrow-up":["M12 19V5","M5 12l7-7 7 7"],"arrow-down":["M12 5v14","M19 12l-7 7-7-7"],"arrow-right":["M5 12h14","M12 5l7 7-7 7"],sort:["M7 15l5 5 5-5","M7 9l5-5 5 5"],"sort-asc":["M12 19V5","M5 12l7-7 7 7"],"sort-desc":["M12 5v14","M19 12l-7 7-7-7"],check:["M20 6L9 17l-5-5"],close:["M18 6L6 18","M6 6l12 12"],alert:["M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","M12 9v4","M12 17h.01"],info:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 16v-4","M12 8h.01"],warning:["M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","M12 9v4","M12 17h.01"],pause:["M6 4h4v16H6z","M14 4h4v16h-4z"],settings:["M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"],search:["M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M21 21l-4.35-4.35"],send:["M22 2L11 13","M22 2l-7 20-4-9-9-4 20-7z"],stop:["M6 6h12v12H6z"],retry:["M1 4v6h6","M23 20v-6h-6","M20.49 9A9 9 0 0 0 5.64 5.64L1 10","M3.51 15a9 9 0 0 0 14.85 3.36L23 14"],upload:["M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4","M17 8l-5-5-5 5","M12 3v12"],trash:["M3 6h18","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14","M10 11v6","M14 11v6"],edit:["M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"],plus:["M12 5v14","M5 12h14"],copy:["M20 9h-9a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2z","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"],eye:["M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"],"eye-off":["M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94","M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19","M14.12 14.12a3 3 0 1 1-4.24-4.24","M1 1l22 22"],star:["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"],dashboard:["M3 13h8V3H3z","M21 13h-8V9h8z","M21 21h-8v-8h8z","M3 21h8v-8H3z"],grid:["M3 3h7v7H3z","M14 3h7v7h-7z","M14 14h7v7h-7z","M3 14h7v7H3z"],box:["M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z","M3.27 6.96L12 12.01l8.73-5.05","M12 22.08V12"],users:["M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2","M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z","M23 21v-2a4 4 0 0 0-3-3.87","M16 3.13a4 4 0 0 1 0 7.75"],user:["M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2","M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z"],home:["M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z","M9 22V12h6v10"],folder:["M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"],file:["M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z","M13 2v7h7"],"file-text":["M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z","M13 2v7h7","M9 13h6","M9 17h6"],calendar:["M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z","M16 3v4","M8 3v4","M3 11h18"],clock:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 6v6l4 2"],bell:["M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9","M13.73 21a2 2 0 0 1-3.46 0"],menu:["M3 12h18","M3 6h18","M3 18h18"],activity:["M22 12h-4l-3 9L9 3l-3 9H2"],"trending-up":["M23 6l-9.5 9.5-5-5L1 18","M17 6h6v6"],"trending-down":["M23 18l-9.5-9.5-5 5L1 6","M17 18h6v-6"],database:["M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z","M21 12c0 1.66-4.03 3-9 3s-9-1.34-9-3","M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"],server:["M20 4H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z","M4 14h16","M20 14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2","M7 18h.01","M12 18h.01"],heart:["M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"],refresh:["M23 4v6h-6","M1 20v-6h6","M3.51 9a9 9 0 0 1 14.85-3.36L23 10","M20.49 15a9 9 0 0 1-14.85 3.36L1 14"],message:["M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"],inbox:["M22 12h-6l-2 3h-4l-2-3H2","M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"],shield:["M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"],zap:["M13 2L3 14h9l-1 8 10-12h-9l1-8z"],target:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12z","M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"],mail:["M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z","M22 6l-10 7L2 6"],"external-link":["M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6","M15 3h6v6","M10 14L21 3"],"log-out":["M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4","M16 17l5-5-5-5","M21 12H9"],lock:["M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z","M7 11V7a5 5 0 0 1 10 0v4"],list:["M8 6h13","M8 12h13","M8 18h13","M3 6h.01","M3 12h.01","M3 18h.01"],"bar-chart":["M12 20V10","M18 20V4","M6 20v-4"],gauge:["M12 15l3.5-3.5","M20.39 18.39A10 10 0 1 0 3.61 18.39","M12 15a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"],paperclip:["M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"],filter:["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"],layers:["M12 2L2 7l10 5 10-5-10-5z","M2 17l10 5 10-5","M2 12l10 5 10-5"],"map-pin":["M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z","M15 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"],"book-open":["M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"],github:["M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"],tag:["M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z","M7 7h.01"],phone:["M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"],"more-vertical":["M12 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","M12 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","M12 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"],"check-circle":["M22 11.08V12a10 10 0 1 1-5.93-9.14","M22 4L12 14.01l-3-3"],"alert-circle":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 8v4","M12 16h.01"],wifi:["M5 12.55a11 11 0 0 1 14.08 0","M1.42 9a16 16 0 0 1 21.16 0","M8.53 16.11a6 6 0 0 1 6.95 0","M12 20h.01"],cpu:["M9 9h6v6H9z","M9 1v4","M15 1v4","M9 19v4","M15 19v4","M1 9h4","M1 15h4","M19 9h4","M19 15h4","M5 5h14v14H5z"],"hard-drive":["M22 12H2","M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z","M6 16h.01","M10 16h.01"],globe:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M2 12h20","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"],briefcase:["M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16","M2 20h20","M4 4h16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"],layout:["M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z","M9 3v18","M3 9h18"]},T=async(l,n)=>async t=>{let{name:e,size:r,className:i}=t;return Zn("svg",{class:`wf-icon${i?" "+i:""}`,width:r??"1em",height:r??"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},pr[e].map(s=>Zn("path",{d:s})))};import{h as eo}from"weifuwu/ui-dom";var st=async(l,n)=>async t=>{let{variant:e="primary",size:r="md",block:i,loading:s,disabled:o,type:a,onClick:c,children:u}=t,d=["wf-btn",`wf-btn--${e}`,`wf-btn--${r}`,i&&"wf-btn--block",s&&"wf-btn--loading"].filter(Boolean).join(" "),f=n?.i18n?.components?.Button??{};return eo("button",{id:t.id,title:t.title,class:d,type:a??"button",disabled:o||s||void 0,"aria-busy":s||void 0,onClick:c},s?[eo("span",{class:"wf-btn-spinner"}),f.loading??"\u52A0\u8F7D\u4E2D..."]:u)};import{h as at}from"weifuwu/ui-dom";var _t=async l=>async n=>{let{label:t,name:e,type:r="text",value:i,placeholder:s,required:o,disabled:a,readonly:c,error:u,hint:d,variant:f="default",onInput:p,onChange:g,...m}=n,h=at("input",{class:`wf-input${f==="borderless"?" wf-input--borderless":""}`,name:e||void 0,type:r,value:i??"",placeholder:s,required:o||void 0,disabled:a||void 0,readonly:c||void 0,onInput:p,onChange:g,...m});if(!t&&!u&&!d)return h;let b=[];if(t){let v=[t];o&&v.push(at("span",{class:"wf-input-req"},"*")),b.push(at("label",{class:"wf-input-label"},v))}return b.push(h),u&&b.push(at("div",{class:"wf-input-err"},u)),d&&!u&&b.push(at("div",{class:"wf-input-hint"},d)),at("div",{class:`wf-input-wrap${u?" wf-input--err":""}`},b)};import{h as Xe}from"weifuwu/ui-dom";var ur=async(l,n)=>async t=>{let{label:e,value:r,placeholder:i,required:s,disabled:o,error:a,hint:c,rows:u=3,maxLength:d,showCount:f,onInput:p}=t,g=Xe("textarea",{class:"wf-textarea",value:r??"",placeholder:i,required:s||void 0,disabled:o||void 0,rows:u,maxLength:d,onInput:p}),m=[];if(e){let h=[e];s&&h.push(Xe("span",{class:"wf-textarea-req"},"*")),m.push(Xe("label",{class:"wf-textarea-label"},h))}if(m.push(g),f){let h=(r??"").length,b=d!=null&&h>d;m.push(Xe("div",{class:`wf-textarea-count${b?" wf-textarea-count--over":""}`,"aria-live":"polite"},d!=null?`${h}/${d}`:String(h)))}return a&&m.push(Xe("div",{class:"wf-textarea-err"},a)),c&&!a&&m.push(Xe("div",{class:"wf-textarea-hint"},c)),Xe("div",{class:`wf-textarea-wrap${a?" wf-textarea--err":""}`},m)};import{h as te}from"weifuwu/ui-dom";function Kt(l){return"options"in l&&!("value"in l)}function pn(l){return l?l.flatMap(n=>Kt(n)?n.options:[n]):[]}var dr=async(l,n)=>async t=>{let{label:e,value:r,options:i,placeholder:s,required:o,disabled:a,error:c,onChange:u,children:d}=t,f=[];if(s&&f.push(te("option",{value:"",disabled:!0},s)),i)for(let m of i)Kt(m)?f.push(te("optgroup",{label:m.label},m.options.map(h=>te("option",{value:h.value,disabled:h.disabled},h.label)))):f.push(te("option",{value:m.value,disabled:m.disabled},m.label));let p=te("select",{class:"wf-select",value:r??"",required:o||void 0,disabled:a||void 0,onChange:m=>u?.(m.target.value)},d??f),g=[];if(e){let m=[e];o&&m.push(te("span",{class:"wf-select-req"},"*")),g.push(te("label",{class:"wf-select-label"},m))}return g.push(p),c&&g.push(te("div",{class:"wf-select-err"},c)),te("div",{class:`wf-select-wrap${c?" wf-select--err":""}`},g)},fr=async(l,n)=>{let t=!1,e="",r=[],i=-1,s=!1,o;n.ui.useStableRef?.(()=>{},()=>{s=!0,o&&clearTimeout(o)});let a=null,c=null,u=p=>{p&&(a=p)},d=p=>{p&&(c=p)},f=n.ui.usePopup({trigger:()=>"click",placement:()=>"bottom",center:!1,gap:4,el:()=>a,isOpen:()=>t,setOpen:p=>{t=p,n.ui.render()}});return async p=>{let{label:g,value:m,options:h=[],placeholder:b,required:v,disabled:y,error:w,onChange:x,onSearch:k,multiple:S}=p,P=!!S,I=P?Array.isArray(m)?m:[]:[m],$=(W,H)=>{if(!H)return W;let X=H.toLowerCase();return W.flatMap(F=>{if(Kt(F)){let ee=F.options.filter(oe=>oe.label.toLowerCase().includes(X));return ee.length?[{label:F.label,options:ee}]:[]}return F.label.toLowerCase().includes(X)?[F]:[]})},L=e&&k&&r.length>0?r:$(h,e),E=pn(L),B=pn(h),D=B.find(W=>W.value===m),N=B.filter(W=>I.includes(W.value)),O=async W=>{if(e=W,t=!0,i=0,n.ui.render(),k&&W){let H=await k(W);H&&(r=H,n.ui.render())}},M=W=>{if(!W.disabled)if(P){let H=Array.isArray(m)?[...m]:[],X=H.indexOf(W.value);X>=0?H.splice(X,1):H.push(W.value),x?.(H)}else e="",t=!1,n.ui.render(),x?.(W.value)},C=W=>{if(!P)return;let H=Array.isArray(m)?[...m]:[];x?.(H.filter(X=>X!==W))},A=W=>{if(!y)if(W.key==="ArrowDown")W.preventDefault(),t=!0,i=Math.min(i+1,E.length-1),n.ui.render();else if(W.key==="ArrowUp")W.preventDefault(),t=!0,i=Math.max(i-1,0),n.ui.render();else if(W.key==="Enter"){W.preventDefault();let H=E[i];H&&M(H)}else W.key==="Escape"&&(W.preventDefault(),t=!1,e="",n.ui.render())},R=P&&N.length>0?N.map(W=>te("span",{class:"wf-select-tag",key:W.value},[W.label,te("button",{type:"button",class:"wf-select-tag-close","aria-label":`\u79FB\u9664 ${W.label}`,onClick:H=>{H.stopPropagation(),C(W.value)}},te(T,{name:"close",size:10}))])):[],z=P?"":t?e:D?.label??"",U=te("div",{key:"select-trigger",class:`wf-select-search-trigger${y?" wf-select-search--disabled":""}${w?" wf-select--err":""}`,ref:u,role:"combobox","aria-haspopup":"listbox","aria-expanded":String(t),onClick:y?void 0:()=>{t=!0,n.ui.render(),c?.focus()}},[...R,te("input",{key:"select-search-input",ref:d,class:"wf-select-search-input",type:"text",value:P?"":t?e:D?.label??"",placeholder:N.length>0?void 0:b??"",disabled:y,readOnly:!t||void 0,onInput:W=>O(W.target.value),onFocus:()=>{y||(t=!0,n.ui.render())},onBlur:()=>{o=setTimeout(()=>{s||(t=!1,e="",n.ui.render())},150)},onKeyDown:A})]),V=[];if(g){let W=[g];v&&W.push(te("span",{class:"wf-select-req"},"*")),V.push(te("label",{class:"wf-select-label"},W))}let _=0,J=(W,H)=>{let X=P?I.includes(W.value):W.value===m,F=te("div",{class:`wf-select-search-opt${X?" wf-select-search-opt--sel":""}${W.disabled?" wf-select-search-opt--dis":""}${i===H?" wf-select-search-opt--hl":""}`,key:W.value,onMouseDown:ee=>{ee.preventDefault(),M(W)}},W.label);return _++,F},Q=[];if(E.length>0)for(let W of L)if(Kt(W)){Q.push(te("div",{class:"wf-select-search-group",key:`group-${W.label}`},W.label));for(let H of W.options)Q.push(J(H,_))}else Q.push(J(W,_));else e&&Q.push(te("div",{class:"wf-select-search-empty"},"\u65E0\u5339\u914D"));let K=te("div",{class:"wf-select-search-menu"},Q),Qe=f.portal(K,"wf-select-menu");return V.push(te("div",{class:"wf-select-search"},[U,Qe].filter(Boolean))),w&&V.push(te("div",{class:"wf-select-err"},w)),te("div",{class:`wf-select-wrap${w?" wf-select--err":""}`},V)}},Wt=async(l,n)=>{let t=await dr(l,n),e=await fr(l,n);return r=>r.searchable?e(r):t(r)};import{h as Ct}from"weifuwu/ui-dom";var un=async(l,n)=>async t=>{let{label:e,checked:r,disabled:i,onChange:s}=t,o=Ct("input",{type:"checkbox",class:"wf-checkbox-input",checked:r||void 0,disabled:i||void 0,onChange:s?c=>s(c.target.checked):void 0}),a=Ct("span",{class:"wf-checkbox-visual"});return e?Ct("label",{class:"wf-checkbox"},[o,a,Ct("span",{class:"wf-checkbox-label"},e)]):Ct("label",{class:"wf-checkbox"},[o,a])};import{h as kt}from"weifuwu/ui-dom";var Vt=async(l,n)=>async t=>{let{label:e,checked:r,disabled:i,onChange:s}=t,o=kt("input",{type:"checkbox",class:"wf-switch-input",checked:r||void 0,disabled:i||void 0,role:"switch","aria-checked":String(!!r),onChange:s?u=>s(u.target.checked):void 0}),a=kt("span",{class:"wf-switch-track"}),c=n?.i18n?.components?.Switch??{};return e?kt("label",{class:"wf-switch"},[o,a,kt("span",{class:"wf-switch-label"},e)]):kt("label",{class:"wf-switch","aria-label":c.ariaLabel??"\u5207\u6362"},[o,a])};import{h as Mt}from"weifuwu/ui-dom";var mr=async(l,n)=>async t=>{let{name:e,options:r=[],inline:i}=t,s=n?.ui?.useControlled({value:t.value,onChange:t.onChange,name:"RadioGroup"}),o=c=>{let u=s?.controlled;s?.setValue(c),u||t.onChange?.(c)},a=r.map(c=>{let u=Mt("input",{type:"radio",class:"wf-radio-input",name:e??"radio",value:c.value,checked:s?.value===c.value||void 0,disabled:c.disabled||void 0,onChange:()=>o(c.value)}),d=Mt("span",{class:"wf-radio-visual"}),f=Mt("span",{class:"wf-radio-label-text"},c.label);return Mt("label",{class:"wf-radio",key:c.value},[u,d,f])});return Mt("div",{class:`wf-radio-group${i?" wf-radio-group--inline":""}`},a)};import{h as pe}from"weifuwu/ui-dom";function gr(l,n,t,e){if(!t||!e)return l;let r=n.find(s=>s.key===t);if(!r||!r.sortable)return l;let i=[...l];return i.sort((s,o)=>{let a=s[t],c=o[t],u=r.sorter?r.sorter(a,c):String(a??"").localeCompare(String(c??""));return e==="desc"?-u:u}),i}var hr=async(l,n)=>async t=>{let{data:e=[],columns:r,onRowClick:i,sortKey:s,sortOrder:o,onSort:a,emptyText:c,rowSelection:u}=t,d=gr(e,r,s,o),f=(E,B)=>E[u?.rowKey??"id"]??B,p=u?.selectedRowKeys??[],g=new Set(p.map(String)),m=d.map((E,B)=>String(f(E,B))),h=m.length>0&&m.every(E=>g.has(E)),b=m.some(E=>g.has(E)),v=()=>{if(!u?.onChange)return;let E=h?[]:m.map(B=>d.find((D,N)=>String(f(D,N))===B));u.onChange(h?[]:m,h?[]:E)},y=(E,B)=>{if(!u?.onChange)return;let D=String(f(E,B)),N=g.has(D)?p.filter(M=>String(M)!==D):[...p,D],O=N.map(M=>d.find((C,A)=>String(f(C,A))===String(M))).filter(Boolean);u.onChange(N,O)},w=u?pe("th",{class:"wf-table-th wf-table-th--selection",scope:"col"},pe("input",{type:"checkbox",class:"wf-table-checkbox",checked:h||void 0,indeterminate:b&&!h?"true":void 0,"aria-label":"\u5168\u9009",onChange:v})):null,x=(E,B)=>u?pe("td",{class:"wf-table-td wf-table-td--selection"},pe("input",{type:"checkbox",class:"wf-table-checkbox",checked:g.has(String(f(E,B)))||void 0,"aria-label":"\u9009\u62E9\u884C",onClick:D=>D.stopPropagation(),onChange:()=>y(E,B)})):null,k=r.map(E=>{let B=E.key===s&&o,D=o==="asc",N=E.label,O=E.sortable?pe(T,{name:B?D?"sort-asc":"sort-desc":"sort",className:`wf-table-sort-icon${B?" wf-table-sort-icon--active":""}`}):null,M=E.sortable&&a?()=>a(E.key,B&&D?"desc":"asc"):void 0;return pe("th",{class:`wf-table-th${E.sortable?" wf-table-th--sortable":""}${B?" wf-table-th--sorted":""}`,scope:"col",tabindex:E.sortable?0:void 0,style:E.width?{width:E.width}:void 0,onClick:M,onKeyDown:M?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),M())}:void 0},[N,O].filter(Boolean))}),S=pe("tr",{class:"wf-table-tr"},[w,...k].filter(Boolean)),P=pe("thead",{class:"wf-table-thead"},S),I;if(t.loading){let E=t.loadingRows??3;I=Array.from({length:E},(B,D)=>pe("tr",{class:"wf-table-tr wf-table-tr--loading",key:`loading-${D}`},r.map((N,O)=>pe("td",{class:"wf-table-td",key:`${D}-${O}`},pe("span",{class:"wf-skeleton wf-skeleton--text"})))))}else if(d.length===0&&c){let E=r.length+(u?1:0);I=[pe("tr",{class:"wf-table-tr"},pe("td",{class:"wf-table-td wf-table-empty",colspan:E,style:{textAlign:"center"}},c))]}else I=d.map((E,B)=>{let D=r.map(O=>{let M=E[O.key],C=O.render?O.render(M,E,B):String(M??"");return pe("td",{class:"wf-table-td"},C)}),N=x(E,B);return pe("tr",{class:"wf-table-tr",onClick:i?()=>i(E,B):void 0,style:i?{cursor:"pointer"}:void 0},[N,...D].filter(Boolean))});let $=pe("tbody",{class:"wf-table-tbody"},I),L=pe("table",{class:"wf-table",style:t.minWidth?{minWidth:t.minWidth}:void 0},[P,$]);return pe("div",{class:"wf-table-wrap"},L)};import{h as Ve}from"weifuwu/ui-dom";var it=async(l,n)=>{let t=!1,e=n.ui.usePopup({presence:!0,trapFocus:!0,lockScroll:!0,positioning:"none",closeOnOutside:!1,closeOnEscape:!1,isOpen:()=>t,setOpen:()=>{}}),r;return n.ui.useGlobalKey(i=>{i.key==="Escape"&&e.phase==="open"&&r?.()}),async i=>{let{open:s,title:o,onClose:a,children:c,footer:u,width:d,closable:f=!0,maskClosable:p=!0}=i;r=a,t=!!s;let g=n?.i18n?.components?.Modal??{},m=e.sync(t);if(m==="closed")return null;let h=Ve("div",{class:"wf-modal-overlay",onClick:p?a:void 0}),b=f?Ve("button",{class:"wf-modal-close",onClick:a,type:"button","aria-label":g.closeAria??"\u5173\u95ED"},Ve(T,{name:"close"})):null,v=o?Ve("div",{class:"wf-modal-header"},[o,b].filter(Boolean)):null,y=Ve("div",{class:"wf-modal-body"},c),w=u?Ve("div",{class:"wf-modal-footer"},u):null,x=Ve("div",{class:"wf-modal-content",onClick:S=>S.stopPropagation(),style:d?{minWidth:`min(${d}, calc(100vw - 32px))`,maxWidth:`min(${d}, calc(100vw - 32px))`}:void 0},[v,y,w].filter(Boolean)),k=Ve("div",{class:`wf-modal ${m==="exit"?"wf-modal--exit":"wf-modal--enter"}`,role:"dialog","aria-modal":"true","aria-label":o??g.ariaLabel??"\u5F39\u7A97"},[h,x]);return e.portal(k,"modal")}};import{createClientBrowser as yr}from"weifuwu/ui-dom";import{h as lt}from"weifuwu/ui-dom";import{mountCommand as br,unmountCommand as wr}from"weifuwu/ui-dom";var Ft=yr();function vr(){return l=>(l.confirm=(n,t)=>xr(n,t??{},l),l)}function xr(l,n,t){return new Promise(e=>{let r=Ft.createElement("div");if(!r){e(!1);return}Ft.bodyAppend(r);let i=!1,s,o=null;o=lt(async(c,u)=>{let d=!0;return s=f=>{if(i)return;i=!0,d=!1,u.ui.render(),e(f);let p=()=>{o&&wr(r,o,t)},g=Ft.query("#__wf_portal .wf-modal");if(g&&typeof g.addEventListener=="function"){let m=!1,h=()=>{m||(m=!0,p())};g.addEventListener("animationend",h,{once:!0}),Ft.timeout(h,600)}else p()},async()=>lt("div",{class:"wf-confirm-host"},lt(to,{open:d,title:n.title,message:l,confirmText:n.confirmText,cancelText:n.cancelText,variant:n.variant,width:n.width,maskClosable:n.maskClosable,onConfirm:()=>s?.(!0),onCancel:()=>s?.(!1)}))},{}),br(r,o,t)})}var to=async(l,n)=>async t=>{let{open:e=!1,title:r,message:i,confirmText:s,cancelText:o,variant:a="primary",width:c,maskClosable:u=!1,onConfirm:d,onCancel:f}=t,p=n?.i18n?.components?.Confirm??{},g=[lt(st,{variant:"secondary",size:"md",onClick:()=>f?.()},o??p.cancelText??"\u53D6\u6D88"),lt(st,{variant:a,size:"md",onClick:()=>d?.()},s??p.confirmText??"\u786E\u5B9A")];return lt(it,{open:e,title:r,onClose:f,maskClosable:u,footer:g,width:c,closable:!1},i)};import{createClientBrowser as Cr}from"weifuwu/ui-dom";import{h as Re}from"weifuwu/ui-dom";import{mountCommand as kr}from"weifuwu/ui-dom";import{animateOut as Mr}from"weifuwu/ui-dom";var dn=Cr();function Pr(l){return{"top-right":"wf-toast--tr","top-left":"wf-toast--tl","bottom-right":"wf-toast--br","bottom-left":"wf-toast--bl","top-center":"wf-toast--tc"}[l]??"wf-toast--tr"}var no=async(l,n)=>async t=>{let{toasts:e=[],onRemove:r,position:i="top-right",duration:s=0,max:o=0}=t,a=n.ui.usePopup?.({positioning:"none",closeOnOutside:!1,closeOnEscape:!1,isOpen:()=>!0,setOpen:()=>{}}),c=o>0&&e.length>o?e.slice(-o):e;if(c.length===0)return null;let u=c.map(d=>Re("div",{class:`wf-toast wf-toast--${d.type}`,key:d.id,role:d.type==="error"?"alert":"status","aria-live":d.type==="error"?"assertive":"polite","data-id":d.id,"data-duration":(d.duration??s)||void 0,onClick:r?()=>r(d.id):void 0},[Re("span",{class:"wf-toast-icon"},Re(T,{name:Tr(d.type)})),Re("span",{class:"wf-toast-msg"},d.message),d.action?Re("button",{class:`wf-toast-action wf-toast-action--${d.type}`,type:"button",onClick:f=>{f.stopPropagation(),d.action.onClick()}},d.action.label):null].filter(Boolean)));return a.portal(Re("div",{class:`wf-toast-container ${Pr(i)}`,"data-max":o||void 0},u),"toast")};function Tr(l){switch(l){case"success":return"check";case"error":return"close";case"warning":return"alert";case"info":return"info"}}function Sr(l){let n={position:l?.position??"top-right",duration:l?.duration??3e3,max:l?.max??3},t=null,e=null,r=0,i=async(o,a)=>{let c=[],u=()=>a.ui.render();return t={add:d=>{c=[...c,d],u()},remove:d=>{let f=dn.query(`.wf-toast[data-id="${d}"]`);if(f){f.classList.add("wf-toast-out");let p=getComputedStyle(f).animationName;if(p&&p!=="none"){Mr(f,()=>{c=c.filter(g=>g.id!==d),u()});return}}c=c.filter(p=>p.id!==d),u()}},async()=>Re("div",{class:"wf-toast-host"},[Re(no,{toasts:c,position:n.position,duration:n.duration,max:n.max,onRemove:d=>t?.remove(d)})])},s=()=>{if(t||!e)return;let o=dn.createElement("div");o&&(dn.bodyAppend(o),kr(o,Re(i,{}),e))};return o=>(e=o,o.toast=(a,c="info",u,d)=>{s();let f=String(++r);t?.add({id:f,type:c,message:a,duration:u,action:d});let p=u??n.duration;p>0&&setTimeout(()=>t?.remove(f),p)},o)}import{h as ct}from"weifuwu/ui-dom";var fn=async(l,n)=>async t=>{let{variant:e="info",closable:r,onClose:i,children:s}=t;if(!s)return null;let o=ct("span",{class:"wf-alert-icon"},ct(T,{name:Er(e)})),a=r?ct("button",{class:"wf-alert-close",onClick:i,type:"button","aria-label":"\u5173\u95ED"},ct(T,{name:"close"})):null,c=ct("span",{class:"wf-alert-msg"},s);return ct("div",{class:`wf-alert wf-alert--${e}`,role:"alert"},[o,c,a].filter(Boolean))};function Er(l){switch(l){case"success":return"check";case"error":return"close";case"warning":return"alert";case"info":return"info"}}import{h as mn}from"weifuwu/ui-dom";var $r=async(l,n)=>async t=>{let{text:e="\u52A0\u8F7D\u4E2D..."}=t;return mn("div",{class:"wf-loading",role:"status","aria-live":"polite"},[mn("div",{class:"wf-loading-spinner"}),mn("span",{class:"wf-loading-text"},e)])};import{h as pt}from"weifuwu/ui-dom";var Lr=async(l,n)=>async t=>{let{icon:e=pt(T,{name:"inbox"}),text:r="\u6682\u65E0\u6570\u636E",hint:i,children:s}=t,o=[pt("div",{class:"wf-empty-icon"},e),pt("div",{class:"wf-empty-text"},r)];return i&&o.push(pt("div",{class:"wf-empty-hint"},i)),s&&o.push(pt("div",{class:"wf-empty-action"},s)),pt("div",{class:"wf-empty",role:"status"},o)};import{createClientBrowser as Ir}from"weifuwu/ui-dom";import{h as Pt}from"weifuwu/ui-dom";var Dr=async(l,n)=>{let t=n?.browser??Ir(),e=0,r=0,i=null,s=c=>{c&&(e=c.offsetLeft,r=c.offsetWidth,n.ui.render())},o=()=>{i&&s(i.querySelector(".wf-tab--active"))},a=c=>{c&&(i=c,queueMicrotask(o))};return async c=>{let{items:u=[]}=c;if(u.length===0)return null;let d=n?.ui?.useControlled({value:c.active,onChange:c.onChange,name:"Tabs"}),f=y=>{let w=d?.controlled;d?.setValue(y),w||c.onChange?.(y)},p=d?.value??u[0].key,g=y=>{let w=y.currentTarget,x=Array.from(w.querySelectorAll(".wf-tab")),k=x.indexOf(t?.activeElement()??null);if(k<0||!d)return;let S=k;if(y.key==="ArrowRight")S=(k+1)%x.length;else if(y.key==="ArrowLeft")S=(k-1+x.length)%x.length;else if(y.key==="Home")S=0;else if(y.key==="End")S=x.length-1;else return;y.preventDefault();let P=u[S];P&&P.key!==u[k].key&&(f(P.key),x[S].focus(),s(x[S]))},m=u.map(y=>Pt("button",{class:`wf-tab${y.key===p?" wf-tab--active":""}`,key:y.key,role:"tab",tabindex:y.key===p?0:-1,"aria-selected":y.key===p?"true":"false",onClick:y.key!==p?(w=>{s(w?.currentTarget),f(y.key)}):void 0},y.label)),h=Pt("span",{class:"wf-tab-ink",style:{transform:`translateX(${e}px)`,width:`${r}px`},"aria-hidden":"true"}),b=u.find(y=>y.key===p),v=b?.content?Pt("div",{class:"wf-tab-content",role:"tabpanel"},b.content):null;return Pt("div",{class:"wf-tabs",role:"tablist",onKeyDown:g},[Pt("div",{class:"wf-tab-list",ref:a},[...m,h]),v].filter(Boolean))}};import{h as gn}from"weifuwu/ui-dom";var Ar=async(l,n)=>{let t=null,e=a=>{t=a},r=null,i=0,s=!1,o=n.ui.usePopup({trigger:"click",el:()=>t,isOpen:()=>r?.open??!1,setOpen:a=>r?.setOpen(a)});return async a=>{let{trigger:c,items:u=[]}=a;r=n.ui.useOpen({open:a.open,onOpenChange:a.onOpenChange,name:"Dropdown"});let d=!!r?.open;d&&!s&&(i=0),s=d;let f=m=>{let h=m.key;if(h==="Escape")return;let b=u.map((w,x)=>w.disabled?-1:x).filter(w=>w>=0);if(!b.length)return;let v=b.indexOf(i),y=v>=0?v:0;if(h==="ArrowDown"||h==="ArrowRight")m.preventDefault(),i=b[Math.min(y+1,b.length-1)],n.ui.render();else if(h==="ArrowUp"||h==="ArrowLeft")m.preventDefault(),i=b[Math.max(y-1,0)],n.ui.render();else if(h==="Home")m.preventDefault(),i=b[0],n.ui.render();else if(h==="End")m.preventDefault(),i=b[b.length-1],n.ui.render();else if(h==="Enter"||h===" "){let w=u[i];w&&!w.disabled&&(m.preventDefault(),w.onClick?.(),r?.setOpen(!1))}},p=u.map((m,h)=>gn("button",{class:["wf-dropdown-item",m.variant==="danger"?" wf-dropdown-item--danger":"",h===i&&d?" wf-dropdown-item--hl":""].filter(Boolean).join(" "),key:m.value??h,disabled:m.disabled||void 0,role:"menuitem","aria-selected":String(h===i&&d),onClick:m.disabled?void 0:()=>{m.onClick?.()}},m.label)),g=gn("div",{class:"wf-dropdown-menu",role:"menu",onKeyDown:f},p);return gn("div",{class:`wf-dropdown${r?.open?" wf-dropdown--open":""}`,ref:e,...o.wrapProps,"aria-haspopup":"menu","aria-expanded":String(!!r?.open)},[c,o.portal(g,"dropdown")].filter(Boolean))}};import{h as Ze}from"weifuwu/ui-dom";var Or=async(l,n)=>async t=>{let{total:e,pageSize:r=20}=t,i=n?.ui?.useControlled({value:t.page,onChange:t.onChange,name:"Pagination"}),s=i?.value??1,o=f=>{let p=i?.controlled;i?.setValue(f),p||t.onChange?.(f)},a=n?.i18n?.components?.Pagination??{},c=Math.max(1,Math.ceil(e/r));if(c<=1)return null;let u=[];u.push(Ze("button",{class:`wf-page-btn${s<=1?" wf-page-btn--disabled":""}`,disabled:s<=1,"aria-label":a.prevAria??"\u4E0A\u4E00\u9875",onClick:s>1?()=>o(s-1):void 0},Ze(T,{name:"chevron-left"})));let d=Rr(s,c);for(let f of d)f==="..."?u.push(Ze("span",{class:"wf-page-ellipsis"},"...")):u.push(Ze("button",{class:`wf-page-btn${f===s?" wf-page-btn--active":""}`,"aria-current":f===s?"page":void 0,onClick:f!==s?()=>o(f):void 0},String(f)));return u.push(Ze("button",{class:`wf-page-btn${s>=c?" wf-page-btn--disabled":""}`,disabled:s>=c,"aria-label":a.nextAria??"\u4E0B\u4E00\u9875",onClick:s<c?()=>o(s+1):void 0},Ze(T,{name:"chevron-right"}))),Ze("nav",{class:"wf-pagination","aria-label":a.ariaLabel??"\u5206\u9875"},u)};function Rr(l,n){if(n<=7)return Array.from({length:n},(i,s)=>s+1);let t=[1];l>3&&t.push("...");let e=Math.max(2,l-1),r=Math.min(n-1,l+1);for(let i=e;i<=r;i++)t.push(i);return l<n-2&&t.push("..."),t.push(n),t}import{h as Br}from"weifuwu/ui-dom";var hn=async(l,n)=>async t=>{let{variant:e="default",padding:r="md",clickable:i,hover:s,active:o,onClick:a,className:c,style:u,children:d}=t,f=["wf-card",`wf-card--${e}`,`wf-card--pad-${r}`,i&&"wf-card--clickable",s&&"wf-card--hover",o&&"wf-card--active",(i||s)&&"wf-elevate"].filter(Boolean).join(" ");return Br("div",{class:c?`${f} ${c}`:f,style:u,onClick:a,role:i?"button":void 0,tabindex:i?0:void 0,onKeyDown:i?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a?.())}:void 0},d)};import{h as yn}from"weifuwu/ui-dom";var Hr=async(l,n)=>async t=>{let{variant:e="default",dot:r,children:i,count:s,overflowCount:o=99,showZero:a=!1}=t;if(r)return yn("span",{class:`wf-badge-dot wf-badge-dot--${e}`});if(s!=null){if(s===0&&!a)return null;let c=s>o?`${o}+`:String(s);return yn("span",{class:`wf-badge wf-badge--count wf-badge--${e}`,"aria-label":`${s>o?`\u8D85\u8FC7 ${o}`:s} \u6761`},c)}return yn("span",{class:`wf-badge wf-badge--${e}`},i??"")};import{h as oo}from"weifuwu/ui-dom";var ro=["#4f6ef7","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899"];function Nr(l){let n=0;for(let t=0;t<l.length;t++)n=l.charCodeAt(t)+((n<<5)-n);return ro[Math.abs(n)%ro.length]}var bn=async(l,n)=>async t=>{let{name:e="",src:r,size:i="md",color:s}=t,o=Array.from(e.trim())[0]?.toUpperCase()??"?";return r?oo("img",{class:`wf-avatar wf-avatar--${i}`,src:r,alt:e}):oo("div",{class:`wf-avatar wf-avatar--${i}`,style:{background:s??Nr(e)}},o)};import{h as Gt}from"weifuwu/ui-dom";var zr=async(l,n)=>async t=>{let{closable:e,onClose:r,variant:i="default",children:s}=t,o=e?Gt("button",{class:"wf-tag-close",onClick:r,type:"button","aria-label":"\u79FB\u9664"},Gt(T,{name:"close"})):null;return Gt("span",{class:`wf-tag wf-tag--${i}`},[Gt("span",{class:"wf-tag-text"},s),o].filter(Boolean))};import{h as Fe}from"weifuwu/ui-dom";var jr=async(l,n)=>{let t=n.ui.useTween(0,{duration:400,ease:"easeOutCubic"}),e=0,r=null,i,s=()=>{r&&(clearInterval(r),r=null)};return async o=>{let{label:a,value:c,trend:u,trendLabel:d,icon:f,onClick:p,animate:g,countdown:m,onFinish:h}=o;i=h;let b=typeof c=="number"?c:0;g&&typeof c=="number"?t.reset(b):t.value=b,m!==void 0?(e=Math.max(0,Math.ceil((m-Date.now())/1e3)),r||(r=setInterval(()=>{e=Math.max(0,Math.ceil((m-Date.now())/1e3)),e<=0&&(s(),i?.()),n.ui.render()},1e3))):r&&s();let v=m!==void 0?(()=>{let w=Math.floor(e/3600),x=Math.floor(e%3600/60),k=e%60,S=P=>String(P).padStart(2,"0");return w>0?`${S(w)}:${S(x)}:${S(k)}`:`${S(x)}:${S(k)}`})():String(typeof c=="number"?t.value:c??""),y=[];return f&&y.push(Fe("div",{class:"wf-stat-icon"},f)),y.push(Fe("div",{class:"wf-stat-value wf-nums"},v)),y.push(Fe("div",{class:"wf-stat-label"},a)),u&&y.push(Fe("div",{class:`wf-stat-trend wf-stat-trend--${u}`},[Fe("span",{class:"wf-stat-trend-arrow"},Fe(T,{name:u==="up"?"arrow-up":"arrow-down"})),d?Fe("span",{class:"wf-stat-trend-label"},d):null].filter(Boolean))),Fe("div",{class:`wf-stat${p?" wf-stat--clickable":""}${p?" wf-elevate":""}`,onClick:p,role:p?"button":void 0,tabindex:p?0:void 0,onKeyDown:p?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),p())}:void 0},y)}};import{h as Ge}from"weifuwu/ui-dom";var _r=async(l,n)=>async t=>{let{items:e=[],active:r,current:i=0}=t,s=r??e[i]?.key,o=e.map((a,c)=>{let u=e.findIndex(v=>v.key===s),d=c<u,f=c===u,p=["wf-step",d&&"wf-step--done",f&&"wf-step--current"].filter(Boolean).join(" "),g=d?Ge("span",{class:"wf-step-num"},Ge(T,{name:"check"})):Ge("span",{class:"wf-step-num"},String(c+1)),m=Ge("span",{class:"wf-step-label"},a.label),h=a.description?Ge("span",{class:"wf-step-desc"},a.description):null,b=c<e.length-1?Ge("span",{class:`wf-step-connector${d?" wf-step-connector--done":""}`}):null;return Ge("div",{class:p,key:a.key,role:"listitem","aria-current":f?"step":void 0},[g,m,h,b].filter(Boolean))});return Ge("div",{class:"wf-steps",role:"list"},o)};import{h as Kr}from"weifuwu/ui-dom";async function Wr(l,n){let t={};for(let[e,r]of Object.entries(n)){let i=l[e]??"";for(let s of r){if(s.required&&!String(i).trim()){t[e]=s.message;break}if(s.pattern&&!s.pattern.test(String(i))){t[e]=s.message;break}if(s.minLength!=null&&String(i).length<s.minLength){t[e]=s.message;break}if(s.maxLength!=null&&String(i).length>s.maxLength){t[e]=s.message;break}if(s.validator){let o=await s.validator(i);if(o!==!0){t[e]=typeof o=="string"?o:s.message;break}}}}return t}var Vr=async(l,n)=>async t=>{let{validation:e,onSubmit:r,onError:i,children:s}=t;return Kr("form",{class:"wf-form",onSubmit:async a=>{a.preventDefault();let c=a.target,u=new FormData(c),d={};for(let[f,p]of u.entries())if(f in d){let g=d[f];d[f]=Array.isArray(g)?[...g,p]:[g,p]}else d[f]=p;if(e){let f=await Wr(d,e);if(Object.keys(f).length>0){i?.(f);return}i?.({})}await r?.(d)},noValidate:e?!0:void 0},s)};import{h as Tt}from"weifuwu/ui-dom";var ut=async(l,n)=>async t=>{let{label:e,required:r,error:i,hint:s,children:o}=t,a=[];if(e){let c=[e];r&&c.push(Tt("span",{class:"wf-field-req"},"*")),a.push(Tt("label",{class:"wf-field-label"},c))}return a.push(o),i&&a.push(Tt("div",{class:"wf-field-err"},i)),s&&!i&&a.push(Tt("div",{class:"wf-field-hint"},s)),Tt("div",{class:`wf-field${i?" wf-field--err":""}`},a)};import{h as dt}from"weifuwu/ui-dom";var Fr=async(l,n)=>async t=>{let{label:e,value:r=0,min:i=0,max:s=100,step:o=1,onChange:a,disabled:c}=t,u=Number(r),d=s>i?(u-i)/(s-i)*100:0,f=`linear-gradient(to right, var(--wf-color-primary) ${d}%, var(--wf-color-border) ${d}%)`,p=dt("input",{type:"range",class:["wf-slider-input",c?"wf-slider-input--dis":""].filter(Boolean).join(" "),value:u,min:i,max:s,step:o,disabled:c||void 0,"aria-label":e,"aria-disabled":c?"true":void 0,style:{background:f},onChange:c||!a?void 0:m=>a(Number(m.target.value))}),g=dt("span",{class:"wf-slider-value"},String(u));return e?dt("div",{class:"wf-slider-wrap"},[dt("label",{class:"wf-slider-label"},e),dt("div",{class:"wf-slider"},[p,g])]):dt("div",{class:"wf-slider"},[p,g])};import{h as ft}from"weifuwu/ui-dom";var Gr=async(l,n)=>async t=>{let{value:e="",placeholder:r="\u641C\u7D22...",onInput:i,onClear:s,disabled:o}=t,a=e&&s?ft("button",{class:"wf-search-clear",type:"button","aria-label":"\u6E05\u9664",onClick:s},ft(T,{name:"close"})):null,c=ft("span",{class:"wf-search-icon"},ft(T,{name:"search"}));return ft("div",{class:"wf-search"},[c,ft("input",{class:["wf-search-input",o?"wf-search-input--dis":""].filter(Boolean).join(" "),type:"search",value:e,placeholder:r,disabled:o||void 0,"aria-disabled":o?"true":void 0,onInput:i}),a].filter(Boolean))};import{h as so}from"weifuwu/ui-dom";var qr=async(l,n)=>async t=>{let{options:e,size:r="md",block:i,ariaLabel:s}=t,o=n?.ui?.useControlled({value:t.value,onChange:t.onChange,name:"SegmentedControl"}),a=u=>{let d=o?.controlled;o?.setValue(u),d||t.onChange?.(u)},c=["wf-segmented",r==="sm"&&"wf-segmented--sm",i&&"wf-segmented--block"].filter(Boolean).join(" ");return so("div",{class:c,role:"group","aria-label":s},e.map(u=>so("button",{type:"button",class:`wf-segmented-option${u.value===o?.value?" wf-segmented-option--active":""}`,"aria-pressed":u.value===o?.value?"true":"false",disabled:u.disabled||void 0,onClick:u.disabled?void 0:()=>a(u.value)},u.label)))};import{h as St}from"weifuwu/ui-dom";var Ur=async(l,n)=>async t=>{let{value:e,max:r=100,label:i,showValue:s,status:o="default",size:a="md"}=t,c=e==null,u=c?0:Math.min(100,Math.max(0,e/r*100)),d=n?.i18n?.components?.ProgressBar??{},f=St("div",{class:`wf-progress wf-progress--${a}${c?" wf-progress--indeterminate":""}${o!=="default"?` wf-progress--${o}`:""}`,role:"progressbar","aria-valuenow":c?void 0:Math.round(e),"aria-valuemin":0,"aria-valuemax":Math.round(r),"aria-label":i??d.ariaLabel??"\u8FDB\u5EA6"},[St("div",{class:`wf-progress-fill${o!=="default"?` wf-progress-fill--${o}`:""}`,style:c?void 0:{width:`${u}%`}})]);if(!i&&!s)return f;let p=[];return i&&p.push(St("span",{class:"wf-progress-label"},i)),p.push(f),s&&!c&&p.push(St("span",{class:"wf-progress-value"},`${Math.round(u)}%`)),St("div",{class:"wf-progress-wrap"},p)};import{createClientBrowser as Jr}from"weifuwu/ui-dom";import{h as Et}from"weifuwu/ui-dom";var Yr=async(l,n)=>{let t=n.browser??Jr(),e=[],r=[],i=new Map,s=o=>{let a=i.get(o);return a||(a=c=>{c&&(r[o]=c)},i.set(o,a)),a};return async o=>{let{items:a=[],active:c,onChange:u,multiple:d=!1}=o;e.length===0&&a.length>0&&(e=a.map(y=>y.key));let f=c!==void 0,p=f?c:e,g=y=>p.includes(y),m=y=>{f?u?.(y):(e=y,n.ui.render())},h=y=>{g(y)?m(p.filter(w=>w!==y)):m(d?[...p,y]:[y])},b=y=>{let w=t?.activeElement()??null,x=r.indexOf(w);if(x<0)return;let k=x;if(y.key==="ArrowDown"||y.key==="ArrowRight")k=(x+1)%a.length;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")k=(x-1+a.length)%a.length;else return;y.preventDefault(),r[k]?.focus()};if(a.length===0)return null;let v=a.map((y,w)=>{let x=g(y.key);return Et("div",{class:`wf-accordion-item${x?" wf-accordion-item--open":""}`,key:y.key},[Et("button",{type:"button",class:"wf-accordion-summary",ref:s(w),disabled:y.disabled||void 0,"aria-expanded":x?"true":"false",onClick:y.disabled?void 0:()=>h(y.key)},[y.title,Et(T,{name:"chevron-down",size:14,className:"wf-accordion-arrow"})]),x&&y.content?Et("div",{class:"wf-accordion-content"},y.content):null].filter(Boolean))});return Et("div",{class:"wf-accordion",onKeyDown:b},v)}};import{h as $t}from"weifuwu/ui-dom";var Qr=async(l,n)=>async t=>{let{title:e,sub:r,display:i,children:s}=t;return $t("div",{class:"wf-page-head"},[$t("div",{class:"wf-page-head-left"},[$t("h2",{class:`wf-page-title${i?" wf-page-title--display":""}`},e),r?$t("p",{class:"wf-page-sub"},r):null].filter(Boolean)),s?$t("div",{class:"wf-page-head-actions"},s):null].filter(Boolean))};import{h as Lt}from"weifuwu/ui-dom";var Xr=async(l,n)=>async t=>{let{items:e}=t,r=e.flatMap((s,o)=>{let a=o===e.length-1,c=a?Lt("span",{class:"wf-breadcrumb-current","aria-current":"page"},s.label):s.href?Lt("a",{class:"wf-breadcrumb-link",href:s.href},s.label):Lt("span",{class:"wf-breadcrumb-text"},s.label);return a?c:[c,Lt("span",{class:"wf-breadcrumb-sep","aria-hidden":"true"},"/")]}),i=n?.i18n?.components?.Breadcrumb??{};return Lt("nav",{class:"wf-breadcrumb","aria-label":i.ariaLabel??"\u9762\u5305\u5C51"},r)};import{h as wn}from"weifuwu/ui-dom";var Zr=async(l,n)=>async t=>{let{vertical:e,children:r}=t;return e?wn("div",{class:"wf-divider wf-divider--vertical",role:"separator"}):wn("div",{class:r?"wf-divider wf-divider--with-text":"wf-divider",role:"separator"},r?wn("span",{class:"wf-divider-text"},r):void 0)};import{h as se}from"weifuwu/ui-dom";function ao(l){return l<1024?`${l}B`:l<1024*1024?`${(l/1024).toFixed(1)}KB`:`${(l/(1024*1024)).toFixed(1)}MB`}var vn=async(l,n)=>{let t=n?.i18n?.components?.FileUpload??{},e=null,r=p=>{p&&(e=p)},i=new Map,s=p=>`${p.name}:${p.size}`,o=p=>{if(!p.type.startsWith("image/"))return;let g=s(p),m=i.get(g);return!m&&typeof URL<"u"&&URL.createObjectURL&&(m=URL.createObjectURL(p),i.set(g,m)),m},a=p=>{if(!p){for(let g of i.values())URL.revokeObjectURL?.(g);i.clear()}},c=!1,u={...l},d=!1,{dropProps:f}=n.ui.useDragDrop({onDrop:p=>{if(d=!1,n.ui.render(),u.disabled)return;let g=Array.from(p.dataTransfer?.files??[]);u.maxSize&&g.filter(h=>h.size>u.maxSize).length>0||u.onChange?.(g)},onDragOver:()=>{d||(d=!0,n.ui.render())},onDragLeave:()=>{d&&(d=!1,n.ui.render())}});return async p=>{Object.assign(u,p);let{accept:g,multiple:m,maxSize:h,disabled:b,error:v,hint:y,value:w,onChange:x,children:k,uploading:S,progress:P}=p,I=w??[];w!==void 0&&!x&&!c&&(c=!0,console.warn(`[weifuwu/FileUpload] value \u5DF2\u4F20\uFF08\u53D7\u63A7\uFF09\u4F46\u672A\u63D0\u4F9B onChange\u2014\u2014\u9009\u62E9/\u5220\u9664\u65E0\u6CD5\u751F\u6548\u3002
1
+ import{h as Zn}from"weifuwu/ui-dom";var pr={"chevron-down":["M6 9l6 6 6-6"],"chevron-up":["M6 15l6-6 6 6"],"chevron-left":["M15 18l-6-6 6-6"],"chevron-right":["M9 18l6-6-6-6"],"arrow-left":["M19 12H5","M12 19l-7-7 7-7"],"arrow-up":["M12 19V5","M5 12l7-7 7 7"],"arrow-down":["M12 5v14","M19 12l-7 7-7-7"],"arrow-right":["M5 12h14","M12 5l7 7-7 7"],sort:["M7 15l5 5 5-5","M7 9l5-5 5 5"],"sort-asc":["M12 19V5","M5 12l7-7 7 7"],"sort-desc":["M12 5v14","M19 12l-7 7-7-7"],check:["M20 6L9 17l-5-5"],close:["M18 6L6 18","M6 6l12 12"],alert:["M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","M12 9v4","M12 17h.01"],info:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 16v-4","M12 8h.01"],warning:["M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","M12 9v4","M12 17h.01"],pause:["M6 4h4v16H6z","M14 4h4v16h-4z"],settings:["M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"],search:["M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M21 21l-4.35-4.35"],send:["M22 2L11 13","M22 2l-7 20-4-9-9-4 20-7z"],stop:["M6 6h12v12H6z"],retry:["M1 4v6h6","M23 20v-6h-6","M20.49 9A9 9 0 0 0 5.64 5.64L1 10","M3.51 15a9 9 0 0 0 14.85 3.36L23 14"],upload:["M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4","M17 8l-5-5-5 5","M12 3v12"],trash:["M3 6h18","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14","M10 11v6","M14 11v6"],edit:["M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"],plus:["M12 5v14","M5 12h14"],copy:["M20 9h-9a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2z","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"],eye:["M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"],"eye-off":["M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94","M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19","M14.12 14.12a3 3 0 1 1-4.24-4.24","M1 1l22 22"],star:["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"],dashboard:["M3 13h8V3H3z","M21 13h-8V9h8z","M21 21h-8v-8h8z","M3 21h8v-8H3z"],grid:["M3 3h7v7H3z","M14 3h7v7h-7z","M14 14h7v7h-7z","M3 14h7v7H3z"],box:["M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z","M3.27 6.96L12 12.01l8.73-5.05","M12 22.08V12"],users:["M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2","M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z","M23 21v-2a4 4 0 0 0-3-3.87","M16 3.13a4 4 0 0 1 0 7.75"],user:["M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2","M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z"],home:["M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z","M9 22V12h6v10"],folder:["M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"],file:["M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z","M13 2v7h7"],"file-text":["M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z","M13 2v7h7","M9 13h6","M9 17h6"],calendar:["M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z","M16 3v4","M8 3v4","M3 11h18"],clock:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 6v6l4 2"],bell:["M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9","M13.73 21a2 2 0 0 1-3.46 0"],menu:["M3 12h18","M3 6h18","M3 18h18"],activity:["M22 12h-4l-3 9L9 3l-3 9H2"],"trending-up":["M23 6l-9.5 9.5-5-5L1 18","M17 6h6v6"],"trending-down":["M23 18l-9.5-9.5-5 5L1 6","M17 18h6v-6"],database:["M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z","M21 12c0 1.66-4.03 3-9 3s-9-1.34-9-3","M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"],server:["M20 4H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z","M4 14h16","M20 14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2","M7 18h.01","M12 18h.01"],heart:["M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"],refresh:["M23 4v6h-6","M1 20v-6h6","M3.51 9a9 9 0 0 1 14.85-3.36L23 10","M20.49 15a9 9 0 0 1-14.85 3.36L1 14"],message:["M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"],inbox:["M22 12h-6l-2 3h-4l-2-3H2","M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"],shield:["M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"],zap:["M13 2L3 14h9l-1 8 10-12h-9l1-8z"],target:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12z","M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"],mail:["M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z","M22 6l-10 7L2 6"],"external-link":["M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6","M15 3h6v6","M10 14L21 3"],"log-out":["M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4","M16 17l5-5-5-5","M21 12H9"],lock:["M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z","M7 11V7a5 5 0 0 1 10 0v4"],list:["M8 6h13","M8 12h13","M8 18h13","M3 6h.01","M3 12h.01","M3 18h.01"],"bar-chart":["M12 20V10","M18 20V4","M6 20v-4"],gauge:["M12 15l3.5-3.5","M20.39 18.39A10 10 0 1 0 3.61 18.39","M12 15a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"],paperclip:["M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"],filter:["M22 3H2l8 9.46V19l4 2v-8.54L22 3z"],layers:["M12 2L2 7l10 5 10-5-10-5z","M2 17l10 5 10-5","M2 12l10 5 10-5"],"map-pin":["M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z","M15 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"],"book-open":["M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"],github:["M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"],tag:["M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z","M7 7h.01"],phone:["M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"],"more-vertical":["M12 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","M12 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","M12 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"],"check-circle":["M22 11.08V12a10 10 0 1 1-5.93-9.14","M22 4L12 14.01l-3-3"],"alert-circle":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 8v4","M12 16h.01"],wifi:["M5 12.55a11 11 0 0 1 14.08 0","M1.42 9a16 16 0 0 1 21.16 0","M8.53 16.11a6 6 0 0 1 6.95 0","M12 20h.01"],cpu:["M9 9h6v6H9z","M9 1v4","M15 1v4","M9 19v4","M15 19v4","M1 9h4","M1 15h4","M19 9h4","M19 15h4","M5 5h14v14H5z"],"hard-drive":["M22 12H2","M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z","M6 16h.01","M10 16h.01"],globe:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M2 12h20","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"],briefcase:["M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16","M2 20h20","M4 4h16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"],layout:["M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z","M9 3v18","M3 9h18"]},T=async(l,n)=>async t=>{let{name:e,size:r,className:i}=t;return Zn("svg",{class:`wf-icon${i?" "+i:""}`,width:r??"1em",height:r??"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},pr[e].map(s=>Zn("path",{d:s})))};import{h as eo}from"weifuwu/ui-dom";var st=async(l,n)=>async t=>{let{variant:e="primary",size:r="md",block:i,loading:s,disabled:o,type:a,onClick:c,children:u}=t,d=["wf-btn",`wf-btn--${e}`,`wf-btn--${r}`,i&&"wf-btn--block",s&&"wf-btn--loading"].filter(Boolean).join(" "),f=n?.i18n?.components?.Button??{};return eo("button",{id:t.id,title:t.title,class:d,type:a??"button",disabled:o||s||void 0,"aria-busy":s||void 0,onClick:c},s?[eo("span",{class:"wf-btn-spinner"}),f.loading??"\u52A0\u8F7D\u4E2D..."]:u)};import{h as at}from"weifuwu/ui-dom";var _t=async l=>async n=>{let{label:t,name:e,type:r="text",value:i,placeholder:s,required:o,disabled:a,readonly:c,error:u,hint:d,variant:f="default",onInput:p,onChange:g,...m}=n,h=at("input",{class:`wf-input${f==="borderless"?" wf-input--borderless":""}`,name:e||void 0,type:r,value:i??"",placeholder:s,required:o||void 0,disabled:a||void 0,readonly:c||void 0,onInput:p,onChange:g,...m});if(!t&&!u&&!d)return h;let b=[];if(t){let v=[t];o&&v.push(at("span",{class:"wf-input-req"},"*")),b.push(at("label",{class:"wf-input-label"},v))}return b.push(h),u&&b.push(at("div",{class:"wf-input-err"},u)),d&&!u&&b.push(at("div",{class:"wf-input-hint"},d)),at("div",{class:`wf-input-wrap${u?" wf-input--err":""}`},b)};import{h as Xe}from"weifuwu/ui-dom";var ur=async(l,n)=>async t=>{let{label:e,value:r,placeholder:i,required:s,disabled:o,error:a,hint:c,rows:u=3,maxLength:d,showCount:f,onInput:p}=t,g=Xe("textarea",{class:"wf-textarea",value:r??"",placeholder:i,required:s||void 0,disabled:o||void 0,rows:u,maxLength:d,onInput:p}),m=[];if(e){let h=[e];s&&h.push(Xe("span",{class:"wf-textarea-req"},"*")),m.push(Xe("label",{class:"wf-textarea-label"},h))}if(m.push(g),f){let h=(r??"").length,b=d!=null&&h>d;m.push(Xe("div",{class:`wf-textarea-count${b?" wf-textarea-count--over":""}`,"aria-live":"polite"},d!=null?`${h}/${d}`:String(h)))}return a&&m.push(Xe("div",{class:"wf-textarea-err"},a)),c&&!a&&m.push(Xe("div",{class:"wf-textarea-hint"},c)),Xe("div",{class:`wf-textarea-wrap${a?" wf-textarea--err":""}`},m)};import{h as te}from"weifuwu/ui-dom";function Kt(l){return"options"in l&&!("value"in l)}function pn(l){return l?l.flatMap(n=>Kt(n)?n.options:[n]):[]}var dr=async(l,n)=>async t=>{let{label:e,value:r,options:i,placeholder:s,required:o,disabled:a,error:c,onChange:u,children:d}=t,f=[];if(s&&f.push(te("option",{value:"",disabled:!0},s)),i)for(let m of i)Kt(m)?f.push(te("optgroup",{label:m.label},m.options.map(h=>te("option",{value:h.value,disabled:h.disabled},h.label)))):f.push(te("option",{value:m.value,disabled:m.disabled},m.label));let p=te("select",{class:"wf-select",value:r??"",required:o||void 0,disabled:a||void 0,onChange:m=>u?.(m.target.value)},d??f),g=[];if(e){let m=[e];o&&m.push(te("span",{class:"wf-select-req"},"*")),g.push(te("label",{class:"wf-select-label"},m))}return g.push(p),c&&g.push(te("div",{class:"wf-select-err"},c)),te("div",{class:`wf-select-wrap${c?" wf-select--err":""}`},g)},fr=async(l,n)=>{let t=!1,e="",r=[],i=-1,s=!1,o;n.ui.useStableRef?.(()=>{},()=>{s=!0,o&&clearTimeout(o)});let a=null,c=null,u=p=>{p&&(a=p)},d=p=>{p&&(c=p)},f=n.ui.usePopup({trigger:()=>"click",placement:()=>"bottom",center:!1,gap:4,el:()=>a,isOpen:()=>t,setOpen:p=>{t=p,n.ui.render()}});return async p=>{let{label:g,value:m,options:h=[],placeholder:b,required:v,disabled:y,error:w,onChange:x,onSearch:k,multiple:S}=p,P=!!S,I=P?Array.isArray(m)?m:[]:[m],$=(W,H)=>{if(!H)return W;let X=H.toLowerCase();return W.flatMap(F=>{if(Kt(F)){let ee=F.options.filter(oe=>oe.label.toLowerCase().includes(X));return ee.length?[{label:F.label,options:ee}]:[]}return F.label.toLowerCase().includes(X)?[F]:[]})},L=e&&k&&r.length>0?r:$(h,e),E=pn(L),B=pn(h),D=B.find(W=>W.value===m),N=B.filter(W=>I.includes(W.value)),O=async W=>{if(e=W,t=!0,i=0,n.ui.render(),k&&W){let H=await k(W);H&&(r=H,n.ui.render())}},M=W=>{if(!W.disabled)if(P){let H=Array.isArray(m)?[...m]:[],X=H.indexOf(W.value);X>=0?H.splice(X,1):H.push(W.value),x?.(H)}else e="",t=!1,n.ui.render(),x?.(W.value)},C=W=>{if(!P)return;let H=Array.isArray(m)?[...m]:[];x?.(H.filter(X=>X!==W))},A=W=>{if(!y)if(W.key==="ArrowDown")W.preventDefault(),t=!0,i=Math.min(i+1,E.length-1),n.ui.render();else if(W.key==="ArrowUp")W.preventDefault(),t=!0,i=Math.max(i-1,0),n.ui.render();else if(W.key==="Enter"){W.preventDefault();let H=E[i];H&&M(H)}else W.key==="Escape"&&(W.preventDefault(),t=!1,e="",n.ui.render())},R=P&&N.length>0?N.map(W=>te("span",{class:"wf-select-tag",key:W.value},[W.label,te("button",{type:"button",class:"wf-select-tag-close","aria-label":`\u79FB\u9664 ${W.label}`,onClick:H=>{H.stopPropagation(),C(W.value)}},te(T,{name:"close",size:10}))])):[],z=P?"":t?e:D?.label??"",U=te("div",{key:"select-trigger",class:`wf-select-search-trigger${y?" wf-select-search--disabled":""}${w?" wf-select--err":""}`,ref:u,role:"combobox","aria-haspopup":"listbox","aria-expanded":String(t),onClick:y?void 0:()=>{t=!0,n.ui.render(),c?.focus()}},[...R,te("input",{key:"select-search-input",ref:d,class:"wf-select-search-input",type:"text",value:P?"":t?e:D?.label??"",placeholder:N.length>0?void 0:b??"",disabled:y,readOnly:!t||void 0,onInput:W=>O(W.target.value),onFocus:()=>{y||(t=!0,n.ui.render())},onBlur:()=>{o=setTimeout(()=>{s||(t=!1,e="",n.ui.render())},150)},onKeyDown:A})]),V=[];if(g){let W=[g];v&&W.push(te("span",{class:"wf-select-req"},"*")),V.push(te("label",{class:"wf-select-label"},W))}let _=0,J=(W,H)=>{let X=P?I.includes(W.value):W.value===m,F=te("div",{class:`wf-select-search-opt${X?" wf-select-search-opt--sel":""}${W.disabled?" wf-select-search-opt--dis":""}${i===H?" wf-select-search-opt--hl":""}`,key:W.value,onMouseDown:ee=>{ee.preventDefault(),M(W)}},W.label);return _++,F},Q=[];if(E.length>0)for(let W of L)if(Kt(W)){Q.push(te("div",{class:"wf-select-search-group",key:`group-${W.label}`},W.label));for(let H of W.options)Q.push(J(H,_))}else Q.push(J(W,_));else e&&Q.push(te("div",{class:"wf-select-search-empty"},"\u65E0\u5339\u914D"));let K=te("div",{class:"wf-select-search-menu"},Q),Qe=f.portal(K,"wf-select-menu");return V.push(te("div",{class:"wf-select-search"},[U,Qe].filter(Boolean))),w&&V.push(te("div",{class:"wf-select-err"},w)),te("div",{class:`wf-select-wrap${w?" wf-select--err":""}`},V)}},Wt=async(l,n)=>{let t=await dr(l,n),e=await fr(l,n);return r=>r.searchable?e(r):t(r)};import{h as Ct}from"weifuwu/ui-dom";var un=async(l,n)=>async t=>{let{label:e,checked:r,disabled:i,onChange:s}=t,o=Ct("input",{type:"checkbox",class:"wf-checkbox-input",checked:r||void 0,disabled:i||void 0,onChange:s?c=>s(c.target.checked):void 0}),a=Ct("span",{class:"wf-checkbox-visual"});return e?Ct("label",{class:"wf-checkbox"},[o,a,Ct("span",{class:"wf-checkbox-label"},e)]):Ct("label",{class:"wf-checkbox"},[o,a])};import{h as kt}from"weifuwu/ui-dom";var Vt=async(l,n)=>async t=>{let{label:e,checked:r,disabled:i,onChange:s}=t,o=kt("input",{type:"checkbox",class:"wf-switch-input",checked:r||void 0,disabled:i||void 0,role:"switch","aria-checked":String(!!r),onChange:s?u=>s(u.target.checked):void 0}),a=kt("span",{class:"wf-switch-track"}),c=n?.i18n?.components?.Switch??{};return e?kt("label",{class:"wf-switch"},[o,a,kt("span",{class:"wf-switch-label"},e)]):kt("label",{class:"wf-switch","aria-label":c.ariaLabel??"\u5207\u6362"},[o,a])};import{h as Mt}from"weifuwu/ui-dom";var mr=async(l,n)=>async t=>{let{name:e,options:r=[],inline:i}=t,s=n?.ui?.useControlled({value:t.value,onChange:t.onChange,name:"RadioGroup"}),o=c=>{let u=s?.controlled;s?.setValue(c),u||t.onChange?.(c)},a=r.map(c=>{let u=Mt("input",{type:"radio",class:"wf-radio-input",name:e??"radio",value:c.value,checked:s?.value===c.value||void 0,disabled:c.disabled||void 0,onChange:()=>o(c.value)}),d=Mt("span",{class:"wf-radio-visual"}),f=Mt("span",{class:"wf-radio-label-text"},c.label);return Mt("label",{class:"wf-radio",key:c.value},[u,d,f])});return Mt("div",{class:`wf-radio-group${i?" wf-radio-group--inline":""}`},a)};import{h as pe}from"weifuwu/ui-dom";function gr(l,n,t,e){if(!t||!e)return l;let r=n.find(s=>s.key===t);if(!r||!r.sortable)return l;let i=[...l];return i.sort((s,o)=>{let a=s[t],c=o[t],u=r.sorter?r.sorter(a,c):String(a??"").localeCompare(String(c??""));return e==="desc"?-u:u}),i}var hr=async(l,n)=>async t=>{let{data:e=[],columns:r,onRowClick:i,sortKey:s,sortOrder:o,onSort:a,emptyText:c,rowSelection:u}=t,d=gr(e,r,s,o),f=(E,B)=>E[u?.rowKey??"id"]??B,p=u?.selectedRowKeys??[],g=new Set(p.map(String)),m=d.map((E,B)=>String(f(E,B))),h=m.length>0&&m.every(E=>g.has(E)),b=m.some(E=>g.has(E)),v=()=>{if(!u?.onChange)return;let E=h?[]:m.map(B=>d.find((D,N)=>String(f(D,N))===B));u.onChange(h?[]:m,h?[]:E)},y=(E,B)=>{if(!u?.onChange)return;let D=String(f(E,B)),N=g.has(D)?p.filter(M=>String(M)!==D):[...p,D],O=N.map(M=>d.find((C,A)=>String(f(C,A))===String(M))).filter(Boolean);u.onChange(N,O)},w=u?pe("th",{class:"wf-table-th wf-table-th--selection",scope:"col"},pe("input",{type:"checkbox",class:"wf-table-checkbox",checked:h||void 0,indeterminate:b&&!h?"true":void 0,"aria-label":"\u5168\u9009",onChange:v})):null,x=(E,B)=>u?pe("td",{class:"wf-table-td wf-table-td--selection"},pe("input",{type:"checkbox",class:"wf-table-checkbox",checked:g.has(String(f(E,B)))||void 0,"aria-label":"\u9009\u62E9\u884C",onClick:D=>D.stopPropagation(),onChange:()=>y(E,B)})):null,k=r.map(E=>{let B=E.key===s&&o,D=o==="asc",N=E.label,O=E.sortable?pe(T,{name:B?D?"sort-asc":"sort-desc":"sort",className:`wf-table-sort-icon${B?" wf-table-sort-icon--active":""}`}):null,M=E.sortable&&a?()=>a(E.key,B&&D?"desc":"asc"):void 0;return pe("th",{class:`wf-table-th${E.sortable?" wf-table-th--sortable":""}${B?" wf-table-th--sorted":""}`,scope:"col",tabindex:E.sortable?0:void 0,style:E.width?{width:E.width}:void 0,onClick:M,onKeyDown:M?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),M())}:void 0},[N,O].filter(Boolean))}),S=pe("tr",{class:"wf-table-tr"},[w,...k].filter(Boolean)),P=pe("thead",{class:"wf-table-thead"},S),I;if(t.loading){let E=t.loadingRows??3;I=Array.from({length:E},(B,D)=>pe("tr",{class:"wf-table-tr wf-table-tr--loading",key:`loading-${D}`},r.map((N,O)=>pe("td",{class:"wf-table-td",key:`${D}-${O}`},pe("span",{class:"wf-skeleton wf-skeleton--text"})))))}else if(d.length===0&&c){let E=r.length+(u?1:0);I=[pe("tr",{class:"wf-table-tr"},pe("td",{class:"wf-table-td wf-table-empty",colspan:E,style:{textAlign:"center"}},c))]}else I=d.map((E,B)=>{let D=r.map(O=>{let M=E[O.key],C=O.render?O.render(M,E,B):String(M??"");return pe("td",{class:"wf-table-td"},C)}),N=x(E,B);return pe("tr",{class:"wf-table-tr",onClick:i?()=>i(E,B):void 0,style:i?{cursor:"pointer"}:void 0},[N,...D].filter(Boolean))});let $=pe("tbody",{class:"wf-table-tbody"},I),L=pe("table",{class:"wf-table",style:t.minWidth?{minWidth:t.minWidth}:void 0},[P,$]);return pe("div",{class:"wf-table-wrap"},L)};import{h as Ve}from"weifuwu/ui-dom";var it=async(l,n)=>{let t=!1,e=n.ui.usePopup({presence:!0,trapFocus:!0,lockScroll:!0,positioning:"none",closeOnOutside:!1,closeOnEscape:!1,isOpen:()=>t,setOpen:()=>{}}),r;return n.ui.useGlobalKey(i=>{i.key==="Escape"&&e.phase==="open"&&r?.()}),async i=>{let{open:s,title:o,onClose:a,children:c,footer:u,width:d,closable:f=!0,maskClosable:p=!0}=i;r=a,t=!!s;let g=n?.i18n?.components?.Modal??{},m=e.sync(t);if(m==="closed")return null;let h=Ve("div",{class:"wf-modal-overlay",onClick:p?a:void 0}),b=f?Ve("button",{class:"wf-modal-close",onClick:a,type:"button","aria-label":g.closeAria??"\u5173\u95ED"},Ve(T,{name:"close"})):null,v=o?Ve("div",{class:"wf-modal-header"},[o,b].filter(Boolean)):null,y=Ve("div",{class:"wf-modal-body"},c),w=u?Ve("div",{class:"wf-modal-footer"},u):null,x=Ve("div",{class:"wf-modal-content",onClick:S=>S.stopPropagation(),style:d?{minWidth:`min(${d}, calc(100vw - 32px))`,maxWidth:`min(${d}, calc(100vw - 32px))`}:void 0},[v,y,w].filter(Boolean)),k=Ve("div",{class:`wf-modal ${m==="exit"?"wf-modal--exit":"wf-modal--enter"}`,role:"dialog","aria-modal":"true","aria-label":o??g.ariaLabel??"\u5F39\u7A97"},[h,x]);return e.portal(k,"modal")}};import{createClientBrowser as yr}from"weifuwu/ui-dom";import{h as lt}from"weifuwu/ui-dom";import{mountCommand as br,unmountCommand as wr}from"weifuwu/ui-dom";var Ft=yr();function vr(){return l=>(l.confirm=(n,t)=>xr(n,t??{},l),l)}function xr(l,n,t){return new Promise(e=>{let r=Ft.createElement("div");if(!r){e(!1);return}Ft.bodyAppend(r);let i=!1,s,o=null;o=lt(async(c,u)=>{let d=!0;return s=f=>{if(i)return;i=!0,d=!1,u.ui.render(),e(f);let p=()=>{o&&wr(r,o,t)},g=Ft.query("#__wf_portal .wf-modal");if(g&&typeof g.addEventListener=="function"){let m=!1,h=()=>{m||(m=!0,p())};g.addEventListener("animationend",h,{once:!0}),Ft.timeout(h,600)}else p()},async()=>lt("div",{class:"wf-confirm-host"},lt(to,{open:d,title:n.title,message:l,confirmText:n.confirmText,cancelText:n.cancelText,variant:n.variant,width:n.width,maskClosable:n.maskClosable,onConfirm:()=>s?.(!0),onCancel:()=>s?.(!1)}))},{}),br(r,o,t)})}var to=async(l,n)=>async t=>{let{open:e=!1,title:r,message:i,confirmText:s,cancelText:o,variant:a="primary",width:c,maskClosable:u=!1,onConfirm:d,onCancel:f}=t,p=n?.i18n?.components?.Confirm??{},g=[lt(st,{variant:"secondary",size:"md",onClick:()=>f?.()},o??p.cancelText??"\u53D6\u6D88"),lt(st,{variant:a,size:"md",onClick:()=>d?.()},s??p.confirmText??"\u786E\u5B9A")];return lt(it,{open:e,title:r,onClose:f,maskClosable:u,footer:g,width:c,closable:!1},i)};import{createClientBrowser as Cr}from"weifuwu/ui-dom";import{h as Re}from"weifuwu/ui-dom";import{mountCommand as kr}from"weifuwu/ui-dom";import{animateOut as Mr}from"weifuwu/ui-dom";var dn=Cr();function Pr(l){return{"top-right":"wf-toast--tr","top-left":"wf-toast--tl","bottom-right":"wf-toast--br","bottom-left":"wf-toast--bl","top-center":"wf-toast--tc"}[l]??"wf-toast--tr"}var no=async(l,n)=>async t=>{let{toasts:e=[],onRemove:r,position:i="top-right",duration:s=0,max:o=0}=t,a=n.ui.usePopup?.({positioning:"none",closeOnOutside:!1,closeOnEscape:!1,isOpen:()=>!0,setOpen:()=>{}}),c=o>0&&e.length>o?e.slice(-o):e;if(c.length===0)return null;let u=c.map(d=>Re("div",{class:`wf-toast wf-toast--${d.type}`,key:d.id,role:d.type==="error"?"alert":"status","aria-live":d.type==="error"?"assertive":"polite","data-id":d.id,"data-duration":(d.duration??s)||void 0,onClick:r?()=>r(d.id):void 0},[Re("span",{class:"wf-toast-icon"},Re(T,{name:Tr(d.type)})),Re("span",{class:"wf-toast-msg"},d.message),d.action?Re("button",{class:`wf-toast-action wf-toast-action--${d.type}`,type:"button",onClick:f=>{f.stopPropagation(),d.action.onClick()}},d.action.label):null].filter(Boolean)));return a.portal(Re("div",{class:`wf-toast-container ${Pr(i)}`,"data-max":o||void 0},u),"toast")};function Tr(l){switch(l){case"success":return"check";case"error":return"close";case"warning":return"alert";case"info":return"info"}}function Sr(l){let n={position:l?.position??"top-right",duration:l?.duration??3e3,max:l?.max??3},t=null,e=null,r=0,i=async(o,a)=>{let c=[],u=()=>a.ui.render();return t={add:d=>{c=[...c,d],u()},remove:d=>{let f=dn.query(`.wf-toast[data-id="${d}"]`);if(f){f.classList.add("wf-toast-out");let p=getComputedStyle(f).animationName;if(p&&p!=="none"){Mr(f,()=>{c=c.filter(g=>g.id!==d),u()});return}}c=c.filter(p=>p.id!==d),u()}},async()=>Re("div",{class:"wf-toast-host"},[Re(no,{toasts:c,position:n.position,duration:n.duration,max:n.max,onRemove:d=>t?.remove(d)})])},s=()=>{if(t||!e)return;let o=dn.createElement("div");o&&(dn.bodyAppend(o),kr(o,Re(i,{}),e))};return o=>(e=o,o.toast=(a,c="info",u,d)=>{s();let f=String(++r);t?.add({id:f,type:c,message:a,duration:u,action:d});let p=u??n.duration;p>0&&setTimeout(()=>t?.remove(f),p)},o)}import{h as ct}from"weifuwu/ui-dom";var fn=async(l,n)=>async t=>{let{variant:e="info",closable:r,onClose:i,children:s}=t;if(!s)return null;let o=ct("span",{class:"wf-alert-icon"},ct(T,{name:Er(e)})),a=r?ct("button",{class:"wf-alert-close",onClick:i,type:"button","aria-label":"\u5173\u95ED"},ct(T,{name:"close"})):null,c=ct("span",{class:"wf-alert-msg"},s);return ct("div",{class:`wf-alert wf-alert--${e}`,role:"alert"},[o,c,a].filter(Boolean))};function Er(l){switch(l){case"success":return"check";case"error":return"close";case"warning":return"alert";case"info":return"info"}}import{h as mn}from"weifuwu/ui-dom";var $r=async(l,n)=>async t=>{let{text:e="\u52A0\u8F7D\u4E2D..."}=t;return mn("div",{class:"wf-loading",role:"status","aria-live":"polite"},[mn("div",{class:"wf-loading-spinner"}),mn("span",{class:"wf-loading-text"},e)])};import{h as pt}from"weifuwu/ui-dom";var Lr=async(l,n)=>async t=>{let{icon:e=pt(T,{name:"inbox"}),text:r="\u6682\u65E0\u6570\u636E",hint:i,children:s}=t,o=[pt("div",{class:"wf-empty-icon"},e),pt("div",{class:"wf-empty-text"},r)];return i&&o.push(pt("div",{class:"wf-empty-hint"},i)),s&&o.push(pt("div",{class:"wf-empty-action"},s)),pt("div",{class:"wf-empty",role:"status"},o)};import{createClientBrowser as Ir}from"weifuwu/ui-dom";import{h as Pt}from"weifuwu/ui-dom";var Dr=async(l,n)=>{let t=n?.browser??Ir(),e=0,r=0,i=null,s=c=>{c&&(e=c.offsetLeft,r=c.offsetWidth,n.ui.render())},o=()=>{i&&s(i.querySelector(".wf-tab--active"))},a=c=>{c&&(i=c,queueMicrotask(o))};return async c=>{let{items:u=[]}=c;if(u.length===0)return null;let d=n?.ui?.useControlled({value:c.active,onChange:c.onChange,name:"Tabs"}),f=y=>{let w=d?.controlled;d?.setValue(y),w||c.onChange?.(y)},p=d?.value??u[0].key,g=y=>{let w=y.currentTarget,x=Array.from(w.querySelectorAll(".wf-tab")),k=x.indexOf(t?.activeElement()??null);if(k<0||!d)return;let S=k;if(y.key==="ArrowRight")S=(k+1)%x.length;else if(y.key==="ArrowLeft")S=(k-1+x.length)%x.length;else if(y.key==="Home")S=0;else if(y.key==="End")S=x.length-1;else return;y.preventDefault();let P=u[S];P&&P.key!==u[k].key&&(f(P.key),x[S].focus(),s(x[S]))},m=u.map(y=>Pt("button",{class:`wf-tab${y.key===p?" wf-tab--active":""}`,key:y.key,role:"tab",tabindex:y.key===p?0:-1,"aria-selected":y.key===p?"true":"false",onClick:y.key!==p?(w=>{s(w?.currentTarget),f(y.key)}):void 0},y.label)),h=Pt("span",{class:"wf-tab-ink",style:{transform:`translateX(${e}px)`,width:`${r}px`},"aria-hidden":"true"}),b=u.find(y=>y.key===p),v=b?.content?Pt("div",{class:"wf-tab-content",role:"tabpanel"},b.content):null;return Pt("div",{class:"wf-tabs",role:"tablist",onKeyDown:g},[Pt("div",{class:"wf-tab-list",ref:a},[...m,h]),v].filter(Boolean))}};import{h as gn}from"weifuwu/ui-dom";var Ar=async(l,n)=>{let t=null,e=a=>{t=a},r=null,i=0,s=!1,o=n.ui.usePopup({trigger:"click",el:()=>t,isOpen:()=>r?.open??!1,setOpen:a=>r?.setOpen(a)});return async a=>{let{trigger:c,items:u=[]}=a;r=n.ui.useOpen({open:a.open,onOpenChange:a.onOpenChange,name:"Dropdown"});let d=!!r?.open;d&&!s&&(i=0),s=d;let f=m=>{let h=m.key;if(h==="Escape")return;let b=u.map((w,x)=>w.disabled?-1:x).filter(w=>w>=0);if(!b.length)return;let v=b.indexOf(i),y=v>=0?v:0;if(h==="ArrowDown"||h==="ArrowRight")m.preventDefault(),i=b[Math.min(y+1,b.length-1)],n.ui.render();else if(h==="ArrowUp"||h==="ArrowLeft")m.preventDefault(),i=b[Math.max(y-1,0)],n.ui.render();else if(h==="Home")m.preventDefault(),i=b[0],n.ui.render();else if(h==="End")m.preventDefault(),i=b[b.length-1],n.ui.render();else if(h==="Enter"||h===" "){let w=u[i];w&&!w.disabled&&(m.preventDefault(),w.onClick?.(),r?.setOpen(!1))}},p=u.map((m,h)=>gn("button",{class:["wf-dropdown-item",m.variant==="danger"?" wf-dropdown-item--danger":"",h===i&&d?" wf-dropdown-item--hl":""].filter(Boolean).join(" "),key:m.value??h,disabled:m.disabled||void 0,role:"menuitem","aria-selected":String(h===i&&d),onClick:m.disabled?void 0:()=>{m.onClick?.()}},m.label)),g=gn("div",{class:"wf-dropdown-menu",role:"menu",onKeyDown:f},p);return gn("div",{class:`wf-dropdown${r?.open?" wf-dropdown--open":""}`,ref:e,...o.wrapProps,"aria-haspopup":"menu","aria-expanded":String(!!r?.open)},[c,o.portal(g,"dropdown")].filter(Boolean))}};import{h as Ze}from"weifuwu/ui-dom";var Or=async(l,n)=>async t=>{let{total:e,pageSize:r=20}=t,i=n?.ui?.useControlled({value:t.page,onChange:t.onChange,name:"Pagination"}),s=i?.value??1,o=f=>{let p=i?.controlled;i?.setValue(f),p||t.onChange?.(f)},a=n?.i18n?.components?.Pagination??{},c=Math.max(1,Math.ceil(e/r));if(c<=1)return null;let u=[];u.push(Ze("button",{class:`wf-page-btn${s<=1?" wf-page-btn--disabled":""}`,disabled:s<=1,"aria-label":a.prevAria??"\u4E0A\u4E00\u9875",onClick:s>1?()=>o(s-1):void 0},Ze(T,{name:"chevron-left"})));let d=Rr(s,c);for(let f of d)f==="..."?u.push(Ze("span",{class:"wf-page-ellipsis"},"...")):u.push(Ze("button",{class:`wf-page-btn${f===s?" wf-page-btn--active":""}`,"aria-current":f===s?"page":void 0,onClick:f!==s?()=>o(f):void 0},String(f)));return u.push(Ze("button",{class:`wf-page-btn${s>=c?" wf-page-btn--disabled":""}`,disabled:s>=c,"aria-label":a.nextAria??"\u4E0B\u4E00\u9875",onClick:s<c?()=>o(s+1):void 0},Ze(T,{name:"chevron-right"}))),Ze("nav",{class:"wf-pagination","aria-label":a.ariaLabel??"\u5206\u9875"},u)};function Rr(l,n){if(n<=7)return Array.from({length:n},(i,s)=>s+1);let t=[1];l>3&&t.push("...");let e=Math.max(2,l-1),r=Math.min(n-1,l+1);for(let i=e;i<=r;i++)t.push(i);return l<n-2&&t.push("..."),t.push(n),t}import{h as Br}from"weifuwu/ui-dom";var hn=async(l,n)=>async t=>{let{variant:e="default",padding:r="md",clickable:i,hover:s,active:o,onClick:a,className:c,style:u,children:d}=t,f=["wf-card",`wf-card--${e}`,`wf-card--pad-${r}`,i&&"wf-card--clickable",s&&"wf-card--hover",o&&"wf-card--active",(i||s)&&"wf-elevate"].filter(Boolean).join(" ");return Br("div",{class:c?`${f} ${c}`:f,style:u,onClick:a,role:i?"button":void 0,tabindex:i?0:void 0,onKeyDown:i?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a?.())}:void 0},d)};import{h as yn}from"weifuwu/ui-dom";var Hr=async(l,n)=>async t=>{let{variant:e="default",dot:r,children:i,count:s,overflowCount:o=99,showZero:a=!1}=t;if(r)return yn("span",{class:`wf-badge-dot wf-badge-dot--${e}`});if(s!=null){if(s===0&&!a)return null;let c=s>o?`${o}+`:String(s);return yn("span",{class:`wf-badge wf-badge--count wf-badge--${e}`,"aria-label":`${s>o?`\u8D85\u8FC7 ${o}`:s} \u6761`},c)}return yn("span",{class:`wf-badge wf-badge--${e}`},i??"")};import{h as oo}from"weifuwu/ui-dom";var ro=["#4f6ef7","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899"];function Nr(l){let n=0;for(let t=0;t<l.length;t++)n=l.charCodeAt(t)+((n<<5)-n);return ro[Math.abs(n)%ro.length]}var bn=async(l,n)=>async t=>{let{name:e="",src:r,size:i="md",color:s}=t,o=Array.from(e.trim())[0]?.toUpperCase()??"?";return r?oo("img",{class:`wf-avatar wf-avatar--${i}`,src:r,alt:e}):oo("div",{class:`wf-avatar wf-avatar--${i}`,style:{background:s??Nr(e)}},o)};import{h as Gt}from"weifuwu/ui-dom";var zr=async(l,n)=>async t=>{let{closable:e,onClose:r,variant:i="default",children:s}=t,o=e?Gt("button",{class:"wf-tag-close",onClick:r,type:"button","aria-label":"\u79FB\u9664"},Gt(T,{name:"close"})):null;return Gt("span",{class:`wf-tag wf-tag--${i}`},[Gt("span",{class:"wf-tag-text"},s),o].filter(Boolean))};import{h as Fe}from"weifuwu/ui-dom";var jr=async(l,n)=>{let t=n.ui.useTween(0,{duration:400,ease:"easeOutCubic"}),e=0,r=null,i,s=()=>{r&&(clearInterval(r),r=null)};return async o=>{let{label:a,value:c,trend:u,trendLabel:d,icon:f,onClick:p,animate:g,countdown:m,onFinish:h}=o;i=h;let b=typeof c=="number"?c:0;g&&typeof c=="number"?t.reset(b):t.value=b,m!==void 0?(e=Math.max(0,Math.ceil((m-Date.now())/1e3)),r||(r=setInterval(()=>{e=Math.max(0,Math.ceil((m-Date.now())/1e3)),e<=0&&(s(),i?.()),n.ui.render()},1e3))):r&&s();let v=m!==void 0?(()=>{let w=Math.floor(e/3600),x=Math.floor(e%3600/60),k=e%60,S=P=>String(P).padStart(2,"0");return w>0?`${S(w)}:${S(x)}:${S(k)}`:`${S(x)}:${S(k)}`})():String(typeof c=="number"?t.value:c??""),y=[];return f&&y.push(Fe("div",{class:"wf-stat-icon"},f)),y.push(Fe("div",{class:"wf-stat-value wf-nums"},v)),y.push(Fe("div",{class:"wf-stat-label"},a)),u&&y.push(Fe("div",{class:`wf-stat-trend wf-stat-trend--${u}`},[Fe("span",{class:"wf-stat-trend-arrow"},Fe(T,{name:u==="up"?"arrow-up":"arrow-down"})),d?Fe("span",{class:"wf-stat-trend-label"},d):null].filter(Boolean))),Fe("div",{class:`wf-stat${p?" wf-stat--clickable":""}${p?" wf-elevate":""}`,onClick:p,role:p?"button":void 0,tabindex:p?0:void 0,onKeyDown:p?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),p())}:void 0},y)}};import{h as Ge}from"weifuwu/ui-dom";var _r=async(l,n)=>async t=>{let{items:e=[],active:r,current:i=0}=t,s=r??e[i]?.key,o=e.map((a,c)=>{let u=e.findIndex(v=>v.key===s),d=c<u,f=c===u,p=["wf-step",d&&"wf-step--done",f&&"wf-step--current"].filter(Boolean).join(" "),g=d?Ge("span",{class:"wf-step-num"},Ge(T,{name:"check"})):Ge("span",{class:"wf-step-num"},String(c+1)),m=Ge("span",{class:"wf-step-label"},a.label),h=a.description?Ge("span",{class:"wf-step-desc"},a.description):null,b=c<e.length-1?Ge("span",{class:`wf-step-connector${d?" wf-step-connector--done":""}`}):null;return Ge("div",{class:p,key:a.key,role:"listitem","aria-current":f?"step":void 0},[g,m,h,b].filter(Boolean))});return Ge("div",{class:"wf-steps",role:"list"},o)};import{h as Kr}from"weifuwu/ui-dom";async function Wr(l,n){let t={};for(let[e,r]of Object.entries(n)){let i=l[e]??"";for(let s of r){if(s.required&&!String(i).trim()){t[e]=s.message;break}if(s.pattern&&!s.pattern.test(String(i))){t[e]=s.message;break}if(s.minLength!=null&&String(i).length<s.minLength){t[e]=s.message;break}if(s.maxLength!=null&&String(i).length>s.maxLength){t[e]=s.message;break}if(s.validator){let o=await s.validator(i);if(o!==!0){t[e]=typeof o=="string"?o:s.message;break}}}}return t}var Vr=async(l,n)=>async t=>{let{validation:e,onSubmit:r,onError:i,children:s}=t;return Kr("form",{class:"wf-form",onSubmit:async a=>{a.preventDefault();let c=a.target,u=new FormData(c),d={};for(let[f,p]of u.entries())if(f in d){let g=d[f];d[f]=Array.isArray(g)?[...g,p]:[g,p]}else d[f]=p;if(e){let f=await Wr(d,e);if(Object.keys(f).length>0){i?.(f);return}i?.({})}await r?.(d)},noValidate:e?!0:void 0},s)};import{h as Tt}from"weifuwu/ui-dom";var ut=async(l,n)=>async t=>{let{label:e,required:r,error:i,hint:s,children:o}=t,a=[];if(e){let c=[e];r&&c.push(Tt("span",{class:"wf-field-req"},"*")),a.push(Tt("label",{class:"wf-field-label"},c))}return a.push(o),i&&a.push(Tt("div",{class:"wf-field-err"},i)),s&&!i&&a.push(Tt("div",{class:"wf-field-hint"},s)),Tt("div",{class:`wf-field${i?" wf-field--err":""}`},a)};import{h as dt}from"weifuwu/ui-dom";var Fr=async(l,n)=>async t=>{let{label:e,value:r=0,min:i=0,max:s=100,step:o=1,onChange:a,disabled:c}=t,u=Number(r),d=s>i?(u-i)/(s-i)*100:0,f=`linear-gradient(to right, var(--wf-color-primary) ${d}%, var(--wf-color-border) ${d}%)`,p=dt("input",{type:"range",class:["wf-slider-input",c?"wf-slider-input--dis":""].filter(Boolean).join(" "),value:u,min:i,max:s,step:o,disabled:c||void 0,"aria-label":e,"aria-disabled":c?"true":void 0,style:{background:f},onChange:c||!a?void 0:m=>a(Number(m.target.value))}),g=dt("span",{class:"wf-slider-value"},String(u));return e?dt("div",{class:"wf-slider-wrap"},[dt("label",{class:"wf-slider-label"},e),dt("div",{class:"wf-slider"},[p,g])]):dt("div",{class:"wf-slider"},[p,g])};import{h as ft}from"weifuwu/ui-dom";var Gr=async(l,n)=>{let t=!1;return async e=>{let{value:r,placeholder:i="\u641C\u7D22...",onInput:s,onClear:o,disabled:a}=e,c=r!==void 0,u=r??"",d=c&&u&&o?ft("button",{class:"wf-search-clear",type:"button","aria-label":"\u6E05\u9664",onClick:o},ft(T,{name:"close"})):null,f=ft("span",{class:"wf-search-icon"},ft(T,{name:"search"}));return ft("div",{class:d?"wf-search wf-search--has-clear":"wf-search"},[f,ft("input",{class:["wf-search-input",a?"wf-search-input--dis":""].filter(Boolean).join(" "),type:"search",value:c?u:void 0,placeholder:i,disabled:a||void 0,"aria-disabled":a?"true":void 0,onInput:p=>{t||p.isComposing||s?.(p)},onCompositionStart:()=>{t=!0},onCompositionEnd:p=>{t=!1,s?.(p)}}),d].filter(Boolean))}};import{h as so}from"weifuwu/ui-dom";var qr=async(l,n)=>async t=>{let{options:e,size:r="md",block:i,ariaLabel:s}=t,o=n?.ui?.useControlled({value:t.value,onChange:t.onChange,name:"SegmentedControl"}),a=u=>{let d=o?.controlled;o?.setValue(u),d||t.onChange?.(u)},c=["wf-segmented",r==="sm"&&"wf-segmented--sm",i&&"wf-segmented--block"].filter(Boolean).join(" ");return so("div",{class:c,role:"group","aria-label":s},e.map(u=>so("button",{type:"button",class:`wf-segmented-option${u.value===o?.value?" wf-segmented-option--active":""}`,"aria-pressed":u.value===o?.value?"true":"false",disabled:u.disabled||void 0,onClick:u.disabled?void 0:()=>a(u.value)},u.label)))};import{h as St}from"weifuwu/ui-dom";var Ur=async(l,n)=>async t=>{let{value:e,max:r=100,label:i,showValue:s,status:o="default",size:a="md"}=t,c=e==null,u=c?0:Math.min(100,Math.max(0,e/r*100)),d=n?.i18n?.components?.ProgressBar??{},f=St("div",{class:`wf-progress wf-progress--${a}${c?" wf-progress--indeterminate":""}${o!=="default"?` wf-progress--${o}`:""}`,role:"progressbar","aria-valuenow":c?void 0:Math.round(e),"aria-valuemin":0,"aria-valuemax":Math.round(r),"aria-label":i??d.ariaLabel??"\u8FDB\u5EA6"},[St("div",{class:`wf-progress-fill${o!=="default"?` wf-progress-fill--${o}`:""}`,style:c?void 0:{width:`${u}%`}})]);if(!i&&!s)return f;let p=[];return i&&p.push(St("span",{class:"wf-progress-label"},i)),p.push(f),s&&!c&&p.push(St("span",{class:"wf-progress-value"},`${Math.round(u)}%`)),St("div",{class:"wf-progress-wrap"},p)};import{createClientBrowser as Jr}from"weifuwu/ui-dom";import{h as Et}from"weifuwu/ui-dom";var Yr=async(l,n)=>{let t=n.browser??Jr(),e=[],r=[],i=new Map,s=o=>{let a=i.get(o);return a||(a=c=>{c&&(r[o]=c)},i.set(o,a)),a};return async o=>{let{items:a=[],active:c,onChange:u,multiple:d=!1}=o;e.length===0&&a.length>0&&(e=a.map(y=>y.key));let f=c!==void 0,p=f?c:e,g=y=>p.includes(y),m=y=>{f?u?.(y):(e=y,n.ui.render())},h=y=>{g(y)?m(p.filter(w=>w!==y)):m(d?[...p,y]:[y])},b=y=>{let w=t?.activeElement()??null,x=r.indexOf(w);if(x<0)return;let k=x;if(y.key==="ArrowDown"||y.key==="ArrowRight")k=(x+1)%a.length;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")k=(x-1+a.length)%a.length;else return;y.preventDefault(),r[k]?.focus()};if(a.length===0)return null;let v=a.map((y,w)=>{let x=g(y.key);return Et("div",{class:`wf-accordion-item${x?" wf-accordion-item--open":""}`,key:y.key},[Et("button",{type:"button",class:"wf-accordion-summary",ref:s(w),disabled:y.disabled||void 0,"aria-expanded":x?"true":"false",onClick:y.disabled?void 0:()=>h(y.key)},[y.title,Et(T,{name:"chevron-down",size:14,className:"wf-accordion-arrow"})]),x&&y.content?Et("div",{class:"wf-accordion-content"},y.content):null].filter(Boolean))});return Et("div",{class:"wf-accordion",onKeyDown:b},v)}};import{h as $t}from"weifuwu/ui-dom";var Qr=async(l,n)=>async t=>{let{title:e,sub:r,display:i,children:s}=t;return $t("div",{class:"wf-page-head"},[$t("div",{class:"wf-page-head-left"},[$t("h2",{class:`wf-page-title${i?" wf-page-title--display":""}`},e),r?$t("p",{class:"wf-page-sub"},r):null].filter(Boolean)),s?$t("div",{class:"wf-page-head-actions"},s):null].filter(Boolean))};import{h as Lt}from"weifuwu/ui-dom";var Xr=async(l,n)=>async t=>{let{items:e}=t,r=e.flatMap((s,o)=>{let a=o===e.length-1,c=a?Lt("span",{class:"wf-breadcrumb-current","aria-current":"page"},s.label):s.href?Lt("a",{class:"wf-breadcrumb-link",href:s.href},s.label):Lt("span",{class:"wf-breadcrumb-text"},s.label);return a?c:[c,Lt("span",{class:"wf-breadcrumb-sep","aria-hidden":"true"},"/")]}),i=n?.i18n?.components?.Breadcrumb??{};return Lt("nav",{class:"wf-breadcrumb","aria-label":i.ariaLabel??"\u9762\u5305\u5C51"},r)};import{h as wn}from"weifuwu/ui-dom";var Zr=async(l,n)=>async t=>{let{vertical:e,children:r}=t;return e?wn("div",{class:"wf-divider wf-divider--vertical",role:"separator"}):wn("div",{class:r?"wf-divider wf-divider--with-text":"wf-divider",role:"separator"},r?wn("span",{class:"wf-divider-text"},r):void 0)};import{h as se}from"weifuwu/ui-dom";function ao(l){return l<1024?`${l}B`:l<1024*1024?`${(l/1024).toFixed(1)}KB`:`${(l/(1024*1024)).toFixed(1)}MB`}var vn=async(l,n)=>{let t=n?.i18n?.components?.FileUpload??{},e=null,r=p=>{p&&(e=p)},i=new Map,s=p=>`${p.name}:${p.size}`,o=p=>{if(!p.type.startsWith("image/"))return;let g=s(p),m=i.get(g);return!m&&typeof URL<"u"&&URL.createObjectURL&&(m=URL.createObjectURL(p),i.set(g,m)),m},a=p=>{if(!p){for(let g of i.values())URL.revokeObjectURL?.(g);i.clear()}},c=!1,u={...l},d=!1,{dropProps:f}=n.ui.useDragDrop({onDrop:p=>{if(d=!1,n.ui.render(),u.disabled)return;let g=Array.from(p.dataTransfer?.files??[]);u.maxSize&&g.filter(h=>h.size>u.maxSize).length>0||u.onChange?.(g)},onDragOver:()=>{d||(d=!0,n.ui.render())},onDragLeave:()=>{d&&(d=!1,n.ui.render())}});return async p=>{Object.assign(u,p);let{accept:g,multiple:m,maxSize:h,disabled:b,error:v,hint:y,value:w,onChange:x,children:k,uploading:S,progress:P}=p,I=w??[];w!==void 0&&!x&&!c&&(c=!0,console.warn(`[weifuwu/FileUpload] value \u5DF2\u4F20\uFF08\u53D7\u63A7\uFF09\u4F46\u672A\u63D0\u4F9B onChange\u2014\u2014\u9009\u62E9/\u5220\u9664\u65E0\u6CD5\u751F\u6548\u3002
2
2
  \u4F20 onChange \u6216\u7701\u7565 value \u4F7F\u7528\u975E\u53D7\u63A7\u6A21\u5F0F\u3002`));let $=M=>{let C=M.target,A=Array.from(C.files??[]);h&&A.filter(z=>z.size>h).length>0||(x?.(A),C.value="")},L=M=>{let C=I.filter((A,R)=>R!==M);x?.(C)},E=se("input",{type:"file",class:"wf-upload-input",accept:g||void 0,multiple:m||void 0,disabled:b||void 0,onChange:$,style:{display:"none"},ref:r}),B=se("div",{class:`wf-upload-zone${b?" wf-upload-zone--disabled":""}${v?" wf-upload-zone--err":""}${d?" wf-upload-zone--drag":""}`,onClick:b?void 0:()=>e?.click(),...f},k??se("div",{class:"wf-upload-placeholder"},[se("span",{class:"wf-upload-icon"},"\u{1F4C1}"),se("span",{class:"wf-upload-text"},t.placeholder??"\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20\u6587\u4EF6"),g?se("span",{class:"wf-upload-hint"},`${t.supportedFormats??"\u652F\u6301\u683C\u5F0F: "}${g}`):null,h?se("span",{class:"wf-upload-hint"},`${t.maxSize??"\u6700\u5927 "}${ao(h)}`):null].filter(Boolean))),D=I.length>0?se("ul",{class:"wf-upload-list"},I.map((M,C)=>{let A=o(M),R=[A?se("img",{class:"wf-upload-thumb",src:A,alt:M.name}):null,se("span",{class:"wf-upload-item-info"},[se("span",{class:"wf-upload-item-name"},M.name),se("span",{class:"wf-upload-item-size"},ao(M.size))]),se("button",{class:"wf-upload-item-remove","aria-label":`${t.remove??"\u5220\u9664"} ${M.name}`,onClick:()=>L(C)},se(T,{name:"trash"}))];return se("li",{class:"wf-upload-item",key:M.name+M.size},R.filter(Boolean))})):null,N=S?se("div",{class:"wf-upload-progress",role:"progressbar","aria-valuenow":P??0},se("div",{class:"wf-upload-progress-fill",style:{width:`${P??0}%`}})):null,O=[E,B,D,N];return v&&O.push(se("div",{class:"wf-upload-err"},v)),y&&!v&&O.push(se("div",{class:"wf-upload-hint"},y)),se("div",{class:"wf-upload",ref:a},O)}};import{h as qt}from"weifuwu/ui-dom";var es=async(l,n)=>{let t=!1,e="top",r=!1,i=null,s=a=>{a&&(i=a)},o=n.ui.usePopup({trigger:"hover",placement:()=>e,gap:6,el:()=>i,isOpen:()=>t,setOpen:a=>{t=a,n.ui.render()},disabled:()=>r});return async a=>{let{content:c,position:u="top",children:d}=a;e=u,r=!!a.disabled;let f=qt("div",{class:`wf-tooltip wf-tooltip--${u}`,role:"tooltip"},[qt("div",{class:"wf-tooltip-arrow"}),qt("div",{class:"wf-tooltip-content"},c)]);return qt("div",{class:"wf-tooltip-wrap",ref:s,"aria-haspopup":"tooltip",...o.wrapProps},[d,o.portal(f,"tooltip")].filter(Boolean))}};import{h as qe}from"weifuwu/ui-dom";var ts=async(l,n)=>{let t=!1,e=n.ui.usePopup({presence:!0,trapFocus:!0,lockScroll:!0,positioning:"none",closeOnOutside:!1,closeOnEscape:!1,isOpen:()=>t,setOpen:()=>{}}),r;return n.ui.useGlobalKey(i=>{i.key==="Escape"&&e.phase==="open"&&r?.()}),async i=>{let{open:s,title:o,position:a="right",onClose:c,children:u,footer:d,width:f}=i;r=c;let p=n?.i18n?.components?.Drawer??{};t=!!s;let g=e.sync(t);if(g==="closed")return null;let m=qe("div",{class:"wf-drawer-overlay",onClick:c}),h=qe("button",{class:"wf-drawer-close",onClick:c,type:"button","aria-label":p.closeAria??"\u5173\u95ED"},qe(T,{name:"close"})),b=o?qe("div",{class:"wf-drawer-header"},[o,h]):null,v=qe("div",{class:"wf-drawer-body"},u),y=d?qe("div",{class:"wf-drawer-footer"},d):null,w=qe("div",{class:`wf-drawer-panel wf-drawer-panel--${a}`,style:f?{"--wf-drawer-width":f}:void 0,onClick:k=>k.stopPropagation()},[b,v,y].filter(Boolean)),x=qe("div",{class:`wf-drawer wf-drawer--${a} ${g==="exit"?"wf-drawer--exit":"wf-drawer--enter"}`,role:"dialog","aria-modal":"true","aria-label":o??p.ariaLabel??"\u4FA7\u8FB9\u9762\u677F",tabIndex:-1,onKeyDown:k=>{k.key==="Escape"&&c?.()}},[m,w]);return e.portal(x,"drawer")}};import{h as Ut}from"weifuwu/ui-dom";var It=async(l,n)=>{let t="bottom",e="click",r=!1,i=null,s=c=>{c&&(i=c)},o=null,a=n.ui.usePopup({trigger:()=>e,placement:()=>t,gap:6,el:()=>i,isOpen:()=>o?.open??!1,setOpen:c=>o?.setOpen(c),disabled:()=>r});return async c=>{let{content:u,position:d="bottom",trigger:f="click",children:p}=c;t=d,e=f,o=n.ui.useOpen({open:c.open,onOpenChange:c.onOpenChange,name:"Popover"}),r=!!c.disabled;let g=Ut("div",{class:`wf-popover wf-popover--${d} wf-popover--enter`,role:"tooltip"},[Ut("div",{class:"wf-popover-arrow"}),Ut("div",{class:"wf-popover-content"},u)]);return Ut("div",{class:`wf-popover-wrap${o?.open?" wf-popover-wrap--open":""}`,ref:s,"aria-haspopup":"dialog","aria-expanded":String(!!o?.open),...a.wrapProps},[p,a.portal(g,"popover")].filter(Boolean))}};import{h as mt,Fragment as ns}from"weifuwu/ui-dom";var os=async l=>async n=>{let{variant:t="text",lines:e=1,cols:r=3,width:i,height:s,className:o}=n,a={};i!==void 0&&(a.width=typeof i=="number"?`${i}px`:i),s!==void 0&&(a.height=typeof s=="number"?`${s}px`:s);let c=["wf-skeleton",`wf-skeleton--${t}`,o].filter(Boolean).join(" ");if(t==="table"){let d=Array.from({length:e},(f,p)=>{let g=Array.from({length:r},(m,h)=>{let b=p===e-1&&h===r-1?"40%":void 0;return mt("div",{class:"wf-skeleton wf-skeleton--text",style:b?{width:b}:void 0})});return mt("div",{class:"wf-skeleton-row"},g)});return mt("div",{class:"wf-skeleton-table"},d)}if(e<=1)return mt("div",{class:c,style:Object.keys(a).length?a:void 0});let u=Array.from({length:e},(d,f)=>{let p=f===e-1&&e>1?`${c} wf-skeleton--short`:c;return mt("div",{class:p,style:Object.keys(a).length?a:void 0})});return mt(ns,null,u)};import{h as Dt}from"weifuwu/ui-dom";var rs=async(l,n)=>{let t=!1,e=1,r=null,i=n.ui.usePopup?.({trigger:"click",placement:"bottom",el:()=>r,isOpen:()=>t,setOpen:o=>{t=o,e=o?e:1,n.ui.render()},mask:!0,maskCentered:!0})??{open:!1,setOpen:()=>{},wrapProps:{},portal:()=>null,refresh:()=>{}},s=o=>{r=o};return async o=>{let{src:a,alt:c="",fallback:u,loading:d,width:f,height:p,className:g,style:m,preview:h,previewScale:b=1}=o,v={class:["wf-image",g].filter(Boolean).join(" "),src:a??u??"",alt:c,loading:d??"lazy"};if(f!==void 0&&(v.width=f),p!==void 0&&(v.height=p),m&&(v.style=m),u&&(v.onError=w=>{let x=w.currentTarget;x.src!==u&&(x.src=u)}),!h)return Dt("img",v);let y=i.portal(Dt("img",{class:"wf-img-preview-image",src:a??u??"",alt:c,style:{transform:`scale(${e*b})`,maxWidth:"90vw",maxHeight:"90vh"},onClick:w=>{w.stopPropagation(),e=e===1?2:1,n.ui.render()}}),"img-preview");return Dt("div",{class:"wf-img-preview-wrap"},[Dt("button",{type:"button",class:"wf-img-preview-trigger","aria-label":"\u653E\u5927\u9884\u89C8",ref:s,onClick:()=>{t=!0,n.ui.render()}},Dt("img",v)),y].filter(Boolean))}};import{h as Jt}from"weifuwu/ui-dom";var ss=async(l,n)=>{let t=!1,e={once:!0},r=n.ui.useInView({rootMargin:()=>e.rootMargin??"0px",threshold:()=>e.threshold??0}),i=s=>{s?r.observe(s):r.disconnect()};return async s=>{if(Object.assign(e,s),r.isIn)return t||(t=!0,s.once!==!1&&r.disconnect(),s.onEnter?.()),Jt("div",{class:"wf-inview wf-inview--loaded"},s.children);let o=s.placeholder!==void 0?s.placeholder:Jt("div",{class:"wf-inview-placeholder"});return Jt("div",{class:"wf-inview wf-inview--pending"},[Jt("div",{class:"wf-inview-pending",style:{width:"1px",height:"1px",opacity:0,pointerEvents:"none"},ref:i}),o])}};import{createClientBrowser as ls}from"weifuwu/ui-dom";import{h as q}from"weifuwu/ui-dom";var as=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"];function Yt(){return as}function io(l,n){return new Date(l,n+1,0).getDate()}function is(l,n){return new Date(l,n,1).getDay()}function At(l,n){let t=[],e=io(l,n),r=is(l,n),i=n===0?11:n-1,s=n===0?l-1:l,o=io(s,i),a=new Date,c=[];for(let p=r-1;p>=0;p--){let g=o-p;c.push({year:s,month:i,day:g,isOtherMonth:!0,isToday:s===a.getFullYear()&&i===a.getMonth()&&g===a.getDate()})}for(let p=1;p<=e;p++)c.push({year:l,month:n,day:p,isOtherMonth:!1,isToday:l===a.getFullYear()&&n===a.getMonth()&&p===a.getDate()}),c.length===7&&(t.push(c),c=[]);let u=n===11?0:n+1,d=n===11?l+1:l,f=1;for(;t.length<6;){for(;c.length<7;)c.push({year:d,month:u,day:f++,isOtherMonth:!0,isToday:d===a.getFullYear()&&u===a.getMonth()&&f-1===a.getDate()});t.push(c),c=[]}return t}function Be(l,n,t){return`${l}-${String(n+1).padStart(2,"0")}-${String(t).padStart(2,"0")}`}function xn(l,n){return`${String(l).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function lo(l,n,t,e,r){return`${Be(l,n,t)} ${xn(e,r)}`}function Cn(){return Array.from({length:24},(l,n)=>n)}function kn(){return Array.from({length:12},(l,n)=>n*5)}var cs=async(l,n)=>{let t=n.browser??ls(),e=!1,r="",i=new Date,s=i.getFullYear(),o=i.getMonth(),a=i.getHours(),c=Math.round(i.getMinutes()/5)*5,u=i.getFullYear(),d=i.getMonth(),f=i.getDate(),p=null,g=null,m=null,h=y=>{m=y},b="date";n.ui.useGlobalKey(y=>{y.key==="Escape"&&e&&(e=!1,n.ui.render())});let v=n.ui.usePopup({trigger:"focus",mask:!0,maskClosable:!0,closeOnEscape:!1,closeDelay:120,el:()=>m,isOpen:()=>e,setOpen:y=>{e=y,n.ui.render()},position:()=>{let y=m?.getBoundingClientRect();if(!y)return{x:0,y:0};let w=b==="range";return{x:y.left,y:y.bottom+4,width:w?void 0:y.width}}});return async y=>{let w=n?.i18n?.components?.DatePicker??{},{mode:x="date",value:k,onChange:S,placeholder:P=w.placeholder??"\u9009\u62E9\u65E5\u671F",disabled:I,error:$}=y;b=x;let L=e,E=H=>{e=H,n.ui.render()},B=H=>{I||E(!e)},D=H=>{if(x==="datetime")u=H.year,d=H.month,f=H.day,s=H.year,o=H.month,n.ui.render();else if(x==="range")if(!p||p&&g)p=Be(H.year,H.month,H.day),g=null,n.ui.render();else{g=Be(H.year,H.month,H.day);let X=p<g?p:g,F=p<g?g:p;r=`${X} ~ ${F}`,S?.(r),E(!1)}else r=Be(H.year,H.month,H.day),S?.(r),E(!1)},N=()=>{o===0?(s--,o=11):o--,n.ui.render()},O=()=>{o===11?(s++,o=0):o++,n.ui.render()},M=()=>{r=xn(a,c),S?.(r),E(!1)},C=()=>{r=lo(u,d,f,a,c),S?.(r),E(!1)},A=At(s,o),R=[w.w0,w.w1,w.w2,w.w3,w.w4,w.w5,w.w6].some(H=>H)?[w.w0,w.w1,w.w2,w.w3,w.w4,w.w5,w.w6]:Yt(),z=(H,X,F)=>q("button",{class:"wf-datepicker-header-btn",type:"button","aria-label":X,onClick:F},q(T,{name:H})),U=q("div",{class:"wf-datepicker-header"},[z("chevron-left",w.prevMonth??"\u4E0A\u4E2A\u6708",N),q("span",{class:"wf-datepicker-header-title"},`${s}\u5E74${o+1}\u6708`),z("chevron-right",w.nextMonth??"\u4E0B\u4E2A\u6708",O)]),V=q("div",{class:"wf-datepicker-weekdays"},R.map(H=>q("span",{class:"wf-datepicker-weekday"},H))),_=A.map((H,X)=>q("div",{class:"wf-datepicker-grid",key:`row-${X}`},H.map((F,ee)=>{let oe=["wf-datepicker-cell"];F.isOtherMonth&&oe.push("wf-datepicker-cell--other-month"),F.isToday&&oe.push("wf-datepicker-cell--today");let de=Be(F.year,F.month,F.day);return x==="range"?de===p||de===g?oe.push("wf-datepicker-cell--range-edge"):p&&g&&de>p&&de<g&&oe.push("wf-datepicker-cell--in-range"):x==="datetime"?u===F.year&&d===F.month&&f===F.day&&oe.push("wf-datepicker-cell--selected"):de===r&&oe.push("wf-datepicker-cell--selected"),q("button",{class:oe.join(" "),key:`${F.year}-${F.month}-${F.day}`,type:"button",onClick:()=>D(F)},String(F.day))}))),J=q("div",{class:"wf-datepicker-range-panel"},[U,V,..._]),Q=H=>{if(H.key==="Escape"){E(!1);return}if(x==="time"||x==="datetime"||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(H.key))return;let X=H.currentTarget,F=Array.from(X.querySelectorAll(".wf-datepicker-cell")),ee=F.indexOf(t?.activeElement()??null);if(ee<0)return;H.preventDefault();let oe=7,de=ee;H.key==="ArrowLeft"?de--:H.key==="ArrowRight"?de++:H.key==="ArrowUp"?de-=oe:H.key==="ArrowDown"&&(de+=oe),de>=0&&de<F.length&&F[de].focus()},K=null;if(L)if(x==="time"){let H=Cn(),X=kn();K=q("div",{class:"wf-time-picker",role:"dialog",onKeyDown:Q,onMouseDown:ee=>ee.stopPropagation()},[q("div",{class:"wf-time-body"},[q("div",{class:"wf-time-col"},[q("div",{class:"wf-time-col-label"},w.hour??"\u65F6"),q("div",{class:"wf-time-opt-list"},H.map(ee=>q("button",{class:`wf-time-opt${ee===a?" wf-time-opt--selected":""}`,type:"button",key:ee,onClick:()=>{a=ee,n.ui.render()}},String(ee).padStart(2,"0"))))]),q("div",{class:"wf-time-col"},[q("div",{class:"wf-time-col-label"},w.minute??"\u5206"),q("div",{class:"wf-time-opt-list"},X.map(ee=>q("button",{class:`wf-time-opt${ee===c?" wf-time-opt--selected":""}`,type:"button",key:ee,onClick:()=>{c=ee,n.ui.render()}},String(ee).padStart(2,"0"))))])]),q("div",{class:"wf-time-footer"},[q("button",{class:"wf-datepicker-footer-btn",type:"button",onClick:()=>E(!1)},w.cancel??"\u53D6\u6D88"),q("button",{class:"wf-datepicker-footer-btn",type:"button",onClick:M},w.confirm??"\u786E\u5B9A")])])}else if(x==="range"){let H=o===11?0:o+1,X=o===11?s+1:s,F=At(X,H);K=q("div",{class:"wf-datepicker-range-wrap",onMouseDown:oe=>oe.stopPropagation()},[q("div",{class:"wf-datepicker-range-panel"},[q("div",{class:"wf-datepicker-header"},[z("chevron-left",w.prevMonth??"\u4E0A\u4E2A\u6708",N),q("span",{class:"wf-datepicker-header-title"},`${s}\u5E74${o+1}\u6708`),q("span",{class:"wf-datepicker-header-title"})]),V,..._]),q("div",{class:"wf-datepicker-range-panel"},[q("div",{class:"wf-datepicker-header"},[q("span",{class:"wf-datepicker-header-title"}),q("span",{class:"wf-datepicker-header-title"},`${X}\u5E74${H+1}\u6708`),z("chevron-right",w.nextMonth??"\u4E0B\u4E2A\u6708",O)]),q("div",{class:"wf-datepicker-weekdays"},R.map(oe=>q("span",{class:"wf-datepicker-weekday"},oe))),...F.map((oe,de)=>q("div",{class:"wf-datepicker-grid",key:`row-${de}`},oe.map(j=>{let ce=Be(j.year,j.month,j.day),We=["wf-datepicker-cell"];return j.isOtherMonth&&We.push("wf-datepicker-cell--other-month"),j.isToday&&We.push("wf-datepicker-cell--today"),ce===p||ce===g?We.push("wf-datepicker-cell--range-edge"):p&&g&&ce>p&&ce<g&&We.push("wf-datepicker-cell--in-range"),q("button",{class:We.join(" "),key:ce,type:"button",onClick:()=>D(j)},String(j.day))})))])])}else{let H=[J];x==="datetime"&&(H.push(q("div",{class:"wf-datetime-time"},[q("span",{class:"wf-datetime-time-label"},(w.time??"\u65F6\u95F4")+"\uFF1A"),q("div",{class:"wf-datetime-time-select"},[q("select",{class:"wf-datetime-select",value:a,onChange:F=>{a=parseInt(F.target.value),n.ui.render()}},Cn().map(F=>q("option",{value:F,key:F},String(F).padStart(2,"0")))),q("span",{class:"wf-datetime-sep"},":"),q("select",{class:"wf-datetime-select",value:c,onChange:F=>{c=parseInt(F.target.value),n.ui.render()}},kn().map(F=>q("option",{value:F,key:F},String(F).padStart(2,"0"))))])])),H.push(q("div",{class:"wf-time-footer"},[q("button",{class:"wf-datepicker-footer-btn",type:"button",onClick:C},w.confirm??"\u786E\u5B9A")]))),K=q("div",{class:"wf-datepicker-dropdown",role:"dialog",onKeyDown:Q,onMouseDown:F=>F.stopPropagation()},H)}let Qe=L&&K?v.portal(K,"dp-calendar"):null,W=k??r??"";return q("div",{class:`wf-datepicker${I?" wf-datepicker--disabled":""}`},[q("input",{class:["wf-datepicker-input",$?" wf-datepicker-input--err":""].filter(Boolean).join(" "),"aria-invalid":$?"true":void 0,type:"text",placeholder:P,value:W||"",ref:h,readonly:!0,disabled:I,role:"combobox","aria-haspopup":"dialog","aria-expanded":String(L),onClick:B}),Qe].filter(Boolean))}};import{h as Y}from"weifuwu/ui-dom";function Ot(l,n){let t=(e=>{let r=(e-l[0])/(l[1]-l[0]);return n[0]+r*(n[1]-n[0])});return t.domain=l,t.range=n,t.invert=e=>{let r=(e-n[0])/(n[1]-n[0]);return l[0]+r*(l[1]-l[0])},t}function po(l,n,t){return l.length===0?"":l.map((e,r)=>{let i=n(r),s=t(e.value);return r===0?`M${i},${s}`:`L${i},${s}`}).join(" ")}function uo(l,n,t,e){if(l.length===0)return"";let r=l.map((o,a)=>{let c=n(a),u=t(o.value);return`${c},${u}`}),i=n(0),s=n(l.length-1);return`M${i},${e}L${r.join("L")}L${s},${e}Z`}function fo(l,n,t,e){let r=e??Math.max(4,(n.range[1]-n.range[0])/l.length*.6);return l.map((i,s)=>({x:n(s)-r/2,y:t(Math.max(0,i.value)),width:r,height:Math.abs(t(i.value)-t(0)),color:i.color??Rt(s),label:i.label,value:i.value}))}function mo(l,n,t,e){let r=l.reduce((s,o)=>s+Math.abs(o.value),0);if(r===0)return[];let i=-Math.PI/2;return l.map((s,o)=>{let a=Math.abs(s.value)/r*Math.PI*2,c=i+a,u=ps(n,t,e,i,c),d=i+a/2;return i=c,{d:u,color:s.color??Rt(o),label:s.label,value:s.value,centroid:{x:n+Math.cos(d)*e*.6,y:t+Math.sin(d)*e*.6}}})}function ps(l,n,t,e,r){let i=l+t*Math.cos(e),s=n+t*Math.sin(e),o=l+t*Math.cos(r),a=n+t*Math.sin(r),c=r-e>Math.PI?1:0;return`M${l},${n}L${i},${s}A${t},${t} 0 ${c} 1 ${o},${a}Z`}var co=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16"];function Rt(l){return co[l%co.length]}function Mn(l,n=5){let[t,e]=l.domain,r=(e-t)/n,i=[];for(let s=0;s<=n;s++){let o=t+r*s;i.push({value:o,y:l(o),label:us(o)})}return i}function us(l){return Math.abs(l)>=1e6?(l/1e6).toFixed(1)+"M":Math.abs(l)>=1e3?(l/1e3).toFixed(1)+"k":String(Math.round(l))}var ds=async(l,n)=>{let t=null,e=null,r=!1,i=n.ui.usePopupPosition({el:()=>e,isOpen:()=>t!==null,compute:s=>({top:s.top-8,left:s.left+s.width/2})});return async s=>{let{type:o="line",data:a,options:c={},title:u,area:d,className:f}=s,p=c.width??320,g=c.height??200,m=c.padding??32,h=p-m*2,b=g-m*2,v=a.map(B=>B.value),y=Math.min(0,...v),w=Math.max(...v),x=w-y||1,k=()=>{let B=Math.max(1,a.length-1),D=Ot([-.5,B+.5],[0,h]),N=Ot([y,w],[b,0]),O=Mn(N),M=po(a,D,N),C=d?uo(a,D,N,N(0)):null,A=a.map((R,z)=>{let U=D(z)+m,V=N(R.value)+m;return Y("circle",{key:`dot-${z}`,cx:U,cy:V,r:3,fill:R.color??Rt(z),stroke:"#fff","stroke-width":1.5,style:{cursor:"pointer"},onMouseEnter:_=>{e=_.target,t={label:R.label,value:R.value},n.ui.render()},onMouseLeave:()=>{e=null,t=null,n.ui.render()}})});return Y("svg",{style:{width:"100%"},height:g,viewBox:`0 0 ${p} ${g}`},[...O.map((R,z)=>Y("g",{key:`tick-${z}`},[Y("line",{x1:m,y1:R.y+m,x2:p-m,y2:R.y+m,stroke:"#e5e7eb","stroke-width":1}),Y("text",{x:m-6,y:R.y+m+4,"text-anchor":"end",fill:"#6b7280","font-size":"11","font-family":"var(--wf-font-sans)"},R.label)])),...C?[Y("path",{key:"area",d:C,fill:"#3b82f620",stroke:"none",transform:`translate(${m},${m})`})]:[],Y("path",{key:"line",d:M,fill:"none",stroke:"#3b82f6","stroke-width":2,"stroke-linejoin":"round","stroke-linecap":"round",transform:`translate(${m},${m})`}),...a.map((R,z)=>{let U=D(z)+m;return Y("text",{key:`xlabel-${z}`,x:U,y:g-m+14,"text-anchor":"middle",fill:"#6b7280","font-size":"10","font-family":"var(--wf-font-sans)"},R.label)}),...A])},S=()=>{let B=Math.max(1,a.length-1),D=Ot([-.5,B+.5],[0,h]),N=Ot([y,w],[b,0]),O=Mn(N),M=fo(a,D,N);return Y("svg",{style:{width:"100%"},height:g,viewBox:`0 0 ${p} ${g}`},[...O.map((C,A)=>Y("g",{key:`tick-${A}`},[Y("line",{x1:m,y1:C.y+m,x2:p-m,y2:C.y+m,stroke:"#e5e7eb","stroke-width":1}),Y("text",{x:m-6,y:C.y+m+4,"text-anchor":"end",fill:"#6b7280","font-size":"11","font-family":"var(--wf-font-sans)"},C.label)])),...M.map((C,A)=>Y("rect",{key:`bar-${A}`,x:C.x+m,y:C.y+m,width:C.width,height:C.height,fill:C.color,rx:2,onMouseEnter:R=>{e=R.target,t={label:C.label,value:C.value},n.ui.render()},onMouseLeave:()=>{e=null,t=null,n.ui.render()}})),...a.map((C,A)=>{let R=D(A)+m;return Y("text",{key:`xlabel-${A}`,x:R,y:g-m+14,"text-anchor":"middle",fill:"#6b7280","font-size":"10","font-family":"var(--wf-font-sans)"},C.label)})])},P=()=>{let B=p/2,D=g/2,N=Math.min(h,b)/2-4,O=mo(a,B,D,N);return Y("svg",{style:{width:"100%"},height:g,viewBox:`0 0 ${p} ${g}`},[...O.map((M,C)=>Y("g",{key:`arc-${C}`},[Y("path",{d:M.d,fill:M.color,stroke:"#fff","stroke-width":1.5,onMouseEnter:A=>{e=A.target,t={label:M.label,value:M.value},n.ui.render()},onMouseLeave:()=>{e=null,t=null,n.ui.render()}}),...M.value/a.reduce((A,R)=>A+Math.abs(R.value),0)>.05?[Y("text",{x:M.centroid.x,y:M.centroid.y+3,"text-anchor":"middle",fill:"#fff","font-size":"11","font-weight":"bold","font-family":"var(--wf-font-sans)"},`${Math.round(M.value/a.reduce((A,R)=>A+Math.abs(R.value),0)*100)}%`)]:[]]))])},I;o==="bar"?I=S():o==="pie"?I=P():I=k();let $=a.length>1?Y("div",{class:"wf-chart-legend"},a.map((B,D)=>Y("span",{class:"wf-chart-legend-item",key:`leg-${D}`},[Y("span",{class:"wf-chart-legend-dot",style:{background:B.color??Rt(D)}}),Y("span",{class:"wf-chart-legend-label"},B.label)]))):null,L=t!==null;L&&!r&&i.refresh(),r=L;let E=t?Y("div",{class:"wf-chart-tooltip",style:{position:"fixed",left:i.left,top:i.top}},[Y("div",{class:"wf-chart-tooltip-label"},t.label),Y("div",{class:"wf-chart-tooltip-value"},String(t.value))]):null;return Y("div",{class:`wf-chart${f?" "+f:""}`,role:"img","aria-label":u??n?.i18n?.components?.Chart?.ariaLabel??"\u56FE\u8868"},[u?Y("div",{class:"wf-chart-title"},u):null,I,$,E].filter(Boolean))}};import{createClientBrowser as ws}from"weifuwu/ui-dom";import{h as ae}from"weifuwu/ui-dom";import{createClientBrowser as fs}from"weifuwu/ui-dom";var Ue=fs();function et(){let l={};try{l.bold=Ue.queryCommandState("bold"),l.italic=Ue.queryCommandState("italic"),l.underline=Ue.queryCommandState("underline");let n=Ue.queryCommandValue("formatBlock");l.h1=n==="h1"||n==="H1",l.h2=n==="h2"||n==="H2",l.h3=n==="h3"||n==="H3",l.blockquote=n==="blockquote"||n==="BLOCKQUOTE",l.alignLeft=Ue.queryCommandState("justifyLeft"),l.alignCenter=Ue.queryCommandState("justifyCenter"),l.alignRight=Ue.queryCommandState("justifyRight")}catch{}return l}function ie(l,n){try{Ue.execCommand(l,n)}catch{}}function go(l){switch(l){case"bold":ie("bold");break;case"italic":ie("italic");break;case"underline":ie("underline");break;case"h1":ie("formatBlock","<h1>");break;case"h2":ie("formatBlock","<h2>");break;case"h3":ie("formatBlock","<h3>");break;case"ul":ie("insertUnorderedList");break;case"ol":ie("insertOrderedList");break;case"blockquote":ie("formatBlock","<blockquote>");break;case"alignLeft":ie("justifyLeft");break;case"alignCenter":ie("justifyCenter");break;case"alignRight":ie("justifyRight");break;case"hr":ie("insertHorizontalRule");break;case"image":break;case"link":break;case"clear":ie("removeFormat"),ie("formatBlock","<div>");break;case"source":break}}import{h as Pn}from"weifuwu/ui-dom";var vo=["bold","italic","underline","h1","h2","h3","ul","ol","blockquote","alignLeft","alignCenter","alignRight","hr","image","table","link","clear","source"],ms={bold:"B",italic:"I",underline:"U",h1:"H1",h2:"H2",h3:"H3",ul:"\u25A1",ol:"1.",blockquote:"\u275D",alignLeft:"\u21E4",alignCenter:"\u21D4",alignRight:"\u21E5",hr:"\u2014",image:"\u{1F5BC}",table:"\u229E",link:"\u{1F517}",clear:"\u2715",source:"</>"},ho={bold:"\u52A0\u7C97 (Ctrl+B)",italic:"\u659C\u4F53 (Ctrl+I)",underline:"\u4E0B\u5212\u7EBF (Ctrl+U)",h1:"\u6807\u9898 1",h2:"\u6807\u9898 2",h3:"\u6807\u9898 3",ul:"\u65E0\u5E8F\u5217\u8868",ol:"\u6709\u5E8F\u5217\u8868",blockquote:"\u5F15\u7528",alignLeft:"\u5DE6\u5BF9\u9F50",alignCenter:"\u5C45\u4E2D",alignRight:"\u53F3\u5BF9\u9F50",hr:"\u5206\u5272\u7EBF",image:"\u63D2\u5165\u56FE\u7247",table:"\u63D2\u5165\u8868\u683C",link:"\u63D2\u5165\u94FE\u63A5",clear:"\u6E05\u9664\u683C\u5F0F",source:"\u6E90\u7801"},gs=["bold","italic","underline"],yo=["h1","h2","h3"],bo=["ul","ol"],wo=["blockquote","alignLeft","alignCenter","alignRight","hr"],hs=["image","table","link","clear"];function ys(l,n){return gs.includes(l)&&yo.includes(n)||yo.includes(l)&&bo.includes(n)||bo.includes(l)&&wo.includes(n)||wo.includes(l)&&hs.includes(n)||["link","clear"].includes(l)&&n==="source"}function xo(l,n,t,e,r){let i=l.map(o=>{if(r?.[o])return r[o](o);let u=["wf-editor-tb-btn",(o==="source"?t:!!n[o])&&"wf-editor-tb-btn--active",o==="link"&&"wf-editor-tb-btn--link"].filter(Boolean).join(" ");return Pn("button",{key:o,class:u,type:"button",title:ho[o],"aria-label":ho[o],"data-item":o,onClick:()=>e(o)},ms[o])}),s=[];return l.forEach((o,a)=>{a>0&&ys(l[a-1],o)&&s.push(Pn("span",{class:"wf-editor-tb-sep",key:`sep-${a}`})),s.push(i[a])}),Pn("div",{class:"wf-editor-toolbar",role:"toolbar","aria-label":"\u7F16\u8F91\u683C\u5F0F"},s)}import{h as Bt}from"weifuwu/ui-dom";import{createClientBrowser as bs}from"weifuwu/ui-dom";var gt=bs(),Co=6;function ko(l,n){let t=gt.getSelection();if(!t||!t.rangeCount)return;let e=t.getRangeAt(0);if(!e)return;let r=gt.createElement("table"),i=gt.createElement("tbody");if(!r||!i)return;r.className="wf-editor-table";for(let o=0;o<l;o++){let a=gt.createElement("tr");if(a){for(let c=0;c<n;c++){let u=gt.createElement("td");u&&(o===0&&(u.style.fontWeight="var(--wf-font-weight-semibold,600)"),u.innerHTML="&nbsp;",a.appendChild(u))}i.appendChild(a)}}r.appendChild(i);let s=gt.createElement("div");s&&(s.appendChild(r),e.deleteContents(),e.insertNode(s),e.setStartAfter(s),e.collapse(!0),t.removeAllRanges(),t.addRange(e))}function Mo(l,n,t,e,r){let i=Bt("div",{class:"wf-editor-table-grid",onMouseLeave:r},Array.from({length:Co},(o,a)=>Bt("div",{class:"wf-editor-table-grid-row",key:`r${a}`},Array.from({length:Co},(c,u)=>{let d=a<=l&&u<=n;return Bt("div",{class:`wf-editor-table-grid-cell${d?" wf-editor-table-grid-cell--active":""}`,key:`${a}-${u}`,onMouseEnter:()=>e(a,u),onClick:()=>t(a+1,u+1)})})))),s=l>=0&&n>=0?`${l+1} \xD7 ${n+1} \u8868\u683C`:"\u9009\u62E9\u8868\u683C\u5927\u5C0F";return Bt("div",{class:"wf-editor-table-picker",onMouseDown:o=>o.stopPropagation()},[i,Bt("div",{class:"wf-editor-table-picker-label"},s)])}function vs(l,n){if(l===n)return!0;if(!l||!n)return!1;let t=Object.keys(l);if(t.length!==Object.keys(n).length)return!1;for(let e of t)if(l[e]!==n[e])return!1;return!0}var xs=async(l,n)=>{let t=n.browser??ws(),e=null,r=!1,i="",s="rich",o=!1,a="",c=!1,u=!1,d=-1,f=-1,p="",g=null,m=y=>{y&&(g=y)},h=null,b=()=>{let y=t?.getSelection();y&&y.rangeCount>0&&(h=y.getRangeAt(0))},v=()=>{if(!g||!h)return;g.focus();let y=t?.getSelection();y&&(y.removeAllRanges(),y.addRange(h))};return async y=>{let{value:w="",onChange:x,onUpload:k,placeholder:S="",disabled:P=!1,minHeight:I="200px"}=y,$=y.toolbar??vo,L=s==="rich",E=j=>{x?.(j)},B=j=>{if(!P){if(j==="source"){L?(p=g?.innerHTML??w,s="source",n.ui.render()):(s="rich",e={},n.ui.render(),x?.(w));return}if(L){if(j==="image"){o=!0,a="",n.ui.render();return}if(j==="link"){b();let ce=t?.getSelection();if(!ce||ce.isCollapsed){r=!0,i="",n.ui.render();return}t?.execCommand("createLink")?(ie("unlink"),e=et(),n.ui.render()):(r=!0,i="",n.ui.render());return}go(j),e=et(),n.ui.render(),g&&x&&E(g.innerHTML)}}},D=j=>{r=!1,n.ui.render(),j&&(g?.focus(),ie("createLink",j),e=et(),g&&x&&E(g.innerHTML))},N=()=>{r=!1,i="",n.ui.render()},O=j=>{j&&(ie("insertImage",j),e=et(),g&&x&&E(g.innerHTML))},M=async j=>{let ce=j[0];if(ce){c=!0,n.ui.render();try{let We=await k(ce);O(We),o=!1,a="",n.ui.render()}catch{}finally{c=!1,n.ui.render()}}},C=j=>{o=!1,a="",n.ui.render(),g?.focus(),O(j)},A=()=>{o=!1,a="",n.ui.render()},R=(j,ce)=>{u=!1,d=-1,f=-1,v(),ko(j,ce),n.ui.render(),g&&x&&E(g.innerHTML)},z=(j,ce)=>{d=j,f=ce,n.ui.render()},U=()=>{d=-1,f=-1,n.ui.render()},V=ae("button",{key:"table",class:"wf-editor-tb-btn",type:"button",title:"\u63D2\u5165\u8868\u683C","aria-label":"\u63D2\u5165\u8868\u683C","data-item":"table"},"\u229E"),_=u?Mo(d,f,R,z,U):null,J=ae(It,{key:"table",open:L&&!!u,onOpenChange:j=>{u=j,j&&b(),n.ui.render()},content:_},V),Q=j=>{P||E(j.currentTarget.innerHTML)},K=j=>{let ce=j.target.value;x?.(ce)},Qe=j=>{if(P||!L)return;b(),(j.ctrlKey||j.metaKey)&&["b","i","u"].includes(j.key.toLowerCase())&&(e=et(),n.ui.render(),g&&x&&E(g.innerHTML))},W=()=>{if(!L)return;b();let j=et();if(e===null){e=j;return}vs(e,j)||(e=j,n.ui.render())},H=()=>{b();let j=!1;r&&(r=!1,j=!0),o&&(o=!1,j=!0),j&&n.ui.render()},X=L&&r?ae(it,{open:!0,title:"\u63D2\u5165\u94FE\u63A5",onClose:N,footer:[ae("button",{class:"wf-btn wf-btn--ghost wf-btn--sm",type:"button",onClick:N},"\u53D6\u6D88"),ae("button",{class:"wf-btn wf-btn--primary wf-btn--sm",type:"button",onClick:()=>D(i)},"\u786E\u5B9A")]},ae("input",{type:"url",class:"wf-editor-link-input",placeholder:"https://...",value:i,"data-editor-link-input":!0,onInput:j=>{i=j.target.value,n.ui.render()},onKeyDown:j=>{j.key==="Enter"&&D(j.target.value),j.key==="Escape"&&N()}})):null,F=[];k&&(F.push(ae(vn,{accept:"image/*",multiple:!1,disabled:c,onChange:M},ae("div",{class:"wf-editor-img-zone"},[ae("span",{class:"wf-editor-img-zone-icon"},"\u{1F5BC}"),ae("span",{class:"wf-editor-img-zone-text"},c?"\u4E0A\u4F20\u4E2D...":"\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20\u56FE\u7247")]))),F.push(ae("span",{class:"wf-editor-img-or"},"\u6216"))),F.push(ae("input",{type:"url",class:"wf-editor-link-input",placeholder:k?"\u7C98\u8D34\u56FE\u7247\u94FE\u63A5":"https://...",value:a,"data-image-input":!0,disabled:c||void 0,onInput:j=>{a=j.target.value,n.ui.render()},onKeyDown:j=>{j.key==="Enter"&&C(j.target.value),j.key==="Escape"&&A()}}));let ee=L&&o?ae(it,{open:!0,title:"\u63D2\u5165\u56FE\u7247",onClose:A,footer:[ae("button",{class:"wf-btn wf-btn--ghost wf-btn--sm",type:"button",disabled:c||void 0,onClick:A},"\u53D6\u6D88"),ae("button",{class:"wf-btn wf-btn--primary wf-btn--sm",type:"button",disabled:c||void 0,onClick:()=>C(a)},k?"\u63D2\u5165":"\u786E\u5B9A")]},ae("div",{class:"wf-stack",style:"gap:8px"},F)):null,oe=null;if(L){let j=["wf-editor-content",P&&"wf-editor-content--disabled",S&&"wf-editor-content--has-placeholder"].filter(Boolean).join(" ");oe=ae("div",{class:j,contentEditable:!P,innerHTML:L?w:p,"data-placeholder":S||void 0,style:{minHeight:I},onInput:Q,onKeyUp:Qe,onMouseUp:W,onMouseDown:H,ref:m})}else oe=ae("textarea",{class:"wf-editor-source",value:w,disabled:P,style:{minHeight:I},onInput:K});let de={table:()=>J};return ae("div",{class:`wf-editor${P?" wf-editor--disabled":""}`},[!P&&$.length>0?xo($,e??{},!L,B,de):null,oe,X,ee,ae("input",{type:"hidden",value:w,"aria-hidden":"true"})])}};import{createClientBrowser as Cs}from"weifuwu/ui-dom";import{h as Po}from"weifuwu/ui-dom";var Sn=Cs(),To="wf_theme";function So(l){let n=Sn.storageGet(l);return n==="light"||n==="dark"||n==="auto"?n:null}function ks(l,n){Sn.storageSet(l,n)}function Tn(l){let n=Sn.rootElement();n&&(l==="auto"?n.removeAttribute("data-theme"):n.setAttribute("data-theme",l))}function Ms(){let l=So(To);return l||"auto"}var Ps=async(l,n)=>{let t=l.storageKey??To,e=l.mode??So(t)??"auto";return Tn(e),async r=>{let i=n?.i18n?.components?.ThemeSwitch??{},o=[{value:"auto",label:i.auto??"\u81EA\u52A8"},{value:"light",label:i.light??"\u4EAE\u8272"},{value:"dark",label:i.dark??"\u6697\u8272"}].map(a=>Po("button",{type:"button",class:`wf-theme-seg${e===a.value?" wf-theme-seg--active":""}`,role:"radio","aria-checked":String(e===a.value),"aria-label":a.label,onClick:()=>{e!==a.value&&(e=a.value,Tn(e),ks(t,e),r.onChange?.(e),n.ui.render())}},a.label));return Po("div",{class:"wf-theme-switch",role:"radiogroup","aria-label":i.label??"\u4E3B\u9898\u5207\u6362"},o)}};import{h as Ce}from"weifuwu/ui-dom";import{h as G}from"weifuwu/ui-dom";function Eo(l){return l===null?"wf-json-null":typeof l=="string"?"wf-json-string":typeof l=="number"?"wf-json-number":typeof l=="boolean"?"wf-json-boolean":""}function $o(l){return l===null?"null":typeof l=="string"?JSON.stringify(l):String(l)}var En=async(l,n)=>{let t={},e,r=(s,o)=>{t[s]=o===void 0?!t[s]:!o,n.ui.render()},i=(s,o,a)=>{if(a){a(s,o);return}n.browser?.copyText(`${s} = ${JSON.stringify(o)}`)};return async s=>{let{data:o,defaultExpandDepth:a=2,maxKeys:c=100,rootName:u="root",onCopy:d,className:f}=s,p=(h,b,v)=>{i(h,b,d);let w=v.currentTarget?.querySelector("path"),x=w?.getAttribute("d");w&&x&&(w.setAttribute("d","M20 6 9 17l-5-5"),n.browser?.timeout(()=>w.setAttribute("d",x),1e3))},g=(h,b,v,y)=>{if(typeof h=="object"&&h!==null){let w=t[b]===!0||v>=a&&t[b]!==!1;if(w){let I=Array.isArray(h)?`Array(${h.length})`:"Object";return G("div",{class:"wf-json-row wf-json-collapse","data-path":b,role:"button",tabIndex:0,onClick:()=>r(b,w),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),r(b,w))}},[G("button",{class:"wf-json-toggle","aria-label":"\u5C55\u5F00",tabIndex:-1,onClick:$=>{$.stopPropagation(),r(b,w)}},G(T,{name:"chevron-right",size:10})),G("span",{class:"wf-json-key"},`${y}:`),G("span",{class:"wf-json-summary"},`${I} {\u2026}`),G("button",{class:"wf-json-copy","aria-label":`\u590D\u5236 ${b}`,tabIndex:-1,onClick:$=>{$.stopPropagation(),p(b,h,$)}},G(T,{name:e===b?"check":"copy",size:10}))])}if(Array.isArray(h)){let I=h.map(($,L)=>g($,`${b}[${L}]`,v+1,String(L)));return G("div",{class:"wf-json-node","data-path":b},[G("div",{class:"wf-json-row wf-json-row--header",role:"button",tabIndex:0,onClick:()=>r(b,w),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),r(b,w))}},[G("button",{class:"wf-json-toggle","aria-label":"\u6536\u8D77",tabIndex:-1,onClick:$=>{$.stopPropagation(),r(b,w)}},G(T,{name:"chevron-down",size:10})),G("span",{class:"wf-json-key"},`${y}:`),G("span",{class:"wf-json-node-summary"},`Array(${h.length})`)]),G("div",{class:"wf-json-children"},I)])}let x=Object.entries(h),k=x.length>c,P=(k?x.slice(0,c):x).map(([I,$])=>g($,`${b}.${I}`,v+1,I));return k&&P.push(G("div",{class:"wf-json-more"},`+${x.length-c} \u9879\uFF08\u61D2\u5C55\u5F00\uFF09`)),G("div",{class:"wf-json-node","data-path":b},[G("div",{class:"wf-json-row wf-json-row--header",role:"button",tabIndex:0,onClick:()=>r(b,w),onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),r(b,w))}},[G("button",{class:"wf-json-toggle","aria-label":"\u6536\u8D77",tabIndex:-1,onClick:I=>{I.stopPropagation(),r(b,w)}},G(T,{name:"chevron-down",size:10})),G("span",{class:"wf-json-key"},`${y}:`),G("span",{class:"wf-json-node-summary"},`Object(${x.length})`)]),G("div",{class:"wf-json-children"},P)])}return G("div",{class:"wf-json-row","data-path":b},[G("span",{class:"wf-json-toggle-placeholder"}),G("span",{class:"wf-json-key"},`${y}:`),G("span",{class:`wf-json-value ${Eo(h)}`},$o(h)),G("button",{class:"wf-json-copy","aria-label":`\u590D\u5236 ${b}`,tabIndex:-1,onClick:w=>p(b,h,w)},G(T,{name:"copy",size:10}))])},m;if(typeof o=="object"&&o!==null){let h=t[u]===!0;m=h?G("div",{class:"wf-json-row wf-json-collapse","data-path":u,role:"button",tabIndex:0,onClick:()=>r(u,h),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r(u,h))}},[G("button",{class:"wf-json-toggle","aria-label":"\u5C55\u5F00",tabIndex:-1,onClick:b=>{b.stopPropagation(),r(u,h)}},G(T,{name:"chevron-right",size:10})),G("span",{class:"wf-json-summary"},"Object {\u2026}")]):Array.isArray(o)?G("div",{class:"wf-json-node","data-path":u},[G("div",{class:"wf-json-row wf-json-row--header",role:"button",tabIndex:0,onClick:()=>r(u,h),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r(u,h))}},[G("button",{class:"wf-json-toggle","aria-label":"\u6536\u8D77",tabIndex:-1,onClick:b=>{b.stopPropagation(),r(u,h)}},G(T,{name:"chevron-down",size:10})),G("span",{class:"wf-json-node-summary"},`Array(${o.length})`)]),G("div",{class:"wf-json-children"},o.map((b,v)=>g(b,`${u}[${v}]`,1,String(v))))]):G("div",{class:"wf-json-node","data-path":u},[G("div",{class:"wf-json-row wf-json-row--header",role:"button",tabIndex:0,onClick:()=>r(u,h),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r(u,h))}},[G("button",{class:"wf-json-toggle","aria-label":"\u6536\u8D77",tabIndex:-1,onClick:b=>{b.stopPropagation(),r(u,h)}},G(T,{name:"chevron-down",size:10})),G("span",{class:"wf-json-key"},`${u}:`),G("span",{class:"wf-json-node-summary"},`Object(${Object.keys(o).length})`)]),G("div",{class:"wf-json-children"},(()=>{let b=Object.entries(o),v=b.length>c,y=(v?b.slice(0,c):b).map(([w,x])=>g(x,`${u}.${w}`,1,w));return v&&y.push(G("div",{class:"wf-json-more"},`+${b.length-c} \u9879\uFF08\u61D2\u5C55\u5F00\uFF09`)),y})())])}else m=G("div",{class:"wf-json-row"},[G("span",{class:`wf-json-value ${Eo(o)}`},$o(o))]);return G("div",{class:["wf-json-viewer",f].filter(Boolean).join(" ")},[m])}};var Ts={running:"settings",ok:"check",error:"close"},$n=async(l,n)=>async t=>{let{call:e,progress:r,result:i,renderArgs:s}=t,o=i?i.ok?"ok":"error":"running",a=s?s(e.args):Ce(En,{data:e.args,defaultExpandDepth:1,maxKeys:50,rootName:"args"}),c=r?[r.message?Ce("div",{class:"wf-toolcall-msg"},`${r.message} (${r.step}/${r.total})`):null,Ce("div",{class:"wf-toolcall-bar",role:"progressbar","aria-valuenow":r.step,"aria-valuemax":r.total},[Ce("div",{class:"wf-toolcall-bar-fill",style:{width:`${Math.min(100,r.step/Math.max(1,r.total)*100)}%`}})])]:null,u=i&&!i.ok&&i.error?Ce("div",{class:"wf-toolcall-error"},`${i.error.code}: ${i.error.message}`):null;return Ce("div",{class:`wf-toolcall wf-toolcall--${o}`},[Ce("div",{class:"wf-toolcall-header"},[Ce("span",{class:`wf-toolcall-icon wf-toolcall-icon--${o}`},Ce(T,{name:Ts[o]})),Ce("span",{class:"wf-toolcall-name"},e.name)]),Ce("div",{class:"wf-toolcall-body"},[a,c,u].filter(Boolean))])};import{h as re}from"weifuwu/ui-dom";import{h as Z}from"weifuwu/ui-dom";import{h as ve}from"weifuwu/ui-dom";var Qt=async(l,n)=>{let t,e,r=()=>{},i=o=>{clearTimeout(t),clearInterval(e),r(o),t=setTimeout(()=>{e=setInterval(()=>r(o),60)},500)},s=()=>{clearTimeout(t),clearInterval(e)};return async o=>{let{value:a=null,onChange:c,min:u,max:d,step:f=1,precision:p,label:g,name:m,placeholder:h,disabled:b,error:v,hint:y,required:w,className:x}=o,k=O=>{let M=O;return u!=null&&(M=Math.max(u,M)),d!=null&&(M=Math.min(d,M)),p!=null&&(M=Number(M.toFixed(p))),M},S=O=>{if(b)return;c?.(k(Number(((a??0)+O*f).toFixed(10))))};r=S;let P=O=>{if(b)return;let M=O.target.value.trim();if(M===""||M==="-"){c?.(null);return}if(!/^-?\d*\.?\d+$/.test(M))return;let C=Number(M);Number.isNaN(C)||c?.(k(C))},I=a==null?"":String(p!=null?a.toFixed(p):a),$=g?ve("label",{class:"wf-inputnumber-label"},[g,w?ve("span",{class:"wf-inputnumber-req"},"*"):null].filter(Boolean)):null,L=ve("input",{class:"wf-inputnumber-input",type:"text",inputMode:"decimal",value:I,placeholder:h,name:m,disabled:b,onInput:P,onBlur:()=>{a!=null&&c?.(k(a))}}),E=ve("button",{class:"wf-inputnumber-btn",type:"button","aria-label":"\u589E\u52A0",disabled:b,onClick:()=>S(1),onPointerDown:()=>i(1),onPointerUp:s,onPointerLeave:s},ve(T,{name:"chevron-up",size:12})),B=ve("button",{class:"wf-inputnumber-btn",type:"button","aria-label":"\u51CF\u5C11",disabled:b,onClick:()=>S(-1),onPointerDown:()=>i(-1),onPointerUp:s,onPointerLeave:s},ve(T,{name:"chevron-down",size:12})),D=ve("div",{class:`wf-inputnumber${b?" wf-inputnumber--disabled":""}${v?" wf-inputnumber--err":""}${x?` ${x}`:""}`},[L,ve("div",{class:"wf-inputnumber-btns"},[E,B])]),N=[];return $&&N.push($),N.push(D),v&&N.push(ve("div",{class:"wf-inputnumber-err"},v)),y&&!v&&N.push(ve("div",{class:"wf-inputnumber-hint"},y)),ve("div",{class:"wf-inputnumber-wrap"},N)}};function Ln(l,n){console.warn(`[JsonSchemaForm] \u5B57\u6BB5 "${l}" \u4E0D\u652F\u6301 ${n}\u2014\u2014\u964D\u7EA7\u4E3A\u6587\u672C\u8F93\u5165`)}function Ss(l){return{...l??{}}}function ht(l,n,t){let e=l;for(let r=0;r<n.length-1;r++){let i=n[r];(e[i]==null||typeof e[i]!="object")&&(e[i]={}),e=e[i]}e[n[n.length-1]]=t}function Je(l,n){let t=l;for(let e of n){if(t==null||typeof t!="object")return;t=t[e]}return t}function Xt(l,n,t){let e=Je(l,n.slice(0,-1));e&&typeof e=="object"&&(e[n[n.length-1]]=t)}function Es(l,n,t=!1){if(t&&(n==null||n===""))return"\u5FC5\u586B";if(!(n==null||n==="")){if(l.type==="number"||l.type==="integer"){let e=Number(n);return Number.isNaN(e)?"\u5FC5\u987B\u662F\u6570\u5B57":l.minimum!=null&&e<l.minimum?`\u4E0D\u80FD\u5C0F\u4E8E ${l.minimum}`:l.maximum!=null&&e>l.maximum?`\u4E0D\u80FD\u5927\u4E8E ${l.maximum}`:void 0}if(typeof n=="string"){if(l.minLength!=null&&n.length<l.minLength)return`\u81F3\u5C11 ${l.minLength} \u4E2A\u5B57\u7B26`;if(l.maxLength!=null&&n.length>l.maxLength)return`\u6700\u591A ${l.maxLength} \u4E2A\u5B57\u7B26`}if(l.enum?.length&&!l.enum.includes(n))return"\u4E0D\u5728\u5141\u8BB8\u503C\u8303\u56F4\u5185"}}var In=async(l,n)=>{let t=Ss(l.value);function e(){n.ui.render(),l.onChange?.(t)}function r(s,o,a,c,u,d=!1){let f=u[a.join(".")],p=o.title??s;if(o.enum?.length){let g=o.enum.map(m=>({value:String(m),label:String(m)}));return Z(ut,{key:s,label:p,required:d,error:f,hint:o.description},Z(Wt,{value:c==null?void 0:String(c),options:g,error:f,onChange:m=>{ht(t,a,m==null?void 0:o.enum?.find(h=>String(h)===m)),e()}}))}switch(o.type){case"number":case"integer":return Z(ut,{key:s,label:p,required:d,error:f,hint:o.description},Z(Qt,{value:c==null?null:Number(c),min:o.minimum,max:o.maximum,error:f,onChange:g=>{ht(t,a,g??void 0),e()}}));case"boolean":return Z(ut,{key:s,label:p,required:d,error:f,hint:o.description},Z(Vt,{checked:!!c,onChange:g=>{ht(t,a,g),e()}}));case"object":return Z("div",{key:s,class:"wf-jsf-obj"},[Z("div",{class:"wf-jsf-obj-title"},[p,d?Z("span",{class:"wf-field-req"},"*"):null]),...Object.entries(o.properties??{}).map(([g,m])=>r(g,m,[...a,g],Je(t,[...a,g]),u,o.required?.includes(g)))]);case"array":{let g=Array.isArray(c)?c:[],m=g.map((h,b)=>{let v=[...a,String(b)];return Z("div",{key:b,class:"wf-jsf-arr-item"},[i(String(b),o.items??{},v,g[b],u),Z("button",{type:"button",class:"wf-jsf-arr-del","aria-label":`\u5220\u9664 ${p} \u7B2C ${b+1} \u9879`,onClick:()=>{let y=Array.isArray(Je(t,a))?[...Je(t,a)]:[];y.splice(b,1),ht(t,a,y),e()}},Z(T,{name:"trash"}))])});return Z("div",{key:s,class:"wf-jsf-arr"},[Z("div",{class:"wf-jsf-obj-title"},[p,Z("span",{class:"wf-jsf-arr-add",role:"button",tabindex:0,"aria-label":`\u6DFB\u52A0 ${p} \u9879`,onClick:()=>{let h=Array.isArray(Je(t,a))?[...Je(t,a)]:[];h.push(void 0),ht(t,a,h),e()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.target.click())}},Z(T,{name:"plus"}))]),...m])}default:return o.type&&o.type!=="string"&&Ln(s,`type "${o.type}"`),o.$ref&&Ln(s,`$ref \u5F15\u7528\uFF08${o.$ref}\uFF09`),Z(ut,{key:s,label:p,required:d,error:f,hint:o.description},Z(_t,{value:c==null?"":String(c),onInput:g=>{ht(t,a,g.target.value),e()}}))}}function i(s,o,a,c,u){if(o.enum?.length){let d=o.enum.map(f=>({value:String(f),label:String(f)}));return Z(Wt,{value:c==null?void 0:String(c),options:d,onChange:f=>{Xt(t,a,o.enum?.find(p=>String(p)===f)),e()}})}switch(o.type){case"number":case"integer":return Z(Qt,{value:c==null?null:Number(c),onChange:d=>{Xt(t,a,d??void 0),e()}});case"boolean":return Z(Vt,{checked:!!c,onChange:d=>{Xt(t,a,d),e()}});case"object":Ln(a.join("."),"\u6570\u7EC4\u5BF9\u8C61 items\uFF08\u5BF9\u8C61\u6570\u7EC4\uFF09");break;default:return Z(_t,{value:c==null?"":String(c),onInput:d=>{Xt(t,a,d.target.value),e()}})}}return async s=>{let o=s.schema,a={};function c(f,p,g=!1){if(f.type==="object"){for(let[h,b]of Object.entries(f.properties??{}))c(b,[...p,h],f.required?.includes(h));return}let m=Es(f,Je(t,p),g);m&&(a[p.join(".")]=m)}for(let[f,p]of Object.entries(o.properties??{}))c(p,[f],o.required?.includes(f));let u=Object.entries(o.properties??{}).map(([f,p])=>r(f,p,[f],Je(t,[f]),a,o.required?.includes(f))),d=s.onSubmit?Z("button",{type:"button",class:"wf-btn wf-btn--primary wf-jsf-submit",onClick:()=>{Object.keys(a).length>0||s.onSubmit?.(t)}},s.submitLabel??"\u63D0\u4EA4"):null;return Z("div",{class:"wf-jsf"},[o.title?Z("div",{class:"wf-jsf-title"},o.title):null,...u,d])}};var $s={pending:"\u7B49\u5F85\u5BA1\u6279",approved:"\u5DF2\u6279\u51C6",rejected:"\u5DF2\u62D2\u7EDD",timeout:"\u5BA1\u6279\u8D85\u65F6"},Dn=async(l,n)=>{let t="",e=!1,r=!1;return async i=>{let{request:s,status:o="pending",onApprove:a,onReject:c,renderDetail:u,loading:d,argsSchema:f}=i,p=u?u(s):[re("div",{class:"wf-approval-name"},s.name),re("code",{class:"wf-approval-args"},JSON.stringify(s.args))],g=f&&r?re("div",{class:"wf-approval-modify"},[re(In,{schema:f,value:s.args,submitLabel:"\u4EE5\u4FEE\u6539\u540E\u53C2\u6570\u6279\u51C6",onSubmit:h=>a?.(h)}),re("button",{type:"button",class:"wf-approval-modify-cancel wf-btn wf-btn--secondary wf-btn--sm",onClick:()=>{r=!1,n.ui.render()}},"\u53D6\u6D88\u4FEE\u6539")]):null,m=o==="pending"?re("div",{class:"wf-approval-actions"},[e?re("div",{class:"wf-approval-note"},[re("input",{class:"wf-approval-note-input",placeholder:"\u5907\u6CE8\uFF08\u62D2\u7EDD\u539F\u56E0\uFF0C\u5C06\u8FDB\u5165 agent \u4E0A\u4E0B\u6587\uFF09\u2026","aria-label":"\u62D2\u7EDD\u5907\u6CE8",value:t,disabled:d||void 0,onInput:h=>{t=h.target.value}})]):null,re("div",{class:"wf-approval-btns"},[re("button",{class:"wf-btn wf-btn--primary wf-btn--sm",type:"button",disabled:d||void 0,onClick:d?void 0:()=>a?.(void 0)},d?"\u63D0\u4EA4\u4E2D\u2026":"\u5141\u8BB8"),f&&!r?re("button",{class:"wf-btn wf-btn--secondary wf-btn--sm wf-approval-modify-btn",type:"button",disabled:d||void 0,onClick:d?void 0:()=>{r=!0,n.ui.render()}},"\u4FEE\u6539\u53C2\u6570"):null,re("button",{class:"wf-btn wf-btn--danger wf-btn--sm",type:"button",disabled:d||void 0,onClick:d?void 0:()=>{if(!e){e=!0,n.ui.render();return}c?.(t)}},e?"\u786E\u8BA4\u62D2\u7EDD":"\u62D2\u7EDD"),e?re("button",{class:"wf-btn wf-btn--secondary wf-btn--sm",type:"button",disabled:d||void 0,onClick:()=>{e=!1,t="",n.ui.render()}},"\u53D6\u6D88"):null].filter(Boolean))].filter(Boolean)):re("div",{class:`wf-approval-status wf-approval-status--${o}`},$s[o]);return re("div",{class:`wf-approval wf-approval--${o}`},[re("div",{class:"wf-approval-header"},[re("span",{class:"wf-approval-icon"},re(T,{name:o==="pending"?"pause":o==="approved"?"check":"close"})),re("span",{class:"wf-approval-title"},"\u5DE5\u5177\u5BA1\u6279")]),re("div",{class:"wf-approval-detail"},p),s.reason?re("div",{class:"wf-approval-reason"},s.reason):null,m,g])}};import{createClientBrowser as Ls}from"weifuwu/ui-dom";import{h as he}from"weifuwu/ui-dom";import{h as tt}from"weifuwu/ui-dom";var An=async(l,n)=>{let t=!!l.defaultExpanded;return async e=>{let{content:r,streaming:i,label:s="\u5DF2\u601D\u8003"}=e,o=()=>{t=!t,n.ui.render()};return tt("div",{class:`wf-reasoning${i?" wf-reasoning--streaming":""}`},[tt("button",{type:"button",class:"wf-reasoning-toggle","aria-expanded":t,onClick:o,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),o())}},[tt("span",{class:`wf-reasoning-chevron${t?" wf-reasoning-chevron--open":""}`},tt(T,{name:"chevron-down"})),tt("span",{class:"wf-reasoning-label"},i?`${s}\u2026`:s),i?tt("span",{class:"wf-reasoning-dot","aria-hidden":"true"}):null]),tt("div",{class:`wf-reasoning-body${t?" wf-reasoning-body--open":""}`,hidden:!t},r)])}};import{h as yt}from"weifuwu/ui-dom";var On=async(l,n)=>async t=>{let e={send:"\u53D1\u9001",stop:"\u505C\u6B62",retry:"\u91CD\u8BD5",placeholder:"\u8F93\u5165\u6D88\u606F\uFF0C\u56DE\u8F66\u53D1\u9001\u2026",...t.labels},r=n.ui.useControlledInput({value:t.value??"",onChange:t.onChange,name:"ChatInput"});t.control&&(t.control.current={setKeyword:a=>{r.setKeyword(a)},setValue:a=>{r.setKeyword(a),t.onChange?.(a)}});let i=!1,s=()=>{let a=r.keyword.trim();a&&(r.setKeyword(""),t.onSend(a))},o={class:"wf-chat-input",value:r.keyword,placeholder:e.placeholder,disabled:t.disabled,onInput:a=>{i||a.isComposing||(r.setKeyword(a.target.value),t.onChange?.(a.target.value))},onCompositionStart:()=>{i=!0},onCompositionEnd:a=>{i=!1;let c=a.target?.value??"";r.setKeyword(c),t.onChange?.(c)},onKeyDown:a=>{if(a.key==="Enter"&&!(i||a.isComposing)){if(a.ctrlKey||a.metaKey){a.preventDefault(),s();return}t.multiline&&a.shiftKey||(a.preventDefault(),s())}}};return yt("div",{class:"wf-chat-inputbar"},[t.multiline?yt("textarea",{...o,rows:1,style:{resize:"none"}}):yt("input",{...o,type:"text"}),t.actions??null,t.streaming?yt("button",{class:"wf-btn wf-btn--primary wf-btn--sm",type:"button",disabled:t.disabled,onClick:()=>t.onStop?.()},e.stop):yt("button",{class:"wf-btn wf-btn--primary wf-btn--sm",type:"button",disabled:t.disabled,onClick:()=>s()},e.send),!t.streaming&&t.error?yt("button",{class:"wf-btn wf-btn--danger wf-btn--sm",type:"button",onClick:()=>t.onRetry?.()},e.retry):null])};var Is={send:"\u53D1\u9001",stop:"\u505C\u6B62",retry:"\u91CD\u8BD5",thinking:"\u{1F914} \u601D\u8003\u4E2D\u2026",runningTool:l=>l?`\u6267\u884C\u5DE5\u5177 ${l}`:"\u6267\u884C\u5DE5\u5177\u2026",tokens:l=>`tokens: ${l.prompt_tokens}\u2192${l.completion_tokens}`,error:l=>`${l.code}: ${l.message}`,placeholder:"\u8F93\u5165\u6D88\u606F\uFF0C\u56DE\u8F66\u53D1\u9001\u2026",empty:"\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u5BF9\u8BDD\u3002"},Ds=async(l,n)=>{let t=n.browser??Ls(),e,r=!0,i=l.chat,s,o=()=>{s?.();let p=i;s=p?.subscribe?p.subscribe(()=>n.ui.render()):void 0};o();let a=p=>{p||(s?.(),s=void 0)},c=n.ui.useVisualViewport(),u=()=>{e&&(e.scrollTop=e.scrollHeight)},d=n.ui.useScrollPosition({getScroller:()=>e??window}),f=p=>{p&&!e?(e=p,d.refresh(),queueMicrotask(u)):!p&&e&&(e=void 0)};return async p=>{let{chat:g,raiseOnKeyboard:m=!1}=p,h={...Is,...p.labels};g!==i&&(i=g,o()),e&&(r=e.scrollHeight-d.y-e.clientHeight<48),r&&queueMicrotask(u);let b=g.messages??[],v=[];b.length===0&&v.push(he("p",{class:"wf-aichat-empty"},h.empty));for(let y of b)v.push(As(y,p,h));return g.step&&v.push(he("div",{class:"wf-aichat-status"},g.step.type==="llm"?h.thinking:h.runningTool(g.step.name))),g.usage&&v.push(he("div",{class:"wf-aichat-usage"},h.tokens(g.usage))),g.error&&v.push(he("div",{class:"wf-aichat-error"},h.error(g.error))),he("div",{class:"wf-aichat",ref:a},[he("div",{class:"wf-aichat-list",style:{maxHeight:p.maxHeight??"70vh"},ref:f},v),he("div",{class:`wf-aichat-inputbar${c.keyboardOpen&&m?" wf-aichat-inputbar--raised":""}`,style:c.keyboardOpen&&m?{position:"fixed",left:"0",right:"0",bottom:`${Math.max(0,t?.viewportHeight()-(c.height+c.offsetTop))+8}px`,zIndex:"var(--wf-z-popover)"}:void 0},[he(On,{value:g.input??"",onChange:y=>{g.input=y},onSend:y=>{g.input=y,g.send()},streaming:g.streaming,onStop:()=>g.stop(),error:g.error?g.error.message:null,onRetry:()=>g.retry(),labels:{send:h.send,stop:h.stop,retry:h.retry,placeholder:h.placeholder}})])])}};function As(l,n,t){let e=[];if(l.toolCalls?.length){let r=l.toolCalls.map((i,s)=>he($n,{key:`${l.id}-tool-${s}`,call:i.call,progress:i.progress,result:i.result,renderArgs:n.renderToolArgs}));e.push(he("div",{class:"wf-aichat-tools"},r))}if(l.approval){let r=he(Dn,{request:l.approval,argsSchema:n.approveSchema?.(l.approval),onApprove:i=>n.chat.approve(i?"modified":"approved",void 0,i),onReject:i=>n.chat.approve("rejected",i??"\u7528\u6237\u62D2\u7EDD")});e.push(he("div",{class:"wf-aichat-approval"},r))}return l.reasoning&&e.push(he(An,{content:l.reasoning,streaming:l.status==="streaming"})),e.push(he("div",{class:`wf-aichat-bubble wf-aichat-bubble--${l.role}`},n.renderMessage?n.renderMessage(l):l.content||"\u2026")),he("div",{key:l.id,class:`wf-aichat-msg wf-aichat-msg--${l.role}`},e)}import{h as ke}from"weifuwu/ui-dom";var Os=async l=>async n=>ke("div",{class:"wf-center wf-p-xl wf-bg-secondary",style:{minHeight:"100vh"}},[ke(hn,{},[ke("div",{class:"wf-stack wf-gap-sm wf-text-center wf-mb-lg"},[n.logo?ke("div",{class:"wf-center"},n.logo):null,ke("div",{class:"wf-text-2xl wf-text-semibold"},n.title),n.subtitle?ke("div",{class:"wf-text-sm wf-text-secondary"},n.subtitle):null]),n.error?ke(fn,{variant:"error"},n.error):null,ke("form",{class:"wf-auth-form",onSubmit:t=>{t.preventDefault(),n.onSubmit?.()}},[ke("div",{class:"wf-stack wf-gap-md"},[n.children,ke(st,{type:"submit",variant:"primary",loading:n.loading,disabled:n.loading,block:!0},n.submitLabel)])]),n.footer?ke("div",{class:"wf-text-center wf-mt-md wf-text-sm"},n.footer):null])]);import{h as ne,Fragment as zs}from"weifuwu/ui-dom";var Rs=/^https?:\/\//i;function Bs(l){let n=l.trim();return Rs.test(n)?n:null}function ye(l){let n=[],t=0,e="",r=()=>{e&&(n.push({type:"text",text:e}),e="")};for(;t<l.length;){let i=l[t];if(i==="`"){let s=l.indexOf("`",t+1);if(s>t){r(),n.push({type:"code",text:l.slice(t+1,s)}),t=s+1;continue}e+=i,t++;continue}if(i==="*"&&l[t+1]==="*"){let s=l.indexOf("**",t+2);if(s>t){r(),n.push({type:"bold",children:ye(l.slice(t+2,s))}),t=s+2;continue}}if(i==="~"&&l[t+1]==="~"){let s=l.indexOf("~~",t+2);if(s>t){r(),n.push({type:"del",children:ye(l.slice(t+2,s))}),t=s+2;continue}}if(i==="*"){let s=l.indexOf("*",t+1);if(s>t){r(),n.push({type:"italic",children:ye(l.slice(t+1,s))}),t=s+1;continue}}if(i==="["){let s=l.indexOf("]",t+1);if(s>t&&l[s+1]==="("){let o=l.indexOf(")",s+2);if(o>s){let a=l.slice(t+1,s),c=l.slice(s+2,o),u=Bs(c);if(u){r(),n.push({type:"link",href:u,children:ye(a)}),t=o+1;continue}e+=l.slice(t,o+1),t=o+1;continue}}}e+=i,t++}return r(),n}function Rn(l){let n=l.replace(/\r\n/g,`
3
3
  `).split(`
4
4
  `),t=[],e=0,r=i=>{i.type==="paragraph"&&i.inline.length===0||t.push(i)};for(;e<n.length;){let i=n[e];if(/^\s*$/.test(i)){e++;continue}if(/^```/.test(i.trim())){let p=i.trim().slice(3).trim(),g=[];for(e++;e<n.length&&!/^\s*```/.test(n[e]);)g.push(n[e]),e++;e++,r({type:"code",lang:p||void 0,code:g.join(`
@@ -7839,6 +7839,13 @@ body.wf-dragging {
7839
7839
  color: var(--wf-color-text);
7840
7840
  }
7841
7841
 
7842
+ /* 受控 + 自定义清除按钮时隐藏原生 ×(type=search WebKit 双清除 UI——
7843
+ 自定义 wf-search-clear 是设计清除入口,原生 × 样式不统一且重复) */
7844
+ .wf-search--has-clear .wf-search-input::-webkit-search-cancel-button {
7845
+ -webkit-appearance: none;
7846
+ appearance: none;
7847
+ }
7848
+
7842
7849
  /* disabled(F2 状态矩阵) */
7843
7850
  .wf-search-input--dis { opacity: 0.5; cursor: not-allowed; }
7844
7851
  .wf-search-input:disabled { cursor: not-allowed; }
package/dist/index.js CHANGED
@@ -3308,7 +3308,8 @@ function base(type, props, key = null) {
3308
3308
  _id: null,
3309
3309
  _customId: null,
3310
3310
  _parentVNode: null,
3311
- _ctxVersion: null
3311
+ _ctxVersion: null,
3312
+ _lifecycle: "fresh"
3312
3313
  };
3313
3314
  }
3314
3315
  function createVNode(type, props, key = null) {
@@ -3378,8 +3379,7 @@ function ensureArrayKeys(children) {
3378
3379
  const c = children[i];
3379
3380
  if (c != null && typeof c === "object" && !Array.isArray(c)) {
3380
3381
  const v = c;
3381
- if (v.key === null) v.key = String(i);
3382
- else v.key = String(v.key);
3382
+ if (v.key !== null) v.key = String(v.key);
3383
3383
  }
3384
3384
  }
3385
3385
  }
@@ -3409,18 +3409,32 @@ async function holeToHtml(v, ctx) {
3409
3409
  async function textToHtml(v, ctx) {
3410
3410
  return escape(String(v));
3411
3411
  }
3412
+ function childHtmlKind(c) {
3413
+ if (c == null || typeof c === "boolean") return "hole";
3414
+ if (Array.isArray(c)) return "arr";
3415
+ return "vnode";
3416
+ }
3417
+ var CHILD_HTML = {
3418
+ /** 占位:wf-hole 注释(与客户端 renderArray 同构——数组项槽位必须有节点) */
3419
+ hole: (c) => Promise.resolve(`<!--${holeMarkup({ type: "hole", value: c, key: null, id: null, fid: null })}-->`),
3420
+ /** 嵌套数组项 = 隐式 Fragment:fragment-start/end 标记 + 内容(fid 传递——配对精确) */
3421
+ arr: async (c, ctx, i, childFid) => {
3422
+ const inner = await x2html(c, { ...ctx, _fidPath: childFid });
3423
+ return `<!--${holeMarkup({ type: "fragment-start", key: String(i), id: null, fid: childFid })}-->${inner}<!--${holeMarkup({ type: "fragment-end", key: String(i), id: null, fid: childFid })}-->`;
3424
+ },
3425
+ /** 普通项:递归 x2html;组件输出 null(渲染层无输出)→ 占位注释(与客户端 renderArray 同构) */
3426
+ vnode: async (c, ctx) => {
3427
+ const html = await x2html(c, ctx);
3428
+ return html === "" ? `<!--${holeMarkup({ type: "hole", value: null, key: null, id: null, fid: null })}-->` : html;
3429
+ }
3430
+ };
3412
3431
  async function arrToHtml(v, ctx) {
3413
3432
  const arr = v;
3414
3433
  ensureArrayKeys(arr);
3415
3434
  const fidBase = ctx._fidPath;
3416
3435
  const parts = await Promise.all(arr.map(async (c, i) => {
3417
3436
  const childFid = fidBase != null ? `${fidBase}-${i}` : String(i);
3418
- if (c == null || typeof c === "boolean") return `<!--${holeMarkup({ type: "hole", value: c, key: null, id: null, fid: null })}-->`;
3419
- if (Array.isArray(c)) {
3420
- const inner = await x2html(c, { ...ctx, _fidPath: childFid });
3421
- return `<!--${holeMarkup({ type: "fragment-start", key: String(i), id: null, fid: childFid })}-->${inner}<!--${holeMarkup({ type: "fragment-end", key: String(i), id: null, fid: childFid })}-->`;
3422
- }
3423
- return x2html(c, ctx);
3437
+ return CHILD_HTML[childHtmlKind(c)](c, ctx, i, childFid);
3424
3438
  }));
3425
3439
  return parts.join("");
3426
3440
  }
@@ -25,9 +25,9 @@ export declare function useLongPress(env: HookEnv, options: UseLongPressOptions)
25
25
  export declare function usePresence(env: HookEnv, options?: {
26
26
  name?: string;
27
27
  }): {
28
- readonly phase: "closed" | "open" | "exit";
28
+ readonly phase: "open" | "closed" | "exit";
29
29
  ref: (el: HTMLElement | null) => void;
30
- sync: (open: boolean) => "closed" | "open" | "exit";
30
+ sync: (open: boolean) => "open" | "closed" | "exit";
31
31
  };
32
32
  /** 数值补间:rAF + ease + reduced-motion 直落终值。目标变化自动补间。 */
33
33
  export declare function useTween(env: HookEnv, target: number, opts?: {