@ys-knife-crud/antd 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/antd/src/commandBar/tableActionMenuButton.d.ts.map +1 -1
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5235 -2538
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const t=require("react/jsx-runtime"),i=require("react"),u=require("antd"),V=require("@ys-knife-crud/react"),bn=require("react-dom"),S=require("@ys-knife-crud/core"),$e=require("dayjs");function hr(n){const{rows:e,rowKey:r,showCheckbox:s,loading:l,hasActions:a,isSelected:c,onCheck:o,onContextMenu:d,card:m,empty:k}=n;return t.jsxs("div",{className:"yk-table__cards",children:[e.map((b,w)=>{const p=s&&c(b);return t.jsxs("div",{className:`yk-table__card${p?" is-selected":""}${a?" has-actions":""}`,title:a?"右键查看行操作":void 0,onContextMenu:j=>d(j,b),children:[s?t.jsx(u.Checkbox,{className:"yk-table__card-checkbox",checked:p,onChange:j=>o(b,j.target.checked)}):null,m?m(b,w):t.jsx("pre",{className:"yk-table__card-json",children:JSON.stringify(b,null,2)})]},String(b[r]))}),!l&&e.length===0?t.jsx(t.Fragment,{children:k??t.jsx(u.Empty,{className:"yk-table__cards-empty",description:"暂无数据"})}):null]})}function gn(n,e,r){return n.map((s,l)=>l===e?{...s,...r}:s)}function yr({open:n,drafts:e,onCancel:r,onSave:s,onReset:l,onMove:a,onDraftsChange:c}){return t.jsx(u.Modal,{open:n,title:"列设置",width:480,destroyOnClose:!0,onCancel:r,footer:t.jsxs(t.Fragment,{children:[t.jsx(u.Button,{onClick:l,children:"重置"}),t.jsx(u.Button,{onClick:r,children:"取消"}),t.jsx(u.Button,{type:"primary",className:"yk-col-config-save",onClick:()=>void s(),children:"保存"})]}),children:t.jsx("div",{className:"yk-col-config",children:e.map((o,d)=>t.jsxs("div",{className:"yk-col-config-row",children:[t.jsx(u.Checkbox,{className:"yk-col-config-name",checked:o.visible,onChange:m=>c(gn(e,d,{visible:m.target.checked})),children:o.displayName}),t.jsx(u.Input,{className:"yk-col-config-width",size:"small",value:o.width,placeholder:"宽度(如 120)",onChange:m=>c(gn(e,d,{width:m.target.value}))}),t.jsx(u.Button,{type:"link",disabled:d===0,onClick:()=>a(d,-1),children:"上移"}),t.jsx(u.Button,{type:"link",disabled:d===e.length-1,onClick:()=>a(d,1),children:"下移"})]},o.propertyPath))})})}function vt(n){return n==null||n===!1?null:i.isValidElement(n)||typeof n=="string"||typeof n=="number"?n:typeof n=="function"?i.createElement(n):null}function gr({menu:n,actions:e,isEnabled:r,onClose:s,onSelect:l}){return i.useEffect(()=>{if(!n)return;const a=c=>{c.key==="Escape"&&s()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n,s]),!n||typeof document>"u"?null:bn.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"yk-table__menu-mask",onClick:s,onContextMenu:a=>{a.preventDefault(),s()}}),t.jsx("ul",{className:"yk-table__context-menu",style:{left:n.x,top:n.y},children:e.map(a=>{const c=r(a,n.row);return t.jsxs("li",{className:`yk-table__context-menu-item${c?"":" is-disabled"}`,onClick:()=>{c&&l(a)},children:[a.icon?t.jsx("span",{className:"yk-table__context-menu-icon",children:vt(a.icon)}):null,a.desc]},a.name)})})]}),document.body)}function xr(n){if(n==null)return null;if(n<60)return`${n} 秒`;const e=Math.floor(n/60),r=n%60;return r>0?`${e} 分 ${r} 秒`:`${e} 分`}function jn({open:n,options:e,exporting:r,fetched:s,total:l,totalKnown:a,percent:c,etaSeconds:o,cancelledVisible:d,cancelledRows:m,onExport:k,onCancelExport:b,onKeepPartial:w,onDiscardPartial:p,onClose:j}){const F=xr(o);return t.jsxs(t.Fragment,{children:[t.jsx(u.Modal,{open:n,title:"导出 Excel",width:420,destroyOnClose:!0,onCancel:j,footer:null,children:t.jsx("div",{className:"yk-export-options",children:e.map(R=>t.jsx(u.Button,{block:!0,className:"yk-export-option","data-scope":R.value,disabled:R.disabled,onClick:()=>k(R.value),children:R.label},R.value))})}),t.jsxs(u.Modal,{open:r,title:"正在导出",width:420,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,footer:t.jsx(u.Button,{onClick:b,children:"取消"}),children:[t.jsx(u.Progress,{percent:c}),t.jsxs("p",{className:"yk-export-progress-text",children:["已加载 ",s,a?` / ${l}`:""," 条",F?`,预计剩余约 ${F}`:""]})]}),t.jsx(u.Modal,{open:d,title:"导出已取消",width:420,destroyOnClose:!0,onCancel:p,footer:t.jsxs(t.Fragment,{children:[t.jsx(u.Button,{className:"yk-export-discard",onClick:p,children:"丢弃"}),t.jsx(u.Button,{className:"yk-export-keep",type:"primary",onClick:w,children:"保留部分文件"})]}),children:t.jsxs("p",{className:"yk-export-cancelled-text",children:["已写入 ",m," 条数据,是否保留已导出的部分文件?"]})})]})}function pr(n){const{rows:e,rowKey:r,showCheckbox:s,loading:l,hasActions:a,isSelected:c,onCheck:o,onContextMenu:d,list:m,empty:k}=n;return t.jsxs("div",{className:"yk-table__list",children:[e.map((b,w)=>{const p=s&&c(b);return t.jsxs("div",{className:`yk-table__list-item${p?" is-selected":""}${a?" has-actions":""}`,title:a?"右键查看行操作":void 0,onContextMenu:j=>d(j,b),children:[s?t.jsx(u.Checkbox,{className:"yk-table__list-item-checkbox",checked:p,onChange:j=>o(b,j.target.checked)}):null,t.jsx("div",{className:"yk-table__list-item-body",children:m?m(b,w):t.jsx("pre",{className:"yk-table__list-item-json",children:JSON.stringify(b,null,2)})})]},String(b[r]))}),!l&&e.length===0?t.jsx(t.Fragment,{children:k??t.jsx(u.Empty,{description:"暂无数据"})}):null]})}function zt(n,e){return n==="danger"?{type:e?"default":"primary",danger:!0}:n==="primary"?{type:"primary"}:{type:"default"}}function vr({actions:n,table:e,row:r}){return t.jsx("div",{className:"yk-row-actions",children:V.visibleActions(n,r).map(s=>{const l=zt(s.type,!0);return t.jsxs(u.Button,{type:"link",size:"small",danger:l.danger,disabled:!V.isEnabled(s,r),className:"yk-row-action",onClick:()=>void s.execute(r,e),children:[s.icon?t.jsx("span",{className:"yk-row-action__icon",children:vt(s.icon)}):null,s.desc]},s.name)})})}function kr({actions:n,table:e}){return n.length===0?null:{key:"__actions",title:"操作",fixed:"right",width:n.length*34+(n.length-1)*12+30,render:(s,l)=>t.jsx(vr,{actions:n,table:e,row:l})}}const _r=20,br=[10,20,50,100],jr=1e3;function Cr(n){if(!n)return;const e=Number.parseInt(n,10);return Number.isFinite(e)?e:void 0}function xn(n){return n==null?null:i.isValidElement(n)||typeof n=="string"||typeof n=="number"?n:typeof n=="boolean"?n?"true":"false":String(n)}const Cn=i.forwardRef(function(e,r){const s=e.pageSize??_r,l=e.pageSizes??br,a=e.rowKey??"id",c=e.exportPageSize??jr,o=i.useRef(e);o.current=e;const{meta:d,paged:m,rows:k,metaLoading:b,dataLoading:w,currentPage:p,total:j,totalKnown:F,loadMeta:R,setPaged:z,setDataLoading:P,setCurrentPage:L}=V.useDefault({metaFun:e.metaFun,dataFun:e.dataFun,pageSize:s,pageSizes:l}),{selectedRows:v,selectedRowKeys:A,onSelectionChange:$,isRowSelected:J,toggleRowSelection:ue,clearSelection:W,selectAllOnPage:ne,invertSelectionOnPage:U}=V.useSelection({rows:k,rowKey:a}),{actions:Q,actionsLoading:X,loadActions:K}=V.useRowActions({rowActionsFunc:e.rowActionsFunc}),{customConfigs:le,customConfigLoading:T,defaultPageSize:f,configDialogVisible:N,columns:M,loadCustomConfigs:B,updateDefaultPageSize:E,updateColumnWidth:G,openConfigDialog:q,closeConfigDialog:Z}=V.useCustomConfig({loadCustomConfigFun:e.loadCustomConfigFun,saveCustomConfigFun:e.saveCustomConfigFun},d),h=f??s,x=j>Math.min(h,...l)||((m==null?void 0:m.hasNext)??!1),Y=e.viewMode,[se,me]=i.useState(Y??"table");i.useEffect(()=>{Y!==void 0&&me(Y)},[Y]);const we=Y??se,be=e.showCheckbox,[et,ee]=i.useState(be??!1);i.useEffect(()=>{be!==void 0&&ee(be)},[be]);const ke=be??et,je=e.columnResizable,[Te,Ne]=i.useState(je??!0);i.useEffect(()=>{je!==void 0&&Ne(je)},[je]);const Re=je??Te,O=e.stickyHeader,[te,H]=i.useState(O??!1);i.useEffect(()=>{O!==void 0&&H(O)},[O]);const ie=O??te,{exportOptions:Ee,exportDialogVisible:Ie,exporting:_e,exportFetched:Ve,exportTotal:Qe,exportTotalKnown:He,exportEtaSeconds:bt,exportPercent:jt,exportCancelledVisible:Ct,exportCancelledRows:ot,openExportDialog:g,closeExportDialog:_,doExport:D,cancelExport:re,keepPartialExport:De,discardPartialExport:We}=V.useExportExcel({props:{dataFun:e.dataFun,exportSelected:ke,exportorFunc:e.exportorFunc},tableName:(d==null?void 0:d.displayName)??"数据",columns:M,currentRows:k,selectedRows:v,total:j,exportPageSize:c,hasMorePage:x}),at=i.useCallback(y=>{var C,I;me(y),(I=(C=o.current).onUpdateViewMode)==null||I.call(C,y)},[]),ct=i.useCallback(y=>{var C,I;ee(y),(I=(C=o.current).onUpdateShowCheckbox)==null||I.call(C,y),y||W()},[W]),Gn=i.useCallback(y=>{var C,I;Ne(y),(I=(C=o.current).onUpdateColumnResizable)==null||I.call(C,y)},[]),Jn=i.useCallback(y=>{var C,I;H(y),(I=(C=o.current).onUpdateStickyHeader)==null||I.call(C,y)},[]),Ht=i.useRef(e.dataFun);Ht.current=e.dataFun;const St=i.useRef(s);St.current=s;const Wt=i.useRef(f);Wt.current=f;const Pe=i.useRef(p);Pe.current=p;const ut=i.useRef(e.onDataLoaded);ut.current=e.onDataLoaded;const wt=i.useRef(0),ye=i.useCallback(async y=>{var ae;const C=++wt.current,I=(y==null?void 0:y.limit)??Wt.current??St.current,oe=(y==null?void 0:y.page)??Pe.current;P(!0);try{const Ce=await Ht.current({limit:I,offset:(oe-1)*I},y==null?void 0:y.signal);if(C!==wt.current)return;z(Ce),(ae=ut.current)==null||ae.call(ut,Ce)}finally{C===wt.current&&P(!1)}},[P,z]),Xn=i.useCallback(y=>{Pe.current=y,L(y),ye({page:y})},[ye,L]),Nt=i.useCallback(y=>{E(y),Pe.current=1,L(1),ye({limit:y,page:1})},[ye,L,E]),qt=i.useRef(!1);i.useEffect(()=>{qt.current||(qt.current=!0,ye({page:1}))},[ye]);const[Rt,Zn]=i.useState(0),Kt=i.useRef(0);i.useEffect(()=>{Rt!==Kt.current&&(Kt.current=Rt,ye({page:1}))},[Rt,ye]);const Ut=i.useRef(void 0);i.useEffect(()=>{const y=Ut.current;Ut.current=f,!(y!==void 0||f===void 0)&&f!==St.current&&(Pe.current=1,L(1),ye({page:1}))},[f,ye,L]);const Gt=i.useRef(s);i.useEffect(()=>{Gt.current!==s&&(Gt.current=s,Nt(s))},[s,Nt]);const Jt=i.useRef(e.dataFun);i.useEffect(()=>{Jt.current!==e.dataFun&&(Jt.current=e.dataFun,Pe.current=1,L(1),ye({page:1}))},[e.dataFun,ye,L]);async function er(){await Promise.all([R(),K(),B()]),Pe.current=1,L(1),Zn(y=>y+1)}function tr(){ye()}const[dt,Xt]=i.useState(null);function nr(y,C,I){y.preventDefault(),y.stopPropagation();const oe=y.clientX,ae=tt=>Math.max(40,Math.round(I+tt-oe)),Ce=tt=>{Xt({propertyPath:C,width:ae(tt.clientX)})},yn=tt=>{window.removeEventListener("mousemove",Ce),window.removeEventListener("mouseup",yn),document.body.style.userSelect="";const mr=ae(tt.clientX);Xt(null),G(C,mr)};document.body.style.userSelect="none",window.addEventListener("mousemove",Ce),window.addEventListener("mouseup",yn)}const[qe,Et]=i.useState(null),rr=qe?V.visibleActions(Q,qe.row):[];function Zt(y,C){if(Q.length===0)return;y.preventDefault();const I=176,ae=V.visibleActions(Q,C).length*34+8;Et({x:Math.min(y.clientX,window.innerWidth-I-8),y:Math.min(y.clientY,window.innerHeight-ae-8),row:C})}function en(y,C){ue(y,C)}function sr(y){const C=qe==null?void 0:qe.row;Et(null),C&&y.execute(C,mt)}const[tn,ft]=i.useState([]),nn=i.useMemo(()=>((d==null?void 0:d.columns)??[]).map((y,C)=>({col:y,index:C})).filter(({col:y})=>y.showForDisplay??!0).sort((y,C)=>(y.col.displayOrder??y.index)-(C.col.displayOrder??C.index)).map(({col:y})=>y),[d]);function ir(){const y=le.columns;return nn.map((C,I)=>({col:C,config:y[C.propertyPath],index:I})).sort((C,I)=>{var oe,ae;return(((oe=C.config)==null?void 0:oe.order)??C.index)-(((ae=I.config)==null?void 0:ae.order)??I.index)}).map(({col:C,config:I})=>({propertyPath:C.propertyPath,displayName:C.displayName??C.propertyPath,visible:(I==null?void 0:I.visible)??!0,width:(I==null?void 0:I.width)??""}))}function lr(){ft(ir()),q()}function or(){ft(nn.map(y=>({propertyPath:y.propertyPath,displayName:y.displayName??y.propertyPath,visible:!0,width:""})))}function ar(y,C){ft(I=>{const oe=y+C;if(oe<0||oe>=I.length)return I;const ae=[...I],[Ce]=ae.splice(y,1);return Ce?(ae.splice(oe,0,Ce),ae):I})}async function cr(){var I,oe;const y={};tn.forEach((ae,Ce)=>{y[ae.propertyPath]={propertyPath:ae.propertyPath,visible:ae.visible,order:Ce,width:ae.width}});const C={pageSize:f,columns:y};await((oe=(I=o.current).saveCustomConfigFun)==null?void 0:oe.call(I,C)),Z(),o.current.loadCustomConfigFun&&await B()}const It=b||w||X||T,Oe=[];e.empty!=null&&Oe.push("empty"),e.footer!=null&&Oe.push("footer"),e.loading!=null&&Oe.push("loading"),e.card!=null&&Oe.push("card"),e.list!=null&&Oe.push("list"),e.selectionBar!=null&&Oe.push("selectionBar");const rn=i.useRef(d);rn.current=d;const sn=i.useRef(m);sn.current=m;const ln=i.useRef(we);ln.current=we;const on=i.useRef(ke);on.current=ke;const an=i.useRef(Re);an.current=Re;const cn=i.useRef(ie);cn.current=ie;const un=i.useRef(v);un.current=v;const dn=i.useRef(k);dn.current=k;const fn=i.useRef(Oe);fn.current=Oe;const mt={get meta(){return rn.current},get paged(){return sn.current},get currentPage(){return Pe.current},get viewMode(){return ln.current},get selectable(){return on.current},get columnResizable(){return an.current},get stickyHeader(){return cn.current},get slotNames(){return fn.current},get selectedRows(){return un.current},get rows(){return dn.current},reload:er,refresh:tr,setViewMode:at,setSelectable:ct,setColumnResizable:Gn,setStickyHeader:Jn,clearSelection:W,selectAllOnPage:ne,invertSelectionOnPage:U,openConfigDialog:lr,openExportDialog:g},Pt=i.useRef(mt);Pt.current=mt;const Ot=i.useRef(null);Ot.current===null&&(Ot.current=new Proxy({},{get:(y,C)=>Reflect.get(Pt.current,C),has:(y,C)=>Reflect.has(Pt.current,C)})),i.useImperativeHandle(r,()=>Ot.current,[]);const mn=M.map(y=>{const C=(dt==null?void 0:dt.propertyPath)===y.propertyPath?dt.width:Cr(y.width);return{key:y.propertyPath,dataIndex:y.propertyPath,title:y.displayName??y.propertyPath,width:C,ellipsis:!0,render:y.render?(I,oe)=>xn(y.render(oe,I)):I=>xn(I),onHeaderCell:()=>({className:`yk-table__col-header${Re?" yk-table__col-header--resizable":""}`,...Re?{onMouseDown:I=>{const oe=I.currentTarget.getBoundingClientRect();I.clientX<oe.right-8||nr(I,y.propertyPath,C??oe.width)}}:{}})}}),hn=kr({actions:Q,table:mt});hn&&mn.push(hn);const ur=ke?{selectedRowKeys:A,preserveSelectedRowKeys:!0,onChange:(y,C)=>$(C)}:void 0,dr={selectedRows:v,total:j,clearSelection:W,selectAllOnPage:ne,invertSelectionOnPage:U,pageSize:h};function fr(y,C){if(C!==h){Nt(C);return}Xn(y)}return t.jsxs("div",{className:"yk-table",children:[e.selectionBar?t.jsx("div",{className:"yk-table__selection-bar-slot",children:e.selectionBar(dr)}):null,t.jsxs("div",{className:"yk-table__view-area",children:[we==="table"?t.jsx("div",{className:`yk-table__table-wrap${ie?" yk-table__table-wrap--sticky-header":""}`,children:t.jsx(u.Table,{columns:mn,dataSource:k,rowKey:a,bordered:!0,pagination:!1,rowSelection:ur,locale:{emptyText:e.empty??t.jsx(u.Empty,{description:"暂无数据"})}})}):we==="card"?t.jsx(hr,{rows:k,rowKey:a,showCheckbox:ke,loading:It,hasActions:Q.length>0,isSelected:J,onCheck:en,onContextMenu:Zt,card:e.card,empty:e.empty}):t.jsx(pr,{rows:k,rowKey:a,showCheckbox:ke,loading:It,hasActions:Q.length>0,isSelected:J,onCheck:en,onContextMenu:Zt,list:e.list,empty:e.empty}),It?t.jsx("div",{className:"yk-table__loading-mask",children:e.loading??t.jsx("span",{className:"yk-table__loading-spinner","aria-label":"加载中"})}):null]}),x||e.footer!=null?t.jsxs("div",{className:"yk-table__footer",children:[t.jsx("div",{className:"yk-table__footer-extra",children:e.footer}),x?t.jsx(u.Pagination,{className:"yk-table__pagination",current:p,pageSize:h,total:j,pageSizeOptions:l,showSizeChanger:!0,showTotal:F?y=>`共 ${y} 条`:void 0,onChange:fr}):null]}):null,t.jsx(gr,{menu:qe,actions:rr,isEnabled:V.isEnabled,onClose:()=>Et(null),onSelect:sr}),t.jsx(yr,{open:N,drafts:tn,onCancel:Z,onSave:cr,onReset:or,onMove:ar,onDraftsChange:ft}),t.jsx(jn,{open:Ie,options:Ee,exporting:_e,fetched:Ve,total:Qe,totalKnown:He,percent:jt,etaSeconds:bt,cancelledVisible:Ct,cancelledRows:ot,onExport:y=>void D(y),onCancelExport:re,onKeepPartial:()=>void De(),onDiscardPartial:()=>void We(),onClose:_})]})});var Ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pe={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.AggInfoOf=ge.AggInfo=ge.AggItem=ge.AggType=void 0;ge.agg=Sr;var nt;(function(n){n.Sum="sum",n.Min="min",n.Max="max",n.Avg="avg",n.Count="count",n.DistinctCount="distinctcount"})(nt||(ge.AggType=nt={}));class Sn{constructor(e,r,s=null,l){this.path=e,this.type=r,this.name=s,this.filter=l}toString(){var e,r;const s=(r=(e=this.filter)===null||e===void 0?void 0:e.toString())!==null&&r!==void 0?r:"";return this.name?`${this.path}.${this.type}(${s}).as(${this.name})`:`${this.path}.${this.type}(${s})`}}ge.AggItem=Sn;class wn{constructor(...e){this.items=[],this.items.push(...e.filter(r=>r!==null))}append(e,r=nt.Sum,s=null,l){return this.items.push(new Sn(e,r,s,l)),this}toString(){return this.items.length===0?"":this.items.filter(e=>e!==null).map(e=>e.toString()).join(",")}}ge.AggInfo=wn;class Nn extends wn{append(e,r=nt.Sum,s=null,l){return super.append(e,r,s,l),this}}ge.AggInfoOf=Nn;function Sr(n,e=nt.Sum,r=null,s){return new Nn().append(n,e,r,s)}var fe={},de={},Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.Constant=void 0;Be.con=wr;class Rn{constructor(e){this.con=e}toString(){return JSON.stringify(this.con)}}Be.Constant=Rn;function wr(n){return new Rn(n)}var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Expression=void 0;Ye.exp=Nr;class En{constructor(e){this.exp=e}getExp(){return this.exp}toString(){return this.exp}}Ye.Expression=En;function Nr(n){return new En(n)}var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.key=Er;Ae.toExp=Ir;Ae.toValueExp=Pr;const xt=Ye,Rr=Be;function Er(n){return n.toString()}function Ir(n){return n instanceof xt.Expression?n:new xt.Expression(n)}function Pr(n){return n==null?null:n instanceof xt.Expression||n instanceof Rr.Constant?n:new xt.Expression(n)}Object.defineProperty(de,"__esModule",{value:!0});de.FilterInfoOf=de.empty=de.FilterInfo=de.CombinType=de.Operator=void 0;de.filter=Mr;de.emptyFilter=Fr;const rt=Be,Or=Ye,pn=Ae;var pt;(function(n){n.Equals="==",n.NotEquals="!=",n.GreaterThan=">",n.LessThanOrEqual="<=",n.LessThan="<",n.GreaterThanOrEqual=">=",n.Between="between",n.NotBetween="not_between",n.In="in",n.NotIn="not_in",n.StartsWith="startswith",n.NotStartsWith="not_startswith",n.EndsWith="endswith",n.NotEndsWith="not_endswith",n.Contains="contains",n.NotContains="not_contains"})(pt||(de.Operator=pt={}));var ce;(function(n){n[n.AndItems=1]="AndItems",n[n.OrItems=2]="OrItems",n[n.SingleItem=0]="SingleItem"})(ce||(de.CombinType=ce={}));class he{constructor(e,r,s,l=ce.SingleItem,a=[]){this.items=[],this.left=e,this.right=s,this.op=r,this.combinType=l,this.items=a}toString(){switch(this.combinType){case ce.AndItems:{const e=this.items.filter(r=>r&&!r.isEmpty());return e.length===1?`${e[0].toString()}`:e.map(r=>`(${r.toString()})`).join(` ${he.Operator_And} `)}case ce.OrItems:{const e=this.items.filter(r=>r&&!r.isEmpty());return e.length===1?`${e[0].toString()}`:e.map(r=>`(${r.toString()})`).join(` ${he.Operator_Or} `)}default:return this.isEmpty()?"":`${this.left} ${this.op} ${this.right}`}}andAlso(e){return this.combinType==ce.AndItems?(e.combinType==ce.AndItems?this.items=this.items.concat(e.items):this.items.push(e),this):he.createAnd(this,e)}orElse(e){return this.combinType==ce.OrItems?(e.combinType==ce.OrItems?this.items=this.items.concat(e.items):this.items.push(e),this):he.createOr(this,e)}static createOr(...e){return new he(null,null,null,ce.OrItems,e)}static createAnd(...e){return new he(null,null,null,ce.AndItems,e)}isEmpty(){return this.combinType==ce.SingleItem&&this.op==null}static fromSimpleObject(...e){return he.createAnd(...e.map(r=>{var s;return new he((0,Or.exp)(r.name),(s=r.op)!==null&&s!==void 0?s:pt.Equals,(0,rt.con)(r.value))}))}static fromSimpleDictionary(e){return he.fromSimpleObject(...Object.entries(e).map(([r,s])=>({name:r,value:s})))}}de.FilterInfo=he;he.Operator_And="and";he.Operator_Or="or";de.empty=new he((0,rt.con)(1),pt.Equals,(0,rt.con)(1));class Fe extends he{constructor(e,r,s,l=ce.SingleItem,a=[]){super((0,pn.toValueExp)(e),r,(0,pn.toValueExp)(s),l,a)}and(e,r,s){const l=new Fe(e,r,s);return this.combinType==ce.AndItems?(l.combinType==ce.AndItems?this.items=this.items.concat(l.items):this.items.push(l),this):new Fe(null,null,null,ce.AndItems,[this,l])}or(e,r,s){const l=new Fe(e,r,s);return this.combinType==ce.OrItems?(l.combinType==ce.OrItems?this.items=this.items.concat(l.items):this.items.push(l),this):new Fe(null,null,null,ce.OrItems,[this,l])}andIf(e,r,s,l){return e?this.and(r,s,l):this}orIf(e,r,s,l){return e?this.or(r,s,l):this}}de.FilterInfoOf=Fe;function Mr(n,e,r){return new Fe(n,e,r)}function Fr(){return new Fe((0,rt.con)(null),null,(0,rt.con)(null))}var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.queryConfig=void 0;Ze.queryConfig={defaultLimit:10,maxLimit:1e3};var st={};Object.defineProperty(st,"__esModule",{value:!0});st.DataOverflowError=void 0;class Yt extends Error{constructor(e){super(e),this.name="DataOverflowError",Object.setPrototypeOf(this,Yt.prototype)}}st.DataOverflowError=Yt;var xe=Ge&&Ge.__awaiter||function(n,e,r,s){function l(a){return a instanceof r?a:new r(function(c){c(a)})}return new(r||(r=Promise))(function(a,c){function o(k){try{m(s.next(k))}catch(b){c(b)}}function d(k){try{m(s.throw(k))}catch(b){c(b)}}function m(k){k.done?a(k.value):l(k.value).then(o,d)}m((s=s.apply(n,e||[])).next())})};Object.defineProperty(fe,"__esModule",{value:!0});fe.findBy=Pn;fe.findById=Ar;fe.count=Tr;fe.distinctCount=Dr;fe.distinctList=Lr;fe.asList=$r;fe.queryPage=zr;fe.loadAll=Yr;fe.aggValue=Vr;fe.aggProp=it;fe.sumProp=Qr;fe.maxProp=Hr;fe.minProp=Wr;fe.avgProp=qr;const vn=de,Br=Be,Je=ge,kt=Ze,In=st;function Pn(n,e,r,s){return xe(this,void 0,void 0,function*(){const l=yield n({limit:1,offset:0,filter:(0,vn.filter)(e,vn.Operator.Equals,(0,Br.con)(r)).toString(),countAll:!1},s);return l.items.length>0?l.items[0]:null})}function Ar(n,e,r){return xe(this,void 0,void 0,function*(){return Pn(n,"id",e,r)})}function Tr(n,e,r){return xe(this,void 0,void 0,function*(){var s;return(s=(yield n({limit:0,offset:0,filter:e==null?void 0:e.toString(),countAll:!0},r)).totalCount)!==null&&s!==void 0?s:0})}function Dr(n,e,r,s){return xe(this,void 0,void 0,function*(){var l;return(l=(yield n({limit:0,offset:0,filter:r==null?void 0:r.toString(),select:e.toString(),distinct:!0,countAll:!0},s)).totalCount)!==null&&l!==void 0?l:0})}function Lr(n,e,r){return xe(this,void 0,void 0,function*(){var s,l,a,c,o;const d=yield n({limit:(s=e.maxPageSize)!==null&&s!==void 0?s:kt.queryConfig.maxLimit,offset:0,filter:(l=e.filter)===null||l===void 0?void 0:l.toString(),select:e.select.toString(),orderBy:(a=e.orderBy)===null||a===void 0?void 0:a.toString(),distinct:!0,countAll:!1},r);if(d.hasNext&&(!((c=e.throwIfOverflow)!==null&&c!==void 0)||c))throw new In.DataOverflowError(`The result data of distinctList is lost. Total: ${(o=d.totalCount)!==null&&o!==void 0?o:0}, Max page size: ${d.limit}`);return d.items})}function $r(n,e,r){return xe(this,void 0,void 0,function*(){var s,l,a,c,o,d;const m=yield n({limit:(s=e==null?void 0:e.maxPageSize)!==null&&s!==void 0?s:kt.queryConfig.maxLimit,offset:0,filter:(l=e==null?void 0:e.filter)===null||l===void 0?void 0:l.toString(),select:(a=e==null?void 0:e.select)===null||a===void 0?void 0:a.toString(),orderBy:(c=e==null?void 0:e.orderBy)===null||c===void 0?void 0:c.toString(),countAll:!1},r);if(m.hasNext&&(!((o=e==null?void 0:e.throwIfOverflow)!==null&&o!==void 0)||o))throw new In.DataOverflowError(`The result data of asList is lost. Total: ${(d=m.totalCount)!==null&&d!==void 0?d:0}, Max page size: ${m.limit}`);return m.items})}function zr(n,e){var r,s,l,a,c,o;return n({limit:(r=e.limit)!==null&&r!==void 0?r:kt.queryConfig.defaultLimit,offset:(s=e.offset)!==null&&s!==void 0?s:0,filter:(l=e.filter)===null||l===void 0?void 0:l.toString(),select:(a=e.select)===null||a===void 0?void 0:a.toString(),orderBy:(c=e.orderBy)===null||c===void 0?void 0:c.toString(),agg:(o=e.agg)===null||o===void 0?void 0:o.toString(),distinct:e.distinct,countAll:e.countAll})}function Yr(n,e,r){return xe(this,void 0,void 0,function*(){var s,l,a,c,o;let d=[],m=0;const k={limit:(s=e==null?void 0:e.maxPageSize)!==null&&s!==void 0?s:kt.queryConfig.maxLimit,filter:(l=e==null?void 0:e.filter)===null||l===void 0?void 0:l.toString(),select:(a=e==null?void 0:e.select)===null||a===void 0?void 0:a.toString(),orderBy:(c=e==null?void 0:e.orderBy)===null||c===void 0?void 0:c.toString(),distinct:(o=e==null?void 0:e.distinct)!==null&&o!==void 0?o:!1,countAll:!1};for(;!(r!=null&&r.aborted);){const b=yield n(Object.assign(Object.assign({},k),{offset:m}),r);if(d=d.concat(b.items),m+=k.limit,b.items.length==0||!b.hasNext||r!=null&&r.aborted)break}return d})}function Vr(n,e,r,s){return xe(this,void 0,void 0,function*(){return(yield n({limit:0,offset:0,filter:r==null?void 0:r.toString(),agg:e.toString(),countAll:!1},s)).aggs})}function it(n,e){return xe(this,arguments,void 0,function*(r,s,l=Je.AggType.Sum,a,c){var o;const d="__tg0",m=yield r({limit:0,offset:0,filter:a==null?void 0:a.toString(),agg:(0,Je.agg)(s,l,d,a).toString(),countAll:!1},c);return Number((o=m.aggs)===null||o===void 0?void 0:o[d])})}function Qr(n,e,r,s){return xe(this,void 0,void 0,function*(){return it(n,e,Je.AggType.Sum,r,s)})}function Hr(n,e,r,s){return xe(this,void 0,void 0,function*(){return it(n,e,Je.AggType.Max,r,s)})}function Wr(n,e,r,s){return xe(this,void 0,void 0,function*(){return it(n,e,Je.AggType.Min,r,s)})}function qr(n,e,r,s){return xe(this,void 0,void 0,function*(){return it(n,e,Je.AggType.Avg,r,s)})}var _t={};Object.defineProperty(_t,"__esModule",{value:!0});_t.LimitInfo=void 0;class Kr{}_t.LimitInfo=Kr;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.OrderByInfoOf=ve.OrderByInfo=ve.OrderByItem=ve.OrderByType=void 0;ve.orderby=Ur;const Tt=Ae;var Xe;(function(n){n.Asc="asc()",n.Desc="desc()"})(Xe||(ve.OrderByType=Xe={}));class On{constructor(e,r){this.path=e,this.type=r}toString(){return`${this.path}.${this.type.toString()}`}}ve.OrderByItem=On;class Mn{constructor(...e){this.items=[],this.items.push(...e.filter(r=>r!==null))}toString(){return this.items.length===0?"":this.items.filter(e=>e!==null).map(e=>e.toString()).join(",")}add(e,r=Xe.Asc){return this.items.push(new On(e,r)),this}}ve.OrderByInfo=Mn;class Fn extends Mn{then(e){return this.add((0,Tt.toExp)(e),Xe.Asc),this}thenDesc(e){return this.add((0,Tt.toExp)(e),Xe.Desc),this}}ve.OrderByInfoOf=Fn;function Ur(n,e=Xe.Asc){const r=new Fn;return r.add((0,Tt.toExp)(n),e),r}var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});var ze={},Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.SelectInfoOf=Se.SelectInfo=Se.SelectItem=void 0;Se.select=Gr;class Dt{constructor(e,r=!1){this.name=e,this.exclude=r}toString(){return this.exclude?`-${this.name}`:this.name}}Se.SelectItem=Dt;class An{constructor(...e){this.items=[],this.items.push(...e.filter(r=>r!==null))}toString(){return this.items.length===0?"":this.items.filter(e=>e!==null).map(e=>e.toString()).join(",")}appendItems(...e){return this.items?this.items=this.items.concat(e):this.items=e,this}}Se.SelectInfo=An;class Tn extends An{include(...e){return this.appendItems(...e.map(r=>new Dt(r.toString()))),this}exclude(...e){return this.appendItems(...e.map(r=>new Dt(r.toString(),!0))),this}}Se.SelectInfoOf=Tn;function Gr(...n){return new Tn().include(...n)}Object.defineProperty(ze,"__esModule",{value:!0});ze.QueryBuilderOf=ze.QueryBuilder=void 0;ze.query=Xr;const Mt=ge,Ft=de,Me=ve,Ke=Se,Le=Ae,Jr=Ze;class Dn{constructor(){this._limit=Jr.queryConfig.defaultLimit,this._offset=0}build(){const e={limit:this._limit,offset:this._offset};return this._filterInfo&&(e.filter=this._filterInfo.toString()),this._orderByInfo&&(e.orderBy=this._orderByInfo.toString()),this._selectInfo&&(e.select=this._selectInfo.toString()),this._aggInfo&&(e.agg=this._aggInfo.toString()),e}withAgg(e){return this._aggInfo=e,this}withFilter(e){return this._filterInfo=e,this}withOrderBy(e){return this._orderByInfo=e,this}withSelect(e){return this._selectInfo=e,this}offset(e){return this._offset=e,this}limit(e){return this._limit=e,this}}ze.QueryBuilder=Dn;class Ln extends Dn{where(e,r=Ft.Operator.Equals,s){return this._filterInfo?this._filterInfo=this._filterInfo.andAlso(new Ft.FilterInfo((0,Le.toValueExp)(e),r,(0,Le.toValueExp)(s))):this._filterInfo=new Ft.FilterInfo((0,Le.toValueExp)(e),r,(0,Le.toValueExp)(s)),this}orderby(e,r=Me.OrderByType.Asc){return this._orderByInfo=new Me.OrderByInfo(new Me.OrderByItem((0,Le.toExp)(e),r)),this}orderbyDesc(e){return this.orderby(e,Me.OrderByType.Desc)}thenby(e,r=Me.OrderByType.Asc){return this._orderByInfo?this._orderByInfo.add((0,Le.toExp)(e),r):this._orderByInfo=new Me.OrderByInfo(new Me.OrderByItem((0,Le.toExp)(e),r)),this}thenbyDesc(e){return this.thenby(e,Me.OrderByType.Desc)}agg(e,r=Mt.AggType.Sum,s=null){return this._aggInfo?this._aggInfo.append(e,r,s):this._aggInfo=new Mt.AggInfo(new Mt.AggItem(e,r,s)),this}include(...e){return this._selectInfo?this._selectInfo.appendItems(...e.map(r=>new Ke.SelectItem(r.toString()))):this._selectInfo=new Ke.SelectInfo(...e.map(r=>new Ke.SelectItem(r.toString()))),this}exclude(...e){return this._selectInfo?this._selectInfo.appendItems(...e.map(r=>new Ke.SelectItem(r.toString(),!0))):this._selectInfo=new Ke.SelectInfo(...e.map(r=>new Ke.SelectItem(r.toString(),!0))),this}}ze.QueryBuilderOf=Ln;function Xr(){return new Ln}(function(n){var e=Ge&&Ge.__createBinding||(Object.create?function(s,l,a,c){c===void 0&&(c=a);var o=Object.getOwnPropertyDescriptor(l,a);(!o||("get"in o?!l.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(s,c,o)}:function(s,l,a,c){c===void 0&&(c=a),s[c]=l[a]}),r=Ge&&Ge.__exportStar||function(s,l){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(l,a)&&e(l,s,a)};Object.defineProperty(n,"__esModule",{value:!0}),r(ge,n),r(fe,n),r(Be,n),r(Ze,n),r(Ye,n),r(de,n),r(_t,n),r(ve,n),r(Bn,n),r(ze,n),r(Se,n),r(Ae,n),r(st,n)})(pe);const Zr=i.createContext(null),es=[{label:"是",value:!0},{label:"否",value:!1}];function ht(n){const e=$e();return[e.subtract(n,"day"),e]}function $n(n){const[e,r]=i.useState(7),s=n.valueFormat??"YYYY-MM-DD",l=n.op===S.Operator.Between||n.op===S.Operator.NotBetween,a=n.op===S.Operator.In||n.op===S.Operator.NotIn,c=n.value,o=typeof c=="string"?c:"",d=typeof c=="number"?c:void 0,m=typeof c=="boolean"?c:void 0,k=typeof c=="string"||typeof c=="number"||typeof c=="boolean"?c:void 0,b=Array.isArray(c)?c:[],w=Array.isArray(c)&&c.length===2&&typeof c[0]=="string"&&typeof c[1]=="string"?[$e(c[0]),$e(c[1])]:null,p=Array.isArray(c)&&typeof c[0]=="number"?c[0]:void 0,j=Array.isArray(c)&&typeof c[1]=="number"?c[1]:void 0,F=(n.options??[]).map(v=>({label:v.label,value:v.value})),R=v=>{var A;return(A=n.onChange)==null?void 0:A.call(n,v)},z=()=>{const v=e;if(!v||v<1)return;const[A,$]=ht(v);R([A.format(s),$.format(s)])};let P;n.fieldType==="string"&&a?P=t.jsx(u.Select,{mode:"tags",value:b,onChange:v=>R(v),tokenSeparators:[",",","],placeholder:"输入后回车添加",style:{width:"100%"}}):n.fieldType==="string"?P=t.jsx(u.Input,{value:o,onChange:v=>R(v.target.value),placeholder:"请输入",allowClear:!0}):n.fieldType==="number"&&l?P=t.jsxs(t.Fragment,{children:[t.jsx(u.InputNumber,{className:"yk-advanced-value-editor__num",value:p,onChange:v=>R([v??null,j??null]),placeholder:"最小值",controls:!1}),t.jsx("span",{className:"yk-advanced-value-editor__sep",children:"~"}),t.jsx(u.InputNumber,{className:"yk-advanced-value-editor__num",value:j,onChange:v=>R([p??null,v??null]),placeholder:"最大值",controls:!1})]}):n.fieldType==="number"?P=t.jsx(u.InputNumber,{value:d,onChange:v=>R(v??null),placeholder:"请输入数字",controls:!1,style:{width:"100%"}}):n.fieldType==="date"&&l?P=t.jsxs(t.Fragment,{children:[t.jsx(u.DatePicker.RangePicker,{className:"yk-advanced-value-editor__daterange-picker",value:w,format:s,placeholder:["开始日期","结束日期"],presets:[{label:"最近 7 天",value:()=>ht(7)},{label:"最近 30 天",value:()=>ht(30)},{label:"最近 90 天",value:()=>ht(90)}],onChange:(v,A)=>{R(v?[A[0],A[1]]:null)}}),t.jsx(u.Popover,{trigger:"click",placement:"bottom",content:t.jsxs("div",{className:"yk-advanced-value-editor__recent-pop",children:[t.jsx("span",{children:"最近"}),t.jsx(u.InputNumber,{className:"yk-advanced-value-editor__recent-input",value:e,onChange:v=>r(typeof v=="number"?v:1),min:1,controls:!1}),t.jsx("span",{children:"天"}),t.jsx(u.Button,{type:"primary",size:"small",onClick:z,children:"应用"})]}),children:t.jsx(u.Button,{className:"yk-advanced-value-editor__recent-trigger",style:{flex:"0 0 auto"},children:"最近 N 天"})})]}):n.fieldType==="date"?P=t.jsx(u.DatePicker,{value:typeof c=="string"?$e(c):null,format:s,onChange:(v,A)=>R(A||null),placeholder:"选择日期",allowClear:!0}):n.fieldType==="boolean"?P=t.jsx(u.Select,{value:m,options:es.map(v=>({label:v.label,value:v.value})),onChange:v=>R(v),placeholder:"请选择",allowClear:!0}):n.fieldType==="enum"&&a?P=t.jsx(u.Select,{mode:"multiple",value:b,options:F,onChange:v=>R(v),placeholder:"请选择",allowClear:!0,loading:n.optionsLoading}):P=t.jsx(u.Select,{value:k,options:F,onChange:v=>R(v??null),placeholder:"请选择",allowClear:!0,loading:n.optionsLoading});const L=["yk-advanced-value-editor",l?"yk-advanced-value-editor--range":"",n.fieldType==="date"&&l?"yk-advanced-value-editor--daterange":"",n.className??""].filter(Boolean).join(" ");return t.jsx("div",{className:L,children:P})}function Vt(n){const e=i.useContext(Zr);if(!e)return null;const{group:r,level:s=0}=n,l=o=>{(o==="and"||o==="or")&&e.api.setGroupCombinator(r.id,o)},a=o=>e.columns.find(d=>d.propertyPath===o),c=o=>{var d;return((d=a(o))==null?void 0:d.displayFormat)??"YYYY-MM-DD"};return t.jsxs("div",{className:`yk-adv-group level-${s}${s===0?" is-root":""}`,children:[t.jsxs("div",{className:"yk-adv-group__header",children:[t.jsx("span",{className:"yk-adv-group__comb-label",children:"满足"}),t.jsxs(u.Radio.Group,{size:"small",value:r.combinator,onChange:o=>l(o.target.value),children:[t.jsx(u.Radio.Button,{value:"and",children:"全部"}),t.jsx(u.Radio.Button,{value:"or",children:"任一"})]}),t.jsx("span",{className:"yk-adv-group__comb-label",children:"条件"}),t.jsxs("span",{className:"yk-adv-group__actions",children:[t.jsx(u.Button,{type:"link",onClick:()=>e.api.addLeaf(r.id),children:"+ 条件"}),t.jsx(u.Button,{type:"link",onClick:()=>e.api.addNestedGroup(r.id),children:"+ 嵌套组"}),s>0&&t.jsx(u.Button,{type:"link",danger:!0,onClick:()=>e.api.removeNode(r.id),children:"删除组"})]})]}),t.jsxs("div",{className:"yk-adv-group__children",children:[r.children.map(o=>{if(S.isConditionGroup(o))return t.jsx("div",{className:"yk-adv-group__nested",children:t.jsx(Vt,{group:o,level:s+1})},o.id);const d=o;return t.jsxs("div",{className:"yk-adv-group__row",children:[t.jsx(u.Select,{className:"yk-adv-group__field",value:d.propertyPath||void 0,options:e.columns.map(m=>({label:m.displayName??m.propertyPath,value:m.propertyPath})),placeholder:"选择字段",showSearch:!0,optionFilterProp:"label",onChange:m=>e.api.changeField(d.id,m)}),t.jsx(u.Select,{className:"yk-adv-group__op",value:d.op,options:e.api.operatorsOf(d.propertyPath).map(m=>({label:S.OPERATOR_LABELS[m]??String(m),value:m})),placeholder:"操作符",showSearch:!0,optionFilterProp:"label",onChange:m=>e.api.changeOperator(d.id,m)}),!S.isNullOperator(d.op)&&t.jsx($n,{className:["yk-adv-group__value",e.api.isConditionEmpty(d)?"is-invalid":""].filter(Boolean).join(" "),fieldType:e.api.fieldTypeOf(d.propertyPath),op:d.op,value:d.value,options:e.optionsMap[d.propertyPath]??[],optionsLoading:e.loadingMap[d.propertyPath]===!0,valueFormat:c(d.propertyPath),onChange:m=>e.updateValue(d.id,m)}),t.jsx(u.Button,{className:"yk-adv-group__remove",type:"link",danger:!0,onClick:()=>e.api.removeNode(d.id),children:"删除"})]},d.id)}),r.children.length===0&&t.jsx("div",{className:"yk-adv-group__empty",children:"暂无条件,点击「+ 条件」或「+ 嵌套组」"})]})]})}const zn=i.forwardRef(function(e,r){const s=e.showSearch??!0,l=e.showReset??!0,a=e.searchButtonText??"查询",c=e.resetButtonText??"重置",o=e.showSaveQuery??!0,d=V.useAdvancedFilter({columns:e.columns,optionSources:e.optionSources}),{rootGroup:m,fieldTypeOf:k,filter:b,reset:w}=d,[p,j]=i.useState({}),[F,R]=i.useState({}),z=i.useRef({}),P=i.useRef({}),L=x=>{var se;const Y=(se=e.optionSources)==null?void 0:se[x];Y&&(z.current[x]||P.current[x]||(P.current={...P.current,[x]:!0},R(P.current),Y().then(me=>{z.current={...z.current,[x]:me},j(z.current)}).finally(()=>{P.current={...P.current,[x]:!1},R(P.current)})))},v=x=>{const Y=new Set,se=me=>{S.isConditionGroup(me)?me.children.forEach(se):k(me.propertyPath)==="enum"&&Y.add(me.propertyPath)};return x.children.forEach(se),[...Y]};i.useEffect(()=>{for(const x of v(m))L(x)},[m,k,e.optionSources]);const[A,$]=i.useState([]),J=e.savedQueries??A,ue=x=>{var Y;$(x),(Y=e.onUpdateSavedQueries)==null||Y.call(e,x)},[W,ne]=i.useState(!1),[U,Q]=i.useState(""),[X,K]=i.useState(""),le=i.useRef(0),T=()=>{const x=Y=>Y.children.some(se=>S.isConditionGroup(se)?x(se):d.isConditionEmpty(se));return x(m)},f=()=>{Q(""),K(""),ne(!0)},N=()=>{const x=U.trim();if(!x)return;T()&&u.message.warning("当前存在未填值的条件行(标红),保存的预设可能不完整");const Y=JSON.parse(JSON.stringify(m)),se={id:`sq-${++le.current}`,name:x,description:X.trim(),group:Y,filterInfo:b};ue([...J,se]),ne(!1)},M=i.useRef(!1),[B,E]=i.useState(0),G=x=>{const Y=JSON.parse(JSON.stringify(x.group));Object.assign(m,Y),d.setGroupCombinator(m.id,m.combinator),M.current=!0,E(se=>se+1)};i.useEffect(()=>{var x;M.current&&(M.current=!1,(x=e.onSearch)==null||x.call(e,b))},[B,b]);const q=x=>{ue(J.filter(Y=>Y.id!==x))},Z=()=>{var x;return(x=e.onSearch)==null?void 0:x.call(e,b)},h=()=>{var x;w(),(x=e.onReset)==null||x.call(e)};return i.useImperativeHandle(r,()=>({get filter(){return b},reset:h,openSaveDialog:f,applySavedQuery:G,removeSavedQuery:q,get savedQueries(){return J}}),[b,J,m]),e.columns,t.jsxs("div",{className:"yk-advanced-filter",onKeyDown:x=>{x.key==="Enter"&&Z()},children:[t.jsx(Vt,{group:m,level:0}),(s||l||o)&&t.jsxs("div",{className:"yk-advanced-filter__actions",children:[s&&t.jsx(u.Button,{type:"primary",onClick:Z,children:a}),l&&t.jsx(u.Button,{onClick:h,children:c}),o&&t.jsx(u.Button,{onClick:f,children:"保存"})]}),t.jsxs(u.Modal,{open:W,title:"保存查询",width:440,onCancel:()=>ne(!1),onOk:N,okText:"确定",cancelText:"取消",okButtonProps:{disabled:!U.trim()},children:[t.jsxs("div",{className:"yk-advanced-filter__form-item",children:[t.jsx("label",{className:"yk-advanced-filter__form-label",children:"名称"}),t.jsx(u.Input,{value:U,onChange:x=>Q(x.target.value),placeholder:"请输入查询名称",maxLength:50,showCount:!0,onPressEnter:N})]}),t.jsxs("div",{className:"yk-advanced-filter__form-item",children:[t.jsx("label",{className:"yk-advanced-filter__form-label",children:"描述"}),t.jsx(u.Input.TextArea,{value:X,onChange:x=>K(x.target.value),rows:2,placeholder:"可选,描述此查询的用途(hover 标签时显示)",maxLength:200,showCount:!0})]})]})]})}),Yn=i.forwardRef(function(e,r){const s=V.useFilterPanel(),l=i.useRef(s);l.current=s;const a=i.useMemo(()=>({get filter(){return l.current.filter},reset:()=>l.current.reset(),register:s.register,notify:s.notify}),[s.register,s.notify]),c=i.useMemo(()=>{const o=[];e.extraFilter&&o.push(e.extraFilter);const d=s.filter;return d&&!d.isEmpty()&&o.push(d),o.length===0?S.emptyFilter():o.length===1?o[0]:S.FilterInfo.createAnd(...o)},[e.extraFilter,s.filter]);return i.useImperativeHandle(r,()=>({filter:c,reset:()=>s.reset()}),[c,s]),t.jsx(V.FilterPanelContext.Provider,{value:a,children:e.children})});function ts(n,e){const r=new Map;for(const s of n)r.set(s.propertyPath,S.inferColumnFieldType(s,(e==null?void 0:e[s.propertyPath])!==void 0));return s=>r.get(s)??"string"}function ns(n,e){if(S.isNullOperator(n.op))return!1;const r=e(n.propertyPath),s=n.value;return S.isRangeOperator(n.op)?!Array.isArray(s)||s.length!==2?!0:s[0]===null||s[0]===void 0||s[0]===""||s[1]===null||s[1]===void 0||s[1]==="":S.isMultiValueOperator(n.op)?!Array.isArray(s)||s.length===0:r==="boolean"||r==="number"||r==="date"?s==null||s==="":s==null||typeof s=="string"&&s.trim()===""}function rs(n,e){if(ns(n,e))return null;if(n.op==="is_null"){const r=e(n.propertyPath);return r==="string"?S.FilterInfo.createOr(S.filter(n.propertyPath,S.Operator.Equals,pe.con(null)),S.filter(n.propertyPath,S.Operator.Equals,pe.con(""))):r==="array"?S.FilterInfo.createOr(S.filter(n.propertyPath,S.Operator.Equals,pe.con(null)),S.filter(`${n.propertyPath}.count`,S.Operator.Equals,pe.con(0))):S.filter(n.propertyPath,S.Operator.Equals,pe.con(null))}if(n.op==="is_not_null"){const r=e(n.propertyPath);return r==="string"?S.FilterInfo.createAnd(S.filter(n.propertyPath,S.Operator.NotEquals,pe.con(null)),S.filter(n.propertyPath,S.Operator.NotEquals,pe.con(""))):r==="array"?S.FilterInfo.createAnd(S.filter(n.propertyPath,S.Operator.NotEquals,pe.con(null)),S.filter(`${n.propertyPath}.count`,S.Operator.GreaterThan,pe.con(0))):S.filter(n.propertyPath,S.Operator.NotEquals,pe.con(null))}return S.filter(n.propertyPath,n.op,pe.con(n.value))}function Vn(n,e){if(S.isConditionGroup(n)){const r=n.children.map(s=>Vn(s,e)).filter(s=>s!==null);return r.length===0?null:r.length===1?r[0]:n.combinator==="or"?S.FilterInfo.createOr(...r):S.FilterInfo.createAnd(...r)}return rs(n,e)}function ss(n,e,r){const s=ts(e,r);return Vn(n,s)??S.emptyFilter()}const Qn=i.forwardRef(function(e,r){const s=e.showSearch??!0,l=e.showReset??!0,a=e.searchButtonText??"查询",c=e.resetButtonText??"重置",o=e.enableAdvancedFilter??!1,d=e.advancedColumns??[],m=e.showQuickQuery??!1,k=e.singleLine??!1,b=i.useRef(null),w=i.useRef(null),[p,j]=i.useState("simple"),[F,R]=i.useState(!0),[z,P]=i.useState(0),L=i.useRef(null),[v,A]=i.useState([]),$=e.quickQueries??v,J=()=>{var f,N;return p==="advanced"?((f=w.current)==null?void 0:f.filter)??S.emptyFilter():((N=b.current)==null?void 0:N.filter)??S.emptyFilter()},ue=()=>{var f;return(f=e.onSearch)==null?void 0:f.call(e,J())},W=()=>{var f,N,M;p==="advanced"?(f=w.current)==null||f.reset():(N=b.current)==null||N.reset(),(M=e.onReset)==null||M.call(e)};i.useImperativeHandle(r,()=>({get filter(){return J()},get mode(){return p},reset:W}),[p]);const ne=f=>{var N;A(f),(N=e.onUpdateQuickQueries)==null||N.call(e,f)},U=async f=>{const N=new Set($.map(B=>B.id)),M=f.filter(B=>!N.has(B.id));if(e.saveQuickQueryFun&&M.length>0){const B=[];for(const G of M)try{const q=await e.saveQuickQueryFun(G);B.push(q??G)}catch{u.message.error(`保存快速查询「${G.name}」失败`),B.push(G)}let E=f;if(B.some((G,q)=>G!==M[q])){const G=new Map(M.map((q,Z)=>[q.id,B[Z]??q]));E=f.map(q=>G.get(q.id)??q)}ne(E)}else ne(f)};i.useEffect(()=>{if(!e.loadQuickQueryFun)return;let f=!1;return e.loadQuickQueryFun().then(N=>{var B;if(f)return;const M=N.map(E=>({...E,filterInfo:E.filterInfo??ss(E.group,d,e.advancedOptionSources)}));A(M),(B=e.onUpdateQuickQueries)==null||B.call(e,M)}).catch(()=>{f||u.message.error("加载快速查询失败")}),()=>{f=!0}},[]);const Q=f=>{var N,M;p==="advanced"?(N=w.current)==null||N.applySavedQuery(f):(M=e.onSearch)==null||M.call(e,f.filterInfo)},X=f=>{const N=$.find(B=>B.id===f),M=(N==null?void 0:N.name)??"该查询";u.Modal.confirm({title:"删除确认",content:`确定要删除快速查询「${M}」吗?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{U($.filter(B=>B.id!==f))}})},K=()=>{const f=L.current;if(!f)return;for(const Z of Array.from(f.children))Z.style.display="";if(!k||!F){P(0),f.style.maxWidth="";return}const N=f.nextElementSibling,M=N?N.offsetWidth:0,B=16;f.style.maxWidth=`calc(100% - ${M+B}px)`;const E=f.clientWidth;let G=0,q=0;for(const Z of Array.from(f.children)){const h=Z,x=h.offsetWidth;G>0&&G+x+B>E?(h.style.display="none",q++):G+=x+B}P(q)};i.useEffect(()=>{K();const f=L.current;if(!f)return;const N=new ResizeObserver(()=>K());return N.observe(f),()=>N.disconnect()},[k,F,p]);const le=()=>R(f=>!f),T=F?t.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("polyline",{points:"6 9 12 15 18 9"}),t.jsx("polyline",{points:"6 14 12 20 18 14"})]}):t.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("polyline",{points:"18 15 12 9 6 15"}),t.jsx("polyline",{points:"18 10 12 4 6 10"})]});return t.jsx("div",{className:["yk-filter-panel",k?"is-single-line":"",k&&F?"is-collapsed":""].filter(Boolean).join(" "),onKeyDown:f=>{f.key==="Enter"&&p==="simple"&&ue()},children:p==="simple"?t.jsxs(t.Fragment,{children:[k&&t.jsx(u.Button,{type:"text",className:"yk-filter-panel__toggle","aria-label":F?"展开更多条件":"折叠",title:F?z?`展开(${z} 个条件被隐藏)`:"展开":"折叠",onClick:le,children:T}),t.jsx("div",{className:"yk-filter-panel__items",ref:L,children:t.jsx(Yn,{ref:b,children:e.children})}),(s||l||o)&&t.jsxs("div",{className:"yk-filter-panel__actions",children:[s&&t.jsx(u.Button,{type:"primary",onClick:ue,children:a}),l&&t.jsx(u.Button,{onClick:W,children:c}),o&&!(k&&F)&&t.jsx(u.Button,{type:"link",onClick:()=>j("advanced"),children:"高级查询"})]}),m&&$.length>0&&t.jsxs("div",{className:"yk-filter-panel__saved",children:[t.jsx("span",{className:"yk-filter-panel__saved-label",children:"快速查询:"}),$.map(f=>t.jsx(u.Tooltip,{title:f.description||void 0,children:t.jsx(u.Button,{size:"small",onClick:()=>Q(f),children:f.name})},f.id))]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"yk-filter-panel__mode-bar",children:t.jsx(u.Button,{type:"link",onClick:()=>j("simple"),children:"← 简单查询"})}),t.jsx(zn,{ref:w,columns:d,optionSources:e.advancedOptionSources,savedQueries:$,onSearch:f=>{var N;return(N=e.onSearch)==null?void 0:N.call(e,f)},onReset:()=>{var f;return(f=e.onReset)==null?void 0:f.call(e)},onUpdateSavedQueries:U}),$.length>0&&t.jsxs("div",{className:"yk-filter-panel__saved",children:[t.jsx("span",{className:"yk-filter-panel__saved-label",children:"已存查询:"}),$.map(f=>t.jsx(u.Tooltip,{title:f.description||void 0,children:t.jsx(u.Tag,{className:"yk-filter-panel__saved-tag",closable:!0,onClick:()=>Q(f),onClose:()=>X(f.id),children:f.name})},f.id))]})]})})});function is({count:n,onSelectAll:e,onInvert:r,onClear:s}){return n<=0?null:t.jsxs("div",{className:"yk-table__selection-bar",children:[t.jsxs("span",{className:"yk-table__selection-bar__count",children:["已选 ",n," 项"]}),t.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),t.jsx(u.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:e,children:"全选"}),t.jsx(u.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:r,children:"反选"}),t.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),t.jsx(u.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:s,children:"清空"})]})}function ls(){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("circle",{cx:"9",cy:"6",r:"2.4",fill:"#fff"}),t.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),t.jsx("circle",{cx:"15",cy:"12",r:"2.4",fill:"#fff"}),t.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"}),t.jsx("circle",{cx:"9",cy:"18",r:"2.4",fill:"#fff"})]})}function os(){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[t.jsx("polyline",{points:"23 4 23 10 17 10"}),t.jsx("polyline",{points:"1 20 1 14 7 14"}),t.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function as(){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"7 10 12 15 17 10"}),t.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function cs(){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Ue({checked:n}){return t.jsx("span",{className:"yk-table-action-menu-button__check",children:n?"✓":""})}const Qt=i.forwardRef(function({table:e,trigger:r,className:s},l){const[,a]=i.useReducer(d=>d+1,0);function c(d){switch(d){case"refresh":e.refresh();break;case"config":e.openConfigDialog();break;case"export":e.openExportDialog();break;case"view-table":e.setViewMode("table");break;case"view-card":e.setViewMode("card");break;case"view-list":e.setViewMode("list");break;case"toggle-checkbox":e.setSelectable(!e.selectable);break;case"toggle-column-resize":e.setColumnResizable(!e.columnResizable);break;case"toggle-sticky-header":e.setStickyHeader(!e.stickyHeader);break}}const o=[{key:"refresh",label:t.jsxs(t.Fragment,{children:[t.jsx(os,{}),"刷新"]})},{key:"export",label:t.jsxs(t.Fragment,{children:[t.jsx(as,{}),"导出 Excel"]})},{key:"config",label:t.jsxs(t.Fragment,{children:[t.jsx(cs,{}),"列设置"]})},{type:"divider"},{key:"view-table",label:t.jsxs(t.Fragment,{children:[t.jsx(Ue,{checked:e.viewMode==="table"}),"表格视图"]})},...e.slotNames.includes("card")?[{key:"view-card",label:t.jsxs(t.Fragment,{children:[t.jsx(Ue,{checked:e.viewMode==="card"}),"卡片视图"]})}]:[],...e.slotNames.includes("list")?[{key:"view-list",label:t.jsxs(t.Fragment,{children:[t.jsx(Ue,{checked:e.viewMode==="list"}),"列表视图"]})}]:[],{type:"divider"},{key:"toggle-checkbox",label:t.jsxs(t.Fragment,{children:[t.jsx(Ue,{checked:e.selectable}),"选择行"]})},{key:"toggle-column-resize",label:t.jsxs(t.Fragment,{children:[t.jsx(Ue,{checked:e.columnResizable}),"列宽拖动"]})},{key:"toggle-sticky-header",label:t.jsxs(t.Fragment,{children:[t.jsx(Ue,{checked:e.stickyHeader}),"锁定表头"]})}];return t.jsx(u.Dropdown,{trigger:["click"],placement:"bottomRight",onOpenChange:d=>{d&&a()},menu:{items:o,onClick:({key:d})=>c(d)},children:r?t.jsx("span",{className:"yk-table-action-menu-button__trigger",children:r}):t.jsx(u.Button,{ref:l,className:`yk-table-action-menu-button__btn${s?` ${s}`:""}`,title:"表格操作","aria-label":"表格操作",children:t.jsx(ls,{})})})});Qt.displayName="YsTableActionMenuButton";function Hn({actions:n,table:e=null,showActionMenuButton:r=!0,children:s}){const[l,a]=i.useState(null);async function c(o){if(!(!e||l!==null)){a(o.name);try{await o.execute(e)}finally{a(null)}}}return t.jsxs("div",{className:"yk-command-bar",children:[t.jsxs("div",{className:"yk-command-bar__actions",children:[n.map(o=>t.jsx(u.Button,{...zt(o.type,o.plain),icon:vt(o.icon),loading:l===o.name,disabled:l!==null&&l!==o.name,onClick:()=>void c(o),children:o.desc},o.name)),e&&t.jsx(is,{count:e.selectedRows.length,onSelectAll:()=>e.selectAllOnPage(),onInvert:()=>e.invertSelectionOnPage(),onClear:()=>e.clearSelection()}),s]}),r&&e&&t.jsx(Qt,{table:e,className:"yk-command-bar__menu"})]})}const us=[10,20,50,100],ds=[],fs=[],ms=[],hs=[],ys=[];function kn(n){if(n!=null)return typeof n=="function"?n:()=>n}function Bt(n){return typeof n=="function"?n():n}const Wn=i.forwardRef(function(e,r){const{metaFun:s,dataFun:l,rowActionsFunc:a,pageSize:c=20,pageSizes:o=us,showCheckbox:d=!1,columnResizable:m=!0,stickyHeader:k=!1,loadCustomConfigFun:b,saveCustomConfigFun:w,exportPageSize:p=1e3,exportorFunc:j,rowKey:F="id",viewMode:R="table",actions:z=fs,showActionMenuButton:P=!0,showSearch:L=!0,showReset:v=!0,searchButtonText:A="查询",resetButtonText:$="重置",enableAdvancedFilter:J=!1,advancedColumns:ue=ds,advancedOptionSources:W,showQuickQuery:ne=!1,quickQueries:U,loadQuickQueryFun:Q,saveQuickQueryFun:X,singleLine:K=!1}=e,le=i.useRef(S.emptyFilter()),T=i.useRef(null),[f,N]=i.useState(null),M=i.useRef(null),B=i.useCallback(h=>{T.current=h,N(h)},[]),E=i.useCallback(()=>T.current,[]),G=i.useCallback((h,x)=>l(h,le.current,x),[l]),q=i.useCallback(h=>{var x,Y;le.current=h,(x=e.onSearch)==null||x.call(e,h),(Y=T.current)==null||Y.reload()},[e.onSearch]),Z=i.useCallback(()=>{var h,x;le.current=S.emptyFilter(),(h=e.onReset)==null||h.call(e),(x=T.current)==null||x.reload()},[e.onReset]);return i.useImperativeHandle(r,()=>({get table(){return E()},get filterPanel(){return M.current},get meta(){var h;return((h=E())==null?void 0:h.meta)??null},get paged(){var h;return((h=E())==null?void 0:h.paged)??null},get currentPage(){var h;return((h=E())==null?void 0:h.currentPage)??1},get viewMode(){var h;return((h=E())==null?void 0:h.viewMode)??"table"},get selectable(){var h;return((h=E())==null?void 0:h.selectable)??!1},get columnResizable(){var h;return((h=E())==null?void 0:h.columnResizable)??!0},get stickyHeader(){var h;return((h=E())==null?void 0:h.stickyHeader)??!1},get slotNames(){var h;return((h=E())==null?void 0:h.slotNames)??ys},get selectedRows(){var h;return((h=E())==null?void 0:h.selectedRows)??ms},get rows(){var h;return((h=E())==null?void 0:h.rows)??hs},reload:()=>{var h;(h=E())==null||h.reload()},refresh:()=>{var h;(h=E())==null||h.refresh()},setViewMode:h=>{var x;(x=E())==null||x.setViewMode(h)},setSelectable:h=>{var x;(x=E())==null||x.setSelectable(h)},setColumnResizable:h=>{var x;(x=E())==null||x.setColumnResizable(h)},setStickyHeader:h=>{var x;(x=E())==null||x.setStickyHeader(h)},clearSelection:()=>{var h;(h=E())==null||h.clearSelection()},selectAllOnPage:()=>{var h;(h=E())==null||h.selectAllOnPage()},invertSelectionOnPage:()=>{var h;(h=E())==null||h.invertSelectionOnPage()},openConfigDialog:()=>{var h;(h=E())==null||h.openConfigDialog()},openExportDialog:()=>{var h;(h=E())==null||h.openExportDialog()}}),[E]),t.jsxs("div",{className:"yk-table-page",children:[t.jsx("div",{className:"yk-table-page__filter",children:t.jsx(Qn,{ref:M,showSearch:L,showReset:v,searchButtonText:A,resetButtonText:$,enableAdvancedFilter:J,advancedColumns:ue,advancedOptionSources:W,showQuickQuery:ne,quickQueries:U,loadQuickQueryFun:Q,saveQuickQueryFun:X,singleLine:K,onSearch:q,onReset:Z,onUpdateQuickQueries:e.onUpdateQuickQueries,children:e.children})}),t.jsx("div",{className:"yk-table-page__command",children:t.jsx(Hn,{actions:z,table:f,showActionMenuButton:P,children:e.commandBar})}),t.jsx("div",{className:"yk-table-page__table",children:t.jsx(Cn,{ref:B,metaFun:s,dataFun:G,rowActionsFunc:a,pageSize:c,pageSizes:o,showCheckbox:d,columnResizable:m,stickyHeader:k,loadCustomConfigFun:b,saveCustomConfigFun:w,exportPageSize:p,exportorFunc:j,rowKey:F,viewMode:R,onDataLoaded:e.onDataLoaded,onUpdateViewMode:e.onUpdateViewMode,onUpdateShowCheckbox:e.onUpdateShowCheckbox,onUpdateColumnResizable:e.onUpdateColumnResizable,onUpdateStickyHeader:e.onUpdateStickyHeader,card:kn(e.card),list:kn(e.list),empty:Bt(e.empty),loading:Bt(e.loading),footer:Bt(e.footer)})})]})});Wn.displayName="YsTablePage";const qn=i.forwardRef(function(e,r){const{dataFun:s,pageSize:l=20,threshold:a=100,rowKey:c="id",height:o="100%",immediate:d=!0,showCheckbox:m=!1,metaFun:k,exportorFunc:b,exportPageSize:w=1e3}=e,[p,j]=i.useState([]),[F,R]=i.useState(!1),[z,P]=i.useState(!1),[L,v]=i.useState(!0),[A,$]=i.useState(null),[J,ue]=i.useState(0),[W,ne]=i.useState(null),U=i.useRef([]),Q=i.useRef(!1),X=i.useRef(!1),K=i.useRef(!0),le=i.useRef(null),T=i.useRef(e.dataFun),f=i.useRef(e.metaFun),N=i.useRef(l),M=i.useRef({onDataLoaded:e.onDataLoaded,onError:e.onError,onSelectionChange:e.onSelectionChange});T.current=e.dataFun,f.current=e.metaFun,N.current=l,le.current=W,M.current={onDataLoaded:e.onDataLoaded,onError:e.onError,onSelectionChange:e.onSelectionChange};const B=V.useSelection({rows:p,rowKey:c}),E=i.useRef(B);E.current=B;const G=i.useRef(!1);i.useEffect(()=>{var O,te;if(!G.current){G.current=!0;return}(te=(O=M.current).onSelectionChange)==null||te.call(O,[...B.selectedRows])},[B.selectedRows]);const q=i.useCallback(async O=>{var te,H,ie,Ee;if(O){if(X.current||Q.current||!K.current)return;X.current=!0,P(!0)}else{if(Q.current)return;Q.current=!0,R(!0),$(null)}try{const Ie=O?U.current.length:0,_e=await T.current({limit:N.current,offset:Ie}),Ve=_e.items,Qe=O?[...U.current,...Ve]:Ve;U.current=Qe,j(Qe);const He=_e.hasNext??!1;K.current=He,v(He),_e.totalCount!=null&&ue(_e.totalCount),(H=(te=M.current).onDataLoaded)==null||H.call(te,_e,O)}catch(Ie){$(Ie),(Ee=(ie=M.current).onError)==null||Ee.call(ie,Ie)}finally{O?(X.current=!1,P(!1)):(Q.current=!1,R(!1))}},[]),Z=i.useCallback(()=>{q(!0)},[q]),h=i.useCallback(()=>{K.current=!0,v(!0),q(!1)},[q]),x=i.useCallback(async()=>{const O=f.current;if(!O){ne(null);return}try{ne(await O())}catch{ne(null)}},[]),Y=i.useRef(null),se=i.useRef(null);i.useEffect(()=>{const O=Y.current,te=se.current;if(!O||!te||typeof IntersectionObserver>"u")return;const H=new IntersectionObserver(ie=>{ie.some(Ee=>Ee.isIntersecting)&&K.current&&!Q.current&&!X.current&&Z()},{root:O,rootMargin:`0px 0px ${a}px 0px`,threshold:0});return H.observe(te),()=>H.disconnect()},[a,Z]),i.useEffect(()=>{x(),d&&q(!1)},[]);const me=i.useRef(e.dataFun);i.useEffect(()=>{me.current!==e.dataFun&&(me.current=e.dataFun,h())},[e.dataFun,h]);const we=i.useRef(e.metaFun);i.useEffect(()=>{we.current!==e.metaFun&&(we.current=e.metaFun,x())},[e.metaFun,x]);const be=i.useMemo(()=>{if(W)return W.columns.map((H,ie)=>({column:H,index:ie})).filter(({column:H})=>H.showForDisplay!==!1).sort((H,ie)=>(H.column.displayOrder??H.index)-(ie.column.displayOrder??ie.index)).map(({column:H})=>H);const O=new Set,te=[];for(const H of p)for(const ie of Object.keys(H))O.has(ie)||(O.add(ie),te.push({propertyPath:ie}));return te},[W,p]),et=(W==null?void 0:W.displayName)??"数据",ee=V.useExportExcel({props:{dataFun:s,exportSelected:m,exportorFunc:b},tableName:et,columns:be,currentRows:p,selectedRows:B.selectedRows,total:J,exportPageSize:w,hasMorePage:L,pageScopeLabel:"导出当前已加载"}),ke=i.useRef(ee);ke.current=ee;const je=i.useCallback(()=>{ke.current.onExportClick()},[]);i.useImperativeHandle(r,()=>({get items(){return U.current},get loading(){return Q.current},get loadingMore(){return X.current},get hasMore(){return K.current},get meta(){return le.current},get selectedRows(){return E.current.selectedRows},get rows(){return U.current},reload:h,refresh:h,loadNextPage:Z,isRowSelected:O=>E.current.isRowSelected(O),toggleRowSelection:(O,te)=>E.current.toggleRowSelection(O,te),clearSelection:()=>E.current.clearSelection(),selectAllOnPage:()=>E.current.selectAllOnPage(),invertSelectionOnPage:()=>E.current.invertSelectionOnPage(),openExportDialog:je}),[Z,je,h]);function Te(O,te){const H=e.children;return typeof H=="function"?H(O,te):H??t.jsx("pre",{className:"yk-infinite-list__item-json",children:JSON.stringify(O,null,2)})}const Ne=e.error,Re=typeof Ne=="function"?Ne({error:A}):Ne;return t.jsxs("div",{ref:Y,className:"yk-infinite-list",style:{height:o},children:[p.map((O,te)=>t.jsxs("div",{className:`yk-infinite-list__item${m&&B.isRowSelected(O)?" is-selected":""}`,children:[m?t.jsx(u.Checkbox,{className:"yk-infinite-list__item-checkbox",checked:B.isRowSelected(O),onChange:H=>B.toggleRowSelection(O,H.target.checked)}):null,t.jsx("div",{className:"yk-infinite-list__item-body",children:Te(O,te)})]},String(O[c]))),A?t.jsx("div",{className:"yk-infinite-list__status",children:Re??t.jsx(u.Empty,{description:`加载失败:${String(A)}`,children:t.jsx(u.Button,{type:"primary",onClick:h,children:"重试"})})}):!F&&p.length===0?t.jsx("div",{className:"yk-infinite-list__status",children:e.empty??t.jsx(u.Empty,{description:"暂无数据"})}):null,t.jsx("div",{ref:se,className:"yk-infinite-list__sentinel"}),z?t.jsx("div",{className:"yk-infinite-list__loading-more",children:e.loading??t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"yk-infinite-list__spinner"}),t.jsx("span",{children:"加载中..."})]})}):null,!L&&p.length>0&&!F?t.jsx("div",{className:"yk-infinite-list__no-more",children:e.noMore??t.jsx("span",{children:"— 没有更多了 —"})}):null,t.jsx(jn,{open:ee.exportDialogVisible,options:ee.exportOptions,exporting:ee.exporting,fetched:ee.exportFetched,total:ee.exportTotal,totalKnown:ee.exportTotalKnown,percent:ee.exportPercent,etaSeconds:ee.exportEtaSeconds,cancelledVisible:ee.exportCancelledVisible,cancelledRows:ee.exportCancelledRows,onExport:O=>void ee.doExport(O),onCancelExport:ee.cancelExport,onKeepPartial:()=>void ee.keepPartialExport(),onDiscardPartial:()=>void ee.discardPartialExport(),onClose:ee.closeExportDialog})]})});qn.displayName="YsInfiniteList";function gs(n){return n.icon?t.jsx("i",{className:"yk-main-panel__menu-icon",children:n.icon}):void 0}function Lt(n){const e=[];for(const r of n){const s=gs(r),l=t.jsx("span",{className:"yk-main-panel__menu-text",children:r.label});r.children&&r.children.length>0?e.push({key:r.key,icon:s,label:l,children:Lt(r.children)}):e.push({key:r.key,icon:s,label:l})}return e}function xs(){return t.jsx("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14","aria-hidden":"true",className:"yk-main-panel__search-icon",children:t.jsx("path",{fill:"currentColor",d:"M909.098 839.904l-181.22-181.248a341.5 341.5 0 1 0-47.734 48.58l180.56 180.588a33.92 33.92 0 0 0 48.394-47.92zM454.4 745.6a291.2 291.2 0 1 1 291.2-291.2 291.2 291.2 0 0 1-291.2 291.2z"})})}function ps({nodesFunc:n,componentMap:e,defaultActive:r="",showMenuSearch:s=!0,menuKeyword:l="",onUpdateMenuKeyword:a,onTabChange:c}){const[o,d]=i.useState(!1),[m,k]=i.useState(l);i.useEffect(()=>{k(l)},[l]);const b=f=>{k(f),a==null||a(f)},w=m.trim().length>0,{nodes:p,menuLoading:j}=V.useMainPanelNodes({nodesFunc:n}),{openTabs:F,activeKey:R,setActiveKey:z,openTab:P,removeTab:L,getComponent:v}=V.useMainPanelTabs({componentMap:e}),A=i.useMemo(()=>V.filterNodesByKeyword(p,m),[p,m]),$=i.useMemo(()=>V.collectGroupKeys(A),[A]),J=i.useMemo(()=>Lt(p),[p]),ue=i.useMemo(()=>Lt(A),[A]),W=({key:f})=>{const N=V.findNode(p,f);N&&!V.isGroupNode(N)&&P(N)},ne=i.useRef(p),U=i.useRef(!1),Q=i.useRef(!1);i.useEffect(()=>{if(!U.current)if(p!==ne.current)U.current=!0;else return;if(Q.current||(Q.current=!0,!r))return;const f=V.findNode(p,r);f&&!V.isGroupNode(f)&&P(f)},[p,r,P]);const X=i.useRef(R),K=i.useRef(c);K.current=c,i.useEffect(()=>{var f;X.current!==R&&(X.current=R,(f=K.current)==null||f.call(K,R))},[R]);const le=F.map(f=>{const N=f.componentPath?v(f.componentPath):null;return{key:f.key,label:f.label,closable:!0,forceRender:!0,children:N?t.jsx(i.Suspense,{fallback:t.jsx("div",{className:"yk-main-panel__loading",children:t.jsx(u.Spin,{size:"small"})}),children:t.jsx(N,{...f.props??{}})}):null}}),T="yk-main-panel__menu";return t.jsxs("div",{className:"yk-main-panel",children:[t.jsxs("aside",{className:`yk-main-panel__aside${o?" is-collapsed":""}`,children:[t.jsxs("div",{className:"yk-main-panel__aside-header",children:[t.jsx(u.Button,{type:"text",size:"small",className:"yk-main-panel__collapse-btn",title:o?"展开菜单":"折叠菜单",onClick:()=>d(f=>!f),children:"☰"}),s&&!o&&t.jsx(u.Input,{className:"yk-main-panel__aside-search",size:"small",allowClear:!0,placeholder:"搜索功能","aria-label":"搜索功能",value:m,prefix:t.jsx(xs,{}),onChange:f=>b(f.target.value)})]}),t.jsx("div",{className:"yk-main-panel__menu-wrap",children:t.jsx(u.Spin,{spinning:j,size:"small",children:w?t.jsxs(t.Fragment,{children:[t.jsx(u.Menu,{mode:"inline",className:T,inlineCollapsed:o,items:ue,selectedKeys:R?[R]:[],defaultOpenKeys:$,onClick:W},`search-${m}`),A.length===0&&!j&&t.jsx("div",{className:"yk-main-panel__menu-empty",children:"未找到匹配的功能"})]}):t.jsx(u.Menu,{mode:"inline",className:T,inlineCollapsed:o,items:J,selectedKeys:R?[R]:[],onClick:W},"full")})})]}),t.jsx("main",{className:"yk-main-panel__main",children:F.length>0?t.jsx(u.Tabs,{className:"yk-main-panel__tabs",type:"editable-card",hideAdd:!0,activeKey:R,items:le,onChange:f=>z(f),onEdit:(f,N)=>{N==="remove"&&typeof f!="object"&&L(f)}}):t.jsx("div",{className:"yk-main-panel__empty",children:t.jsx(u.Empty,{description:"暂无打开的功能,从左侧菜单选择"})})})]})}function lt(n){V.useFilterItem(n.api);const e=n.minWidth??200;return t.jsxs("div",{className:"yk-filter-item",style:{minWidth:`${e}px`},children:[t.jsx("label",{className:"yk-filter-item__label",children:n.label}),t.jsx("div",{className:"yk-filter-item__control",children:n.children})]})}const vs=i.forwardRef(function(e,r){const{value:s,setValue:l,filter:a,reset:c}=V.useTextFilterItem(e),o=i.useMemo(()=>({get filter(){return a},reset:c}),[a,c]);return i.useImperativeHandle(r,()=>o,[o]),t.jsx(lt,{label:e.label,api:o,children:t.jsx(u.Input,{value:s,onChange:d=>l(d.target.value),placeholder:e.placeholder,allowClear:!0})})}),ks=i.forwardRef(function(e,r){const{value:s,setValue:l,filter:a,reset:c}=V.useDateFilterItem(e),o=e.valueFormat??"YYYY-MM-DD",d=i.useMemo(()=>({get filter(){return a},reset:c}),[a,c]);return i.useImperativeHandle(r,()=>d,[d]),t.jsx(lt,{label:e.label,api:d,children:t.jsx(u.DatePicker,{value:s?$e(s):null,format:o,onChange:(m,k)=>l(typeof k=="string"?k:""),placeholder:e.placeholder,allowClear:!0})})}),_s=i.forwardRef(function(e,r){const{value:s,setValue:l,filter:a,reset:c}=V.useDateRangeFilterItem({propertyPath:e.propertyPath,defaultValue:e.defaultValue}),o=e.valueFormat??"YYYY-MM-DD",d=i.useMemo(()=>({get filter(){return a},reset:c}),[a,c]);i.useImperativeHandle(r,()=>d,[d]);const m=s&&s.length===2?[$e(s[0]),$e(s[1])]:null;return t.jsx(lt,{label:e.label,api:d,minWidth:240,children:t.jsx(u.DatePicker.RangePicker,{value:m,format:o,onChange:(k,b)=>{l(k?[b[0],b[1]]:null)},placeholder:[e.startPlaceholder??"开始日期",e.endPlaceholder??"结束日期"],disabledDate:e.disabledDate?k=>{var b;return((b=e.disabledDate)==null?void 0:b.call(e,k.toDate()))??!1}:void 0,allowClear:!0})})}),bs=i.forwardRef(function(e,r){const{value:s,setValue:l,filter:a,reset:c}=V.useEnumFilterItem({op:e.op,propertyPath:e.propertyPath,defaultValue:e.defaultValue,multiple:e.multiple}),[o,d]=i.useState([]),[m,k]=i.useState(!1),b=i.useRef(e.optionsSource);b.current=e.optionsSource,i.useEffect(()=>{let j=!0;return k(!0),b.current().then(F=>{j&&d(F)}).finally(()=>{j&&k(!1)}),()=>{j=!1}},[]);const w=i.useMemo(()=>({get filter(){return a},reset:c}),[a,c]);i.useImperativeHandle(r,()=>w,[w]);const p=o.map(j=>({label:j.label,value:j.value}));return t.jsx(lt,{label:e.label,api:w,children:e.multiple?t.jsx(u.Select,{mode:"multiple",value:Array.isArray(s)?s:[],options:p,onChange:j=>l(j),placeholder:e.placeholder,allowClear:e.clearable??!0,loading:m}):t.jsx(u.Select,{value:s??void 0,options:p,onChange:j=>l(j??null),placeholder:e.placeholder,allowClear:e.clearable??!0,loading:m})})});function Kn(n){if(n==null)return"";if(typeof n=="object")try{return JSON.stringify(n)}catch{return String(n)}return String(n)}function js({open:n,row:e,columns:r,saver:s,onClose:l,onSaved:a}){const[c,o]=i.useState({}),[d,m]=i.useState([]);i.useEffect(()=>{if(!n||!e)return;const w={};for(const p of r)w[p.name]=Kn(e.data[p.name]);o(w),m([])},[n,e,r]);function k(){l==null||l()}function b(){if(!e)return;const w={};for(const F of r)w[F.name]=c[F.name]??"";const{row:p,errors:j}=s(e,w);m(j),!(j.length>0)&&(a==null||a(p),k())}return t.jsxs(u.Modal,{open:n,title:e?`编辑第 ${e.rowNumber} 行`:"编辑数据行",width:480,maskClosable:!1,destroyOnClose:!0,onCancel:k,footer:t.jsxs(t.Fragment,{children:[t.jsx(u.Button,{onClick:k,children:"取消"}),t.jsx(u.Button,{type:"primary",onClick:b,children:"保存并重新校验"})]}),children:[d.length>0?t.jsx(u.Alert,{className:"yk-import-row-edit-dialog__alert",type:"error",showIcon:!0,message:t.jsx(t.Fragment,{children:d.map((w,p)=>t.jsx("div",{children:w},p))})}):null,t.jsx(u.Form,{labelCol:{flex:"0 0 92px"},wrapperCol:{flex:"auto"},children:r.map(w=>t.jsx(u.Form.Item,{label:w.name,required:!w.optional,children:t.jsx(u.Input,{value:c[w.name]??"",placeholder:w.optional?"可留空":`请输入${w.name}`,onChange:p=>o(j=>({...j,[w.name]:p.target.value})),onPressEnter:b})},w.name))})]})}const At={valid:{label:"待处理"},invalid:{label:"校验失败",color:"red"},processing:{label:"处理中",color:"orange"},success:{label:"成功",color:"green"},failed:{label:"失败",color:"red"}};function Cs(n){const e=Math.max(0,Math.ceil(n/1e3));if(e<60)return`${e} 秒`;const r=Math.floor(e/60),s=e%60;return s>0?`${r} 分 ${s} 秒`:`${r} 分`}function yt(n){var e;return Array.from(((e=n.dataTransfer)==null?void 0:e.types)??[]).includes("Files")}function Ss(){return t.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 20h9"}),t.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function ws(){return t.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("polyline",{points:"3 6 5 6 21 6"}),t.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),t.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),t.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Ns=i.forwardRef(function(e,r){var ot;const{columns:s,processor:l,parser:a,accept:c=".xlsx",autoScroll:o=!0,title:d,maxHeight:m}=e,{rows:k,fileName:b,sheetName:w,loading:p,processing:j,stopping:F,processingTotal:R,progressDone:z,progressSuccess:P,progressFailed:L,hasData:v,invalidCount:A,selectedCount:$,pendingCount:J,loadFile:ue,syncSelection:W,saveRowEdit:ne,removeRow:U,startProcessing:Q,stopProcessing:X,clear:K}=V.useImportExcel({columns:s,processor:l,parser:a}),le=i.useRef(null),T=i.useRef(null),f=i.useRef(w);f.current=w;const[N,M]=i.useState(0),B=N>0;function E(g){const _=c.split(",").map(re=>re.trim().toLowerCase()).filter(Boolean);if(_.length===0)return!0;const D=g.name.toLowerCase();return _.some(re=>D.endsWith(re))}async function G(g){var _;if(!p){if(!E(g)){u.message.error(`仅支持 ${c} 格式的文件`);return}try{const D=await ue(g);(_=e.onLoaded)==null||_.call(e,D),setTimeout(()=>{const re=f.current;u.message.success(`已加载 ${D.length} 行${re?`(工作表「${re}」)`:""}`)},0)}catch(D){u.message.error(D instanceof Error?D.message:String(D))}}}async function q(g){var re;const _=g.target,D=(re=_.files)==null?void 0:re[0];_.value="",D&&await G(D)}function Z(){var g;(g=le.current)==null||g.click()}function h(g){yt(g)&&M(_=>_+1)}function x(g){yt(g)&&(g.preventDefault(),g.dataTransfer&&(g.dataTransfer.dropEffect="copy"))}function Y(g){yt(g)&&M(_=>Math.max(0,_-1))}function se(g){var D,re;if(!yt(g))return;g.preventDefault(),M(0);const _=(re=(D=g.dataTransfer)==null?void 0:D.files)==null?void 0:re[0];_&&G(_)}const me=i.useRef(0),[we,be]=i.useState(0);i.useEffect(()=>{if(!j)return;me.current=Date.now(),be(Date.now());const g=setInterval(()=>be(Date.now()),500);return()=>clearInterval(g)},[j]);const et=R<=0?0:Math.min(100,z/R*100),ee=!j||z===0?"预计剩余 计算中…":`预计剩余 ${Cs((we-me.current)/z*(R-z))}`,[ke,je]=i.useState(360);i.useEffect(()=>{const g=T.current;if(!g)return;const _=()=>{var We;const re=((We=g.querySelector(".ant-table-thead"))==null?void 0:We.getBoundingClientRect().height)??39;let De=Math.max(120,Math.floor(g.clientHeight-re-1));typeof m=="number"&&(De=Math.min(De,m)),je(De)};_();const D=new ResizeObserver(_);return D.observe(g),()=>D.disconnect()},[m,v]);const Te=((ot=k.find(g=>g.status==="processing"))==null?void 0:ot.rowNumber)??null;i.useEffect(()=>{var at,ct;if(Te===null||!o)return;const g=(at=T.current)==null?void 0:at.querySelector(".ant-table-body"),_=(ct=T.current)==null?void 0:ct.querySelector(`.ant-table-tbody tr[data-row-key="${Te}"]`);if(!g||!_)return;const D=g.getBoundingClientRect(),re=_.getBoundingClientRect(),De=Math.max(0,g.scrollHeight-g.clientHeight),We=g.scrollTop+(re.top-D.top)-(g.clientHeight-re.height)/2;g.scrollTop=Math.min(De,Math.max(0,Math.round(We)))},[Te,o]);const Ne=k.filter(g=>g.selected).map(g=>g.rowNumber);function Re(g){return g.status!=="invalid"}function O(g){var D;const _=k.filter(re=>g.includes(re.rowNumber));W(_),(D=e.onSelectionChange)==null||D.call(e,_)}async function te(){var g;try{const _=await Q();if(!_)return;if((g=e.onProcessed)==null||g.call(e,_),_.stopped){const D=_.total-_.success-_.failed;u.message.warning(`已停止:成功 ${_.success} 行,失败 ${_.failed} 行,剩余 ${D} 行未处理(可再次「开始处理」续跑)`)}else _.failed===0?u.message.success(`全部处理完成,共 ${_.success} 行`):u.message.warning(`处理完成:成功 ${_.success} 行,失败 ${_.failed} 行`)}catch(_){u.message.error(_ instanceof Error?_.message:String(_))}}const[H,ie]=i.useState(!1),[Ee,Ie]=i.useState(null);function _e(g){return!j&&(g.status==="invalid"||g.status==="failed")}function Ve(g){_e(g)&&(Ie(g),ie(!0))}function Qe(g){var _;(_=e.onRowUpdate)==null||_.call(e,g),u.message.success(`第 ${g.rowNumber} 行已修正,可重新处理`)}function He(g){_e(g)&&u.Modal.confirm({title:"删除数据行",content:`确定删除第 ${g.rowNumber} 行吗?删除后不可恢复。`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{var _;U(g),(_=e.onRowRemove)==null||_.call(e,g),u.message.success(`已删除第 ${g.rowNumber} 行`)}})}i.useImperativeHandle(r,()=>({openFilePicker:Z,startProcessing:te,stopProcessing:X,clear:K}));const bt=Object.keys(At).map(g=>({text:`${At[g].label}(${k.filter(_=>_.status===g).length})`,value:g})),jt=[{title:"行号",key:"rowNumber",width:70,align:"center",fixed:"left",render:(g,_,D)=>t.jsx("span",{title:`Excel 第 ${_.rowNumber} 行`,children:D+1})},...s.map(g=>({title:g.name,key:g.name,width:120,ellipsis:{showTitle:!0},render:(_,D)=>Kn(D.data[g.name])})),{title:"状态",key:"status",dataIndex:"status",width:200,fixed:"right",className:"yk-import-excel__status-cell",filters:bt,filterMultiple:!1,onFilter:(g,_)=>_.status===g,render:(g,_)=>{const D=At[_.status];return t.jsxs(t.Fragment,{children:[t.jsxs(u.Tag,{color:D.color,children:[_.status==="processing"?t.jsx("span",{className:"yk-import-excel__spin"}):null,D.label]}),_.status==="invalid"?t.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:_.errors.join(";")}):_.message?t.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:_.message}):null]})}},{title:"操作",key:"action",width:110,align:"center",fixed:"right",render:(g,_)=>_e(_)?t.jsxs("div",{className:"yk-import-excel__actions",children:[t.jsx(u.Button,{type:"link",size:"small",icon:t.jsx(Ss,{}),onClick:()=>Ve(_),children:"编辑"}),t.jsx(u.Button,{type:"link",size:"small",danger:!0,icon:t.jsx(ws,{}),onClick:()=>He(_),children:"删除"})]}):t.jsx("span",{className:"yk-import-excel__action-placeholder",children:"—"})}],Ct={selectedRowKeys:Ne,columnWidth:44,getCheckboxProps:g=>({disabled:!Re(g)}),onChange:O};return t.jsxs("div",{className:"yk-import-excel",onDragEnter:h,onDragOver:x,onDragLeave:Y,onDrop:se,children:[t.jsx("input",{ref:le,className:"yk-import-excel__file",type:"file",accept:c,onChange:q}),d?t.jsx("div",{className:"yk-import-excel__title",children:d}):null,t.jsxs("div",{className:"yk-import-excel__toolbar",children:[t.jsx(u.Button,{type:"primary",loading:p,onClick:Z,children:"选择 Excel 文件"}),t.jsxs(u.Button,{type:"primary",loading:j,disabled:J===0,onClick:te,children:["开始处理",J>0?`(${J} 行)`:""]}),j?t.jsx(u.Button,{danger:!0,disabled:F,onClick:X,children:F?"正在停止…":"停止"}):null,t.jsx(u.Button,{disabled:!v||j,onClick:K,children:"清空"}),b?t.jsxs("span",{className:"yk-import-excel__file-name",title:b,children:[b,w?`(工作表:${w})`:""]}):null,v?t.jsxs("div",{className:"yk-import-excel__stats",children:[t.jsxs("span",{className:"yk-import-excel__stat",children:["共 ",k.length," 行"]}),t.jsxs("span",{className:"yk-import-excel__stat",children:["已选 ",$]}),t.jsxs("span",{className:"yk-import-excel__stat yk-import-excel__stat--danger",children:["校验失败 ",A]})]}):null]}),j?t.jsxs("div",{className:"yk-import-excel__progress",children:[t.jsx(u.Progress,{className:"yk-import-excel__progress-bar",percent:et,status:"active",format:()=>`${z}/${R}`}),t.jsxs("span",{className:"yk-import-excel__progress-meta",children:["成功 ",P,t.jsxs("span",{className:"yk-import-excel__danger-text",children:[" ","/ 失败 ",L]})]}),t.jsx("span",{className:"yk-import-excel__progress-eta",children:ee})]}):null,t.jsx("div",{ref:T,className:"yk-import-excel__body",children:t.jsx(u.Spin,{spinning:p,wrapperClassName:"yk-import-excel__loading",children:v?t.jsx(u.Table,{className:"yk-import-excel__table",rowKey:"rowNumber",columns:jt,dataSource:k,bordered:!0,size:"small",pagination:!1,rowSelection:Ct,scroll:{x:"max-content",y:ke},rowClassName:(g,_)=>_%2===1?"yk-import-excel__row-alt":""}):t.jsxs("div",{className:"yk-import-excel__empty",onClick:Z,children:[t.jsxs("svg",{className:"yk-import-excel__empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"}),t.jsx("path",{d:"M12 18v-6"}),t.jsx("polyline",{points:"9.5 14.5 12 12l2.5 2.5"})]}),t.jsx("p",{className:"yk-import-excel__empty-title",children:"点击选择 Excel 文件,或将文件拖拽到此处"}),t.jsxs("p",{className:"yk-import-excel__empty-hint",children:["支持 ",c," 格式,首行需为表头"]})]})})}),B?t.jsx("div",{className:"yk-import-excel__drop-mask",children:t.jsxs("div",{className:"yk-import-excel__drop-tip",children:[t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 15V3"}),t.jsx("polyline",{points:"7 8 12 3 17 8"}),t.jsx("path",{d:"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4"})]}),t.jsx("span",{children:"松开鼠标,加载 Excel 文件"})]})}):null,t.jsx(js,{open:H,row:Ee,columns:s,saver:ne,onClose:()=>ie(!1),onSaved:Qe})]})});var $t,gt=bn;if(process.env.NODE_ENV==="production")$t=gt.createRoot,gt.hydrateRoot;else{var _n=gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;$t=function(n,e){_n.usingClientEntryPoint=!0;try{return gt.createRoot(n,e)}finally{_n.usingClientEntryPoint=!1}}}function Rs(){return t.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function Es(){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),t.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10"})]})}const Is=i.forwardRef(function(e,r){const{title:s,width:l,heightValue:a,component:c,componentProps:o,actions:d,onCancel:m,onClosed:k,closeOnClickModal:b,closeOnPressEscape:w,maximizable:p,defaultMaximized:j,contentRef:F,modalHandle:R,destroy:z}=e,[P,L]=i.useState(!0),[v,A]=i.useState(-1),[$,J]=i.useState(p&&j),ue=()=>{p&&J(T=>!T)},W=()=>{L(!1)},ne=()=>{v>=0||(m==null||m(),L(!1))},U=async(T,f)=>{if(!(v>=0)){A(f);try{await T.execute(R)}finally{A(-1)}}};i.useImperativeHandle(r,()=>({close:W,toggleMaximize:ue,isMaximized:()=>$}),[p,$]);const Q=p?t.jsxs("div",{className:"yk-modal__title-row",children:[t.jsx("span",{className:"yk-modal__title-text",children:s}),t.jsx(u.Button,{type:"text",size:"small",className:"yk-modal__maximize",title:$?"还原":"最大化","aria-label":$?"还原":"最大化",onClick:ue,children:$?t.jsx(Es,{}):t.jsx(Rs,{})})]}):s,X=d&&d.length>0?t.jsx("div",{className:"yk-modal__footer",children:d.map((T,f)=>{const{type:N,danger:M}=zt(T.type);return t.jsx(u.Button,{type:N,danger:M,title:T.desc,disabled:v>=0&&v!==f,loading:v===f,onClick:()=>void U(T,f),icon:T.icon?t.jsx("span",{className:"yk-modal__action-icon",children:vt(T.icon)}):void 0,children:T.desc},T.name)})}):null,K={...$?{top:0}:{},...a&&!$?{"--yk-modal-height":a}:{}},le=["yk-modal",$?"yk-modal--maximized":a?"yk-modal--fixed-height":""].filter(Boolean).join(" ");return t.jsx(u.Modal,{open:P,title:Q,width:l,style:K,wrapClassName:le,closable:v<0,maskClosable:b,keyboard:w,destroyOnClose:!0,onCancel:ne,afterClose:()=>{k==null||k(),z()},footer:X,children:i.createElement(c,{...o??{},onClose:W,ref:F})})});function Ps(n){if(n!=null)return typeof n=="number"?`${n}px`:n}function Un(n){const{title:e="",width:r="500px",height:s,component:l,props:a,actions:c,onCancel:o,onClosed:d,closeOnClickModal:m=!1,closeOnPressEscape:k=!1,maximizable:b=!1,defaultMaximized:w=!1}=n,p=document.createElement("div");document.body.appendChild(p);const j=$t(p);let F=!1;const R=()=>{F||(F=!0,j.unmount(),p.remove())},z={current:null},P={current:null},L={close:()=>{var v;return(v=z.current)==null?void 0:v.close()},toggleMaximize:()=>{var v;return(v=z.current)==null?void 0:v.toggleMaximize()},isMaximized:()=>{var v;return((v=z.current)==null?void 0:v.isMaximized())??!1},getContentInstance:()=>P.current??null};return j.render(t.jsx(Is,{ref:z,title:e,width:r,heightValue:Ps(s),component:l,componentProps:a,actions:c,onCancel:o,onClosed:d,closeOnClickModal:m,closeOnPressEscape:k,maximizable:b,defaultMaximized:w,contentRef:P,modalHandle:L,destroy:R})),L}function Os(n){const{confirmText:e="确定",cancelText:r="取消",confirmType:s="primary",onConfirm:l,...a}=n;return Un({...a,actions:[{name:"cancel",desc:r,execute:o=>o.close()},{name:"confirm",desc:e,type:s,execute:async o=>{if(!l){o.close();return}await l(o)!==!1&&o.close()}}]})}Object.defineProperty(exports,"fromArray",{enumerable:!0,get:()=>S.fromArray});Object.defineProperty(exports,"fromBool",{enumerable:!0,get:()=>S.fromBool});Object.defineProperty(exports,"fromObjectItems",{enumerable:!0,get:()=>S.fromObjectItems});Object.defineProperty(exports,"fromOptions",{enumerable:!0,get:()=>S.fromOptions});exports.YsAdvancedConditionGroup=Vt;exports.YsAdvancedFilterPanel=zn;exports.YsAdvancedValueEditor=$n;exports.YsCommandBar=Hn;exports.YsDateFilterItem=ks;exports.YsDateRangeFilterItem=_s;exports.YsEnumFilterItem=bs;exports.YsFilterItemLayout=lt;exports.YsFilterPanel=Qn;exports.YsImportExcel=Ns;exports.YsInfiniteList=qn;exports.YsMainPanel=ps;exports.YsRootFilterPanel=Yn;exports.YsTable=Cn;exports.YsTableActionMenuButton=Qt;exports.YsTablePage=Wn;exports.YsTextFilterItem=vs;exports.openDialog=Os;exports.openModal=Un;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const i=require("react/jsx-runtime"),u=require("react"),f=require("antd"),J=require("@ys-knife-crud/react"),Vs=require("react-dom"),N=require("@ys-knife-crud/core");function ja(e){const{rows:t,rowKey:n,showCheckbox:r,loading:s,hasActions:a,isSelected:l,onCheck:o,onContextMenu:c,card:d,empty:y}=e;return i.jsxs("div",{className:"yk-table__cards",children:[t.map((x,C)=>{const w=r&&l(x);return i.jsxs("div",{className:`yk-table__card${w?" is-selected":""}${a?" has-actions":""}`,title:a?"右键查看行操作":void 0,onContextMenu:D=>c(D,x),children:[r?i.jsx(f.Checkbox,{className:"yk-table__card-checkbox",checked:w,onChange:D=>o(x,D.target.checked)}):null,d?d(x,C):i.jsx("pre",{className:"yk-table__card-json",children:JSON.stringify(x,null,2)})]},String(x[n]))}),!s&&t.length===0?i.jsx(i.Fragment,{children:y??i.jsx(f.Empty,{className:"yk-table__cards-empty",description:"暂无数据"})}):null]})}function js(e,t,n){return e.map((r,s)=>s===t?{...r,...n}:r)}function Oa({open:e,drafts:t,onCancel:n,onSave:r,onReset:s,onMove:a,onDraftsChange:l}){return i.jsx(f.Modal,{open:e,title:"列设置",width:480,destroyOnClose:!0,onCancel:n,footer:i.jsxs(i.Fragment,{children:[i.jsx(f.Button,{onClick:s,children:"重置"}),i.jsx(f.Button,{onClick:n,children:"取消"}),i.jsx(f.Button,{type:"primary",className:"yk-col-config-save",onClick:()=>void r(),children:"保存"})]}),children:i.jsx("div",{className:"yk-col-config",children:t.map((o,c)=>i.jsxs("div",{className:"yk-col-config-row",children:[i.jsx(f.Checkbox,{className:"yk-col-config-name",checked:o.visible,onChange:d=>l(js(t,c,{visible:d.target.checked})),children:o.displayName}),i.jsx(f.Input,{className:"yk-col-config-width",size:"small",value:o.width,placeholder:"宽度(如 120)",onChange:d=>l(js(t,c,{width:d.target.value}))}),i.jsx(f.Button,{type:"link",disabled:c===0,onClick:()=>a(c,-1),children:"上移"}),i.jsx(f.Button,{type:"link",disabled:c===t.length-1,onClick:()=>a(c,1),children:"下移"})]},o.propertyPath))})})}function Wn(e){return e==null||e===!1?null:u.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="function"?u.createElement(e):null}function Na({menu:e,actions:t,isEnabled:n,onClose:r,onSelect:s}){return u.useEffect(()=>{if(!e)return;const a=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,r]),!e||typeof document>"u"?null:Vs.createPortal(i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"yk-table__menu-mask",onClick:r,onContextMenu:a=>{a.preventDefault(),r()}}),i.jsx("ul",{className:"yk-table__context-menu",style:{left:e.x,top:e.y},children:t.map(a=>{const l=n(a,e.row);return i.jsxs("li",{className:`yk-table__context-menu-item${l?"":" is-disabled"}`,onClick:()=>{l&&s(a)},children:[a.icon?i.jsx("span",{className:"yk-table__context-menu-icon",children:Wn(a.icon)}):null,a.desc]},a.name)})})]}),document.body)}function Ra(e){if(e==null)return null;if(e<60)return`${e} 秒`;const t=Math.floor(e/60),n=e%60;return n>0?`${t} 分 ${n} 秒`:`${t} 分`}function Us({open:e,options:t,exporting:n,fetched:r,total:s,totalKnown:a,percent:l,etaSeconds:o,cancelledVisible:c,cancelledRows:d,onExport:y,onCancelExport:x,onKeepPartial:C,onDiscardPartial:w,onClose:D}){const B=Ra(o);return i.jsxs(i.Fragment,{children:[i.jsx(f.Modal,{open:e,title:"导出 Excel",width:420,destroyOnClose:!0,onCancel:D,footer:null,children:i.jsx("div",{className:"yk-export-options",children:t.map(P=>i.jsx(f.Button,{block:!0,className:"yk-export-option","data-scope":P.value,disabled:P.disabled,onClick:()=>y(P.value),children:P.label},P.value))})}),i.jsxs(f.Modal,{open:n,title:"正在导出",width:420,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,footer:i.jsx(f.Button,{onClick:x,children:"取消"}),children:[i.jsx(f.Progress,{percent:l}),i.jsxs("p",{className:"yk-export-progress-text",children:["已加载 ",r,a?` / ${s}`:""," 条",B?`,预计剩余约 ${B}`:""]})]}),i.jsx(f.Modal,{open:c,title:"导出已取消",width:420,destroyOnClose:!0,onCancel:w,footer:i.jsxs(i.Fragment,{children:[i.jsx(f.Button,{className:"yk-export-discard",onClick:w,children:"丢弃"}),i.jsx(f.Button,{className:"yk-export-keep",type:"primary",onClick:C,children:"保留部分文件"})]}),children:i.jsxs("p",{className:"yk-export-cancelled-text",children:["已写入 ",d," 条数据,是否保留已导出的部分文件?"]})})]})}function Pa(e){const{rows:t,rowKey:n,showCheckbox:r,loading:s,hasActions:a,isSelected:l,onCheck:o,onContextMenu:c,list:d,empty:y}=e;return i.jsxs("div",{className:"yk-table__list",children:[t.map((x,C)=>{const w=r&&l(x);return i.jsxs("div",{className:`yk-table__list-item${w?" is-selected":""}${a?" has-actions":""}`,title:a?"右键查看行操作":void 0,onContextMenu:D=>c(D,x),children:[r?i.jsx(f.Checkbox,{className:"yk-table__list-item-checkbox",checked:w,onChange:D=>o(x,D.target.checked)}):null,i.jsx("div",{className:"yk-table__list-item-body",children:d?d(x,C):i.jsx("pre",{className:"yk-table__list-item-json",children:JSON.stringify(x,null,2)})})]},String(x[n]))}),!s&&t.length===0?i.jsx(i.Fragment,{children:y??i.jsx(f.Empty,{description:"暂无数据"})}):null]})}function Nr(e,t){return e==="danger"?{type:t?"default":"primary",danger:!0}:e==="primary"?{type:"primary"}:{type:"default"}}function Ya({actions:e,table:t,row:n}){return i.jsx("div",{className:"yk-row-actions",children:J.visibleActions(e,n).map(r=>{const s=Nr(r.type,!0);return i.jsxs(f.Button,{type:"link",size:"small",danger:s.danger,disabled:!J.isEnabled(r,n),className:"yk-row-action",onClick:()=>void r.execute(n,t),children:[r.icon?i.jsx("span",{className:"yk-row-action__icon",children:Wn(r.icon)}):null,r.desc]},r.name)})})}function Ta({actions:e,table:t}){return e.length===0?null:{key:"__actions",title:"操作",fixed:"right",width:e.length*34+(e.length-1)*12+30,render:(r,s)=>i.jsx(Ya,{actions:e,table:t,row:s})}}const Ia=20,Ea=[10,20,50,100],Fa=1e3;function Aa(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function Os(e){return e==null?null:u.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="boolean"?e?"true":"false":String(e)}const $s=u.forwardRef(function(t,n){const r=t.pageSize??Ia,s=t.pageSizes??Ea,a=t.rowKey??"id",l=t.exportPageSize??Fa,o=u.useRef(t);o.current=t;const{meta:c,paged:d,rows:y,metaLoading:x,dataLoading:C,currentPage:w,total:D,totalKnown:B,loadMeta:P,setPaged:Z,setDataLoading:E,setCurrentPage:G}=J.useDefault({metaFun:t.metaFun,dataFun:t.dataFun,pageSize:r,pageSizes:s}),{selectedRows:S,selectedRowKeys:U,onSelectionChange:Q,isRowSelected:ce,toggleRowSelection:Ce,clearSelection:re,selectAllOnPage:ye,invertSelectionOnPage:le}=J.useSelection({rows:y,rowKey:a}),{actions:X,actionsLoading:de,loadActions:ie}=J.useRowActions({rowActionsFunc:t.rowActionsFunc}),{customConfigs:we,customConfigLoading:$,defaultPageSize:h,configDialogVisible:R,columns:L,loadCustomConfigs:H,updateDefaultPageSize:Y,updateColumnWidth:oe,openConfigDialog:se,closeConfigDialog:fe}=J.useCustomConfig({loadCustomConfigFun:t.loadCustomConfigFun,saveCustomConfigFun:t.saveCustomConfigFun},c),g=h??r,k=D>Math.min(g,...s)||((d==null?void 0:d.hasNext)??!1),K=t.viewMode,[pe,Oe]=u.useState(K??"table");u.useEffect(()=>{K!==void 0&&Oe(K)},[K]);const rt=K??pe,Ze=t.showCheckbox,[en,he]=u.useState(Ze??!1);u.useEffect(()=>{Ze!==void 0&&he(Ze)},[Ze]);const ze=Ze??en,Ke=t.columnResizable,[bt,ft]=u.useState(Ke??!0);u.useEffect(()=>{Ke!==void 0&&ft(Ke)},[Ke]);const ht=Ke??bt,F=t.stickyHeader,[me,ee]=u.useState(F??!1);u.useEffect(()=>{F!==void 0&&ee(F)},[F]);const xe=F??me,{exportOptions:mt,exportDialogVisible:yt,exporting:Ge,exportFetched:Tt,exportTotal:It,exportTotalKnown:Et,exportEtaSeconds:Xn,exportPercent:er,exportCancelledVisible:tr,exportCancelledRows:vn,openExportDialog:v,closeExportDialog:b,doExport:z,cancelExport:ge,keepPartialExport:Mt,discardPartialExport:Ft}=J.useExportExcel({props:{dataFun:t.dataFun,exportSelected:ze,exportorFunc:t.exportorFunc},tableName:(c==null?void 0:c.displayName)??"数据",columns:L,currentRows:y,selectedRows:S,total:D,exportPageSize:l,hasMorePage:k}),pn=u.useCallback(_=>{var j,T;Oe(_),(T=(j=o.current).onUpdateViewMode)==null||T.call(j,_)},[]),xn=u.useCallback(_=>{var j,T;he(_),(T=(j=o.current).onUpdateShowCheckbox)==null||T.call(j,_),_||re()},[re]),ca=u.useCallback(_=>{var j,T;ft(_),(T=(j=o.current).onUpdateColumnResizable)==null||T.call(j,_)},[]),da=u.useCallback(_=>{var j,T;ee(_),(T=(j=o.current).onUpdateStickyHeader)==null||T.call(j,_)},[]),ss=u.useRef(t.dataFun);ss.current=t.dataFun;const nr=u.useRef(r);nr.current=r;const is=u.useRef(h);is.current=h;const gt=u.useRef(w);gt.current=w;const kn=u.useRef(t.onDataLoaded);kn.current=t.onDataLoaded;const rr=u.useRef(0),Ye=u.useCallback(async _=>{var be;const j=++rr.current,T=(_==null?void 0:_.limit)??is.current??nr.current,Se=(_==null?void 0:_.page)??gt.current;E(!0);try{const Je=await ss.current({limit:T,offset:(Se-1)*T},_==null?void 0:_.signal);if(j!==rr.current)return;Z(Je),(be=kn.current)==null||be.call(kn,Je)}finally{j===rr.current&&E(!1)}},[E,Z]),fa=u.useCallback(_=>{gt.current=_,G(_),Ye({page:_})},[Ye,G]),sr=u.useCallback(_=>{Y(_),gt.current=1,G(1),Ye({limit:_,page:1})},[Ye,G,Y]),as=u.useRef(!1);u.useEffect(()=>{as.current||(as.current=!0,Ye({page:1}))},[Ye]);const[ir,ha]=u.useState(0),ls=u.useRef(0);u.useEffect(()=>{ir!==ls.current&&(ls.current=ir,Ye({page:1}))},[ir,Ye]);const os=u.useRef(void 0);u.useEffect(()=>{const _=os.current;os.current=h,!(_!==void 0||h===void 0)&&h!==nr.current&&(gt.current=1,G(1),Ye({page:1}))},[h,Ye,G]);const us=u.useRef(r);u.useEffect(()=>{us.current!==r&&(us.current=r,sr(r))},[r,sr]);const cs=u.useRef(t.dataFun);u.useEffect(()=>{cs.current!==t.dataFun&&(cs.current=t.dataFun,gt.current=1,G(1),Ye({page:1}))},[t.dataFun,Ye,G]);async function ma(){await Promise.all([P(),ie(),H()]),gt.current=1,G(1),ha(_=>_+1)}function ya(){Ye()}const[wn,ds]=u.useState(null);function ga(_,j,T){_.preventDefault(),_.stopPropagation();const Se=_.clientX,be=tn=>Math.max(40,Math.round(T+tn-Se)),Je=tn=>{ds({propertyPath:j,width:be(tn.clientX)})},Ds=tn=>{window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",Ds),document.body.style.userSelect="";const Da=be(tn.clientX);ds(null),oe(j,Da)};document.body.style.userSelect="none",window.addEventListener("mousemove",Je),window.addEventListener("mouseup",Ds)}const[At,ar]=u.useState(null),_a=At?J.visibleActions(X,At.row):[];function fs(_,j){if(X.length===0)return;_.preventDefault();const T=176,be=J.visibleActions(X,j).length*34+8;ar({x:Math.min(_.clientX,window.innerWidth-T-8),y:Math.min(_.clientY,window.innerHeight-be-8),row:j})}function hs(_,j){Ce(_,j)}function va(_){const j=At==null?void 0:At.row;ar(null),j&&_.execute(j,bn)}const[ms,Sn]=u.useState([]),ys=u.useMemo(()=>((c==null?void 0:c.columns)??[]).map((_,j)=>({col:_,index:j})).filter(({col:_})=>_.showForDisplay??!0).sort((_,j)=>(_.col.displayOrder??_.index)-(j.col.displayOrder??j.index)).map(({col:_})=>_),[c]);function pa(){const _=we.columns;return ys.map((j,T)=>({col:j,config:_[j.propertyPath],index:T})).sort((j,T)=>{var Se,be;return(((Se=j.config)==null?void 0:Se.order)??j.index)-(((be=T.config)==null?void 0:be.order)??T.index)}).map(({col:j,config:T})=>({propertyPath:j.propertyPath,displayName:j.displayName??j.propertyPath,visible:(T==null?void 0:T.visible)??!0,width:(T==null?void 0:T.width)??""}))}function xa(){Sn(pa()),se()}function ka(){Sn(ys.map(_=>({propertyPath:_.propertyPath,displayName:_.displayName??_.propertyPath,visible:!0,width:""})))}function wa(_,j){Sn(T=>{const Se=_+j;if(Se<0||Se>=T.length)return T;const be=[...T],[Je]=be.splice(_,1);return Je?(be.splice(Se,0,Je),be):T})}async function Sa(){var T,Se;const _={};ms.forEach((be,Je)=>{_[be.propertyPath]={propertyPath:be.propertyPath,visible:be.visible,order:Je,width:be.width}});const j={pageSize:h,columns:_};await((Se=(T=o.current).saveCustomConfigFun)==null?void 0:Se.call(T,j)),fe(),o.current.loadCustomConfigFun&&await H()}const lr=x||C||de||$,_t=[];t.empty!=null&&_t.push("empty"),t.footer!=null&&_t.push("footer"),t.loading!=null&&_t.push("loading"),t.card!=null&&_t.push("card"),t.list!=null&&_t.push("list"),t.selectionBar!=null&&_t.push("selectionBar");const gs=u.useRef(c);gs.current=c;const _s=u.useRef(d);_s.current=d;const vs=u.useRef(rt);vs.current=rt;const ps=u.useRef(ze);ps.current=ze;const xs=u.useRef(ht);xs.current=ht;const ks=u.useRef(xe);ks.current=xe;const ws=u.useRef(S);ws.current=S;const Ss=u.useRef(y);Ss.current=y;const bs=u.useRef(_t);bs.current=_t;const bn={get meta(){return gs.current},get paged(){return _s.current},get currentPage(){return gt.current},get viewMode(){return vs.current},get selectable(){return ps.current},get columnResizable(){return xs.current},get stickyHeader(){return ks.current},get slotNames(){return bs.current},get selectedRows(){return ws.current},get rows(){return Ss.current},reload:ma,refresh:ya,setViewMode:pn,setSelectable:xn,setColumnResizable:ca,setStickyHeader:da,clearSelection:re,selectAllOnPage:ye,invertSelectionOnPage:le,openConfigDialog:xa,openExportDialog:v},or=u.useRef(bn);or.current=bn;const ur=u.useRef(null);ur.current===null&&(ur.current=new Proxy({},{get:(_,j)=>Reflect.get(or.current,j),has:(_,j)=>Reflect.has(or.current,j)})),u.useImperativeHandle(n,()=>ur.current,[]);const Ms=L.map(_=>{const j=(wn==null?void 0:wn.propertyPath)===_.propertyPath?wn.width:Aa(_.width);return{key:_.propertyPath,dataIndex:_.propertyPath,title:_.displayName??_.propertyPath,width:j,ellipsis:!0,render:_.render?(T,Se)=>Os(_.render(Se,T)):T=>Os(T),onHeaderCell:()=>({className:`yk-table__col-header${ht?" yk-table__col-header--resizable":""}`,...ht?{onMouseDown:T=>{const Se=T.currentTarget.getBoundingClientRect();T.clientX<Se.right-8||ga(T,_.propertyPath,j??Se.width)}}:{}})}}),Cs=Ta({actions:X,table:bn});Cs&&Ms.push(Cs);const ba=ze?{selectedRowKeys:U,preserveSelectedRowKeys:!0,onChange:(_,j)=>Q(j)}:void 0,Ma={selectedRows:S,total:D,clearSelection:re,selectAllOnPage:ye,invertSelectionOnPage:le,pageSize:g};function Ca(_,j){if(j!==g){sr(j);return}fa(_)}return i.jsxs("div",{className:"yk-table",children:[t.selectionBar?i.jsx("div",{className:"yk-table__selection-bar-slot",children:t.selectionBar(Ma)}):null,i.jsxs("div",{className:"yk-table__view-area",children:[rt==="table"?i.jsx("div",{className:`yk-table__table-wrap${xe?" yk-table__table-wrap--sticky-header":""}`,children:i.jsx(f.Table,{columns:Ms,dataSource:y,rowKey:a,bordered:!0,pagination:!1,rowSelection:ba,locale:{emptyText:t.empty??i.jsx(f.Empty,{description:"暂无数据"})}})}):rt==="card"?i.jsx(ja,{rows:y,rowKey:a,showCheckbox:ze,loading:lr,hasActions:X.length>0,isSelected:ce,onCheck:hs,onContextMenu:fs,card:t.card,empty:t.empty}):i.jsx(Pa,{rows:y,rowKey:a,showCheckbox:ze,loading:lr,hasActions:X.length>0,isSelected:ce,onCheck:hs,onContextMenu:fs,list:t.list,empty:t.empty}),lr?i.jsx("div",{className:"yk-table__loading-mask",children:t.loading??i.jsx("span",{className:"yk-table__loading-spinner","aria-label":"加载中"})}):null]}),k||t.footer!=null?i.jsxs("div",{className:"yk-table__footer",children:[i.jsx("div",{className:"yk-table__footer-extra",children:t.footer}),k?i.jsx(f.Pagination,{className:"yk-table__pagination",current:w,pageSize:g,total:D,pageSizeOptions:s,showSizeChanger:!0,showTotal:B?_=>`共 ${_} 条`:void 0,onChange:Ca}):null]}):null,i.jsx(Na,{menu:At,actions:_a,isEnabled:J.isEnabled,onClose:()=>ar(null),onSelect:va}),i.jsx(Oa,{open:R,drafts:ms,onCancel:fe,onSave:Sa,onReset:ka,onMove:wa,onDraftsChange:Sn}),i.jsx(Us,{open:yt,options:mt,exporting:Ge,fetched:Tt,total:It,totalKnown:Et,percent:er,etaSeconds:Xn,cancelledVisible:tr,cancelledRows:vn,onExport:_=>void z(_),onCancelExport:ge,onKeepPartial:()=>void Mt(),onDiscardPartial:()=>void Ft(),onClose:b})]})});var Ht=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Le={},Te={};Object.defineProperty(Te,"__esModule",{value:!0});Te.AggInfoOf=Te.AggInfo=Te.AggItem=Te.AggType=void 0;Te.agg=La;var ln;(function(e){e.Sum="sum",e.Min="min",e.Max="max",e.Avg="avg",e.Count="count",e.DistinctCount="distinctcount"})(ln||(Te.AggType=ln={}));class zs{constructor(t,n,r=null,s){this.path=t,this.type=n,this.name=r,this.filter=s}toString(){var t,n;const r=(n=(t=this.filter)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:"";return this.name?`${this.path}.${this.type}(${r}).as(${this.name})`:`${this.path}.${this.type}(${r})`}}Te.AggItem=zs;class Gs{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}append(t,n=ln.Sum,r=null,s){return this.items.push(new zs(t,n,r,s)),this}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}}Te.AggInfo=Gs;class Qs extends Gs{append(t,n=ln.Sum,r=null,s){return super.append(t,n,r,s),this}}Te.AggInfoOf=Qs;function La(e,t=ln.Sum,n=null,r){return new Qs().append(e,t,n,r)}var je={},De={},wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.Constant=void 0;wt.con=Wa;class qs{constructor(t){this.con=t}toString(){return JSON.stringify(this.con)}}wt.Constant=qs;function Wa(e){return new qs(e)}var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Expression=void 0;Pt.exp=Ba;class Zs{constructor(t){this.exp=t}getExp(){return this.exp}toString(){return this.exp}}Pt.Expression=Zs;function Ba(e){return new Zs(e)}var St={};Object.defineProperty(St,"__esModule",{value:!0});St.key=Va;St.toExp=Ua;St.toValueExp=$a;const Yn=Pt,Ha=wt;function Va(e){return e.toString()}function Ua(e){return e instanceof Yn.Expression?e:new Yn.Expression(e)}function $a(e){return e==null?null:e instanceof Yn.Expression||e instanceof Ha.Constant?e:new Yn.Expression(e)}Object.defineProperty(De,"__esModule",{value:!0});De.FilterInfoOf=De.empty=De.FilterInfo=De.CombinType=De.Operator=void 0;De.filter=Ga;De.emptyFilter=Qa;const on=wt,za=Pt,Ns=St;var Tn;(function(e){e.Equals="==",e.NotEquals="!=",e.GreaterThan=">",e.LessThanOrEqual="<=",e.LessThan="<",e.GreaterThanOrEqual=">=",e.Between="between",e.NotBetween="not_between",e.In="in",e.NotIn="not_in",e.StartsWith="startswith",e.NotStartsWith="not_startswith",e.EndsWith="endswith",e.NotEndsWith="not_endswith",e.Contains="contains",e.NotContains="not_contains"})(Tn||(De.Operator=Tn={}));var Me;(function(e){e[e.AndItems=1]="AndItems",e[e.OrItems=2]="OrItems",e[e.SingleItem=0]="SingleItem"})(Me||(De.CombinType=Me={}));class Ne{constructor(t,n,r,s=Me.SingleItem,a=[]){this.items=[],this.left=t,this.right=r,this.op=n,this.combinType=s,this.items=a}toString(){switch(this.combinType){case Me.AndItems:{const t=this.items.filter(n=>n&&!n.isEmpty());return t.length===1?`${t[0].toString()}`:t.map(n=>`(${n.toString()})`).join(` ${Ne.Operator_And} `)}case Me.OrItems:{const t=this.items.filter(n=>n&&!n.isEmpty());return t.length===1?`${t[0].toString()}`:t.map(n=>`(${n.toString()})`).join(` ${Ne.Operator_Or} `)}default:return this.isEmpty()?"":`${this.left} ${this.op} ${this.right}`}}andAlso(t){return this.combinType==Me.AndItems?(t.combinType==Me.AndItems?this.items=this.items.concat(t.items):this.items.push(t),this):Ne.createAnd(this,t)}orElse(t){return this.combinType==Me.OrItems?(t.combinType==Me.OrItems?this.items=this.items.concat(t.items):this.items.push(t),this):Ne.createOr(this,t)}static createOr(...t){return new Ne(null,null,null,Me.OrItems,t)}static createAnd(...t){return new Ne(null,null,null,Me.AndItems,t)}isEmpty(){return this.combinType==Me.SingleItem&&this.op==null}static fromSimpleObject(...t){return Ne.createAnd(...t.map(n=>{var r;return new Ne((0,za.exp)(n.name),(r=n.op)!==null&&r!==void 0?r:Tn.Equals,(0,on.con)(n.value))}))}static fromSimpleDictionary(t){return Ne.fromSimpleObject(...Object.entries(t).map(([n,r])=>({name:n,value:r})))}}De.FilterInfo=Ne;Ne.Operator_And="and";Ne.Operator_Or="or";De.empty=new Ne((0,on.con)(1),Tn.Equals,(0,on.con)(1));class pt extends Ne{constructor(t,n,r,s=Me.SingleItem,a=[]){super((0,Ns.toValueExp)(t),n,(0,Ns.toValueExp)(r),s,a)}and(t,n,r){const s=new pt(t,n,r);return this.combinType==Me.AndItems?(s.combinType==Me.AndItems?this.items=this.items.concat(s.items):this.items.push(s),this):new pt(null,null,null,Me.AndItems,[this,s])}or(t,n,r){const s=new pt(t,n,r);return this.combinType==Me.OrItems?(s.combinType==Me.OrItems?this.items=this.items.concat(s.items):this.items.push(s),this):new pt(null,null,null,Me.OrItems,[this,s])}andIf(t,n,r,s){return t?this.and(n,r,s):this}orIf(t,n,r,s){return t?this.or(n,r,s):this}}De.FilterInfoOf=pt;function Ga(e,t,n){return new pt(e,t,n)}function Qa(){return new pt((0,on.con)(null),null,(0,on.con)(null))}var qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.queryConfig=void 0;qt.queryConfig={defaultLimit:10,maxLimit:1e3};var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.DataOverflowError=void 0;class Rr extends Error{constructor(t){super(t),this.name="DataOverflowError",Object.setPrototypeOf(this,Rr.prototype)}}dn.DataOverflowError=Rr;var Fe=Ht&&Ht.__awaiter||function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(l){l(a)})}return new(n||(n=Promise))(function(a,l){function o(y){try{d(r.next(y))}catch(x){l(x)}}function c(y){try{d(r.throw(y))}catch(x){l(x)}}function d(y){y.done?a(y.value):s(y.value).then(o,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(je,"__esModule",{value:!0});je.findBy=Js;je.findById=Za;je.count=Ka;je.distinctCount=Ja;je.distinctList=Xa;je.asList=el;je.queryPage=tl;je.loadAll=nl;je.aggValue=rl;je.aggProp=fn;je.sumProp=sl;je.maxProp=il;je.minProp=al;je.avgProp=ll;const Rs=De,qa=wt,Gt=Te,Bn=qt,Ks=dn;function Js(e,t,n,r){return Fe(this,void 0,void 0,function*(){const s=yield e({limit:1,offset:0,filter:(0,Rs.filter)(t,Rs.Operator.Equals,(0,qa.con)(n)).toString(),countAll:!1},r);return s.items.length>0?s.items[0]:null})}function Za(e,t,n){return Fe(this,void 0,void 0,function*(){return Js(e,"id",t,n)})}function Ka(e,t,n){return Fe(this,void 0,void 0,function*(){var r;return(r=(yield e({limit:0,offset:0,filter:t==null?void 0:t.toString(),countAll:!0},n)).totalCount)!==null&&r!==void 0?r:0})}function Ja(e,t,n,r){return Fe(this,void 0,void 0,function*(){var s;return(s=(yield e({limit:0,offset:0,filter:n==null?void 0:n.toString(),select:t.toString(),distinct:!0,countAll:!0},r)).totalCount)!==null&&s!==void 0?s:0})}function Xa(e,t,n){return Fe(this,void 0,void 0,function*(){var r,s,a,l,o;const c=yield e({limit:(r=t.maxPageSize)!==null&&r!==void 0?r:Bn.queryConfig.maxLimit,offset:0,filter:(s=t.filter)===null||s===void 0?void 0:s.toString(),select:t.select.toString(),orderBy:(a=t.orderBy)===null||a===void 0?void 0:a.toString(),distinct:!0,countAll:!1},n);if(c.hasNext&&(!((l=t.throwIfOverflow)!==null&&l!==void 0)||l))throw new Ks.DataOverflowError(`The result data of distinctList is lost. Total: ${(o=c.totalCount)!==null&&o!==void 0?o:0}, Max page size: ${c.limit}`);return c.items})}function el(e,t,n){return Fe(this,void 0,void 0,function*(){var r,s,a,l,o,c;const d=yield e({limit:(r=t==null?void 0:t.maxPageSize)!==null&&r!==void 0?r:Bn.queryConfig.maxLimit,offset:0,filter:(s=t==null?void 0:t.filter)===null||s===void 0?void 0:s.toString(),select:(a=t==null?void 0:t.select)===null||a===void 0?void 0:a.toString(),orderBy:(l=t==null?void 0:t.orderBy)===null||l===void 0?void 0:l.toString(),countAll:!1},n);if(d.hasNext&&(!((o=t==null?void 0:t.throwIfOverflow)!==null&&o!==void 0)||o))throw new Ks.DataOverflowError(`The result data of asList is lost. Total: ${(c=d.totalCount)!==null&&c!==void 0?c:0}, Max page size: ${d.limit}`);return d.items})}function tl(e,t){var n,r,s,a,l,o;return e({limit:(n=t.limit)!==null&&n!==void 0?n:Bn.queryConfig.defaultLimit,offset:(r=t.offset)!==null&&r!==void 0?r:0,filter:(s=t.filter)===null||s===void 0?void 0:s.toString(),select:(a=t.select)===null||a===void 0?void 0:a.toString(),orderBy:(l=t.orderBy)===null||l===void 0?void 0:l.toString(),agg:(o=t.agg)===null||o===void 0?void 0:o.toString(),distinct:t.distinct,countAll:t.countAll})}function nl(e,t,n){return Fe(this,void 0,void 0,function*(){var r,s,a,l,o;let c=[],d=0;const y={limit:(r=t==null?void 0:t.maxPageSize)!==null&&r!==void 0?r:Bn.queryConfig.maxLimit,filter:(s=t==null?void 0:t.filter)===null||s===void 0?void 0:s.toString(),select:(a=t==null?void 0:t.select)===null||a===void 0?void 0:a.toString(),orderBy:(l=t==null?void 0:t.orderBy)===null||l===void 0?void 0:l.toString(),distinct:(o=t==null?void 0:t.distinct)!==null&&o!==void 0?o:!1,countAll:!1};for(;!(n!=null&&n.aborted);){const x=yield e(Object.assign(Object.assign({},y),{offset:d}),n);if(c=c.concat(x.items),d+=y.limit,x.items.length==0||!x.hasNext||n!=null&&n.aborted)break}return c})}function rl(e,t,n,r){return Fe(this,void 0,void 0,function*(){return(yield e({limit:0,offset:0,filter:n==null?void 0:n.toString(),agg:t.toString(),countAll:!1},r)).aggs})}function fn(e,t){return Fe(this,arguments,void 0,function*(n,r,s=Gt.AggType.Sum,a,l){var o;const c="__tg0",d=yield n({limit:0,offset:0,filter:a==null?void 0:a.toString(),agg:(0,Gt.agg)(r,s,c,a).toString(),countAll:!1},l);return Number((o=d.aggs)===null||o===void 0?void 0:o[c])})}function sl(e,t,n,r){return Fe(this,void 0,void 0,function*(){return fn(e,t,Gt.AggType.Sum,n,r)})}function il(e,t,n,r){return Fe(this,void 0,void 0,function*(){return fn(e,t,Gt.AggType.Max,n,r)})}function al(e,t,n,r){return Fe(this,void 0,void 0,function*(){return fn(e,t,Gt.AggType.Min,n,r)})}function ll(e,t,n,r){return Fe(this,void 0,void 0,function*(){return fn(e,t,Gt.AggType.Avg,n,r)})}var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.LimitInfo=void 0;class ol{}Hn.LimitInfo=ol;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.OrderByInfoOf=Be.OrderByInfo=Be.OrderByItem=Be.OrderByType=void 0;Be.orderby=ul;const vr=St;var Qt;(function(e){e.Asc="asc()",e.Desc="desc()"})(Qt||(Be.OrderByType=Qt={}));class Xs{constructor(t,n){this.path=t,this.type=n}toString(){return`${this.path}.${this.type.toString()}`}}Be.OrderByItem=Xs;class ei{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}add(t,n=Qt.Asc){return this.items.push(new Xs(t,n)),this}}Be.OrderByInfo=ei;class ti extends ei{then(t){return this.add((0,vr.toExp)(t),Qt.Asc),this}thenDesc(t){return this.add((0,vr.toExp)(t),Qt.Desc),this}}Be.OrderByInfoOf=ti;function ul(e,t=Qt.Asc){const n=new ti;return n.add((0,vr.toExp)(e),t),n}var ni={};Object.defineProperty(ni,"__esModule",{value:!0});var Nt={},et={};Object.defineProperty(et,"__esModule",{value:!0});et.SelectInfoOf=et.SelectInfo=et.SelectItem=void 0;et.select=cl;class pr{constructor(t,n=!1){this.name=t,this.exclude=n}toString(){return this.exclude?`-${this.name}`:this.name}}et.SelectItem=pr;class ri{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}appendItems(...t){return this.items?this.items=this.items.concat(t):this.items=t,this}}et.SelectInfo=ri;class si extends ri{include(...t){return this.appendItems(...t.map(n=>new pr(n.toString()))),this}exclude(...t){return this.appendItems(...t.map(n=>new pr(n.toString(),!0))),this}}et.SelectInfoOf=si;function cl(...e){return new si().include(...e)}Object.defineProperty(Nt,"__esModule",{value:!0});Nt.QueryBuilderOf=Nt.QueryBuilder=void 0;Nt.query=fl;const cr=Te,dr=De,vt=Be,Lt=et,Ct=St,dl=qt;class ii{constructor(){this._limit=dl.queryConfig.defaultLimit,this._offset=0}build(){const t={limit:this._limit,offset:this._offset};return this._filterInfo&&(t.filter=this._filterInfo.toString()),this._orderByInfo&&(t.orderBy=this._orderByInfo.toString()),this._selectInfo&&(t.select=this._selectInfo.toString()),this._aggInfo&&(t.agg=this._aggInfo.toString()),t}withAgg(t){return this._aggInfo=t,this}withFilter(t){return this._filterInfo=t,this}withOrderBy(t){return this._orderByInfo=t,this}withSelect(t){return this._selectInfo=t,this}offset(t){return this._offset=t,this}limit(t){return this._limit=t,this}}Nt.QueryBuilder=ii;class ai extends ii{where(t,n=dr.Operator.Equals,r){return this._filterInfo?this._filterInfo=this._filterInfo.andAlso(new dr.FilterInfo((0,Ct.toValueExp)(t),n,(0,Ct.toValueExp)(r))):this._filterInfo=new dr.FilterInfo((0,Ct.toValueExp)(t),n,(0,Ct.toValueExp)(r)),this}orderby(t,n=vt.OrderByType.Asc){return this._orderByInfo=new vt.OrderByInfo(new vt.OrderByItem((0,Ct.toExp)(t),n)),this}orderbyDesc(t){return this.orderby(t,vt.OrderByType.Desc)}thenby(t,n=vt.OrderByType.Asc){return this._orderByInfo?this._orderByInfo.add((0,Ct.toExp)(t),n):this._orderByInfo=new vt.OrderByInfo(new vt.OrderByItem((0,Ct.toExp)(t),n)),this}thenbyDesc(t){return this.thenby(t,vt.OrderByType.Desc)}agg(t,n=cr.AggType.Sum,r=null){return this._aggInfo?this._aggInfo.append(t,n,r):this._aggInfo=new cr.AggInfo(new cr.AggItem(t,n,r)),this}include(...t){return this._selectInfo?this._selectInfo.appendItems(...t.map(n=>new Lt.SelectItem(n.toString()))):this._selectInfo=new Lt.SelectInfo(...t.map(n=>new Lt.SelectItem(n.toString()))),this}exclude(...t){return this._selectInfo?this._selectInfo.appendItems(...t.map(n=>new Lt.SelectItem(n.toString(),!0))):this._selectInfo=new Lt.SelectInfo(...t.map(n=>new Lt.SelectItem(n.toString(),!0))),this}}Nt.QueryBuilderOf=ai;function fl(){return new ai}(function(e){var t=Ht&&Ht.__createBinding||(Object.create?function(r,s,a,l){l===void 0&&(l=a);var o=Object.getOwnPropertyDescriptor(s,a);(!o||("get"in o?!s.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(r,l,o)}:function(r,s,a,l){l===void 0&&(l=a),r[l]=s[a]}),n=Ht&&Ht.__exportStar||function(r,s){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&t(s,r,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(Te,e),n(je,e),n(wt,e),n(qt,e),n(Pt,e),n(De,e),n(Hn,e),n(Be,e),n(ni,e),n(Nt,e),n(et,e),n(St,e),n(dn,e)})(Le);const hl=u.createContext(null);//! moment.js
|
|
2
|
+
//! version : 2.31.0
|
|
3
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
4
|
+
//! license : MIT
|
|
5
|
+
//! momentjs.com
|
|
6
|
+
var li;function p(){return li.apply(null,arguments)}function ml(e){li=e}function Qe(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Ot(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function W(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Pr(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(W(e,t))return!1;return!0}function Re(e){return e===void 0}function ut(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function hn(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function oi(e,t){var n=[],r,s=e.length;for(r=0;r<s;++r)n.push(t(e[r],r));return n}function Xe(e,t){for(var n in t)W(t,n)&&(e[n]=t[n]);return W(t,"toString")&&(e.toString=t.toString),W(t,"valueOf")&&(e.valueOf=t.valueOf),e}function tt(e,t,n,r){return Yi(e,t,n,r,!0).utc()}function yl(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidOffset:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function I(e){return e._pf==null&&(e._pf=yl()),e._pf}var xr;Array.prototype.some?xr=Array.prototype.some:xr=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function Yr(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=I(e),n=xr.call(t.parsedDateParts,function(s){return s!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidOffset&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function mn(e){var t=tt(NaN);return e!=null?Xe(I(t),e):I(t).userInvalidated=!0,t}var Ps=p.momentProperties=[],fr=!1;function Tr(e,t){var n,r,s,a=Ps.length;if(Re(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Re(t._i)||(e._i=t._i),Re(t._f)||(e._f=t._f),Re(t._l)||(e._l=t._l),Re(t._strict)||(e._strict=t._strict),Re(t._tzm)||(e._tzm=t._tzm),Re(t._isUTC)||(e._isUTC=t._isUTC),Re(t._offset)||(e._offset=t._offset),Re(t._pf)||(e._pf=I(t)),Re(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=Ps[n],s=t[r],Re(s)||(e[r]=s);return e}function yn(e){Tr(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),fr===!1&&(fr=!0,p.updateOffset(this),fr=!1)}function Ee(e){return e instanceof yn||e!=null&&e._isAMomentObject!=null}function ui(e){p.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Ue(e,t){var n=!0;return Xe(function(){if(p.deprecationHandler!=null&&p.deprecationHandler(null,e),n){var r=[],s,a,l,o=arguments.length;for(a=0;a<o;a++){if(s="",typeof arguments[a]=="object"){s+=`
|
|
7
|
+
[`+a+"] ";for(l in arguments[0])W(arguments[0],l)&&(s+=l+": "+arguments[0][l]+", ");s=s.slice(0,-2)}else s=arguments[a];r.push(s)}ui(e+`
|
|
8
|
+
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
9
|
+
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Ys={};function ci(e,t){p.deprecationHandler!=null&&p.deprecationHandler(e,t),Ys[e]||(ui(t+`
|
|
10
|
+
`+new Error().stack),Ys[e]=!0)}p.suppressDeprecationWarnings=!1;p.deprecationHandler=null;function nt(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}var Ts={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function $e(e){return typeof e=="string"?Ts[e]||Ts[e.toLowerCase()]:void 0}function Ir(e){var t={},n,r;for(r in e)W(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var gl={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function _l(e){var t=[],n;for(n in e)W(e,n)&&t.push({unit:n,priority:gl[n]});return t.sort(function(r,s){return r.priority-s.priority}),t}function Ve(e,t,n){var r=""+Math.abs(e),s=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+r}var Er=/(\[[^\[]*\])|(\\e)|(\\)?(eHHmm|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Mn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,hr={},Ut={};function O(e,t,n,r){var s=r;typeof r=="string"&&(s=function(){return this[r]()}),e&&(Ut[e]=s),t&&(Ut[t[0]]=function(){return Ve(s.apply(this,arguments),t[1],t[2])}),n&&(Ut[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function vl(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function pl(e){var t=e.match(Er),n,r;for(n=0,r=t.length;n<r;n++)Ut[t[n]]?t[n]=Ut[t[n]]:t[n]=vl(t[n]);return function(s){var a="",l;for(l=0;l<r;l++)a+=nt(t[l])?t[l].call(s,e):t[l];return a}}function Nn(e,t){if(!e.isValid())return e.localeData().invalidDate();t=di(t,e.localeData());var n="$"+t;return W(hr,n)||(hr[n]=pl(t)),hr[n](e)}function di(e,t){var n=5;function r(s){return t.longDateFormat(s)||s}for(Mn.lastIndex=0;n>=0&&Mn.test(e);)e=e.replace(Mn,r),Mn.lastIndex=0,n-=1;return e}var fi=/\d/,Ae=/\d\d/,hi=/\d{3}/,Fr=/\d{4}/,Vn=/[+-]?\d{6}/,ae=/\d\d?/,mi=/\d\d\d\d?/,Ar=/\d\d\d\d\d\d?/,Un=/\d{1,3}/,Lr=/\d{1,4}/,$n=/[+-]?\d{1,6}/,Zt=/\d+/,zn=/[+-]?\d+/,xl=/Z|[+-]\d\d:?\d\d/gi,Gn=/Z|[+-]\d\d(?::?\d\d)?/gi,kl=/[+-]?\d+(\.\d{1,3})?/,gn=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Kt=/^[1-9]\d?/,Wr=/^([1-9]\d|\d)/,In;In={};function M(e,t,n){In[e]=nt(t)?t:function(r,s){return r&&n?n:t}}function wl(e,t){return W(In,e)?In[e](t._strict,t._locale):new RegExp(Sl(e))}function Sl(e){return lt(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,s,a){return n||r||s||a}))}function lt(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function We(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function A(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=We(t)),n}var kr={};function ne(e,t){var n,r=t,s;for(typeof e=="string"&&(e=[e]),ut(t)&&(r=function(a,l){l[t]=A(a)}),s=e.length,n=0;n<s;n++)kr[e[n]]=r}function Jt(e,t){ne(e,function(n,r,s,a){s._w=s._w||{},t(n,s._w,s,a)})}function bl(e,t,n){t!=null&&W(kr,e)&&kr[e](t,n._a,n,e)}function Qn(e){return e%4===0&&e%100!==0||e%400===0}var ve=0,Ie=1,Pe=2,ke=3,He=4,at=5,jt=6,Ml=7,Cl=8;O("Y",0,0,function(){var e=this.year();return e<=9999?Ve(e,4):"+"+e});O(0,["YY",2],0,function(){return this.year()%100});O(0,["YYYY",4],0,"year");O(0,["YYYYY",5],0,"year");O(0,["YYYYYY",6,!0],0,"year");M("Y",zn);M("YY",ae,Ae);M("YYYY",Lr,Fr);M("YYYYY",$n,Vn);M("YYYYYY",$n,Vn);ne(["YYYYY","YYYYYY"],ve);ne("YYYY",function(e,t){t[ve]=e.length===2?p.parseTwoDigitYear(e):A(e)});ne("YY",function(e,t){t[ve]=p.parseTwoDigitYear(e)});ne("Y",function(e,t){t[ve]=parseInt(e,10)});function an(e){return Qn(e)?366:365}p.parseTwoDigitYear=function(e){return A(e)+(A(e)>68?1900:2e3)};var yi=Xt("FullYear",!0);function Dl(){return Qn(this.year())}function Xt(e,t){return function(n){return n!=null?(gi(this,e,n),p.updateOffset(this,t),this):un(this,e)}}function un(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function gi(e,t,n){var r,s,a,l,o;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(s?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(s?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(s?r.setUTCHours(n):r.setHours(n));case"Date":return void(s?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,l=e.month(),o=e.date(),o=o===29&&l===1&&!Qn(a)?28:o,s?r.setUTCFullYear(a,l,o):r.setFullYear(a,l,o)}}function jl(e){return e=$e(e),nt(this[e])?this[e]():this}function Ol(e,t){if(typeof e=="object"){e=Ir(e);var n=_l(e),r,s=n.length;for(r=0;r<s;r++)this[n[r].unit](e[n[r].unit])}else if(e=$e(e),nt(this[e]))return this[e](t);return this}function Nl(e,t){return(e%t+t)%t}var _e;Array.prototype.indexOf?_e=Array.prototype.indexOf:_e=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Br(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Nl(t,12);return e+=(t-n)/12,n===1?Qn(e)?29:28:31-n%7%2}O("M",["MM",2],"Mo",function(){return this.month()+1});O("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});O("MMMM",0,0,function(e){return this.localeData().months(this,e)});M("M",ae,Kt);M("MM",ae,Ae);M("MMM",function(e,t){return t.monthsShortRegex(e)});M("MMMM",function(e,t){return t.monthsRegex(e)});ne(["M","MM"],function(e,t){t[Ie]=A(e)-1});ne(["MMM","MMMM"],function(e,t,n,r){var s=n._locale.monthsParse(e,r,n._strict);s!=null?t[Ie]=s:I(n).invalidMonth=e});var Rl="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),_i="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),vi=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pl=gn,Yl=gn,Is=["monthsParse","longMonthsParse","shortMonthsParse","monthsRegex","monthsShortRegex","monthsStrictRegex","monthsShortStrictRegex"];function Tl(e,t){var n,r;for(n=0;n<Is.length;n++)r=Is[n],W(t,r)||delete e["_"+r]}function Il(e,t){return e?Qe(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||vi).test(t)?"format":"standalone"][e.month()]:Qe(this._months)?this._months:this._months.standalone}function El(e,t){return e?Qe(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[vi.test(t)?"format":"standalone"][e.month()]:Qe(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Fl(e,t,n){var r,s,a,l=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=tt([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(s=_e.call(this._shortMonthsParse,l),s!==-1?s:null):(s=_e.call(this._longMonthsParse,l),s!==-1?s:null):t==="MMM"?(s=_e.call(this._shortMonthsParse,l),s!==-1?s:(s=_e.call(this._longMonthsParse,l),s!==-1?s:null)):(s=_e.call(this._longMonthsParse,l),s!==-1?s:(s=_e.call(this._shortMonthsParse,l),s!==-1?s:null))}function Al(e,t,n){var r,s,a;if(this._monthsParseExact)return Fl.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(s=tt([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function pi(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=A(t);else if(t=e.localeData().monthsParse(t),!ut(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Br(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function xi(e){return e!=null?(pi(this,e),p.updateOffset(this,!0),this):un(this,"Month")}function Ll(){return Br(this.year(),this.month())}function Wl(e){return this._monthsParseExact?(W(this,"_monthsRegex")||ki.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(W(this,"_monthsShortRegex")||(this._monthsShortRegex=Pl),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Bl(e){return this._monthsParseExact?(W(this,"_monthsRegex")||ki.call(this),e?this._monthsStrictRegex:this._monthsRegex):(W(this,"_monthsRegex")||(this._monthsRegex=Yl),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function ki(){function e(c,d){return d.length-c.length}var t=[],n=[],r=[],s,a,l,o;for(s=0;s<12;s++)a=tt([2e3,s]),l=lt(this.monthsShort(a,"")),o=lt(this.months(a,"")),t.push(l),n.push(o),r.push(o),r.push(l);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}O("d",0,"do","day");O("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});O("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});O("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});O("e",0,0,"weekday");O("E",0,0,"isoWeekday");O("eHHmm",0,0,function(){return""+this.weekday()+Ve(this.hours(),2)+Ve(this.minutes(),2)});M("d",ae);M("e",ae);M("E",ae);M("eHHmm",Ar);M("dd",function(e,t){return t.weekdaysMinRegex(e)});M("ddd",function(e,t){return t.weekdaysShortRegex(e)});M("dddd",function(e,t){return t.weekdaysRegex(e)});Jt(["dd","ddd","dddd"],function(e,t,n,r){var s=n._locale.weekdaysParse(e,r,n._strict);s!=null?t.d=s:I(n).invalidWeekday=e});Jt(["d","e","E"],function(e,t,n,r){t[r]=A(e)});Jt("eHHmm",function(e,t,n){var r=e.length-4;t.e=A(e.substr(0,r)),n._a[ke]=A(e.substr(r,2)),n._a[He]=A(e.substr(r+2))});function Hl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Vl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Hr(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Ul="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$l="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),zl=gn,Gl=gn,Ql=gn,Es=["weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","minWeekdaysParse","weekdaysRegex","weekdaysShortRegex","weekdaysMinRegex","weekdaysStrictRegex","weekdaysShortStrictRegex","weekdaysMinStrictRegex"];function ql(e,t){var n,r;for(n=0;n<Es.length;n++)r=Es[n],W(t,r)||delete e["_"+r]}function Zl(e,t){var n=Qe(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Hr(n,this._week.dow):e?n[e.day()]:n}function Kl(e){return e===!0?Hr(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Jl(e){return e===!0?Hr(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Xl(e,t,n){var r,s,a,l=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=tt([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(s=_e.call(this._weekdaysParse,l),s!==-1?s:null):t==="ddd"?(s=_e.call(this._shortWeekdaysParse,l),s!==-1?s:null):(s=_e.call(this._minWeekdaysParse,l),s!==-1?s:null):t==="dddd"?(s=_e.call(this._weekdaysParse,l),s!==-1||(s=_e.call(this._shortWeekdaysParse,l),s!==-1)?s:(s=_e.call(this._minWeekdaysParse,l),s!==-1?s:null)):t==="ddd"?(s=_e.call(this._shortWeekdaysParse,l),s!==-1||(s=_e.call(this._weekdaysParse,l),s!==-1)?s:(s=_e.call(this._minWeekdaysParse,l),s!==-1?s:null)):(s=_e.call(this._minWeekdaysParse,l),s!==-1||(s=_e.call(this._weekdaysParse,l),s!==-1)?s:(s=_e.call(this._shortWeekdaysParse,l),s!==-1?s:null))}function eo(e,t,n){var r,s,a;if(this._weekdaysParseExact)return Xl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(s=tt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function to(e){if(!this.isValid())return e!=null?this:NaN;var t=un(this,"Day");return e!=null?(e=Hl(e,this.localeData()),this.add(e-t,"d")):t}function no(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function ro(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Vl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function so(e){return this._weekdaysParseExact?(W(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(W(this,"_weekdaysRegex")||(this._weekdaysRegex=zl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function io(e){return this._weekdaysParseExact?(W(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(W(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Gl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ao(e){return this._weekdaysParseExact?(W(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(W(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ql),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vr(){function e(y,x){return x.length-y.length}var t=[],n=[],r=[],s=[],a,l,o,c,d;for(a=0;a<7;a++)l=tt([2e3,1]).day(a),o=lt(this.weekdaysMin(l,"")),c=lt(this.weekdaysShort(l,"")),d=lt(this.weekdays(l,"")),t.push(o),n.push(c),r.push(d),s.push(o),s.push(c),s.push(d);t.sort(e),n.sort(e),r.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function lo(e){var t,n;Tl(this,e),ql(this,e);for(n in e)W(e,n)&&(t=e[n],nt(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function wr(e,t){var n=Xe({},e),r;for(r in t)W(t,r)&&(Ot(e[r])&&Ot(t[r])?(n[r]={},Xe(n[r],e[r]),Xe(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)W(e,r)&&!W(t,r)&&Ot(e[r])&&(n[r]=Xe({},n[r]));return n}function Ur(e){e!=null&&this.set(e)}var Sr;Object.keys?Sr=Object.keys:Sr=function(e){var t,n=[];for(t in e)W(e,t)&&n.push(t);return n};var oo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function uo(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return nt(r)?r.call(t,n):r}var co={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function fo(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()],r=this._longDateFormatCache;return t||!n?t:r&&r[e]&&r[e].formatUpper===n?r[e].format:(t=n.match(Er).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),r||(r=this._longDateFormatCache={}),r[e]={formatUpper:n,format:t},t)}var ho="Invalid date";function mo(){return this._invalidDate}var yo="%d",go=/\d{1,2}/;function _o(e){return this._ordinal.replace("%d",e)}var vo={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Si(e,t,n,r){var s=this._relativeTime[n];return nt(s)?s(e,t,n,r):s.replace(/%d/i,e)}function po(e,t,n,r){return this.postformat(Si.call(this,e,t,n,r))}function bi(e,t){var n=this._relativeTime[e>0?"future":"past"];return nt(n)?n(t):n.replace(/%s/i,t)}function xo(e,t){return this.postformat(bi.call(this,e,t))}function ko(e,t,n,r,s,a,l){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,r,s,a,l),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,r,s,a,l),o}function Rt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function En(e,t,n){var r=7+t-n,s=(7+Rt(e,0,r).getUTCDay()-t)%7;return-s+r-1}function Mi(e,t,n,r,s){var a=(7+n-r)%7,l=En(e,r,s),o=1+7*(t-1)+a+l,c,d;return o<=0?(c=e-1,d=an(c)+o):o>an(e)?(c=e+1,d=o-an(e)):(c=e,d=o),{year:c,dayOfYear:d}}function Ci(e,t,n,r){var s=En(e,n,r),a=Math.floor((t-s-1)/7)+1,l,o;return a<1?(o=e-1,l=a+ot(o,n,r)):a>ot(e,n,r)?(l=a-ot(e,n,r),o=e+1):(o=e,l=a),{week:l,year:o}}function $r(e,t,n){return Ci(e.year(),e.dayOfYear(),t,n)}function Fs(e,t,n,r,s){var a=Math.round((Rt(e,t,n)-Rt(e,0,1))/864e5)+1;return Ci(e,a,r,s)}function ot(e,t,n){var r=En(e,t,n),s=En(e+1,t,n);return(an(e)-r+s)/7}O("w",["ww",2],"wo","week");O("W",["WW",2],"Wo","isoWeek");M("w",ae,Kt);M("ww",ae,Ae);M("W",ae,Kt);M("WW",ae,Ae);Jt(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=A(e)});function wo(e){return $r(e,this._week.dow,this._week.doy).week}var So={dow:0,doy:6};function bo(){return this._week.dow}function Mo(){return this._week.doy}function Co(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Do(e){var t=$r(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}function zr(){return this.hours()%12||12}function jo(){return this.hours()||24}O("H",["HH",2],0,"hour");O("h",["hh",2],0,zr);O("k",["kk",2],0,jo);O("hmm",0,0,function(){return""+zr.apply(this)+Ve(this.minutes(),2)});O("hmmss",0,0,function(){return""+zr.apply(this)+Ve(this.minutes(),2)+Ve(this.seconds(),2)});O("Hmm",0,0,function(){return""+this.hours()+Ve(this.minutes(),2)});O("Hmmss",0,0,function(){return""+this.hours()+Ve(this.minutes(),2)+Ve(this.seconds(),2)});function Di(e,t){O(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Di("a",!0);Di("A",!1);function ji(e,t){return t._meridiemParse}M("a",ji);M("A",ji);M("H",ae,Wr);M("h",ae,Kt);M("k",ae,Kt);M("HH",ae,Ae);M("hh",ae,Ae);M("kk",ae,Ae);M("hmm",mi);M("hmmss",Ar);M("Hmm",mi);M("Hmmss",Ar);ne(["H","HH"],ke);ne(["k","kk"],function(e,t,n){var r=A(e);t[ke]=r===24?0:r});ne(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});ne(["h","hh"],function(e,t,n){t[ke]=A(e),I(n).bigHour=!0});ne("hmm",function(e,t,n){var r=e.length-2;t[ke]=A(e.substr(0,r)),t[He]=A(e.substr(r)),I(n).bigHour=!0});ne("hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[ke]=A(e.substr(0,r)),t[He]=A(e.substr(r,2)),t[at]=A(e.substr(s)),I(n).bigHour=!0});ne("Hmm",function(e,t,n){var r=e.length-2;t[ke]=A(e.substr(0,r)),t[He]=A(e.substr(r))});ne("Hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[ke]=A(e.substr(0,r)),t[He]=A(e.substr(r,2)),t[at]=A(e.substr(s))});function Oo(e){return(e+"").toLowerCase().charAt(0)==="p"}var No=/[ap]\.?m?\.?/i,Ro=Xt("Hours",!0);function Po(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Oi={calendar:oo,longDateFormat:co,invalidDate:ho,ordinal:yo,dayOfMonthOrdinalParse:go,relativeTime:vo,months:Rl,monthsShort:_i,week:So,weekdays:Ul,weekdaysMin:$l,weekdaysShort:wi,meridiemParse:No},te={},nn={},cn;function Yo(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function br(e){return e&&e.toLowerCase().replace("_","-")}function To(e){for(var t=0,n,r,s,a;t<e.length;){for(a=br(e[t]).split("-"),n=a.length,r=br(e[t+1]),r=r?r.split("-"):null;n>0;){if(s=qn(a.slice(0,n).join("-")),s)return s;if(r&&r.length>=n&&Yo(a,r)>=n-1)break;n--}t++}return cn}function Io(e){return typeof e=="string"&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)}function qn(e){var t=null,n,r;if(W(te,e))return te[e];if(r=br(e),W(te,r))return te[r];if(typeof module<"u"&&module&&module.exports&&Io(r))try{t=cn._abbr,n=require,n("./locale/"+r),kt(t)}catch{te[r]=null}if(W(te,r))return te[r]}function kt(e,t){var n;return e&&(Re(t)?n=ct(e):n=Gr(e,t),n?cn=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),cn._abbr}function Gr(e,t){if(t!==null){var n,r=Oi;if(t.abbr=e,te[e]!=null)ci("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=te[e]._config;else if(t.parentLocale!=null)if(te[t.parentLocale]!=null)r=te[t.parentLocale]._config;else if(n=qn(t.parentLocale),n!=null)r=n._config;else return nn[t.parentLocale]||(nn[t.parentLocale]=[]),nn[t.parentLocale].push({name:e,config:t}),null;return te[e]=new Ur(wr(r,t)),nn[e]&&nn[e].forEach(function(s){Gr(s.name,s.config)}),kt(e),te[e]}else return delete te[e],null}function Eo(e,t){var n,r=qn(e),s=Oi;return r!=null&&(e=r._abbr),t!=null?(te[e]!=null&&te[e].parentLocale!=null?te[e].set(wr(te[e]._config,t)):(r!=null&&(s=r._config),t=wr(s,t),r==null&&(t.abbr=e),n=new Ur(t),n.parentLocale=te[e],te[e]=n),kt(e)):te[e]!=null&&(te[e].parentLocale!=null?(te[e]=te[e].parentLocale,e===kt()&&kt(e)):te[e]!=null&&delete te[e]),te[e]}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return cn;if(!Qe(e)){if(t=qn(e),t)return t;e=[e]}return To(e)}function Fo(){return Sr(te)}function Qr(e){var t,n=e._a;return n&&I(e).overflow===-2&&(t=n[Ie]<0||n[Ie]>11?Ie:n[Pe]<1||n[Pe]>Br(n[ve],n[Ie])?Pe:n[ke]<0||n[ke]>24||n[ke]===24&&(n[He]!==0||n[at]!==0||n[jt]!==0)?ke:n[He]<0||n[He]>59?He:n[at]<0||n[at]>59?at:n[jt]<0||n[jt]>999?jt:-1,I(e)._overflowDayOfYear&&(t<ve||t>Pe)&&(t=Pe),I(e)._overflowWeeks&&t===-1&&(t=Ml),I(e)._overflowWeekday&&t===-1&&(t=Cl),I(e).overflow=t),e}var Ao=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Lo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wo=/Z|[+-]\d\d(?::?\d\d)?/,Cn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],mr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Bo=/^\/?Date\((-?\d+)/i,Ho=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Vo={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ni(e){var t,n,r=e._i,s=Ao.exec(r)||Lo.exec(r),a,l,o,c,d=Cn.length,y=mr.length;if(s){for(I(e).iso=!0,t=0,n=d;t<n;t++)if(Cn[t][1].exec(s[1])){l=Cn[t][0],a=Cn[t][2]!==!1;break}if(l==null){e._isValid=!1;return}if(s[3]){for(t=0,n=y;t<n;t++)if(mr[t][1].exec(s[3])){o=(s[2]||" ")+mr[t][0];break}if(o==null){e._isValid=!1;return}}if(!a&&o!=null){e._isValid=!1;return}if(s[4])if(Wo.exec(s[4]))c="Z";else{e._isValid=!1;return}e._f=l+(o||"")+(c||""),Zr(e)}else e._isValid=!1}function Uo(e,t,n,r,s,a){var l=[$o(e),_i.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(s,10)];return a&&l.push(parseInt(a,10)),l}function $o(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function zo(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Go(e,t,n){if(e){var r=wi.indexOf(e),s=new Date(t[0],t[1],t[2]).getDay();if(r!==s)return I(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Qo(e,t,n){if(e)return Vo[e];if(t)return 0;var r=parseInt(n,10),s=r%100,a=(r-s)/100;return a*60+s}function Ri(e){var t=Ho.exec(zo(e._i)),n;if(t){if(n=Uo(t[4],t[3],t[2],t[5],t[6],t[7]),!Go(t[1],n,e))return;e._a=n,e._tzm=Qo(t[8],t[9],t[10]),e._d=Rt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),I(e).rfc2822=!0}else e._isValid=!1}function qo(e){var t=Bo.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Ni(e),e._isValid===!1)delete e._isValid;else return;if(Ri(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:p.createFromInputFallback(e)}p.createFromInputFallback=Ue("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function rn(e,t,n){return e??t??n}function As(e,t,n){var r=Object.prototype.hasOwnProperty.call(e,"_isDefaultDatePartsForWeek"),s=e._isDefaultDatePartsForWeek;e._isDefaultDatePartsForWeek=!!n;try{return p._getDefaultDateParts(e,t,n)}finally{r?e._isDefaultDatePartsForWeek=s:delete e._isDefaultDatePartsForWeek}}function Zo(e){var t=e._defaultDatePartsNow;return t?(t.hasValue||(t.value=p.now(),t.hasValue=!0),t.value):p.now()}function Ko(e,t,n){var r=n||e._isDefaultDatePartsForWeek,s=r?ue(t):new Date(t);return r?[s.year(),s.month(),s.date()]:e._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}p._getDefaultDateParts=Ko;function qr(e){var t,n,r=[],s,a,l,o,c;if(!e._d){for((e._a[ve]==null||e._a[Ie]==null||e._a[Pe]==null)&&(s=Zo(e),a=As(e,s)),e._w&&e._a[Pe]==null&&e._a[Ie]==null&&Jo(e,As(e,s,!0)),e._dayOfYear!=null&&(o=e._a[ve]!=null?e._a[ve]:a[ve],(e._dayOfYear>an(o)||e._dayOfYear===0)&&(I(e)._overflowDayOfYear=!0),n=Rt(o,0,e._dayOfYear),e._a[Ie]=n.getUTCMonth(),e._a[Pe]=n.getUTCDate()),c=e._a[ve]==null||e._a[Ie]==null||e._a[Pe]==null,t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=a[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[ke]===24&&e._a[He]===0&&e._a[at]===0&&e._a[jt]===0&&(e._nextDay=!0,e._a[ke]=0),e._d=(e._useUTC?Rt:ko).apply(null,r),l=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ke]=24),e._w&&typeof e._w.d<"u"&&!c&&e._w.d!==l&&(I(e).weekdayMismatch=!0)}}function Jo(e,t){var n,r,s,a,l,o,c,d,y;n=e._w,n.GG!=null||n.W!=null||n.E!=null?(l=1,o=4,r=rn(n.GG,e._a[ve],Fs(t[ve],t[Ie],t[Pe],1,4).year),s=rn(n.W,1),a=rn(n.E,1),(a<1||a>7)&&(d=!0)):(l=e._locale._week.dow,o=e._locale._week.doy,y=Fs(t[ve],t[Ie],t[Pe],l,o),r=rn(n.gg,e._a[ve],y.year),s=rn(n.w,y.week),n.d!=null?(a=n.d,(a<0||a>6)&&(d=!0)):n.e!=null?(a=n.e+l,(n.e<0||n.e>6)&&(d=!0)):a=l),s<1||s>ot(r,l,o)?I(e)._overflowWeeks=!0:d!=null?I(e)._overflowWeekday=!0:(c=Mi(r,s,a,l,o),e._a[ve]=c.year,e._dayOfYear=c.dayOfYear)}p.ISO_8601=function(){};p.RFC_2822=function(){};function Zr(e){if(e._f===p.ISO_8601){Ni(e);return}if(e._f===p.RFC_2822){Ri(e);return}e._a=[],I(e).empty=!0;var t=""+e._i,n,r,s,a,l,o=t.length,c=0,d,y;for(s=di(e._f,e._locale).match(Er)||[],y=s.length,n=0;n<y;n++)a=s[n],r=(t.match(wl(a,e))||[])[0],r&&(l=t.substr(0,t.indexOf(r)),l.length>0&&I(e).unusedInput.push(l),t=t.slice(t.indexOf(r)+r.length),c+=r.length),Ut[a]?(r?I(e).empty=!1:I(e).unusedTokens.push(a),bl(a,r,e)):e._strict&&!r&&I(e).unusedTokens.push(a);I(e).charsLeftOver=o-c,t.length>0&&I(e).unusedInput.push(t),e._a[ke]<=12&&I(e).bigHour===!0&&e._a[ke]>0&&(I(e).bigHour=void 0),I(e).parsedDateParts=e._a.slice(0),I(e).meridiem=e._meridiem,e._a[ke]=Xo(e._locale,e._a[ke],e._meridiem),d=I(e).era,d!==null&&(e._a[ve]=e._locale.erasConvertYear(d,e._a[ve])),qr(e),Qr(e)}function Xo(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function eu(e){var t,n,r,s,a,l,o=!1,c={},d=e._f.length;if(d===0){I(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;s<d;s++)a=0,l=!1,t=Tr({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._defaultDatePartsNow=c,t._f=e._f[s],Zr(t),Yr(t)&&(l=!0),a+=I(t).charsLeftOver,a+=I(t).unusedTokens.length*10,I(t).score=a,o?a<r&&(r=a,n=t):(r==null||a<r||l)&&(r=a,n=t,l&&(o=!0));Xe(e,n||t)}function tu(e){if(!e._d){var t=Ir(e._i),n=t.day===void 0?t.date:t.day;e._a=oi([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),qr(e)}}function nu(e){var t=new yn(Qr(Pi(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Pi(e){var t=e._i,n=e._f;return e._locale=e._locale||ct(e._l),t===null||n===void 0&&t===""?mn({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ee(t)?new yn(Qr(t)):(hn(t)?e._d=t:Qe(n)?eu(e):n?Zr(e):ru(e),Yr(e)||(e._d=null),e))}function ru(e){var t=e._i;Re(t)?e._d=new Date(p.now()):hn(t)?e._d=new Date(t.valueOf()):typeof t=="string"?qo(e):Qe(t)?(e._a=oi(t.slice(0),function(n){return parseInt(n,10)}),qr(e)):Ot(t)?tu(e):ut(t)?e._d=new Date(t):p.createFromInputFallback(e)}function Yi(e,t,n,r,s){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Ot(e)&&Pr(e)||Qe(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=s,a._l=n,a._i=e,a._f=t,a._strict=r,nu(a)}function ue(e,t,n,r){return Yi(e,t,n,r,!1)}var su=Ue("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ue.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:mn()}),iu=Ue("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ue.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:mn()});function Ti(e,t){var n,r;if(t.length===1&&Qe(t[0])&&(t=t[0]),!t.length)return ue();for(r=0;r<t.length;++r)if(Ee(t[r])){n=t[r];break}if(!n)return mn();for(++r;r<t.length;++r)Ee(t[r])&&(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function au(){var e=[].slice.call(arguments,0);return Ti("isBefore",e)}function lu(){var e=[].slice.call(arguments,0);return Ti("isAfter",e)}var ou=function(){return Date.now?Date.now():+new Date},sn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function uu(e){var t,n=!1,r,s=sn.length;for(t in e)if(W(e,t)&&!(_e.call(sn,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<s;++r)if(e[sn[r]]){if(n)return!1;parseFloat(e[sn[r]])!==A(e[sn[r]])&&(n=!0)}return!0}function cu(){return this._isValid}function du(){return qe(NaN)}function Zn(e){var t=Ir(e),n=t.year||0,r=t.quarter||0,s=t.month||0,a=t.week||t.isoWeek||0,l=t.day||0,o=t.hour||0,c=t.minute||0,d=t.second||0,y=t.millisecond||0;this._isValid=uu(t),this._milliseconds=+y+d*1e3+c*6e4+o*1e3*60*60,this._days=+l+a*7,this._months=+s+r*3+n*12,this._data={},this._locale=ct(),this._bubble()}function Rn(e){return e instanceof Zn}function Mr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function fu(e,t,n){var r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),a=0,l;for(l=0;l<r;l++)A(e[l])!==A(t[l])&&a++;return a+s}function Ii(e,t){O(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Ve(~~(n/60),2)+t+Ve(~~n%60,2)})}Ii("Z",":");Ii("ZZ","");M("Z",Gn);M("ZZ",Gn);ne(["Z","ZZ"],function(e,t,n){var r=Kr(Gn,e);n._useUTC=!0,n._tzm=r,r===null&&(I(n).invalidOffset=e)});var hu=/([\+\-]|\d\d)/gi;function Kr(e,t){var n=(t||"").match(e),r,s,a;return n===null||(r=n[n.length-1]||[],s=(r+"").match(hu)||["-",0,0],a=+(s[1]*60)+A(s[2]),A(s[2])>59||(s[0]==="+"?a>14*60:a>12*60))?null:a===0?0:s[0]==="+"?a:-a}function Jr(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ee(e)||hn(e)?e.valueOf():ue(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),p.updateOffset(n,!1),n):ue(e).local()}function Cr(e){return-Math.round(e._d.getTimezoneOffset())}p.updateOffset=function(){};function mu(e,t,n){var r=this._offset||0,s;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Kr(Gn,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(s=Cr(this)),this._offset=e,this._isUTC=!0,s!=null&&this.add(s,"m"),r!==e&&(!t||this._changeInProgress?Ai(this,qe(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,p.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Cr(this)}function yu(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function gu(e){return this.utcOffset(0,e)}function _u(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Cr(this),"m")),this}function vu(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Kr(xl,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function pu(e){return this.isValid()?(e=e?ue(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function xu(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ku(){if(!Re(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Tr(e,this),e=Pi(e),e._a?(t=e._isUTC?tt(e._a):ue(e._a),this._isDSTShifted=this.isValid()&&fu(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function wu(){return this.isValid()?!this._isUTC:!1}function Su(){return this.isValid()?this._isUTC:!1}function Ei(){return this.isValid()?this._isUTC&&this._offset===0:!1}var bu=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Mu=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function qe(e,t){var n=e,r=null,s,a,l;return Rn(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ut(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=bu.exec(e))?(s=r[1]==="-"?-1:1,n={y:0,d:A(r[Pe])*s,h:A(r[ke])*s,m:A(r[He])*s,s:A(r[at])*s,ms:A(Mr(r[jt]*1e3))*s}):(r=Mu.exec(e))?(s=r[1]==="-"?-1:1,n={y:Dt(r[2],s),M:Dt(r[3],s),w:Dt(r[4],s),d:Dt(r[5],s),h:Dt(r[6],s),m:Dt(r[7],s),s:Dt(r[8],s)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(l=Cu(ue(n.from),ue(n.to)),n={},n.ms=l.milliseconds,n.M=l.months),a=new Zn(n),Rn(e)&&W(e,"_locale")&&(a._locale=e._locale),Rn(e)&&W(e,"_isValid")&&(a._isValid=e._isValid),a}qe.fn=Zn.prototype;qe.invalid=du;function Dt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Ls(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Cu(e,t){var n;return e.isValid()&&t.isValid()?(t=Jr(t,e),e.isBefore(t)?n=Ls(e,t):(n=Ls(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fi(e,t){return function(n,r){var s,a;return r!==null&&!isNaN(+r)&&(ci(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),s=qe(n,r),Ai(this,s,e),this}}function Ai(e,t,n,r){var s=t._milliseconds,a=Mr(t._days),l=Mr(t._months);e.isValid()&&(r=r??!0,l&&pi(e,un(e,"Month")+l*n),a&&gi(e,"Date",un(e,"Date")+a*n),s&&e._d.setTime(e._d.valueOf()+s*n),r&&p.updateOffset(e,a||l))}var Du=Fi(1,"add"),ju=Fi(-1,"subtract");function Li(e){return typeof e=="string"||e instanceof String}function Ou(e){return Ee(e)||hn(e)||Li(e)||ut(e)||Ru(e)||Nu(e)||e===null||e===void 0}function Nu(e){var t=Ot(e)&&!Pr(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,a,l=r.length;for(s=0;s<l;s+=1)a=r[s],n=n||W(e,a);return t&&n}function Ru(e){var t=Qe(e),n=!1;return t&&(n=e.filter(function(r){return!ut(r)&&Li(e)}).length===0),t&&n}function Pu(e){var t=Ot(e)&&!Pr(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,a;for(s=0;s<r.length;s+=1)a=r[s],n=n||W(e,a);return t&&n}function Yu(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Tu(e,t){arguments.length===1&&(arguments[0]?Ou(arguments[0])?(e=arguments[0],t=void 0):Pu(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ue(),r=Jr(n,this).startOf("day"),s=p.calendarFormat(this,r)||"sameElse",a=t&&(nt(t[s])?t[s].call(this,n):t[s]);return this.format(a||this.localeData().calendar(s,this,ue(n)))}function Iu(){return new yn(this)}function Eu(e,t){var n=Ee(e)?e:ue(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Fu(e,t){var n=Ee(e)?e:ue(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Au(e,t,n,r){var s=Ee(e)?e:ue(e),a=Ee(t)?t:ue(t);return this.isValid()&&s.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(s,n):!this.isBefore(s,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Lu(e,t){var n=Ee(e)?e:ue(e),r;return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Wu(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Bu(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Hu(e,t,n){var r,s,a;if(!this.isValid())return NaN;if(r=Jr(e,this),!r.isValid())return NaN;switch(s=(r.utcOffset()-this.utcOffset())*6e4,t=$e(t),t){case"year":a=Pn(this,r)/12;break;case"month":a=Pn(this,r);break;case"quarter":a=Pn(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-s)/864e5;break;case"week":a=(this-r-s)/6048e5;break;default:a=this-r}return n?a:We(a)}function Pn(e,t){if(e.date()<t.date())return-Pn(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),s,a;return t-r<0?(s=e.clone().add(n-1,"months"),a=(t-r)/(r-s)):(s=e.clone().add(n+1,"months"),a=(t-r)/(s-r)),-(n+a)||0}p.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";p.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Vu(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Uu(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Nn(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):nt(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Nn(n,"Z")):Nn(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function $u(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,s,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+s+a)}function zu(e){e||(e=this.isUtc()?p.defaultFormatUtc:p.defaultFormat);var t=Nn(this,e);return this.localeData().postformat(t)}function Gu(e,t){return this.isValid()&&(Ee(e)&&e.isValid()||ue(e).isValid())?qe({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Qu(e){return this.from(ue(),e)}function qu(e,t){return this.isValid()&&(Ee(e)&&e.isValid()||ue(e).isValid())?qe({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Zu(e){return this.to(ue(),e)}function Wi(e){var t;return e===void 0?this._locale._abbr:(t=ct(e),t!=null&&(this._locale=t),this)}var Bi=Ue("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Hi(){return this._locale}var Fn=1e3,$t=60*Fn,An=60*$t,Vi=(365*400+97)*24*An;function zt(e,t){return(e%t+t)%t}function Ui(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Vi:new Date(e,t,n).valueOf()}function $i(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Vi:Date.UTC(e,t,n)}function Ku(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?$i:Ui,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=zt(t+(this._isUTC?0:this.utcOffset()*$t),An);break;case"minute":t=this._d.valueOf(),t-=zt(t,$t);break;case"second":t=this._d.valueOf(),t-=zt(t,Fn);break}return this._d.setTime(t),p.updateOffset(this,!0),this}function Ju(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?$i:Ui,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=An-zt(t+(this._isUTC?0:this.utcOffset()*$t),An)-1;break;case"minute":t=this._d.valueOf(),t+=$t-zt(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Fn-zt(t,Fn)-1;break}return this._d.setTime(t),p.updateOffset(this,!0),this}function Xu(){return this._d.valueOf()-(this._offset||0)*6e4}function ec(){return Math.floor(this.valueOf()/1e3)}function tc(){return new Date(this.valueOf())}function nc(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function rc(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function sc(){return this.isValid()?this.toISOString():null}function ic(){return Yr(this)}function ac(){return Xe({},I(this))}function lc(){return I(this).overflow}function oc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}O("N",0,0,"eraAbbr");O("NN",0,0,"eraAbbr");O("NNN",0,0,"eraAbbr");O("NNNN",0,0,"eraName");O("NNNNN",0,0,"eraNarrow");O("y",["y",1],"yo","eraYear");O("y",["yy",2],0,"eraYear");O("y",["yyy",3],0,"eraYear");O("y",["yyyy",4],0,"eraYear");M("N",Xr);M("NN",Xr);M("NNN",Xr);M("NNNN",pc);M("NNNNN",xc);ne(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var s=n._locale.erasParse(e,r,n._strict);s?I(n).era=s:I(n).invalidEra=e});M("y",Zt);M("yy",Zt);M("yyy",Zt);M("yyyy",Zt);M("yo",kc);ne(["y","yy","yyy","yyyy"],ve);ne(["yo"],function(e,t,n,r){var s;n._locale._eraYearOrdinalRegex&&(s=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ve]=n._locale.eraYearOrdinalParse(e,s):t[ve]=parseInt(e,10)});function uc(e,t){var n,r,s,a=this._eras||ct("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":s=p(a[n].since).startOf("day"),a[n].since=s.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":s=p(a[n].until).startOf("day").valueOf(),a[n].until=s.valueOf();break}}return a}function cc(e,t,n){var r,s,a=this.eras(),l,o,c;for(e=e.toUpperCase(),r=0,s=a.length;r<s;++r)if(l=a[r].name.toUpperCase(),o=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(o===e)return a[r];break;case"NNNN":if(l===e)return a[r];break;case"NNNNN":if(c===e)return a[r];break}else if([l,o,c].indexOf(e)>=0)return a[r]}function dc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?p(e.since).year():p(e.since).year()+(t-e.offset)*n}function fc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function hc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function mc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function yc(){var e,t,n,r,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,r=this.clone().startOf("day").valueOf(),s[e].since<=r&&r<=s[e].until||s[e].until<=r&&r<=s[e].since)return(this.year()-p(s[e].since).year())*n+s[e].offset;return this.year()}function gc(e){return W(this,"_erasNameRegex")||es.call(this),e?this._erasNameRegex:this._erasRegex}function _c(e){return W(this,"_erasAbbrRegex")||es.call(this),e?this._erasAbbrRegex:this._erasRegex}function vc(e){return W(this,"_erasNarrowRegex")||es.call(this),e?this._erasNarrowRegex:this._erasRegex}function Xr(e,t){return t.erasAbbrRegex(e)}function pc(e,t){return t.erasNameRegex(e)}function xc(e,t){return t.erasNarrowRegex(e)}function kc(e,t){return t._eraYearOrdinalRegex||Zt}function es(){var e=[],t=[],n=[],r=[],s,a,l,o,c,d=this.eras();for(s=0,a=d.length;s<a;++s)l=lt(d[s].name),o=lt(d[s].abbr),c=lt(d[s].narrow),t.push(l),e.push(o),n.push(c),r.push(l),r.push(o),r.push(c);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}O(0,["gg",2],0,function(){return this.weekYear()%100});O(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Kn(e,t){O(0,[e,e.length],0,t)}Kn("gggg","weekYear");Kn("ggggg","weekYear");Kn("GGGG","isoWeekYear");Kn("GGGGG","isoWeekYear");M("G",zn);M("g",zn);M("GG",ae,Ae);M("gg",ae,Ae);M("GGGG",Lr,Fr);M("gggg",Lr,Fr);M("GGGGG",$n,Vn);M("ggggg",$n,Vn);Jt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=A(e)});Jt(["gg","GG"],function(e,t,n,r){t[r]=p.parseTwoDigitYear(e)});function wc(e){return zi.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Sc(e){return zi.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function bc(){return ot(this.year(),1,4)}function Mc(){return ot(this.isoWeekYear(),1,4)}function Cc(){var e=this.localeData()._week;return ot(this.year(),e.dow,e.doy)}function Dc(){var e=this.localeData()._week;return ot(this.weekYear(),e.dow,e.doy)}function zi(e,t,n,r,s){var a;return e==null?$r(this,r,s).year:(a=ot(e,r,s),t>a&&(t=a),jc.call(this,e,t,n,r,s))}function jc(e,t,n,r,s){var a=Mi(e,t,n,r,s),l=Rt(a.year,0,a.dayOfYear);return this.year(l.getUTCFullYear()),this.month(l.getUTCMonth()),this.date(l.getUTCDate()),this}O("Q",0,"Qo","quarter");M("Q",fi);ne("Q",function(e,t){t[Ie]=(A(e)-1)*3});function Oc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}O("D",["DD",2],"Do","date");M("D",ae,Kt);M("DD",ae,Ae);M("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});ne(["D","DD"],Pe);ne("Do",function(e,t){t[Pe]=A(e.match(ae)[0])});var Gi=Xt("Date",!0);O("DDD",["DDDD",3],"DDDo","dayOfYear");M("DDD",Un);M("DDDD",hi);ne(["DDD","DDDD"],function(e,t,n){n._dayOfYear=A(e)});function Nc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}O("m",["mm",2],0,"minute");M("m",ae,Wr);M("mm",ae,Ae);ne(["m","mm"],He);var Rc=Xt("Minutes",!1);O("s",["ss",2],0,"second");M("s",ae,Wr);M("ss",ae,Ae);ne(["s","ss"],at);var Pc=Xt("Seconds",!1);O("S",0,0,function(){return~~(this.millisecond()/100)});O(0,["SS",2],0,function(){return~~(this.millisecond()/10)});O(0,["SSS",3],0,"millisecond");O(0,["SSSS",4],0,function(){return this.millisecond()*10});O(0,["SSSSS",5],0,function(){return this.millisecond()*100});O(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});O(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});O(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});O(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});M("S",Un,fi);M("SS",Un,Ae);M("SSS",Un,hi);var xt,Qi;for(xt="SSSS";xt.length<=9;xt+="S")M(xt,Zt);function Yc(e,t){t[jt]=A(("0."+e)*1e3)}for(xt="S";xt.length<=9;xt+="S")ne(xt,Yc);Qi=Xt("Milliseconds",!1);O("z",0,0,"zoneAbbr");O("zz",0,0,"zoneName");function Tc(){return this._isUTC?"UTC":""}function Ic(){return this._isUTC?"Coordinated Universal Time":""}var m=yn.prototype;m.add=Du;m.calendar=Tu;m.clone=Iu;m.diff=Hu;m.endOf=Ju;m.format=zu;m.from=Gu;m.fromNow=Qu;m.to=qu;m.toNow=Zu;m.get=jl;m.invalidAt=lc;m.isAfter=Eu;m.isBefore=Fu;m.isBetween=Au;m.isSame=Lu;m.isSameOrAfter=Wu;m.isSameOrBefore=Bu;m.isValid=ic;m.lang=Bi;m.locale=Wi;m.localeData=Hi;m.max=iu;m.min=su;m.parsingFlags=ac;m.set=Ol;m.startOf=Ku;m.subtract=ju;m.toArray=nc;m.toObject=rc;m.toDate=tc;m.toISOString=Uu;m.inspect=$u;typeof Symbol<"u"&&Symbol.for!=null&&(m[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});m.toJSON=sc;m.toString=Vu;m.unix=ec;m.valueOf=Xu;m.creationData=oc;m.eraName=fc;m.eraNarrow=hc;m.eraAbbr=mc;m.eraYear=yc;m.year=yi;m.isLeapYear=Dl;m.weekYear=wc;m.isoWeekYear=Sc;m.quarter=m.quarters=Oc;m.month=xi;m.daysInMonth=Ll;m.week=m.weeks=Co;m.isoWeek=m.isoWeeks=Do;m.weeksInYear=Cc;m.weeksInWeekYear=Dc;m.isoWeeksInYear=bc;m.isoWeeksInISOWeekYear=Mc;m.date=Gi;m.day=m.days=to;m.weekday=no;m.isoWeekday=ro;m.dayOfYear=Nc;m.hour=m.hours=Ro;m.minute=m.minutes=Rc;m.second=m.seconds=Pc;m.millisecond=m.milliseconds=Qi;m.utcOffset=mu;m.utc=gu;m.local=_u;m.parseZone=vu;m.hasAlignedHourOffset=pu;m.isDST=xu;m.isLocal=wu;m.isUtcOffset=Su;m.isUtc=Ei;m.isUTC=Ei;m.zoneAbbr=Tc;m.zoneName=Ic;m.dates=Ue("dates accessor is deprecated. Use date instead.",Gi);m.months=Ue("months accessor is deprecated. Use month instead",xi);m.years=Ue("years accessor is deprecated. Use year instead",yi);m.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yu);m.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ku);function Ec(e){return ue(e*1e3)}function Fc(){return ue.apply(null,arguments).parseZone()}function qi(e){return e}var q=Ur.prototype;q.calendar=uo;q.longDateFormat=fo;q.invalidDate=mo;q.ordinal=_o;q.preparse=qi;q.postformat=qi;q.relativeTime=po;q.pastFuture=xo;q.set=lo;q.eras=uc;q.erasParse=cc;q.erasConvertYear=dc;q.erasAbbrRegex=_c;q.erasNameRegex=gc;q.erasNarrowRegex=vc;q.months=Il;q.monthsShort=El;q.monthsParse=Al;q.monthsRegex=Bl;q.monthsShortRegex=Wl;q.week=wo;q.firstDayOfYear=Mo;q.firstDayOfWeek=bo;q.weekdays=Zl;q.weekdaysMin=Jl;q.weekdaysShort=Kl;q.weekdaysParse=eo;q.weekdaysRegex=so;q.weekdaysShortRegex=io;q.weekdaysMinRegex=ao;q.isPM=Oo;q.meridiem=Po;function Ln(e,t,n,r){var s=ct(),a=tt().set(r,t);return s[n](a,e)}function Zi(e,t,n){if(ut(e)&&(t=e,e=void 0),e=e||"",t!=null)return Ln(e,t,n,"month");var r,s=[];for(r=0;r<12;r++)s[r]=Ln(e,r,n,"month");return s}function ts(e,t,n,r){typeof e=="boolean"?(ut(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ut(t)&&(n=t,t=void 0),t=t||"");var s=ct(),a=e?s._week.dow:0,l,o=[];if(n!=null)return Ln(t,(n+a)%7,r,"day");for(l=0;l<7;l++)o[l]=Ln(t,(l+a)%7,r,"day");return o}function Ac(e,t){return Zi(e,t,"months")}function Lc(e,t){return Zi(e,t,"monthsShort")}function Wc(e,t,n){return ts(e,t,n,"weekdays")}function Bc(e,t,n){return ts(e,t,n,"weekdaysShort")}function Hc(e,t,n){return ts(e,t,n,"weekdaysMin")}kt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=A(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});p.lang=Ue("moment.lang is deprecated. Use moment.locale instead.",kt);p.langData=Ue("moment.langData is deprecated. Use moment.localeData instead.",ct);var st=Math.abs;function Vc(){var e=this._data;return this._milliseconds=st(this._milliseconds),this._days=st(this._days),this._months=st(this._months),e.milliseconds=st(e.milliseconds),e.seconds=st(e.seconds),e.minutes=st(e.minutes),e.hours=st(e.hours),e.months=st(e.months),e.years=st(e.years),this}function Ki(e,t,n,r){var s=qe(t,n);return e._milliseconds+=r*s._milliseconds,e._days+=r*s._days,e._months+=r*s._months,e._bubble()}function Uc(e,t){return Ki(this,e,t,1)}function $c(e,t){return Ki(this,e,t,-1)}function Ws(e){return e<0?Math.floor(e):Math.ceil(e)}function zc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,s,a,l,o,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Ws(Dr(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,s=We(e/1e3),r.seconds=s%60,a=We(s/60),r.minutes=a%60,l=We(a/60),r.hours=l%24,t+=We(l/24),c=We(Ji(t)),n+=c,t-=Ws(Dr(c)),o=We(n/12),n%=12,r.days=t,r.months=n,r.years=o,this}function Ji(e){return e*4800/146097}function Dr(e){return e*146097/4800}function Gc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=$e(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+Ji(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dr(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function dt(e){return function(){return this.as(e)}}var Xi=dt("ms"),Qc=dt("s"),qc=dt("m"),Zc=dt("h"),Kc=dt("d"),Jc=dt("w"),Xc=dt("M"),ed=dt("Q"),td=dt("y"),nd=Xi;function rd(){return qe(this)}function sd(e){return e=$e(e),this.isValid()?this[e+"s"]():NaN}function Yt(e){return function(){return this.isValid()?this._data[e]:NaN}}var id=Yt("milliseconds"),ad=Yt("seconds"),ld=Yt("minutes"),od=Yt("hours"),ud=Yt("days"),cd=Yt("months"),dd=Yt("years");function fd(){return We(this.days()/7)}var it=Math.round,Vt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function hd(e,t,n,r,s){return Si.call(s,t||1,!!n,e,r)}function md(e,t,n,r){var s=qe(e).abs(),a=it(s.as("s")),l=it(s.as("m")),o=it(s.as("h")),c=it(s.as("d")),d=it(s.as("M")),y=it(s.as("w")),x=it(s.as("y")),C=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||l<=1&&["m"]||l<n.m&&["mm",l]||o<=1&&["h"]||o<n.h&&["hh",o]||c<=1&&["d"]||c<n.d&&["dd",c];return n.w!=null&&(C=C||y<=1&&["w"]||y<n.w&&["ww",y]),C=C||d<=1&&["M"]||d<n.M&&["MM",d]||x<=1&&["y"]||["yy",x],C[2]=t,C[3]=+e>0,C[4]=r,hd.apply(null,C)}function yd(e){return e===void 0?it:typeof e=="function"?(it=e,!0):!1}function gd(e,t){return Vt[e]===void 0?!1:t===void 0?Vt[e]:(Vt[e]=t,e==="s"&&(Vt.ss=t-1),!0)}function _d(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Vt,s,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Xe(Xe({},Vt),t||{}),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),s=this.localeData(),a=md(this,!n,r,s),n&&(a=bi.call(s,+this,a)),s.postformat(a)}var yr=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Jn(){if(!this.isValid())return this.localeData().invalidDate();var e=yr(this._milliseconds)/1e3,t=yr(this._days),n=yr(this._months),r,s,a,l,o=this.asSeconds(),c,d,y,x;return o?(r=We(e/60),s=We(r/60),e%=60,r%=60,a=We(n/12),n%=12,l=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=o<0?"-":"",d=Wt(this._months)!==Wt(o)?"-":"",y=Wt(this._days)!==Wt(o)?"-":"",x=Wt(this._milliseconds)!==Wt(o)?"-":"",c+"P"+(a?d+a+"Y":"")+(n?d+n+"M":"")+(t?y+t+"D":"")+(s||r||e?"T":"")+(s?x+s+"H":"")+(r?x+r+"M":"")+(e?x+l+"S":"")):"P0D"}var V=Zn.prototype;V.isValid=cu;V.abs=Vc;V.add=Uc;V.subtract=$c;V.as=Gc;V.asMilliseconds=Xi;V.asSeconds=Qc;V.asMinutes=qc;V.asHours=Zc;V.asDays=Kc;V.asWeeks=Jc;V.asMonths=Xc;V.asQuarters=ed;V.asYears=td;V.valueOf=nd;V._bubble=zc;V.clone=rd;V.get=sd;V.milliseconds=id;V.seconds=ad;V.minutes=ld;V.hours=od;V.days=ud;V.weeks=fd;V.months=cd;V.years=dd;V.humanize=_d;V.toISOString=Jn;V.toString=Jn;V.toJSON=Jn;V.locale=Wi;V.localeData=Hi;V.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jn);V.lang=Bi;O("X",0,0,"unix");O("x",0,0,"valueOf");M("x",zn);M("X",kl);ne("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});ne("x",function(e,t,n){n._d=new Date(A(e))});//! moment.js
|
|
11
|
+
p.version="2.31.0";ml(ue);p.fn=m;p.min=au;p.max=lu;p.now=ou;p.utc=tt;p.unix=Ec;p.months=Ac;p.isDate=hn;p.locale=kt;p.invalid=mn;p.duration=qe;p.isMoment=Ee;p.weekdays=Wc;p.parseZone=Fc;p.localeData=ct;p.isDuration=Rn;p.monthsShort=Lc;p.weekdaysMin=Hc;p.defineLocale=Gr;p.updateLocale=Eo;p.locales=Fo;p.weekdaysShort=Bc;p.normalizeUnits=$e;p.relativeTimeRounding=yd;p.relativeTimeThreshold=gd;p.calendarFormat=Yu;p.prototype=m;p.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const vd=[{label:"是",value:!0},{label:"否",value:!1}];function Dn(e){const t=p();return[t.clone().subtract(e,"day"),t]}function ea(e){const[t,n]=u.useState(7),r=e.valueFormat??"YYYY-MM-DD",s=e.op===N.Operator.Between||e.op===N.Operator.NotBetween,a=e.op===N.Operator.In||e.op===N.Operator.NotIn,l=e.value,o=typeof l=="string"?l:"",c=typeof l=="number"?l:void 0,d=typeof l=="boolean"?l:void 0,y=typeof l=="string"||typeof l=="number"||typeof l=="boolean"?l:void 0,x=Array.isArray(l)?l:[],C=Array.isArray(l)&&l.length===2&&typeof l[0]=="string"&&typeof l[1]=="string"?[p(l[0]),p(l[1])]:null,w=Array.isArray(l)&&typeof l[0]=="number"?l[0]:void 0,D=Array.isArray(l)&&typeof l[1]=="number"?l[1]:void 0,B=(e.options??[]).map(S=>({label:S.label,value:S.value})),P=S=>{var U;return(U=e.onChange)==null?void 0:U.call(e,S)},Z=()=>{const S=t;if(!S||S<1)return;const[U,Q]=Dn(S);P([U.format(r),Q.format(r)])};let E;e.fieldType==="string"&&a?E=i.jsx(f.Select,{mode:"tags",value:x,onChange:S=>P(S),tokenSeparators:[",",","],placeholder:"输入后回车添加",style:{width:"100%"}}):e.fieldType==="string"?E=i.jsx(f.Input,{value:o,onChange:S=>P(S.target.value),placeholder:"请输入",allowClear:!0}):e.fieldType==="number"&&s?E=i.jsxs(i.Fragment,{children:[i.jsx(f.InputNumber,{className:"yk-advanced-value-editor__num",value:w,onChange:S=>P([S??null,D??null]),placeholder:"最小值",controls:!1}),i.jsx("span",{className:"yk-advanced-value-editor__sep",children:"~"}),i.jsx(f.InputNumber,{className:"yk-advanced-value-editor__num",value:D,onChange:S=>P([w??null,S??null]),placeholder:"最大值",controls:!1})]}):e.fieldType==="number"?E=i.jsx(f.InputNumber,{value:c,onChange:S=>P(S??null),placeholder:"请输入数字",controls:!1,style:{width:"100%"}}):e.fieldType==="date"&&s?E=i.jsxs(i.Fragment,{children:[i.jsx(f.DatePicker.RangePicker,{className:"yk-advanced-value-editor__daterange-picker",value:C,format:r,placeholder:["开始日期","结束日期"],ranges:{"最近 7 天":Dn(7),"最近 30 天":Dn(30),"最近 90 天":Dn(90)},onChange:(S,U)=>{P(S?[U[0],U[1]]:null)}}),i.jsx(f.Popover,{trigger:"click",placement:"bottom",content:i.jsxs("div",{className:"yk-advanced-value-editor__recent-pop",children:[i.jsx("span",{children:"最近"}),i.jsx(f.InputNumber,{className:"yk-advanced-value-editor__recent-input",value:t,onChange:S=>n(typeof S=="number"?S:1),min:1,controls:!1}),i.jsx("span",{children:"天"}),i.jsx(f.Button,{type:"primary",size:"small",onClick:Z,children:"应用"})]}),children:i.jsx(f.Button,{className:"yk-advanced-value-editor__recent-trigger",style:{flex:"0 0 auto"},children:"最近 N 天"})})]}):e.fieldType==="date"?E=i.jsx(f.DatePicker,{value:typeof l=="string"?p(l):null,format:r,onChange:(S,U)=>P(U||null),placeholder:"选择日期",allowClear:!0}):e.fieldType==="boolean"?E=i.jsx(f.Select,{value:d,options:vd.map(S=>({label:S.label,value:S.value})),onChange:S=>P(S),placeholder:"请选择",allowClear:!0}):e.fieldType==="enum"&&a?E=i.jsx(f.Select,{mode:"multiple",value:x,options:B,onChange:S=>P(S),placeholder:"请选择",allowClear:!0,loading:e.optionsLoading}):E=i.jsx(f.Select,{value:y,options:B,onChange:S=>P(S??null),placeholder:"请选择",allowClear:!0,loading:e.optionsLoading});const G=["yk-advanced-value-editor",s?"yk-advanced-value-editor--range":"",e.fieldType==="date"&&s?"yk-advanced-value-editor--daterange":"",e.className??""].filter(Boolean).join(" ");return i.jsx("div",{className:G,children:E})}function ns(e){const t=u.useContext(hl);if(!t)return null;const{group:n,level:r=0}=e,s=o=>{(o==="and"||o==="or")&&t.api.setGroupCombinator(n.id,o)},a=o=>t.columns.find(c=>c.propertyPath===o),l=o=>{var c;return((c=a(o))==null?void 0:c.displayFormat)??"YYYY-MM-DD"};return i.jsxs("div",{className:`yk-adv-group level-${r}${r===0?" is-root":""}`,children:[i.jsxs("div",{className:"yk-adv-group__header",children:[i.jsx("span",{className:"yk-adv-group__comb-label",children:"满足"}),i.jsxs(f.Radio.Group,{size:"small",value:n.combinator,onChange:o=>s(o.target.value),children:[i.jsx(f.Radio.Button,{value:"and",children:"全部"}),i.jsx(f.Radio.Button,{value:"or",children:"任一"})]}),i.jsx("span",{className:"yk-adv-group__comb-label",children:"条件"}),i.jsxs("span",{className:"yk-adv-group__actions",children:[i.jsx(f.Button,{type:"link",onClick:()=>t.api.addLeaf(n.id),children:"+ 条件"}),i.jsx(f.Button,{type:"link",onClick:()=>t.api.addNestedGroup(n.id),children:"+ 嵌套组"}),r>0&&i.jsx(f.Button,{type:"link",danger:!0,onClick:()=>t.api.removeNode(n.id),children:"删除组"})]})]}),i.jsxs("div",{className:"yk-adv-group__children",children:[n.children.map(o=>{if(N.isConditionGroup(o))return i.jsx("div",{className:"yk-adv-group__nested",children:i.jsx(ns,{group:o,level:r+1})},o.id);const c=o;return i.jsxs("div",{className:"yk-adv-group__row",children:[i.jsx(f.Select,{className:"yk-adv-group__field",value:c.propertyPath||void 0,options:t.columns.map(d=>({label:d.displayName??d.propertyPath,value:d.propertyPath})),placeholder:"选择字段",showSearch:!0,optionFilterProp:"label",onChange:d=>t.api.changeField(c.id,d)}),i.jsx(f.Select,{className:"yk-adv-group__op",value:c.op,options:t.api.operatorsOf(c.propertyPath).map(d=>({label:N.OPERATOR_LABELS[d]??String(d),value:d})),placeholder:"操作符",showSearch:!0,optionFilterProp:"label",onChange:d=>t.api.changeOperator(c.id,d)}),!N.isNullOperator(c.op)&&i.jsx(ea,{className:["yk-adv-group__value",t.api.isConditionEmpty(c)?"is-invalid":""].filter(Boolean).join(" "),fieldType:t.api.fieldTypeOf(c.propertyPath),op:c.op,value:c.value,options:t.optionsMap[c.propertyPath]??[],optionsLoading:t.loadingMap[c.propertyPath]===!0,valueFormat:l(c.propertyPath),onChange:d=>t.updateValue(c.id,d)}),i.jsx(f.Button,{className:"yk-adv-group__remove",type:"link",danger:!0,onClick:()=>t.api.removeNode(c.id),children:"删除"})]},c.id)}),n.children.length===0&&i.jsx("div",{className:"yk-adv-group__empty",children:"暂无条件,点击「+ 条件」或「+ 嵌套组」"})]})]})}const ta=u.forwardRef(function(t,n){const r=t.showSearch??!0,s=t.showReset??!0,a=t.searchButtonText??"查询",l=t.resetButtonText??"重置",o=t.showSaveQuery??!0,c=J.useAdvancedFilter({columns:t.columns,optionSources:t.optionSources}),{rootGroup:d,fieldTypeOf:y,filter:x,reset:C}=c,[w,D]=u.useState({}),[B,P]=u.useState({}),Z=u.useRef({}),E=u.useRef({}),G=k=>{var pe;const K=(pe=t.optionSources)==null?void 0:pe[k];K&&(Z.current[k]||E.current[k]||(E.current={...E.current,[k]:!0},P(E.current),K().then(Oe=>{Z.current={...Z.current,[k]:Oe},D(Z.current)}).finally(()=>{E.current={...E.current,[k]:!1},P(E.current)})))},S=k=>{const K=new Set,pe=Oe=>{N.isConditionGroup(Oe)?Oe.children.forEach(pe):y(Oe.propertyPath)==="enum"&&K.add(Oe.propertyPath)};return k.children.forEach(pe),[...K]};u.useEffect(()=>{for(const k of S(d))G(k)},[d,y,t.optionSources]);const[U,Q]=u.useState([]),ce=t.savedQueries??U,Ce=k=>{var K;Q(k),(K=t.onUpdateSavedQueries)==null||K.call(t,k)},[re,ye]=u.useState(!1),[le,X]=u.useState(""),[de,ie]=u.useState(""),we=u.useRef(0),$=()=>{const k=K=>K.children.some(pe=>N.isConditionGroup(pe)?k(pe):c.isConditionEmpty(pe));return k(d)},h=()=>{X(""),ie(""),ye(!0)},R=()=>{const k=le.trim();if(!k)return;$()&&f.message.warning("当前存在未填值的条件行(标红),保存的预设可能不完整");const K=JSON.parse(JSON.stringify(d)),pe={id:`sq-${++we.current}`,name:k,description:de.trim(),group:K,filterInfo:x};Ce([...ce,pe]),ye(!1)},L=u.useRef(!1),[H,Y]=u.useState(0),oe=k=>{const K=JSON.parse(JSON.stringify(k.group));Object.assign(d,K),c.setGroupCombinator(d.id,d.combinator),L.current=!0,Y(pe=>pe+1)};u.useEffect(()=>{var k;L.current&&(L.current=!1,(k=t.onSearch)==null||k.call(t,x))},[H,x]);const se=k=>{Ce(ce.filter(K=>K.id!==k))},fe=()=>{var k;return(k=t.onSearch)==null?void 0:k.call(t,x)},g=()=>{var k;C(),(k=t.onReset)==null||k.call(t)};return u.useImperativeHandle(n,()=>({get filter(){return x},reset:g,openSaveDialog:h,applySavedQuery:oe,removeSavedQuery:se,get savedQueries(){return ce}}),[x,ce,d]),t.columns,i.jsxs("div",{className:"yk-advanced-filter",onKeyDown:k=>{k.key==="Enter"&&fe()},children:[i.jsx(ns,{group:d,level:0}),(r||s||o)&&i.jsxs("div",{className:"yk-advanced-filter__actions",children:[r&&i.jsx(f.Button,{type:"primary",onClick:fe,children:a}),s&&i.jsx(f.Button,{onClick:g,children:l}),o&&i.jsx(f.Button,{onClick:h,children:"保存"})]}),i.jsxs(f.Modal,{open:re,title:"保存查询",width:440,onCancel:()=>ye(!1),onOk:R,okText:"确定",cancelText:"取消",okButtonProps:{disabled:!le.trim()},children:[i.jsxs("div",{className:"yk-advanced-filter__form-item",children:[i.jsx("label",{className:"yk-advanced-filter__form-label",children:"名称"}),i.jsx(f.Input,{value:le,onChange:k=>X(k.target.value),placeholder:"请输入查询名称",maxLength:50,showCount:!0,onPressEnter:R})]}),i.jsxs("div",{className:"yk-advanced-filter__form-item",children:[i.jsx("label",{className:"yk-advanced-filter__form-label",children:"描述"}),i.jsx(f.Input.TextArea,{value:de,onChange:k=>ie(k.target.value),rows:2,placeholder:"可选,描述此查询的用途(hover 标签时显示)",maxLength:200,showCount:!0})]})]})]})}),na=u.forwardRef(function(t,n){const r=J.useFilterPanel(),s=u.useRef(r);s.current=r;const a=u.useMemo(()=>({get filter(){return s.current.filter},reset:()=>s.current.reset(),register:r.register,notify:r.notify}),[r.register,r.notify]),l=u.useMemo(()=>{const o=[];t.extraFilter&&o.push(t.extraFilter);const c=r.filter;return c&&!c.isEmpty()&&o.push(c),o.length===0?N.emptyFilter():o.length===1?o[0]:N.FilterInfo.createAnd(...o)},[t.extraFilter,r.filter]);return u.useImperativeHandle(n,()=>({filter:l,reset:()=>r.reset()}),[l,r]),i.jsx(J.FilterPanelContext.Provider,{value:a,children:t.children})});function pd(e,t){const n=new Map;for(const r of e)n.set(r.propertyPath,N.inferColumnFieldType(r,(t==null?void 0:t[r.propertyPath])!==void 0));return r=>n.get(r)??"string"}function xd(e,t){if(N.isNullOperator(e.op))return!1;const n=t(e.propertyPath),r=e.value;return N.isRangeOperator(e.op)?!Array.isArray(r)||r.length!==2?!0:r[0]===null||r[0]===void 0||r[0]===""||r[1]===null||r[1]===void 0||r[1]==="":N.isMultiValueOperator(e.op)?!Array.isArray(r)||r.length===0:n==="boolean"||n==="number"||n==="date"?r==null||r==="":r==null||typeof r=="string"&&r.trim()===""}function kd(e,t){if(xd(e,t))return null;if(e.op==="is_null"){const n=t(e.propertyPath);return n==="string"?N.FilterInfo.createOr(N.filter(e.propertyPath,N.Operator.Equals,Le.con(null)),N.filter(e.propertyPath,N.Operator.Equals,Le.con(""))):n==="array"?N.FilterInfo.createOr(N.filter(e.propertyPath,N.Operator.Equals,Le.con(null)),N.filter(`${e.propertyPath}.count`,N.Operator.Equals,Le.con(0))):N.filter(e.propertyPath,N.Operator.Equals,Le.con(null))}if(e.op==="is_not_null"){const n=t(e.propertyPath);return n==="string"?N.FilterInfo.createAnd(N.filter(e.propertyPath,N.Operator.NotEquals,Le.con(null)),N.filter(e.propertyPath,N.Operator.NotEquals,Le.con(""))):n==="array"?N.FilterInfo.createAnd(N.filter(e.propertyPath,N.Operator.NotEquals,Le.con(null)),N.filter(`${e.propertyPath}.count`,N.Operator.GreaterThan,Le.con(0))):N.filter(e.propertyPath,N.Operator.NotEquals,Le.con(null))}return N.filter(e.propertyPath,e.op,Le.con(e.value))}function ra(e,t){if(N.isConditionGroup(e)){const n=e.children.map(r=>ra(r,t)).filter(r=>r!==null);return n.length===0?null:n.length===1?n[0]:e.combinator==="or"?N.FilterInfo.createOr(...n):N.FilterInfo.createAnd(...n)}return kd(e,t)}function wd(e,t,n){const r=pd(t,n);return ra(e,r)??N.emptyFilter()}const sa=u.forwardRef(function(t,n){const r=t.showSearch??!0,s=t.showReset??!0,a=t.searchButtonText??"查询",l=t.resetButtonText??"重置",o=t.enableAdvancedFilter??!1,c=t.advancedColumns??[],d=t.showQuickQuery??!1,y=t.singleLine??!1,x=u.useRef(null),C=u.useRef(null),[w,D]=u.useState("simple"),[B,P]=u.useState(!0),[Z,E]=u.useState(0),G=u.useRef(null),[S,U]=u.useState([]),Q=t.quickQueries??S,ce=()=>{var h,R;return w==="advanced"?((h=C.current)==null?void 0:h.filter)??N.emptyFilter():((R=x.current)==null?void 0:R.filter)??N.emptyFilter()},Ce=()=>{var h;return(h=t.onSearch)==null?void 0:h.call(t,ce())},re=()=>{var h,R,L;w==="advanced"?(h=C.current)==null||h.reset():(R=x.current)==null||R.reset(),(L=t.onReset)==null||L.call(t)};u.useImperativeHandle(n,()=>({get filter(){return ce()},get mode(){return w},reset:re}),[w]);const ye=h=>{var R;U(h),(R=t.onUpdateQuickQueries)==null||R.call(t,h)},le=async h=>{const R=new Set(Q.map(H=>H.id)),L=h.filter(H=>!R.has(H.id));if(t.saveQuickQueryFun&&L.length>0){const H=[];for(const oe of L)try{const se=await t.saveQuickQueryFun(oe);H.push(se??oe)}catch{f.message.error(`保存快速查询「${oe.name}」失败`),H.push(oe)}let Y=h;if(H.some((oe,se)=>oe!==L[se])){const oe=new Map(L.map((se,fe)=>[se.id,H[fe]??se]));Y=h.map(se=>oe.get(se.id)??se)}ye(Y)}else ye(h)};u.useEffect(()=>{if(!t.loadQuickQueryFun)return;let h=!1;return t.loadQuickQueryFun().then(R=>{var H;if(h)return;const L=R.map(Y=>({...Y,filterInfo:Y.filterInfo??wd(Y.group,c,t.advancedOptionSources)}));U(L),(H=t.onUpdateQuickQueries)==null||H.call(t,L)}).catch(()=>{h||f.message.error("加载快速查询失败")}),()=>{h=!0}},[]);const X=h=>{var R,L;w==="advanced"?(R=C.current)==null||R.applySavedQuery(h):(L=t.onSearch)==null||L.call(t,h.filterInfo)},de=h=>{const R=Q.find(H=>H.id===h),L=(R==null?void 0:R.name)??"该查询";f.Modal.confirm({title:"删除确认",content:`确定要删除快速查询「${L}」吗?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{le(Q.filter(H=>H.id!==h))}})},ie=()=>{const h=G.current;if(!h)return;for(const fe of Array.from(h.children))fe.style.display="";if(!y||!B){E(0),h.style.maxWidth="";return}const R=h.nextElementSibling,L=R?R.offsetWidth:0,H=16;h.style.maxWidth=`calc(100% - ${L+H}px)`;const Y=h.clientWidth;let oe=0,se=0;for(const fe of Array.from(h.children)){const g=fe,k=g.offsetWidth;oe>0&&oe+k+H>Y?(g.style.display="none",se++):oe+=k+H}E(se)};u.useEffect(()=>{ie();const h=G.current;if(!h)return;const R=new ResizeObserver(()=>ie());return R.observe(h),()=>R.disconnect()},[y,B,w]);const we=()=>P(h=>!h),$=B?i.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"6 9 12 15 18 9"}),i.jsx("polyline",{points:"6 14 12 20 18 14"})]}):i.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"18 15 12 9 6 15"}),i.jsx("polyline",{points:"18 10 12 4 6 10"})]});return i.jsx("div",{className:["yk-filter-panel",y?"is-single-line":"",y&&B?"is-collapsed":""].filter(Boolean).join(" "),onKeyDown:h=>{h.key==="Enter"&&w==="simple"&&Ce()},children:w==="simple"?i.jsxs(i.Fragment,{children:[y&&i.jsx(f.Button,{type:"text",className:"yk-filter-panel__toggle","aria-label":B?"展开更多条件":"折叠",title:B?Z?`展开(${Z} 个条件被隐藏)`:"展开":"折叠",onClick:we,children:$}),i.jsx("div",{className:"yk-filter-panel__items",ref:G,children:i.jsx(na,{ref:x,children:t.children})}),(r||s||o)&&i.jsxs("div",{className:"yk-filter-panel__actions",children:[r&&i.jsx(f.Button,{type:"primary",onClick:Ce,children:a}),s&&i.jsx(f.Button,{onClick:re,children:l}),o&&!(y&&B)&&i.jsx(f.Button,{type:"link",onClick:()=>D("advanced"),children:"高级查询"})]}),d&&Q.length>0&&i.jsxs("div",{className:"yk-filter-panel__saved",children:[i.jsx("span",{className:"yk-filter-panel__saved-label",children:"快速查询:"}),Q.map(h=>i.jsx(f.Tooltip,{title:h.description||void 0,children:i.jsx(f.Button,{size:"small",onClick:()=>X(h),children:h.name})},h.id))]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"yk-filter-panel__mode-bar",children:i.jsx(f.Button,{type:"link",onClick:()=>D("simple"),children:"← 简单查询"})}),i.jsx(ta,{ref:C,columns:c,optionSources:t.advancedOptionSources,savedQueries:Q,onSearch:h=>{var R;return(R=t.onSearch)==null?void 0:R.call(t,h)},onReset:()=>{var h;return(h=t.onReset)==null?void 0:h.call(t)},onUpdateSavedQueries:le}),Q.length>0&&i.jsxs("div",{className:"yk-filter-panel__saved",children:[i.jsx("span",{className:"yk-filter-panel__saved-label",children:"已存查询:"}),Q.map(h=>i.jsx(f.Tooltip,{title:h.description||void 0,children:i.jsx(f.Tag,{className:"yk-filter-panel__saved-tag",closable:!0,onClick:()=>X(h),onClose:()=>de(h.id),children:h.name})},h.id))]})]})})});function Sd({count:e,onSelectAll:t,onInvert:n,onClear:r}){return e<=0?null:i.jsxs("div",{className:"yk-table__selection-bar",children:[i.jsxs("span",{className:"yk-table__selection-bar__count",children:["已选 ",e," 项"]}),i.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),i.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:t,children:"全选"}),i.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:n,children:"反选"}),i.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),i.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:r,children:"清空"})]})}function bd(){return i.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),i.jsx("circle",{cx:"9",cy:"6",r:"2.4",fill:"#fff"}),i.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),i.jsx("circle",{cx:"15",cy:"12",r:"2.4",fill:"#fff"}),i.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"}),i.jsx("circle",{cx:"9",cy:"18",r:"2.4",fill:"#fff"})]})}function Md(){return i.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[i.jsx("polyline",{points:"23 4 23 10 17 10"}),i.jsx("polyline",{points:"1 20 1 14 7 14"}),i.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Cd(){return i.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i.jsx("polyline",{points:"7 10 12 15 17 10"}),i.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Dd(){return i.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Bt({checked:e}){return i.jsx("span",{className:"yk-table-action-menu-button__check",children:e?"✓":""})}const rs=u.forwardRef(function({table:t,trigger:n,className:r},s){const[,a]=u.useReducer(c=>c+1,0);function l(c){switch(c){case"refresh":t.refresh();break;case"config":t.openConfigDialog();break;case"export":t.openExportDialog();break;case"view-table":t.setViewMode("table");break;case"view-card":t.setViewMode("card");break;case"view-list":t.setViewMode("list");break;case"toggle-checkbox":t.setSelectable(!t.selectable);break;case"toggle-column-resize":t.setColumnResizable(!t.columnResizable);break;case"toggle-sticky-header":t.setStickyHeader(!t.stickyHeader);break}}const o=[{key:"refresh",label:i.jsxs(i.Fragment,{children:[i.jsx(Md,{}),"刷新"]})},{key:"export",label:i.jsxs(i.Fragment,{children:[i.jsx(Cd,{}),"导出 Excel"]})},{key:"config",label:i.jsxs(i.Fragment,{children:[i.jsx(Dd,{}),"列设置"]})},{type:"divider"},{key:"view-table",label:i.jsxs(i.Fragment,{children:[i.jsx(Bt,{checked:t.viewMode==="table"}),"表格视图"]})},...t.slotNames.includes("card")?[{key:"view-card",label:i.jsxs(i.Fragment,{children:[i.jsx(Bt,{checked:t.viewMode==="card"}),"卡片视图"]})}]:[],...t.slotNames.includes("list")?[{key:"view-list",label:i.jsxs(i.Fragment,{children:[i.jsx(Bt,{checked:t.viewMode==="list"}),"列表视图"]})}]:[],{type:"divider"},{key:"toggle-checkbox",label:i.jsxs(i.Fragment,{children:[i.jsx(Bt,{checked:t.selectable}),"选择行"]})},{key:"toggle-column-resize",label:i.jsxs(i.Fragment,{children:[i.jsx(Bt,{checked:t.columnResizable}),"列宽拖动"]})},{key:"toggle-sticky-header",label:i.jsxs(i.Fragment,{children:[i.jsx(Bt,{checked:t.stickyHeader}),"锁定表头"]})}];return i.jsx(f.Dropdown,{trigger:["click"],placement:"bottomRight",onOpenChange:c=>{c&&a()},overlay:i.jsx(f.Menu,{items:o,onClick:({key:c})=>l(c)}),children:n?i.jsx("span",{className:"yk-table-action-menu-button__trigger",children:n}):i.jsx(f.Button,{ref:s,className:`yk-table-action-menu-button__btn${r?` ${r}`:""}`,title:"表格操作","aria-label":"表格操作",children:i.jsx(bd,{})})})});rs.displayName="YsTableActionMenuButton";function ia({actions:e,table:t=null,showActionMenuButton:n=!0,children:r}){const[s,a]=u.useState(null);async function l(o){if(!(!t||s!==null)){a(o.name);try{await o.execute(t)}finally{a(null)}}}return i.jsxs("div",{className:"yk-command-bar",children:[i.jsxs("div",{className:"yk-command-bar__actions",children:[e.map(o=>i.jsx(f.Button,{...Nr(o.type,o.plain),icon:Wn(o.icon),loading:s===o.name,disabled:s!==null&&s!==o.name,onClick:()=>void l(o),children:o.desc},o.name)),t&&i.jsx(Sd,{count:t.selectedRows.length,onSelectAll:()=>t.selectAllOnPage(),onInvert:()=>t.invertSelectionOnPage(),onClear:()=>t.clearSelection()}),r]}),n&&t&&i.jsx(rs,{table:t,className:"yk-command-bar__menu"})]})}const jd=[10,20,50,100],Od=[],Nd=[],Rd=[],Pd=[],Yd=[];function Bs(e){if(e!=null)return typeof e=="function"?e:()=>e}function gr(e){return typeof e=="function"?e():e}const aa=u.forwardRef(function(t,n){const{metaFun:r,dataFun:s,rowActionsFunc:a,pageSize:l=20,pageSizes:o=jd,showCheckbox:c=!1,columnResizable:d=!0,stickyHeader:y=!1,loadCustomConfigFun:x,saveCustomConfigFun:C,exportPageSize:w=1e3,exportorFunc:D,rowKey:B="id",viewMode:P="table",actions:Z=Nd,showActionMenuButton:E=!0,showSearch:G=!0,showReset:S=!0,searchButtonText:U="查询",resetButtonText:Q="重置",enableAdvancedFilter:ce=!1,advancedColumns:Ce=Od,advancedOptionSources:re,showQuickQuery:ye=!1,quickQueries:le,loadQuickQueryFun:X,saveQuickQueryFun:de,singleLine:ie=!1}=t,we=u.useRef(N.emptyFilter()),$=u.useRef(null),[h,R]=u.useState(null),L=u.useRef(null),H=u.useCallback(g=>{$.current=g,R(g)},[]),Y=u.useCallback(()=>$.current,[]),oe=u.useCallback((g,k)=>s(g,we.current,k),[s]),se=u.useCallback(g=>{var k,K;we.current=g,(k=t.onSearch)==null||k.call(t,g),(K=$.current)==null||K.reload()},[t.onSearch]),fe=u.useCallback(()=>{var g,k;we.current=N.emptyFilter(),(g=t.onReset)==null||g.call(t),(k=$.current)==null||k.reload()},[t.onReset]);return u.useImperativeHandle(n,()=>({get table(){return Y()},get filterPanel(){return L.current},get meta(){var g;return((g=Y())==null?void 0:g.meta)??null},get paged(){var g;return((g=Y())==null?void 0:g.paged)??null},get currentPage(){var g;return((g=Y())==null?void 0:g.currentPage)??1},get viewMode(){var g;return((g=Y())==null?void 0:g.viewMode)??"table"},get selectable(){var g;return((g=Y())==null?void 0:g.selectable)??!1},get columnResizable(){var g;return((g=Y())==null?void 0:g.columnResizable)??!0},get stickyHeader(){var g;return((g=Y())==null?void 0:g.stickyHeader)??!1},get slotNames(){var g;return((g=Y())==null?void 0:g.slotNames)??Yd},get selectedRows(){var g;return((g=Y())==null?void 0:g.selectedRows)??Rd},get rows(){var g;return((g=Y())==null?void 0:g.rows)??Pd},reload:()=>{var g;(g=Y())==null||g.reload()},refresh:()=>{var g;(g=Y())==null||g.refresh()},setViewMode:g=>{var k;(k=Y())==null||k.setViewMode(g)},setSelectable:g=>{var k;(k=Y())==null||k.setSelectable(g)},setColumnResizable:g=>{var k;(k=Y())==null||k.setColumnResizable(g)},setStickyHeader:g=>{var k;(k=Y())==null||k.setStickyHeader(g)},clearSelection:()=>{var g;(g=Y())==null||g.clearSelection()},selectAllOnPage:()=>{var g;(g=Y())==null||g.selectAllOnPage()},invertSelectionOnPage:()=>{var g;(g=Y())==null||g.invertSelectionOnPage()},openConfigDialog:()=>{var g;(g=Y())==null||g.openConfigDialog()},openExportDialog:()=>{var g;(g=Y())==null||g.openExportDialog()}}),[Y]),i.jsxs("div",{className:"yk-table-page",children:[i.jsx("div",{className:"yk-table-page__filter",children:i.jsx(sa,{ref:L,showSearch:G,showReset:S,searchButtonText:U,resetButtonText:Q,enableAdvancedFilter:ce,advancedColumns:Ce,advancedOptionSources:re,showQuickQuery:ye,quickQueries:le,loadQuickQueryFun:X,saveQuickQueryFun:de,singleLine:ie,onSearch:se,onReset:fe,onUpdateQuickQueries:t.onUpdateQuickQueries,children:t.children})}),i.jsx("div",{className:"yk-table-page__command",children:i.jsx(ia,{actions:Z,table:h,showActionMenuButton:E,children:t.commandBar})}),i.jsx("div",{className:"yk-table-page__table",children:i.jsx($s,{ref:H,metaFun:r,dataFun:oe,rowActionsFunc:a,pageSize:l,pageSizes:o,showCheckbox:c,columnResizable:d,stickyHeader:y,loadCustomConfigFun:x,saveCustomConfigFun:C,exportPageSize:w,exportorFunc:D,rowKey:B,viewMode:P,onDataLoaded:t.onDataLoaded,onUpdateViewMode:t.onUpdateViewMode,onUpdateShowCheckbox:t.onUpdateShowCheckbox,onUpdateColumnResizable:t.onUpdateColumnResizable,onUpdateStickyHeader:t.onUpdateStickyHeader,card:Bs(t.card),list:Bs(t.list),empty:gr(t.empty),loading:gr(t.loading),footer:gr(t.footer)})})]})});aa.displayName="YsTablePage";const la=u.forwardRef(function(t,n){const{dataFun:r,pageSize:s=20,threshold:a=100,rowKey:l="id",height:o="100%",immediate:c=!0,showCheckbox:d=!1,metaFun:y,exportorFunc:x,exportPageSize:C=1e3}=t,[w,D]=u.useState([]),[B,P]=u.useState(!1),[Z,E]=u.useState(!1),[G,S]=u.useState(!0),[U,Q]=u.useState(null),[ce,Ce]=u.useState(0),[re,ye]=u.useState(null),le=u.useRef([]),X=u.useRef(!1),de=u.useRef(!1),ie=u.useRef(!0),we=u.useRef(null),$=u.useRef(t.dataFun),h=u.useRef(t.metaFun),R=u.useRef(s),L=u.useRef({onDataLoaded:t.onDataLoaded,onError:t.onError,onSelectionChange:t.onSelectionChange});$.current=t.dataFun,h.current=t.metaFun,R.current=s,we.current=re,L.current={onDataLoaded:t.onDataLoaded,onError:t.onError,onSelectionChange:t.onSelectionChange};const H=J.useSelection({rows:w,rowKey:l}),Y=u.useRef(H);Y.current=H;const oe=u.useRef(!1);u.useEffect(()=>{var F,me;if(!oe.current){oe.current=!0;return}(me=(F=L.current).onSelectionChange)==null||me.call(F,[...H.selectedRows])},[H.selectedRows]);const se=u.useCallback(async F=>{var me,ee,xe,mt;if(F){if(de.current||X.current||!ie.current)return;de.current=!0,E(!0)}else{if(X.current)return;X.current=!0,P(!0),Q(null)}try{const yt=F?le.current.length:0,Ge=await $.current({limit:R.current,offset:yt}),Tt=Ge.items,It=F?[...le.current,...Tt]:Tt;le.current=It,D(It);const Et=Ge.hasNext??!1;ie.current=Et,S(Et),Ge.totalCount!=null&&Ce(Ge.totalCount),(ee=(me=L.current).onDataLoaded)==null||ee.call(me,Ge,F)}catch(yt){Q(yt),(mt=(xe=L.current).onError)==null||mt.call(xe,yt)}finally{F?(de.current=!1,E(!1)):(X.current=!1,P(!1))}},[]),fe=u.useCallback(()=>{se(!0)},[se]),g=u.useCallback(()=>{ie.current=!0,S(!0),se(!1)},[se]),k=u.useCallback(async()=>{const F=h.current;if(!F){ye(null);return}try{ye(await F())}catch{ye(null)}},[]),K=u.useRef(null),pe=u.useRef(null);u.useEffect(()=>{const F=K.current,me=pe.current;if(!F||!me||typeof IntersectionObserver>"u")return;const ee=new IntersectionObserver(xe=>{xe.some(mt=>mt.isIntersecting)&&ie.current&&!X.current&&!de.current&&fe()},{root:F,rootMargin:`0px 0px ${a}px 0px`,threshold:0});return ee.observe(me),()=>ee.disconnect()},[a,fe]),u.useEffect(()=>{k(),c&&se(!1)},[]);const Oe=u.useRef(t.dataFun);u.useEffect(()=>{Oe.current!==t.dataFun&&(Oe.current=t.dataFun,g())},[t.dataFun,g]);const rt=u.useRef(t.metaFun);u.useEffect(()=>{rt.current!==t.metaFun&&(rt.current=t.metaFun,k())},[t.metaFun,k]);const Ze=u.useMemo(()=>{if(re)return re.columns.map((ee,xe)=>({column:ee,index:xe})).filter(({column:ee})=>ee.showForDisplay!==!1).sort((ee,xe)=>(ee.column.displayOrder??ee.index)-(xe.column.displayOrder??xe.index)).map(({column:ee})=>ee);const F=new Set,me=[];for(const ee of w)for(const xe of Object.keys(ee))F.has(xe)||(F.add(xe),me.push({propertyPath:xe}));return me},[re,w]),en=(re==null?void 0:re.displayName)??"数据",he=J.useExportExcel({props:{dataFun:r,exportSelected:d,exportorFunc:x},tableName:en,columns:Ze,currentRows:w,selectedRows:H.selectedRows,total:ce,exportPageSize:C,hasMorePage:G,pageScopeLabel:"导出当前已加载"}),ze=u.useRef(he);ze.current=he;const Ke=u.useCallback(()=>{ze.current.onExportClick()},[]);u.useImperativeHandle(n,()=>({get items(){return le.current},get loading(){return X.current},get loadingMore(){return de.current},get hasMore(){return ie.current},get meta(){return we.current},get selectedRows(){return Y.current.selectedRows},get rows(){return le.current},reload:g,refresh:g,loadNextPage:fe,isRowSelected:F=>Y.current.isRowSelected(F),toggleRowSelection:(F,me)=>Y.current.toggleRowSelection(F,me),clearSelection:()=>Y.current.clearSelection(),selectAllOnPage:()=>Y.current.selectAllOnPage(),invertSelectionOnPage:()=>Y.current.invertSelectionOnPage(),openExportDialog:Ke}),[fe,Ke,g]);function bt(F,me){const ee=t.children;return typeof ee=="function"?ee(F,me):ee??i.jsx("pre",{className:"yk-infinite-list__item-json",children:JSON.stringify(F,null,2)})}const ft=t.error,ht=typeof ft=="function"?ft({error:U}):ft;return i.jsxs("div",{ref:K,className:"yk-infinite-list",style:{height:o},children:[w.map((F,me)=>i.jsxs("div",{className:`yk-infinite-list__item${d&&H.isRowSelected(F)?" is-selected":""}`,children:[d?i.jsx(f.Checkbox,{className:"yk-infinite-list__item-checkbox",checked:H.isRowSelected(F),onChange:ee=>H.toggleRowSelection(F,ee.target.checked)}):null,i.jsx("div",{className:"yk-infinite-list__item-body",children:bt(F,me)})]},String(F[l]))),U?i.jsx("div",{className:"yk-infinite-list__status",children:ht??i.jsx(f.Empty,{description:`加载失败:${String(U)}`,children:i.jsx(f.Button,{type:"primary",onClick:g,children:"重试"})})}):!B&&w.length===0?i.jsx("div",{className:"yk-infinite-list__status",children:t.empty??i.jsx(f.Empty,{description:"暂无数据"})}):null,i.jsx("div",{ref:pe,className:"yk-infinite-list__sentinel"}),Z?i.jsx("div",{className:"yk-infinite-list__loading-more",children:t.loading??i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"yk-infinite-list__spinner"}),i.jsx("span",{children:"加载中..."})]})}):null,!G&&w.length>0&&!B?i.jsx("div",{className:"yk-infinite-list__no-more",children:t.noMore??i.jsx("span",{children:"— 没有更多了 —"})}):null,i.jsx(Us,{open:he.exportDialogVisible,options:he.exportOptions,exporting:he.exporting,fetched:he.exportFetched,total:he.exportTotal,totalKnown:he.exportTotalKnown,percent:he.exportPercent,etaSeconds:he.exportEtaSeconds,cancelledVisible:he.exportCancelledVisible,cancelledRows:he.exportCancelledRows,onExport:F=>void he.doExport(F),onCancelExport:he.cancelExport,onKeepPartial:()=>void he.keepPartialExport(),onDiscardPartial:()=>void he.discardPartialExport(),onClose:he.closeExportDialog})]})});la.displayName="YsInfiniteList";function Td(e){return e.icon?i.jsx("i",{className:"yk-main-panel__menu-icon",children:e.icon}):void 0}function jr(e){const t=[];for(const n of e){const r=Td(n),s=i.jsx("span",{className:"yk-main-panel__menu-text",children:n.label});n.children&&n.children.length>0?t.push({key:n.key,icon:r,label:s,children:jr(n.children)}):t.push({key:n.key,icon:r,label:s})}return t}function Id(){return i.jsx("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14","aria-hidden":"true",className:"yk-main-panel__search-icon",children:i.jsx("path",{fill:"currentColor",d:"M909.098 839.904l-181.22-181.248a341.5 341.5 0 1 0-47.734 48.58l180.56 180.588a33.92 33.92 0 0 0 48.394-47.92zM454.4 745.6a291.2 291.2 0 1 1 291.2-291.2 291.2 291.2 0 0 1-291.2 291.2z"})})}function Ed({nodesFunc:e,componentMap:t,defaultActive:n="",showMenuSearch:r=!0,menuKeyword:s="",onUpdateMenuKeyword:a,onTabChange:l}){const[o,c]=u.useState(!1),[d,y]=u.useState(s);u.useEffect(()=>{y(s)},[s]);const x=h=>{y(h),a==null||a(h)},C=d.trim().length>0,{nodes:w,menuLoading:D}=J.useMainPanelNodes({nodesFunc:e}),{openTabs:B,activeKey:P,setActiveKey:Z,openTab:E,removeTab:G,getComponent:S}=J.useMainPanelTabs({componentMap:t}),U=u.useMemo(()=>J.filterNodesByKeyword(w,d),[w,d]),Q=u.useMemo(()=>J.collectGroupKeys(U),[U]),ce=u.useMemo(()=>jr(w),[w]),Ce=u.useMemo(()=>jr(U),[U]),re=({key:h})=>{const R=J.findNode(w,h);R&&!J.isGroupNode(R)&&E(R)},ye=u.useRef(w),le=u.useRef(!1),X=u.useRef(!1);u.useEffect(()=>{if(!le.current)if(w!==ye.current)le.current=!0;else return;if(X.current||(X.current=!0,!n))return;const h=J.findNode(w,n);h&&!J.isGroupNode(h)&&E(h)},[w,n,E]);const de=u.useRef(P),ie=u.useRef(l);ie.current=l,u.useEffect(()=>{var h;de.current!==P&&(de.current=P,(h=ie.current)==null||h.call(ie,P))},[P]);const we=B.map(h=>{const R=h.componentPath?S(h.componentPath):null;return{key:h.key,label:h.label,closable:!0,forceRender:!0,children:R?i.jsx(u.Suspense,{fallback:i.jsx("div",{className:"yk-main-panel__loading",children:i.jsx(f.Spin,{size:"small"})}),children:i.jsx(R,{...h.props??{}})}):null}}),$="yk-main-panel__menu";return i.jsxs("div",{className:"yk-main-panel",children:[i.jsxs("aside",{className:`yk-main-panel__aside${o?" is-collapsed":""}`,children:[i.jsxs("div",{className:"yk-main-panel__aside-header",children:[i.jsx(f.Button,{type:"text",size:"small",className:"yk-main-panel__collapse-btn",title:o?"展开菜单":"折叠菜单",onClick:()=>c(h=>!h),children:"☰"}),r&&!o&&i.jsx(f.Input,{className:"yk-main-panel__aside-search",size:"small",allowClear:!0,placeholder:"搜索功能","aria-label":"搜索功能",value:d,prefix:i.jsx(Id,{}),onChange:h=>x(h.target.value)})]}),i.jsx("div",{className:"yk-main-panel__menu-wrap",children:i.jsx(f.Spin,{spinning:D,size:"small",children:C?i.jsxs(i.Fragment,{children:[i.jsx(f.Menu,{mode:"inline",className:$,inlineCollapsed:o,items:Ce,selectedKeys:P?[P]:[],defaultOpenKeys:Q,onClick:re},`search-${d}`),U.length===0&&!D&&i.jsx("div",{className:"yk-main-panel__menu-empty",children:"未找到匹配的功能"})]}):i.jsx(f.Menu,{mode:"inline",className:$,inlineCollapsed:o,items:ce,selectedKeys:P?[P]:[],onClick:re},"full")})})]}),i.jsx("main",{className:"yk-main-panel__main",children:B.length>0?i.jsx(f.Tabs,{className:"yk-main-panel__tabs",type:"editable-card",hideAdd:!0,activeKey:P,items:we,onChange:h=>Z(h),onEdit:(h,R)=>{R==="remove"&&typeof h!="object"&&G(h)}}):i.jsx("div",{className:"yk-main-panel__empty",children:i.jsx(f.Empty,{description:"暂无打开的功能,从左侧菜单选择"})})})]})}function _n(e){J.useFilterItem(e.api);const t=e.minWidth??200;return i.jsxs("div",{className:"yk-filter-item",style:{minWidth:`${t}px`},children:[i.jsx("label",{className:"yk-filter-item__label",children:e.label}),i.jsx("div",{className:"yk-filter-item__control",children:e.children})]})}const Fd=u.forwardRef(function(t,n){const{value:r,setValue:s,filter:a,reset:l}=J.useTextFilterItem(t),o=u.useMemo(()=>({get filter(){return a},reset:l}),[a,l]);return u.useImperativeHandle(n,()=>o,[o]),i.jsx(_n,{label:t.label,api:o,children:i.jsx(f.Input,{value:r,onChange:c=>s(c.target.value),placeholder:t.placeholder,allowClear:!0})})}),Ad=u.forwardRef(function(t,n){const{value:r,setValue:s,filter:a,reset:l}=J.useDateFilterItem(t),o=t.valueFormat??"YYYY-MM-DD",c=u.useMemo(()=>({get filter(){return a},reset:l}),[a,l]);return u.useImperativeHandle(n,()=>c,[c]),i.jsx(_n,{label:t.label,api:c,children:i.jsx(f.DatePicker,{value:r?p(r):null,format:o,onChange:(d,y)=>s(typeof y=="string"?y:""),placeholder:t.placeholder,allowClear:!0})})}),Ld=u.forwardRef(function(t,n){const{value:r,setValue:s,filter:a,reset:l}=J.useDateRangeFilterItem({propertyPath:t.propertyPath,defaultValue:t.defaultValue}),o=t.valueFormat??"YYYY-MM-DD",c=u.useMemo(()=>({get filter(){return a},reset:l}),[a,l]);u.useImperativeHandle(n,()=>c,[c]);const d=r&&r.length===2?[p(r[0]),p(r[1])]:null;return i.jsx(_n,{label:t.label,api:c,minWidth:240,children:i.jsx(f.DatePicker.RangePicker,{value:d,format:o,onChange:(y,x)=>{s(y?[x[0],x[1]]:null)},placeholder:[t.startPlaceholder??"开始日期",t.endPlaceholder??"结束日期"],disabledDate:t.disabledDate?y=>{var x;return((x=t.disabledDate)==null?void 0:x.call(t,y.toDate()))??!1}:void 0,allowClear:!0})})}),Wd=u.forwardRef(function(t,n){const{value:r,setValue:s,filter:a,reset:l}=J.useEnumFilterItem({op:t.op,propertyPath:t.propertyPath,defaultValue:t.defaultValue,multiple:t.multiple}),[o,c]=u.useState([]),[d,y]=u.useState(!1),x=u.useRef(t.optionsSource);x.current=t.optionsSource,u.useEffect(()=>{let D=!0;return y(!0),x.current().then(B=>{D&&c(B)}).finally(()=>{D&&y(!1)}),()=>{D=!1}},[]);const C=u.useMemo(()=>({get filter(){return a},reset:l}),[a,l]);u.useImperativeHandle(n,()=>C,[C]);const w=o.map(D=>({label:D.label,value:D.value}));return i.jsx(_n,{label:t.label,api:C,children:t.multiple?i.jsx(f.Select,{mode:"multiple",value:Array.isArray(r)?r:[],options:w,onChange:D=>s(D),placeholder:t.placeholder,allowClear:t.clearable??!0,loading:d}):i.jsx(f.Select,{value:r??void 0,options:w,onChange:D=>s(D??null),placeholder:t.placeholder,allowClear:t.clearable??!0,loading:d})})});function oa(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function Bd({open:e,row:t,columns:n,saver:r,onClose:s,onSaved:a}){const[l,o]=u.useState({}),[c,d]=u.useState([]);u.useEffect(()=>{if(!e||!t)return;const C={};for(const w of n)C[w.name]=oa(t.data[w.name]);o(C),d([])},[e,t,n]);function y(){s==null||s()}function x(){if(!t)return;const C={};for(const B of n)C[B.name]=l[B.name]??"";const{row:w,errors:D}=r(t,C);d(D),!(D.length>0)&&(a==null||a(w),y())}return i.jsxs(f.Modal,{open:e,title:t?`编辑第 ${t.rowNumber} 行`:"编辑数据行",width:480,maskClosable:!1,destroyOnClose:!0,onCancel:y,footer:i.jsxs(i.Fragment,{children:[i.jsx(f.Button,{onClick:y,children:"取消"}),i.jsx(f.Button,{type:"primary",onClick:x,children:"保存并重新校验"})]}),children:[c.length>0?i.jsx(f.Alert,{className:"yk-import-row-edit-dialog__alert",type:"error",showIcon:!0,message:i.jsx(i.Fragment,{children:c.map((C,w)=>i.jsx("div",{children:C},w))})}):null,i.jsx(f.Form,{labelCol:{flex:"0 0 92px"},wrapperCol:{flex:"auto"},children:n.map(C=>i.jsx(f.Form.Item,{label:C.name,required:!C.optional,children:i.jsx(f.Input,{value:l[C.name]??"",placeholder:C.optional?"可留空":`请输入${C.name}`,onChange:w=>o(D=>({...D,[C.name]:w.target.value})),onPressEnter:x})},C.name))})]})}const _r={valid:{label:"待处理"},invalid:{label:"校验失败",color:"red"},processing:{label:"处理中",color:"orange"},success:{label:"成功",color:"green"},failed:{label:"失败",color:"red"}};function Hd(e){const t=Math.max(0,Math.ceil(e/1e3));if(t<60)return`${t} 秒`;const n=Math.floor(t/60),r=t%60;return r>0?`${n} 分 ${r} 秒`:`${n} 分`}function jn(e){var t;return Array.from(((t=e.dataTransfer)==null?void 0:t.types)??[]).includes("Files")}function Vd(){return i.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function Ud(){return i.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("polyline",{points:"3 6 5 6 21 6"}),i.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),i.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),i.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const $d=u.forwardRef(function(t,n){var vn;const{columns:r,processor:s,parser:a,accept:l=".xlsx",autoScroll:o=!0,title:c,maxHeight:d}=t,{rows:y,fileName:x,sheetName:C,loading:w,processing:D,stopping:B,processingTotal:P,progressDone:Z,progressSuccess:E,progressFailed:G,hasData:S,invalidCount:U,selectedCount:Q,pendingCount:ce,loadFile:Ce,syncSelection:re,saveRowEdit:ye,removeRow:le,startProcessing:X,stopProcessing:de,clear:ie}=J.useImportExcel({columns:r,processor:s,parser:a}),we=u.useRef(null),$=u.useRef(null),h=u.useRef(C);h.current=C;const[R,L]=u.useState(0),H=R>0;function Y(v){const b=l.split(",").map(ge=>ge.trim().toLowerCase()).filter(Boolean);if(b.length===0)return!0;const z=v.name.toLowerCase();return b.some(ge=>z.endsWith(ge))}async function oe(v){var b;if(!w){if(!Y(v)){f.message.error(`仅支持 ${l} 格式的文件`);return}try{const z=await Ce(v);(b=t.onLoaded)==null||b.call(t,z),setTimeout(()=>{const ge=h.current;f.message.success(`已加载 ${z.length} 行${ge?`(工作表「${ge}」)`:""}`)},0)}catch(z){f.message.error(z instanceof Error?z.message:String(z))}}}async function se(v){var ge;const b=v.target,z=(ge=b.files)==null?void 0:ge[0];b.value="",z&&await oe(z)}function fe(){var v;(v=we.current)==null||v.click()}function g(v){jn(v)&&L(b=>b+1)}function k(v){jn(v)&&(v.preventDefault(),v.dataTransfer&&(v.dataTransfer.dropEffect="copy"))}function K(v){jn(v)&&L(b=>Math.max(0,b-1))}function pe(v){var z,ge;if(!jn(v))return;v.preventDefault(),L(0);const b=(ge=(z=v.dataTransfer)==null?void 0:z.files)==null?void 0:ge[0];b&&oe(b)}const Oe=u.useRef(0),[rt,Ze]=u.useState(0);u.useEffect(()=>{if(!D)return;Oe.current=Date.now(),Ze(Date.now());const v=setInterval(()=>Ze(Date.now()),500);return()=>clearInterval(v)},[D]);const en=P<=0?0:Math.min(100,Z/P*100),he=!D||Z===0?"预计剩余 计算中…":`预计剩余 ${Hd((rt-Oe.current)/Z*(P-Z))}`,[ze,Ke]=u.useState(360);u.useEffect(()=>{const v=$.current;if(!v)return;const b=()=>{var Ft;const ge=((Ft=v.querySelector(".ant-table-thead"))==null?void 0:Ft.getBoundingClientRect().height)??39;let Mt=Math.max(120,Math.floor(v.clientHeight-ge-1));typeof d=="number"&&(Mt=Math.min(Mt,d)),Ke(Mt)};b();const z=new ResizeObserver(b);return z.observe(v),()=>z.disconnect()},[d,S]);const bt=((vn=y.find(v=>v.status==="processing"))==null?void 0:vn.rowNumber)??null;u.useEffect(()=>{var pn,xn;if(bt===null||!o)return;const v=(pn=$.current)==null?void 0:pn.querySelector(".ant-table-body"),b=(xn=$.current)==null?void 0:xn.querySelector(`.ant-table-tbody tr[data-row-key="${bt}"]`);if(!v||!b)return;const z=v.getBoundingClientRect(),ge=b.getBoundingClientRect(),Mt=Math.max(0,v.scrollHeight-v.clientHeight),Ft=v.scrollTop+(ge.top-z.top)-(v.clientHeight-ge.height)/2;v.scrollTop=Math.min(Mt,Math.max(0,Math.round(Ft)))},[bt,o]);const ft=y.filter(v=>v.selected).map(v=>v.rowNumber);function ht(v){return v.status!=="invalid"}function F(v){var z;const b=y.filter(ge=>v.includes(ge.rowNumber));re(b),(z=t.onSelectionChange)==null||z.call(t,b)}async function me(){var v;try{const b=await X();if(!b)return;if((v=t.onProcessed)==null||v.call(t,b),b.stopped){const z=b.total-b.success-b.failed;f.message.warning(`已停止:成功 ${b.success} 行,失败 ${b.failed} 行,剩余 ${z} 行未处理(可再次「开始处理」续跑)`)}else b.failed===0?f.message.success(`全部处理完成,共 ${b.success} 行`):f.message.warning(`处理完成:成功 ${b.success} 行,失败 ${b.failed} 行`)}catch(b){f.message.error(b instanceof Error?b.message:String(b))}}const[ee,xe]=u.useState(!1),[mt,yt]=u.useState(null);function Ge(v){return!D&&(v.status==="invalid"||v.status==="failed")}function Tt(v){Ge(v)&&(yt(v),xe(!0))}function It(v){var b;(b=t.onRowUpdate)==null||b.call(t,v),f.message.success(`第 ${v.rowNumber} 行已修正,可重新处理`)}function Et(v){Ge(v)&&f.Modal.confirm({title:"删除数据行",content:`确定删除第 ${v.rowNumber} 行吗?删除后不可恢复。`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{var b;le(v),(b=t.onRowRemove)==null||b.call(t,v),f.message.success(`已删除第 ${v.rowNumber} 行`)}})}u.useImperativeHandle(n,()=>({openFilePicker:fe,startProcessing:me,stopProcessing:de,clear:ie}));const Xn=Object.keys(_r).map(v=>({text:`${_r[v].label}(${y.filter(b=>b.status===v).length})`,value:v})),er=[{title:"行号",key:"rowNumber",width:70,align:"center",fixed:"left",render:(v,b,z)=>i.jsx("span",{title:`Excel 第 ${b.rowNumber} 行`,children:z+1})},...r.map(v=>({title:v.name,key:v.name,width:120,ellipsis:{showTitle:!0},render:(b,z)=>oa(z.data[v.name])})),{title:"状态",key:"status",dataIndex:"status",width:200,fixed:"right",className:"yk-import-excel__status-cell",filters:Xn,filterMultiple:!1,onFilter:(v,b)=>b.status===v,render:(v,b)=>{const z=_r[b.status];return i.jsxs(i.Fragment,{children:[i.jsxs(f.Tag,{color:z.color,children:[b.status==="processing"?i.jsx("span",{className:"yk-import-excel__spin"}):null,z.label]}),b.status==="invalid"?i.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:b.errors.join(";")}):b.message?i.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:b.message}):null]})}},{title:"操作",key:"action",width:110,align:"center",fixed:"right",render:(v,b)=>Ge(b)?i.jsxs("div",{className:"yk-import-excel__actions",children:[i.jsx(f.Button,{type:"link",size:"small",icon:i.jsx(Vd,{}),onClick:()=>Tt(b),children:"编辑"}),i.jsx(f.Button,{type:"link",size:"small",danger:!0,icon:i.jsx(Ud,{}),onClick:()=>Et(b),children:"删除"})]}):i.jsx("span",{className:"yk-import-excel__action-placeholder",children:"—"})}],tr={selectedRowKeys:ft,columnWidth:44,getCheckboxProps:v=>({disabled:!ht(v)}),onChange:F};return i.jsxs("div",{className:"yk-import-excel",onDragEnter:g,onDragOver:k,onDragLeave:K,onDrop:pe,children:[i.jsx("input",{ref:we,className:"yk-import-excel__file",type:"file",accept:l,onChange:se}),c?i.jsx("div",{className:"yk-import-excel__title",children:c}):null,i.jsxs("div",{className:"yk-import-excel__toolbar",children:[i.jsx(f.Button,{type:"primary",loading:w,onClick:fe,children:"选择 Excel 文件"}),i.jsxs(f.Button,{type:"primary",loading:D,disabled:ce===0,onClick:me,children:["开始处理",ce>0?`(${ce} 行)`:""]}),D?i.jsx(f.Button,{danger:!0,disabled:B,onClick:de,children:B?"正在停止…":"停止"}):null,i.jsx(f.Button,{disabled:!S||D,onClick:ie,children:"清空"}),x?i.jsxs("span",{className:"yk-import-excel__file-name",title:x,children:[x,C?`(工作表:${C})`:""]}):null,S?i.jsxs("div",{className:"yk-import-excel__stats",children:[i.jsxs("span",{className:"yk-import-excel__stat",children:["共 ",y.length," 行"]}),i.jsxs("span",{className:"yk-import-excel__stat",children:["已选 ",Q]}),i.jsxs("span",{className:"yk-import-excel__stat yk-import-excel__stat--danger",children:["校验失败 ",U]})]}):null]}),D?i.jsxs("div",{className:"yk-import-excel__progress",children:[i.jsx(f.Progress,{className:"yk-import-excel__progress-bar",percent:en,status:"active",format:()=>`${Z}/${P}`}),i.jsxs("span",{className:"yk-import-excel__progress-meta",children:["成功 ",E,i.jsxs("span",{className:"yk-import-excel__danger-text",children:[" ","/ 失败 ",G]})]}),i.jsx("span",{className:"yk-import-excel__progress-eta",children:he})]}):null,i.jsx("div",{ref:$,className:"yk-import-excel__body",children:i.jsx(f.Spin,{spinning:w,wrapperClassName:"yk-import-excel__loading",children:S?i.jsx(f.Table,{className:"yk-import-excel__table",rowKey:"rowNumber",columns:er,dataSource:y,bordered:!0,size:"small",pagination:!1,rowSelection:tr,scroll:{x:"max-content",y:ze},rowClassName:(v,b)=>b%2===1?"yk-import-excel__row-alt":""}):i.jsxs("div",{className:"yk-import-excel__empty",onClick:fe,children:[i.jsxs("svg",{className:"yk-import-excel__empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"}),i.jsx("path",{d:"M12 18v-6"}),i.jsx("polyline",{points:"9.5 14.5 12 12l2.5 2.5"})]}),i.jsx("p",{className:"yk-import-excel__empty-title",children:"点击选择 Excel 文件,或将文件拖拽到此处"}),i.jsxs("p",{className:"yk-import-excel__empty-hint",children:["支持 ",l," 格式,首行需为表头"]})]})})}),H?i.jsx("div",{className:"yk-import-excel__drop-mask",children:i.jsxs("div",{className:"yk-import-excel__drop-tip",children:[i.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M12 15V3"}),i.jsx("polyline",{points:"7 8 12 3 17 8"}),i.jsx("path",{d:"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4"})]}),i.jsx("span",{children:"松开鼠标,加载 Excel 文件"})]})}):null,i.jsx(Bd,{open:ee,row:mt,columns:r,saver:ye,onClose:()=>xe(!1),onSaved:It})]})});var Or,On=Vs;if(process.env.NODE_ENV==="production")Or=On.createRoot,On.hydrateRoot;else{var Hs=On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Or=function(e,t){Hs.usingClientEntryPoint=!0;try{return On.createRoot(e,t)}finally{Hs.usingClientEntryPoint=!1}}}function zd(){return i.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function Gd(){return i.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),i.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10"})]})}const Qd=u.forwardRef(function(t,n){const{title:r,width:s,heightValue:a,component:l,componentProps:o,actions:c,onCancel:d,onClosed:y,closeOnClickModal:x,closeOnPressEscape:C,maximizable:w,defaultMaximized:D,contentRef:B,modalHandle:P,destroy:Z}=t,[E,G]=u.useState(!0),[S,U]=u.useState(-1),[Q,ce]=u.useState(w&&D),Ce=()=>{w&&ce($=>!$)},re=()=>{G(!1)},ye=()=>{S>=0||(d==null||d(),G(!1))},le=async($,h)=>{if(!(S>=0)){U(h);try{await $.execute(P)}finally{U(-1)}}};u.useImperativeHandle(n,()=>({close:re,toggleMaximize:Ce,isMaximized:()=>Q}),[w,Q]);const X=w?i.jsxs("div",{className:"yk-modal__title-row",children:[i.jsx("span",{className:"yk-modal__title-text",children:r}),i.jsx(f.Button,{type:"text",size:"small",className:"yk-modal__maximize",title:Q?"还原":"最大化","aria-label":Q?"还原":"最大化",onClick:Ce,children:Q?i.jsx(Gd,{}):i.jsx(zd,{})})]}):r,de=c&&c.length>0?i.jsx("div",{className:"yk-modal__footer",children:c.map(($,h)=>{const{type:R,danger:L}=Nr($.type);return i.jsx(f.Button,{type:R,danger:L,title:$.desc,disabled:S>=0&&S!==h,loading:S===h,onClick:()=>void le($,h),icon:$.icon?i.jsx("span",{className:"yk-modal__action-icon",children:Wn($.icon)}):void 0,children:$.desc},$.name)})}):null,ie={...Q?{top:0}:{},...a&&!Q?{"--yk-modal-height":a}:{}},we=["yk-modal",Q?"yk-modal--maximized":a?"yk-modal--fixed-height":""].filter(Boolean).join(" ");return i.jsx(f.Modal,{open:E,title:X,width:s,style:ie,wrapClassName:we,closable:S<0,maskClosable:x,keyboard:C,destroyOnClose:!0,onCancel:ye,afterClose:()=>{y==null||y(),Z()},footer:de,children:u.createElement(l,{...o??{},onClose:re,ref:B})})});function qd(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function ua(e){const{title:t="",width:n="500px",height:r,component:s,props:a,actions:l,onCancel:o,onClosed:c,closeOnClickModal:d=!1,closeOnPressEscape:y=!1,maximizable:x=!1,defaultMaximized:C=!1}=e,w=document.createElement("div");document.body.appendChild(w);const D=Or(w);let B=!1;const P=()=>{B||(B=!0,D.unmount(),w.remove())},Z={current:null},E={current:null},G={close:()=>{var S;return(S=Z.current)==null?void 0:S.close()},toggleMaximize:()=>{var S;return(S=Z.current)==null?void 0:S.toggleMaximize()},isMaximized:()=>{var S;return((S=Z.current)==null?void 0:S.isMaximized())??!1},getContentInstance:()=>E.current??null};return D.render(i.jsx(Qd,{ref:Z,title:t,width:n,heightValue:qd(r),component:s,componentProps:a,actions:l,onCancel:o,onClosed:c,closeOnClickModal:d,closeOnPressEscape:y,maximizable:x,defaultMaximized:C,contentRef:E,modalHandle:G,destroy:P})),G}function Zd(e){const{confirmText:t="确定",cancelText:n="取消",confirmType:r="primary",onConfirm:s,...a}=e;return ua({...a,actions:[{name:"cancel",desc:n,execute:o=>o.close()},{name:"confirm",desc:t,type:r,execute:async o=>{if(!s){o.close();return}await s(o)!==!1&&o.close()}}]})}Object.defineProperty(exports,"fromArray",{enumerable:!0,get:()=>N.fromArray});Object.defineProperty(exports,"fromBool",{enumerable:!0,get:()=>N.fromBool});Object.defineProperty(exports,"fromObjectItems",{enumerable:!0,get:()=>N.fromObjectItems});Object.defineProperty(exports,"fromOptions",{enumerable:!0,get:()=>N.fromOptions});exports.YsAdvancedConditionGroup=ns;exports.YsAdvancedFilterPanel=ta;exports.YsAdvancedValueEditor=ea;exports.YsCommandBar=ia;exports.YsDateFilterItem=Ad;exports.YsDateRangeFilterItem=Ld;exports.YsEnumFilterItem=Wd;exports.YsFilterItemLayout=_n;exports.YsFilterPanel=sa;exports.YsImportExcel=$d;exports.YsInfiniteList=la;exports.YsMainPanel=Ed;exports.YsRootFilterPanel=na;exports.YsTable=$s;exports.YsTableActionMenuButton=rs;exports.YsTablePage=aa;exports.YsTextFilterItem=Fd;exports.openDialog=Zd;exports.openModal=ua;
|
|
2
12
|
//# sourceMappingURL=index.cjs.map
|