dcp-design-react 1.10.5 → 1.10.7
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/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/index.js +1 -4
- package/lib/style/index.css +4 -0
- package/lib/style/index.min.css +1 -1
- package/lib/tinymce/style/index.less +4 -0
- package/package.json +10 -10
package/lib/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t,{createContext as n,Component as r,version as i,isValidElement as l,useRef as a,useLayoutEffect as o,useEffect as s,createRef as c,forwardRef as d,useImperativeHandle as u,useState as p,useCallback as h}from"react";import*as m from"prop-types";import f from"prop-types";import g from"dayjs";import"dayjs/locale/zh-cn";import v from"dayjs/plugin/localeData";import y from"dayjs/plugin/advancedFormat";import b from"dayjs/plugin/customParseFormat";import x from"dayjs/plugin/quarterOfYear";import E from"dayjs/plugin/weekOfYear";import S from"dayjs/plugin/weekday";import{ConfigProvider as w,Button as C,Popconfirm as T,Space as N,Empty as I,Spin as R,Input as O,Upload as k,message as L,Tabs as A,Drawer as P,Modal as _,Form as H,Row as F,Col as D,Select as $,Checkbox as M,Dropdown as q,InputNumber as j,Rate as V,Radio as K,Switch as z,Tag as W,TreeSelect as B,Cascader as U,notification as G,Tooltip as Y,Image as X,Tree as Z,Menu as Q,Popover as J,Pagination as ee,Slider as te}from"antd";export{Affix,Alert,Anchor,AutoComplete,Avatar,BackTop,Badge,Breadcrumb,Button,Card,Carousel,Cascader,Checkbox,Col,Collapse,Comment,ConfigProvider,Descriptions,Divider,Drawer,Dropdown,Empty,Form,Grid,Image,Input,InputNumber,Layout,List,Mentions,Menu,Modal,PageHeader,Pagination,Popconfirm,Popover,Progress,Radio,Rate,Result,Row,Segmented,Select,Skeleton,Slider,Space,Spin,Statistic,Steps,Switch,Table,Tabs,Tag,Timeline,Tooltip,Transfer,Tree,TreeSelect,Typography,Upload,message,notification}from"antd";import ne from"dayjs/plugin/weekYear";import re from"antd/es/calendar/generateCalendar";import"antd/es/calendar/style";import ie from"antd/es/date-picker/generatePicker";import"antd/es/date-picker/style/index";import le from"antd/es/locale/zh_CN";import ae from"antd/es/locale/en_GB";import{isArray as oe,isPlainObject as se,isNumber as ce,isFunction as de,isString as ue,throttle as pe,isUndefined as he,get as me,transform as fe,isEqual as ge,set as ve,xor as ye,isRegExp as be,merge as xe,uniqBy as Ee,debounce as Se,intersection as we,map as Ce,groupBy as Te,flatten as Ne,spread as Ie,mergeWith as Re,isDate as Oe,omitBy as ke,sumBy as Le,maxBy as Ae,minBy as Pe,union as _e,pickBy as He}from"lodash-es";import Fe from"classnames";import{UpOutlined as De,DownOutlined as $e,PaperClipOutlined as Me,EditOutlined as qe,CheckOutlined as je,EyeOutlined as Ve,DownloadOutlined as Ke,DeleteOutlined as ze,UploadOutlined as We,FullscreenExitOutlined as Be,FullscreenOutlined as Ue,HolderOutlined as Ge,UnorderedListOutlined as Ye,SearchOutlined as Xe,CloseOutlined as Ze,ExclamationCircleOutlined as Qe,ReloadOutlined as Je,ZoomInOutlined as et,ZoomOutOutlined as tt,RotateRightOutlined as nt,RotateLeftOutlined as rt,InboxOutlined as it,InfoCircleFilled as lt,PrinterOutlined as at,ImportOutlined as ot,SettingOutlined as st,CopyOutlined as ct,CheckSquareOutlined as dt,CloseCircleOutlined as ut,MonitorOutlined as pt,PlusOutlined as ht,PieChartOutlined as mt,FunnelPlotOutlined as ft,AppstoreAddOutlined as gt,StepBackwardOutlined as vt,StepForwardOutlined as yt,InfoCircleOutlined as bt,ClearOutlined as xt,PauseOutlined as Et,CaretRightOutlined as St,QuestionCircleOutlined as wt,MenuOutlined as Ct,BorderOutlined as Tt,RightOutlined as Nt,LeftOutlined as It}from"@ant-design/icons";import Rt from"react-countup";import Ot from"resize-observer-polyfill";import kt from"sortablejs";import Lt from"add-dom-event-listener";import At from"scroll-into-view-if-needed";import Pt from"react-draggable";import _t from"memoize-one";import Ht from"cropperjs";import Ft from"big.js";import Dt from"react-dom";import $t from"copy-to-clipboard";import Mt from"@rc-component/portal";import qt from"@rc-component/trigger";import jt from"html2canvas";import{ReactSortable as Vt}from"react-sortablejs";import Kt from"localforage";import zt from"exceljs";import Wt from"china-area-data";const Bt=n({locale:"zh-cn",size:"middle"});var Ut={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",countLimit:"数量不能超过 {count} 个",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传",remove:"删除文件"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选",nullValue:"空值"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",tabPanes:["查找条件","更多条件"],matchCase:"大小写匹配",matchFullchar:"全字符匹配",clear:"清空条件",queryPrev:"查找上一个",queryNext:"查找下一个"}}}};let Gt=Ut;function Yt(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const Xt=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[r,i]=t;let l;const a=r.split(".");let o=Gt;for(let e=0,t=a.length;e<t;e++){if(l=o[a[e]],e===t-1)return Yt(l,i);if(!l)return"";o=l}return""},Zt=e=>{Gt=e||Gt,Gt.name&&g.locale(Gt.name)};class Qt extends Error{constructor(e){super(e),this.name="QmDesignError"}}function Jt(e,t){throw new Qt(`[${e}] ${t}`)}function en(e,t){console.warn(new Qt(`[${e}] ${t}`))}const tn=e=>"number"==typeof e||void 0===e||(["px","rem","em","vw","vh","%"].some((t=>e.endsWith(t)))||e.startsWith("calc")),nn=e=>["","small","middle","large"].includes(e);g.extend(v),g.extend(y),g.extend(b),g.extend(x),g.extend(E),g.extend(S);var rn={},ln=[];function an(e,t){if(!e&&void 0!==console){var n=ln.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function on(e,t){if(!e&&void 0!==console){var n=ln.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function sn(e,t,n){t||rn[n]||(e(!1,n),rn[n]=!0)}function cn(e,t){sn(an,e,t)}function dn(e,t){sn(on,e,t)}cn.preMessage=function(e){ln.push(e)},cn.resetWarned=function(){rn={}},cn.noteOnce=dn,g.extend(b),g.extend(y),g.extend(S),g.extend(v),g.extend(E),g.extend(ne),g.extend((function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=(e||"").replace("Wo","wo");return r.bind(this)(t)}}));var un={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},pn=function(e){return un[e]||e.split("_")[0]},hn=function(){dn(!1,"Not match any format. Please help to fire a issue about this.")},mn={getNow:function(){return g()},getFixedDate:function(e){return g(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return g().locale(pn(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(pn(e)).weekday(0)},getWeek:function(e,t){return t.locale(pn(e)).week()},getShortWeekDays:function(e){return g().locale(pn(e)).localeData().weekdaysMin()},getShortMonths:function(e){return g().locale(pn(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(pn(e)).format(n)},parse:function(e,t,n){for(var r=pn(e),i=0;i<n.length;i+=1){var l=n[i],a=t;if(l.includes("wo")||l.includes("Wo")){for(var o=a.split("-")[0],s=a.split("-")[1],c=g(o,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var u=c.add(d,"week");if(u.format("Wo")===s)return u}return hn(),null}var p=g(a,l).locale(r);if(p.isValid())return p}return t&&hn(),null}}};const fn=re(mn),gn=ie(mn);function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vn.apply(this,arguments)}const yn=e.forwardRef(((t,n)=>e.createElement(gn,vn({},t,{picker:"time",mode:void 0,ref:n}))));yn.displayName="TimePicker";const bn=e.forwardRef(((t,n)=>e.createElement(gn.RangePicker,vn({},t,{picker:"time",mode:void 0,ref:n}))));bn.displayName="RangePicker",yn.RangePicker=bn;var xn={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",countLimit:"Quantity cannot exceed {count}",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload",remove:"Delete files"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter",nullValue:"Null Value"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",tabPanes:["Search condition","More conditions"],matchCase:"Case matching",matchFullchar:"Full character matching",clear:"Clear condition",queryPrev:"Find previous",queryNext:"Find next"}}}};const En={[xn.name]:{qm:xn,antd:ae},[Ut.name]:{qm:Ut,antd:le}};class Sn extends r{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},Zt(Object.assign({},En,e.global.langPackage)[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:n,size:r}=t.value,{locale:i,size:l,global:a}=e;return i!==n&&Zt(Object.assign({},En,a.langPackage)[i].qm),i!==n||l!==r?{value:Object.assign({},t.value,{locale:i,size:l})}:null}render(){const{global:e}=this.props,{value:n}=this.state,r=Object.assign({},En,e.langPackage);return t.createElement(Bt.Provider,{value:n},t.createElement(w,{locale:r[n.locale].antd,componentSize:n.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}function wn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function Cn(e,t,n,r){var i,l=arguments.length,a=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(l<3?i(a):l>3?i(t,n,a):i(t,n))||a);return l>3&&a&&Object.defineProperty(t,n,a),a}function Tn(e,t,n,r){return new(n||(n=Promise))((function(i,l){function a(e){try{s(r.next(e))}catch(e){l(e)}}function o(e){try{s(r.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}s((r=r.apply(e,t||[])).next())}))}Sn.propTypes={locale:f.string,size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},theme:f.string,global:f.object},Sn.defaultProps={locale:"zh-cn",size:"middle",global:{}};var Nn="undefined"==typeof window;const In=e=>t.isValidElement(e),Rn=e=>In(e)&&e.type===t.Fragment,On=()=>{},kn=()=>!0,Ln=e=>Tn(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),An=e=>{Promise.resolve().then(e)},Pn=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),_n=e=>!!(!e&&0!==e||oe(e)&&!e.length||se(e)&&!Object.keys(e).length),Hn=(e,t)=>{const n=Object.assign({},e);for(const e of t)delete n[e];return n};const Fn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(se(e)||oe(e)){const n=Array.isArray(e),r=n?[]:{};if(t.get(e))return e;t.set(e,r);const i=n?void 0:Object.keys(e);return function(e,t){let n=-1;const r=e.length;for(;++n<r;)t(e[n],n)}(i||e,((n,l)=>{i&&(l=n),r[l]=Fn(e[l],t)})),r}return e},Dn=e=>ce(e)?`${e}px`:e.toString();class $n extends r{constructor(){super(...arguments),this.state={isLoading:!1},this.clickHandle=e=>Tn(this,void 0,void 0,(function*(){var t,n;this.setState({isLoading:!0});try{yield null===(n=(t=this.props).click)||void 0===n?void 0:n.call(t,e)}catch(e){en("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:n,authConfig:r,click:i,confirm:l}=this.props,{isLoading:a}=this.state,o=e||this.context.size||"",s=de(i)?{onClick:this.clickHandle}:null,c=Object.assign(Object.assign(Object.assign({},Hn(this.props,["authConfig","click","confirm"])),{size:o,loading:a||n||!1}),s);if(r){const{visible:e=1,disabled:t}=r||{};if(!e)return null;t&&(c.disabled=!0)}return l?t.createElement(T,{title:l.title||Xt("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{var t,n;null===(t=l.onConfirm)||void 0===t||t.call(l),null===(n=c.onClick)||void 0===n||n.call(c,e)},onCancel:e=>{var t;null===(t=l.onCancel)||void 0===t||t.call(l,e)}},t.createElement(C,vn({},c,{onClick:On}),this.props.children)):t.createElement(C,c,this.props.children)}}var Mn;$n.propTypes={click:f.func,confirm:f.shape({title:f.node,onConfirm:f.func,onCancel:f.func})},$n.contextType=Bt,function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(Mn||(Mn={}));class qn extends r{render(){const{size:e}=this.props,n=e||this.context.size||"",r=ce(e)?e:Mn[e||n||"default"],i=Object.assign(Object.assign({},this.props),{size:r});return t.createElement(N,i,this.props.children)}}qn.contextType=Bt;const jn=e=>`qm-${e}`;class Vn extends r{constructor(){super(...arguments),this.clickHandle=()=>{const{collapse:e,onCollapseChange:t=On}=this.props;t(!e)}}render(){const{size:e,label:n,extra:r,collapse:i,bordered:l,disabled:a,id:o,className:s,style:c}=this.props,d=e||this.context.size||"",u=jn("divider"),p={[u]:!0,[`${u}-borderless`]:!l,[`${u}--lg`]:"large"===d,[`${u}--sm`]:"small"===d};return t.createElement("div",{id:o,className:Fe(p,s),style:c},t.createElement("span",{className:Fe(`${u}__title`)},n),t.createElement("div",{className:Fe(`${u}__extra`)},r),void 0!==i&&t.createElement(C,{type:"link",className:Fe(`${u}__collapse`),disabled:a,onClick:this.clickHandle},Xt(i?"qm.divider.collect":"qm.divider.spread"),i?t.createElement(De,null):t.createElement($e,null)))}}Vn.contextType=Bt,Vn.propTypes={label:f.string,size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},extra:f.oneOfType([f.element,f.string]),collapse:f.bool,bordered:f.bool},Vn.defaultProps={bordered:!0};const Kn=()=>({height:0,opacity:0}),zn=(e,t)=>"height"===t.propertyName,Wn={motionName:"rc-collapse-motion",onEnterStart:Kn,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:Kn,onEnterEnd:zn,onLeaveEnd:zn,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"};function Bn(e){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bn(e)}function Un(e){var t=function(e,t){if("object"!==Bn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Bn(t)?t:String(t)}function Gn(e,t,n){return(t=Un(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yn(Object(n),!0).forEach((function(t){Gn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,l,a,o=[],s=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=l.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jn(e){return e instanceof HTMLElement||e instanceof SVGElement}function er(e){var n,r=function(e){return e&&"object"===Bn(e)&&Jn(e.nativeElement)?e.nativeElement:Jn(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=Dt.findDOMNode)||void 0===n?void 0:n.call(Dt,e):null)}var tr,nr={exports:{}},rr={};nr.exports=(tr||(tr=1,function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function f(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var f=e.type;switch(f){case r:case l:case i:case d:case u:return f;default:var g=f&&f.$$typeof;switch(g){case s:case o:case c:case h:case p:case a:return g;default:return m}}case n:return m}}}e=Symbol.for("react.module.reference");var g=o,v=a,y=t,b=c,x=r,E=h,S=p,w=n,C=l,T=i,N=d,I=u,R=!1,O=!1;rr.ContextConsumer=g,rr.ContextProvider=v,rr.Element=y,rr.ForwardRef=b,rr.Fragment=x,rr.Lazy=E,rr.Memo=S,rr.Portal=w,rr.Profiler=C,rr.StrictMode=T,rr.Suspense=N,rr.SuspenseList=I,rr.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},rr.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},rr.isContextConsumer=function(e){return f(e)===o},rr.isContextProvider=function(e){return f(e)===a},rr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},rr.isForwardRef=function(e){return f(e)===c},rr.isFragment=function(e){return f(e)===r},rr.isLazy=function(e){return f(e)===h},rr.isMemo=function(e){return f(e)===p},rr.isPortal=function(e){return f(e)===n},rr.isProfiler=function(e){return f(e)===l},rr.isStrictMode=function(e){return f(e)===i},rr.isSuspense=function(e){return f(e)===d},rr.isSuspenseList=function(e){return f(e)===u},rr.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===l||t===i||t===d||t===u||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===p||t.$$typeof===a||t.$$typeof===o||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},rr.typeOf=f}()),rr);var ir=function(e,t){"function"==typeof e?e(t):"object"===Bn(e)&&e&&"current"in e&&(e.current=t)},lr=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(Boolean);return r.length<=1?r[0]:function(e){t.forEach((function(t){ir(t,e)}))}},ar=function(e){var t,n,r=nr.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===nr.exports.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===nr.exports.ForwardRef)};function or(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}Number(i.split(".")[0]);var sr=e.createContext({});function cr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Un(r.key),r)}}function ur(e,t,n){return t&&dr(e.prototype,t),n&&dr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pr(e,t){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pr(e,t)}function hr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pr(e,t)}function mr(e){return mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mr(e)}function fr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=mr(e);if(t){var i=mr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fr(e)}(this,n)}}var vr=function(t){hr(r,e.Component);var n=gr(r);function r(){return cr(this,r),n.apply(this,arguments)}return ur(r,[{key:"render",value:function(){return this.props.children}}]),r}();function yr(t){var n=e.useRef(!1),r=Qn(e.useState(t),2),i=r[0],l=r[1];return e.useEffect((function(){return n.current=!1,function(){n.current=!0}}),[]),[i,function(e,t){t&&n.current||l(e)}]}var br="none",xr="appear",Er="enter",Sr="leave",wr="none",Cr="prepare",Tr="start",Nr="active",Ir="end",Rr="prepared";function Or(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Lr,Ar,Pr,_r=(Lr=Or(),Ar="undefined"!=typeof window?window:{},Pr={animationend:kr("Animation","AnimationEnd"),transitionend:kr("Transition","TransitionEnd")},Lr&&("AnimationEvent"in Ar||delete Pr.animationend.animation,"TransitionEvent"in Ar||delete Pr.transitionend.transition),Pr),Hr={};if(Or()){var Fr=document.createElement("div");Hr=Fr.style}var Dr={};function $r(e){if(Dr[e])return Dr[e];var t=_r[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var l=n[i];if(Object.prototype.hasOwnProperty.call(t,l)&&l in Hr)return Dr[e]=t[l],Dr[e]}return""}var Mr=$r("animationend"),qr=$r("transitionend"),jr=!(!Mr||!qr),Vr=Mr||"animationend",Kr=qr||"transitionend";function zr(e,t){return e?"object"===Bn(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var Wr=function(t){var n=a(),r=a(t);r.current=t;var i=e.useCallback((function(e){r.current(e)}),[]);function l(e){e&&(e.removeEventListener(Kr,i),e.removeEventListener(Vr,i))}return e.useEffect((function(){return function(){l(n.current)}}),[]),[function(e){n.current&&n.current!==e&&l(n.current),e&&e!==n.current&&(e.addEventListener(Kr,i),e.addEventListener(Vr,i),n.current=e)},l]},Br=Or()?o:s,Ur=function(e){return+setTimeout(e,16)},Gr=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Ur=function(e){return window.requestAnimationFrame(e)},Gr=function(e){return window.cancelAnimationFrame(e)});var Yr=0,Xr=new Map;function Zr(e){Xr.delete(e)}var Qr=function(e){var t=Yr+=1;return function n(r){if(0===r)Zr(t),e();else{var i=Ur((function(){n(r-1)}));Xr.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};Qr.cancel=function(e){var t=Xr.get(e);return Zr(e),Gr(t)},Qr.ids=function(){return Xr};var Jr=[Cr,Tr,Nr,Ir],ei=[Cr,Rr],ti=!1,ni=!0;function ri(e){return e===Nr||e===Ir}var ii=function(t,n,r){var i=Qn(yr(wr),2),l=i[0],a=i[1],o=function(){var t=e.useRef(null);function n(){Qr.cancel(t.current)}return e.useEffect((function(){return function(){n()}}),[]),[function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n();var l=Qr((function(){i<=1?r({isCanceled:function(){return l!==t.current}}):e(r,i-1)}));t.current=l},n]}(),s=Qn(o,2),c=s[0],d=s[1];var u=n?ei:Jr;return Br((function(){if(l!==wr&&l!==Ir){var e=u.indexOf(l),t=u[e+1],n=r(l);n===ti?a(t,!0):t&&c((function(e){function r(){e.isCanceled()||a(t,!0)}!0===n?r():Promise.resolve(n).then(r)}))}}),[t,l]),e.useEffect((function(){return function(){d()}}),[]),[function(){a(Cr,!0)},l]};var li=function(t){var n=t;"object"===Bn(t)&&(n=t.transitionSupport);var r=e.forwardRef((function(t,r){var i=t.visible,l=void 0===i||i,o=t.removeOnLeave,c=void 0===o||o,d=t.forceRender,u=t.children,p=t.motionName,h=t.leavedClassName,m=t.eventProps,f=function(e,t){return!(!e.motionName||!n||!1===t)}(t,e.useContext(sr).motion),g=a(),v=a();var y=function(t,n,r,i){var l=i.motionEnter,o=void 0===l||l,c=i.motionAppear,d=void 0===c||c,u=i.motionLeave,p=void 0===u||u,h=i.motionDeadline,m=i.motionLeaveImmediately,f=i.onAppearPrepare,g=i.onEnterPrepare,v=i.onLeavePrepare,y=i.onAppearStart,b=i.onEnterStart,x=i.onLeaveStart,E=i.onAppearActive,S=i.onEnterActive,w=i.onLeaveActive,C=i.onAppearEnd,T=i.onEnterEnd,N=i.onLeaveEnd,I=i.onVisibleChanged,R=Qn(yr(),2),O=R[0],k=R[1],L=Qn(yr(br),2),A=L[0],P=L[1],_=Qn(yr(null),2),H=_[0],F=_[1],D=a(!1),$=a(null);function M(){return r()}var q=a(!1);function j(){P(br,!0),F(null,!0)}function V(e){var t=M();if(!e||e.deadline||e.target===t){var n,r=q.current;A===xr&&r?n=null==C?void 0:C(t,e):A===Er&&r?n=null==T?void 0:T(t,e):A===Sr&&r&&(n=null==N?void 0:N(t,e)),A!==br&&r&&!1!==n&&j()}}var K=Qn(Wr(V),1)[0],z=function(e){var t,n,r;switch(e){case xr:return Gn(t={},Cr,f),Gn(t,Tr,y),Gn(t,Nr,E),t;case Er:return Gn(n={},Cr,g),Gn(n,Tr,b),Gn(n,Nr,S),n;case Sr:return Gn(r={},Cr,v),Gn(r,Tr,x),Gn(r,Nr,w),r;default:return{}}},W=e.useMemo((function(){return z(A)}),[A]),B=Qn(ii(A,!t,(function(e){if(e===Cr){var t=W[Cr];return t?t(M()):ti}var n;return G in W&&F((null===(n=W[G])||void 0===n?void 0:n.call(W,M(),null))||null),G===Nr&&(K(M()),h>0&&(clearTimeout($.current),$.current=setTimeout((function(){V({deadline:!0})}),h))),G===Rr&&j(),ni})),2),U=B[0],G=B[1],Y=ri(G);q.current=Y,Br((function(){k(n);var e,r=D.current;D.current=!0,!r&&n&&d&&(e=xr),r&&n&&o&&(e=Er),(r&&!n&&p||!r&&m&&!n&&p)&&(e=Sr);var i=z(e);e&&(t||i[Cr])?(P(e),U()):P(br)}),[n]),s((function(){(A===xr&&!d||A===Er&&!o||A===Sr&&!p)&&P(br)}),[d,o,p]),s((function(){return function(){D.current=!1,clearTimeout($.current)}}),[]);var X=e.useRef(!1);s((function(){O&&(X.current=!0),void 0!==O&&A===br&&((X.current||O)&&(null==I||I(O)),X.current=!0)}),[O,A]);var Z=H;return W[Cr]&&G===Tr&&(Z=Xn({transition:"none"},Z)),[A,G,Z,null!=O?O:n]}(f,l,(function(){try{return g.current instanceof HTMLElement?g.current:er(v.current)}catch(e){return null}}),t),b=Qn(y,4),x=b[0],E=b[1],S=b[2],w=b[3],C=e.useRef(w);w&&(C.current=!0);var T,N=e.useCallback((function(e){g.current=e,ir(r,e)}),[r]),I=Xn(Xn({},m),{},{visible:l});if(u)if(x===br)T=w?u(Xn({},I),N):!c&&C.current&&h?u(Xn(Xn({},I),{},{className:h}),N):d||!c&&!h?u(Xn(Xn({},I),{},{style:{display:"none"}}),N):null;else{var R,O;E===Cr?O="prepare":ri(E)?O="active":E===Tr&&(O="start");var k=zr(p,"".concat(x,"-").concat(O));T=u(Xn(Xn({},I),{},{className:Fe(zr(p,x),(R={},Gn(R,k,k&&O),Gn(R,p,"string"==typeof p),R)),style:S}),N)}else T=null;e.isValidElement(T)&&ar(T)&&(T.ref||(T=e.cloneElement(T,{ref:N})));return e.createElement(vr,{ref:v},T)}));return r.displayName="CSSMotion",r}(jr);function ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ai.apply(this,arguments)}var oi="add",si="keep",ci="remove",di="removed";function ui(e){var t;return Xn(Xn({},t=e&&"object"===Bn(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function pi(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(ui)}var hi=["component","children","onVisibleChanged","onAllRemoved"],mi=["status"],fi=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:li,r=function(t){hr(i,e.Component);var r=gr(i);function i(){var e;cr(this,i);for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];return Gn(fr(e=r.call.apply(r,[this].concat(n))),"state",{keyEntities:[]}),Gn(fr(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:Xn(Xn({},e),{},{status:di})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==di})).length})),e}return ur(i,[{key:"render",value:function(){var t=this,r=this.state.keyEntities,i=this.props,l=i.component,a=i.children,o=i.onVisibleChanged,s=i.onAllRemoved,c=or(i,hi),d=l||e.Fragment,u={};return fi.forEach((function(e){u[e]=c[e],delete c[e]})),delete c.keys,e.createElement(d,c,r.map((function(r){var i=r.status,l=or(r,mi),c=i===oi||i===si;return e.createElement(n,ai({},u,{key:l.key,visible:c,eventProps:l,onVisibleChanged:function(e){(null==o||o(e,{key:l.key}),e)||0===t.removeKey(l.key)&&s&&s()}}),a)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,i=pi(n),l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,l=pi(e),a=pi(t);l.forEach((function(e){for(var t=!1,l=r;l<i;l+=1){var o=a[l];if(o.key===e.key){r<l&&(n=n.concat(a.slice(r,l).map((function(e){return Xn(Xn({},e),{},{status:oi})}))),r=l),n.push(Xn(Xn({},o),{},{status:si})),r+=1,t=!0;break}}t||n.push(Xn(Xn({},e),{},{status:ci}))})),r<i&&(n=n.concat(a.slice(r).map((function(e){return Xn(Xn({},e),{},{status:oi})}))));var o={};return n.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==ci}))).forEach((function(t){t.key===e&&(t.status=si)}))})),n}(r,i);return{keyEntities:l.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==di||e.status!==ci}))}}}]),i}();Gn(r,"defaultProps",{component:"div"})}(jr);const gi=t.forwardRef(((e,n)=>{const{forceRender:r,className:i,style:l,boxStyle:a,isActive:o}=e,[s,c]=t.useState(o||r);if(t.useEffect((()=>{(r||o)&&c(!0)}),[r,o]),!s)return null;const d=jn("collapse");return t.createElement("div",{ref:n,className:Fe(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},i),style:l},t.createElement("div",{className:`${d}-content-box`,style:a},e.children))}));gi.displayName="PanelContent";const vi=e=>{const{defaultActive:n,label:r,extra:i,className:l,style:a,containerStyle:o,bordered:s,disabled:c,forceRender:d,destroyOnClose:u=!1,onChange:p}=e,[h,m]=t.useState(!!n),f=jn("collapse"),g=Fe({[`${f}`]:!0,[`${f}-active`]:h,[`${f}-disabled`]:c},l);return t.createElement("div",{className:g,style:a},t.createElement(Vn,{label:r,extra:i,collapse:h,bordered:s,disabled:c,onCollapseChange:e=>{m(e),null==p||p(e)}}),t.createElement(li,vn({visible:h},Wn,{leavedClassName:`${f}-content-hidden`,forceRender:d,removeOnLeave:u}),((n,r)=>{let{className:i,style:l}=n;return t.createElement(gi,{ref:r,prefixCls:f,className:i,style:l,boxStyle:o,isActive:h,forceRender:d},e.children)})))};vi.displayName="QmCollapse";const yi=t.createContext(void 0);function bi(t,n){((t,n)=>{const r=e.useRef(!0);e.useEffect((()=>t(r.current)),n),e.useEffect((()=>(r.current=!1,()=>{r.current=!0})),[])})((e=>{if(!e)return t()}),n)}const xi=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},Ei=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},Si=e=>e.preventDefault(),wi=(e,t)=>{if(Nn||!e||!t)return null;"float"===(t=Pn(t))&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=window.getComputedStyle(e);return r?r[t]:""}catch(n){return e.style[t]}},Ci=(e,t,n)=>{!Nn&&e&&t&&(se(t)?Object.keys(t).forEach((n=>{Ci(e,n,t[n])})):(t=Pn(t),e.style[t]=n))},Ti=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Ni=(e,t)=>Math.abs(Ti(e)-Ti(t)),Ii=e=>{let t=0,n=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}},Ri=(e,t)=>{var n;let r=e;for(;r;){if(null===(n=r.classList)||void 0===n?void 0:n.contains(t))return r;r=r.parentNode}return null},Oi=(e,t)=>{if(Nn||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},ki=e=>Math.pow(e,3),Li=e=>e<.5?ki(2*e)/2:1-ki(2*(1-e))/2,Ai=e=>{const{minValues:n,onDragChange:r,onDragging:i}=e,{splitRef:l,direction:a}=t.useContext(yi),o=t.useRef(Nn?null:document.onselectstart),s=t.useMemo((()=>"horizontal"===a),[a]),c=t.useMemo((()=>s?"X":"Y"),[s]),d=t.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),u=e=>{d.current=Object.assign({},d.current,e)},p=e=>{if(1!==e.buttons)return h();const t=e[`page${c}`]-d.current[`start${c}`],r=[n[0],d.current[`containerSize${c}`]-n[1]];let l=d.current[`firstElementSize${c}`]+t;l=Math.max(r[0],l),l=Math.min(r[1],l),i(l)},h=()=>{u({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),Ei(document,"mousemove",p),Ei(document,"mouseup",h),m()},m=()=>{document.onselectstart!==o.current&&(document.onselectstart=o.current)},f={[`${jn("split")}__resize-bar`]:!0,vertical:"vertical"===a,horizontal:"horizontal"===a};return t.createElement("div",{className:Fe(f),title:Xt("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=l.current,n=t.children[0];u({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),xi(document,"mousemove",p),xi(document,"mouseup",h),r(!0),o.current=document.onselectstart,document.onselectstart=()=>!1}})};Ai.displayName="ResizeBar";const Pi=t.forwardRef(((e,n)=>{const{offset:r,className:i,style:l}=e,{direction:a,dragging:o}=t.useContext(yi),s="vertical"===a?"height":"width",c={[jn("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===a,vertical:"vertical"===a,[i]:!!i},d=void 0!==r?{[s]:Dn(r)}:{flex:1,[s]:0};return t.createElement("div",{ref:n,className:Fe(c),style:Object.assign(Object.assign({},d),l)},e.children)}));Pi.displayName="QmSplitPane";const _i=e=>{const{direction:n="horizontal",defaultValue:r="50%",uniqueKey:i,className:l,style:a,onDragStart:o,onDrag:s=On,onDragEnd:c}=e,{global:d}=t.useContext(Bt),u=t.useRef(null),p=t.useRef(null),h=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,m=e=>Number.parseInt(e,10),f=e=>{var t;const n=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return n>=0?n:0},g=t.useMemo((()=>i?`split_${i}`:""),[i]),[v,y]=t.useState(!1),[b,x]=t.useState(h(r));bi((()=>{v?null==o||o(m(b)):(null==c||c(m(b)),localStorage.setItem(g,b),w(g,b))}),[v]),t.useEffect((()=>{E()}),[]);const E=()=>{if(!g)return;const e=localStorage.getItem(g);e?x(h(e)):S(g).then((e=>{localStorage.setItem(g,h(e||r)),E()})).catch((()=>{}))},S=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),w=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),C=t.useMemo((()=>({splitRef:u,direction:n,dragging:v})),[n,v]),T=[];t.Children.map(e.children,(e=>{var t;In(e)&&!Rn(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&T.push(e)}));const[N,I]=T,R=t.useMemo((()=>[f(N),f(I)]),[N,I]),O={[jn("split")]:!0,vertical:"vertical"===n};return t.createElement(yi.Provider,{value:C},t.createElement("div",{ref:u,className:Fe(O,l),style:a},t.createElement(Pi,vn({},N.props,{ref:p,offset:b})),t.createElement(Ai,{minValues:R,onDragChange:e=>y(e),onDragging:e=>{x(`${e}px`),s(e)}}),t.createElement(Pi,I.props)))};_i.Pane=Pi,_i.displayName="QmSplit";class Hi extends r{render(){const{size:e,className:n,style:r}=this.props,i=e||this.context.size||"",l=jn("countup"),a={[l]:!0,[`${l}--lg`]:"large"===i,[`${l}--sm`]:"small"===i};return t.createElement(Rt,vn({},this.props,{className:Fe(a,n),style:r}),this.props.children)}}Hi.defaultProps={duration:2},Hi.contextType=Bt;class Fi extends r{render(){const{size:e,className:n}=this.props,r=e||this.context.size||"",i=jn("empty"),l=Object.assign(Object.assign({},this.props),{image:I.PRESENTED_IMAGE_SIMPLE}),a={[i]:!0,[`${i}--lg`]:"large"===r,[`${i}--sm`]:"small"===r};return t.createElement(I,vn({},l,{className:Fe(a,n)}))}}Fi.contextType=Bt,Fi.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class Di extends r{render(){const{fullHeight:e,className:n,style:r={}}=this.props,i={[`${jn("spin")}-full-height`]:e},l=Object.assign(Object.assign({wrapperClassName:Fe(i,n)},Hn(this.props,["fullHeight"])),{style:Object.assign(Object.assign({},r),{maxHeight:"none"})});return t.createElement(R,l,this.props.children)}}Di.defaultProps={tip:"Loading...",fullHeight:!1};const $i=t.createContext(void 0),Mi=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},qi=function(e,t){!Nn&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new Ot(Mi),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},ji=function(e,t){var n;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(n=e.__ro__)||void 0===n||n.disconnect())};function Vi(t){const[n,r]=e.useState({width:0,height:0});return e.useLayoutEffect((()=>{const e=t.current,n=e=>{const{width:t,height:n}=e.contentRect;r({width:t,height:n})};return e&&qi(e,n),()=>{e&&ji(e,n)}}),[t]),n}const Ki=(t,n)=>{const r=e.useRef(!0);e.useLayoutEffect((()=>t(r.current)),n),e.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function zi(e,t){Ki((t=>{if(!t)return e()}),t)}function Wi(t,n){var r=this;const i=e.useRef(null);e.useEffect((()=>()=>{clearTimeout(i.current),i.current=null}),[]);const l=e.useCallback((function(){for(var e=arguments.length,l=new Array(e),a=0;a<e;a++)l[a]=arguments[a];i.current&&clearTimeout(i.current),i.current=setTimeout((()=>t.apply(r,l)),n)}),[t,n]);return l}const Bi=6,Ui={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",reverse:"width",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",reverse:"height",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},Gi=e=>{const{thumb:n,always:r,className:i,barSize:l=Bi,direction:a="vertical",onDrag:o=On}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=t.useContext($i),u=Ui[a],p=t.useRef(n),h=t.useRef(null),m=t.useRef(null),f=t.useRef({}),g=t.useRef(!1),v=t.useRef(!1),y=t.useRef(Nn?null:document.onselectstart),[b,x]=t.useState(!1);t.useLayoutEffect((()=>{p.current=n}),[n]),t.useEffect((()=>{const e=c.current;return xi(e,"mousemove",C),xi(e,"mouseleave",T),()=>{w(),Ei(document,"mouseup",S),Ei(e,"mousemove",C),Ei(e,"mouseleave",T)}}),[]);const E=e=>{if(!h.current||!m.current)return;if(!g.current)return;const t=f.current[u.axis];if(!t)return;const n=100*(-1*(h.current.getBoundingClientRect()[u.direction]-e[u.client])-(m.current[u.offset]-t))/h.current[u.offset];d.current[u.scroll]=n*d.current[u.scrollSize]/100,o(!0)},S=()=>{g.current=!1,f.current={[u.axis]:0},Ei(document,"mousemove",E),Ei(document,"mouseup",S),w(),v.current&&x(!1),o(!1)},w=()=>{document.onselectstart!==y.current&&(document.onselectstart=y.current)},C=()=>{v.current=!1,x(!!p.current.size)},T=()=>{v.current=!0,x(g.current)},N=jn("scrollbar"),I={[`${N}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},R={[u.reverse]:l},O={[u.size]:n.size,transform:`translate${u.axis}(${n.offset}%)`};return t.createElement(Ap,{name:"fade",in:r||s||b,timeout:300},t.createElement("div",{ref:h,className:Fe(I,i),style:R},t.createElement("div",{ref:m,className:`${N}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),xi(document,"mousemove",E),xi(document,"mouseup",S),g.current=!0,y.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(f.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},Yi=20,Xi=t.forwardRef(((e,n)=>{const{wrapClassName:r,wrapStyle:i,barWidth:l,always:a,native:o,showTopScrollbar:s,minSize:c=Yi,onScroll:d}=e,u=t.useRef(null),p=t.useRef(null),h=t.useRef(null),[m,f]=t.useState({size:0,offset:0,ratio:1}),[g,v]=t.useState({size:0,offset:0,ratio:1}),[y,b]=t.useState(!1),x=Vi(u),E=Vi(h);zi((()=>{!o&&S()}),[E.width,E.height,x.width,x.height]);const S=Wi((()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,n=Math.pow(e,2)/p.current.scrollHeight,r=Math.pow(t,2)/p.current.scrollWidth,i=Math.max(n,c),l=Math.max(r,c),a=n/(e-n)/(i/(e-i)),o=r/(t-r)/(l/(t-l)),s=i+4<e?i:0,d=l+4<t?l:0,u=100*p.current.scrollTop/e*a,h=100*p.current.scrollLeft/t*o;f(Object.assign({},m,{size:d,ratio:o,offset:h})),v(Object.assign({},g,{size:s,ratio:a,offset:u}))}),5),w=e=>{b(e)},C=(e,t)=>{ce(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollTop,i=window.requestAnimationFrame,l=()=>{const a=(Date.now()-n)/500;a<1?(e.scrollTop=r+(t-r)*Li(a),i(l)):e.scrollTop=t};i(l)})(p.current,e):p.current.scrollTop=e:en("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},T=(e,t)=>{ce(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollLeft,i=window.requestAnimationFrame,l=()=>{const a=(Date.now()-n)/500;a<1?(e.scrollLeft=r+(t-r)*Li(a),i(l)):e.scrollLeft=t};i(l)})(p.current,e):p.current.scrollLeft=e:en("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};t.useImperativeHandle(n,(()=>{var e,t;return{container:u.current,scrollTop:(null===(e=p.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=p.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:C,SET_SCROLL_LEFT:T}}));const N=t.useMemo((()=>({dragging:y,scrollbarElement:u,wrapElement:p})),[y]),I=jn("scrollbar"),R={[`${I}__wrap`]:!0,[`${I}__wrap--hidden`]:!o};return t.createElement("div",{ref:u,className:Fe(I,e.className),style:e.style},t.createElement("div",{ref:p,className:Fe(R,r),style:i,onScroll:e=>{const{scrollTop:t,scrollLeft:n}=e.target;!o&&(()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,n=100*p.current.scrollTop/e*g.ratio,r=100*p.current.scrollLeft/t*m.ratio;f(Object.assign({},m,{offset:r})),v(Object.assign({},g,{offset:n}))})(),null==d||d({scrollTop:t,scrollLeft:n})}},t.createElement("div",{ref:h,className:`${I}__view`},e.children)),!o&&t.createElement($i.Provider,{value:N},s&&t.createElement(Gi,{className:"top",direction:"horizontal",thumb:m,barSize:l,always:a,onDrag:w}),t.createElement(Gi,{direction:"horizontal",thumb:m,barSize:l,always:a,onDrag:w}),t.createElement(Gi,{direction:"vertical",thumb:g,barSize:l,always:a,onDrag:w})))}));Xi.displayName="QmScrollbar";const Zi=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const n=window.URL.createObjectURL(e);let r=document.createElement("a");r.href=n,r.download=decodeURI(t),r.click(),r=null}},Qi=(e,t)=>{let{fileName:n,headers:r,params:i}=t;return Tn(void 0,void 0,void 0,(function*(){const t=i?new URLSearchParams(i).toString():"",l=t?e.includes("?")?"&":"?":"",a=yield fetch(e+`${l+t}`,{method:"GET",headers:r});if(!a.ok)throw new Error(Xt("qm.download.error"));const o=yield a.blob(),s=a.headers.get("content-disposition"),c=n||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Zi(o,c)}))},Ji=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e};class el extends r{constructor(){super(...arguments),this.state={actived:{}},this.uploadRef=t.createRef(),this.setActiveState=(e,t)=>{this.setState((n=>({actived:Object.assign({},n.actived,{[e]:null!=t?t:!n.actived[e]})})))},this.createSortable=()=>{this.props.draggable&&(this.sortableInstance=kt.create(this.getFileListNode(),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:e=>{const{oldIndex:t,newIndex:n}=e,{fileList:r=[],onSortChange:i,onChange:l}=this.props;if(t!==n){const e=[...r],[a]=e.splice(t,1);e.splice(n,0,a),null==i||i(e),null==l||l({fileList:e})}}}))},this.getFileListNode=()=>Ri(this.uploadRef.current,jn("upload-file")).querySelector(".ant-upload-list"),this.beforeUpload=(e,t)=>new Promise(((n,r)=>Tn(this,void 0,void 0,(function*(){const{fileTypes:i=[],fileSize:l,maxCount:a,fileList:o=[],beforeUpload:s}=this.props,c=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),d=!l||e.size/1024/1024<l,u=!(a>1)||o.length<a,p=c&&d&&u;if(c||L.warning(Xt("qm.upload.tooltip",{type:i.join(",")})),d||L.warning(Xt("qm.upload.sizeLimit",{size:l})),u||L.warning(Xt("qm.upload.countLimit",{count:a})),!p)return k.LIST_IGNORE;if(s){const i=s(e,t);if(!0===i)return n(e);if(!1===i)return r("not upload");if(i&&"function"==typeof i.then)try{const e=yield i;n(e)}catch(e){r(e)}}else n(e)})))),this.doDownload=e=>Tn(this,void 0,void 0,(function*(){const{downloadWithHeaders:t,headers:n}=this.props;try{e.url&&(yield Qi(e.url,Object.assign({fileName:e.name},t?{headers:n}:null)))}catch(e){L.error(Xt("qm.download.error"))}})),this.itemRender=(e,n)=>{const{fileList:r=[],draggable:i,editable:l,disabled:a,readOnly:o,iconRender:s,onChange:c,onEditChange:d}=this.props,{actived:u}=this.state,{uid:p,name:h,url:m,status:f="done"}=e,g=a||o,v="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return t.createElement("div",{className:Fe("ant-upload-list-item",`ant-upload-list-item-${f}`,"ant-upload-list-item-list-type-text",{handle:i})},t.createElement("div",{className:"ant-upload-list-item-info"},t.createElement("span",{className:"ant-upload-span"},t.createElement("div",{className:"ant-upload-text-icon"},s?s(e):t.createElement(Me,null)),t.createElement("div",{className:"ant-upload-list-item-name"},u[p]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:Ji(h),onBlur:t=>{const{value:n}=t.target;if(n!==Ji(h)){const t=Object.assign({},e,{name:n}),i=r.map((e=>e.uid!==p?e:t));null==d||d(t,i),null==c||c({file:t,fileList:i})}this.setActiveState(p,!1)}}):t.createElement("a",{target:"_blank",rel:"noreferrer",title:h,href:m,onClick:e=>{e.preventDefault(),l?g||this.setActiveState(p,!0):n.preview()}},h)),t.createElement("span",{className:"ant-upload-list-item-card-actions"},l&&!g&&t.createElement("button",{type:"button",className:v,onClick:()=>this.setActiveState(p)},u[p]?t.createElement(je,null):t.createElement(qe,null)),l&&t.createElement("button",{type:"button",className:v,onClick:()=>n.preview()},t.createElement(Ve,null)),t.createElement("button",{type:"button",className:v,disabled:g,onClick:()=>n.download()},t.createElement(Ke,null)),t.createElement("button",{type:"button",className:v,disabled:g,onClick:()=>n.remove()},t.createElement(ze,null))))))}}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}componentDidMount(){this.createSortable()}componentWillUnmount(){var e;null===(e=this.sortableInstance)||void 0===e||e.destroy()}render(){var e,n;const{fileList:r=[],button:i={},fileDirection:l,disabled:a,readOnly:o,className:s,onPreview:c,onChange:d}=this.props,u=jn("upload-file"),p=a||o,h={[u]:!0,[`${u}--lg`]:"large"===this.$size,[`${u}--sm`]:"small"===this.$size,[`${u}--horizontal`]:"horizontal"===l};return t.createElement(k,vn({className:Fe(h,s)},Hn(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,disabled:p,onChange:d,onPreview:e=>Tn(this,void 0,void 0,(function*(){if("function"==typeof c)return c(e,(t=>this.doDownload(t||e)));a||(yield this.doDownload(e))})),onDownload:e=>Tn(this,void 0,void 0,(function*(){yield this.doDownload(e)})),itemRender:(e,t,n,r)=>this.itemRender(t,r)}),t.createElement("span",{ref:this.uploadRef},this.props.children||o&&r.length?this.props.children:t.createElement(C,{type:null!==(e=i.type)&&void 0!==e?e:"default",icon:null!==(n=i.icon)&&void 0!==n?n:t.createElement(We,null),disabled:p},i.text||Xt("qm.upload.text"))))}}el.contextType=Bt,el.defaultProps={name:"file",multiple:!0,fileDirection:"vertical",showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}};class tl extends r{constructor(){super(...arguments),this.state={loading:!1},this.downloadHandle=()=>Tn(this,void 0,void 0,(function*(){var e,t,n,r;this.setState({loading:!0});try{const{action:n,fileName:r,headers:i,params:l,beforeDownload:a=kn}=this.props,o=ue(n)?n:yield this.getActionUrl();if(!o)return en("Download","参数 `action` 有误!");if(!a(o))return;yield Qi(o,{fileName:r,headers:i,params:l}),yield Ln(100),null===(t=(e=this.props).onSuccess)||void 0===t||t.call(e),L.success(Xt("qm.download.success"))}catch(e){null===(r=(n=this.props).onError)||void 0===r||r.call(n,e),L.error(Xt("qm.download.error"))}this.setState({loading:!1})}))}getActionUrl(){return Tn(this,void 0,void 0,(function*(){const e=this.props.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}))}render(){const{size:e}=this.props,{loading:n}=this.state,r=e||this.context.size||"",i=Hn(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t.createElement(C,vn({},i,{size:r,loading:n,onClick:this.downloadHandle}),this.props.children)}}tl.propTypes={action:f.oneOfType([f.string,f.shape({api:f.func.isRequired,params:f.object})]),size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},fileName:f.string,headers:f.object,withCredentials:f.bool,params:f.object,beforeDownload:f.func,onSuccess:f.func,onError:f.func},tl.defaultProps={icon:t.createElement(Ke,null),children:Xt("qm.download.text"),withCredentials:!1},tl.contextType=Bt;class nl extends r{renderLabel(){const{activeKey:e,labels:n,onTabClick:r}=this.props;return n.map(((n,i)=>{const l={item:!0,actived:i===e};return t.createElement("div",{key:i,className:Fe(l),onClick:e=>r(i,e)},t.createElement("span",null,n))}))}render(){return t.createElement(t.Fragment,null,this.renderLabel())}}class rl extends r{render(){const{label:e,showDivider:n,className:r,style:i}=this.props,l={[jn("anchor-item")]:!0};return t.createElement("div",{className:Fe(l,r),style:i},n&&t.createElement(Vn,{label:e,style:{marginBottom:10}}),this.props.children)}}rl.displayName="QmAnchorItem";class il extends r{get __is_conf(){var e;return!!(null===(e=this.props.labelList)||void 0===e?void 0:e.length)}constructor(e){super(e),this.currentState="ready",this.scrollRef=c(),this.onScrollHandle=e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})},this.onTabClickHandle=e=>{const t=this.getTargetElement(e);t&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),At(t,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))},this.SCROLL_TO_ITEM=e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)},this.state={activeKey:e.defaultActiveIndex||0}}componentDidMount(){this.initialHandle(),this.scrollEvent=Lt(this.scrollRef.current,"scroll",pe(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}initialHandle(){const{activeKey:e}=this.state;e>0&&(this.scrollRef.current.scrollTop=Ni(this.getTargetElement(e),this.scrollRef.current))}createDistances(){var e;const{labelList:t=[]}=this.props;return(this.__is_conf?t.map((e=>document.getElementById(e.id))):Array.from((null===(e=this.scrollRef.current)||void 0===e?void 0:e.children)||[])).map((e=>Ni(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),n=this.createDistances();let r=-1;for(let e=0;e<n.length;e++){const i=n[e],l=n[e+1]||1e4;t>=i-1&&t<l&&(r=e)}return r}getTargetElement(e){const{labelList:t=[]}=this.props;return this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e]}render(){const{activeKey:e}=this.state,{size:n,labelWidth:r,tabPosition:i,labelList:l=[],onTabClick:a,className:o,style:s}=this.props,c=n||this.context.size||"",d=jn("anchor"),u={[d]:!0,[`${d}-left`]:"left"===i,[`${d}-top`]:"top"===i,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c},p=[];t.Children.map(this.props.children,(e=>{var t;In(e)&&!Rn(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&p.push(e)}));const h=this.__is_conf?l.map((e=>e.label)):p.map((e=>e.props.label)),m=this.__is_conf?l.map((e=>e.id)):p.map(((e,t)=>e.props["data-id"]||t.toString()));return this.itemsTotal=h.length,t.createElement("div",{className:Fe(u,o),style:s},t.createElement("div",{className:Fe("anchor-nav"),style:{width:r?Dn(r):""}},t.createElement(nl,{activeKey:e,labels:h,onTabClick:(e,t)=>{this.onTabClickHandle(e),null==a||a({label:h[e],id:m[e]},t)}})),t.createElement("div",{ref:this.scrollRef,className:Fe("anchor-container")},this.__is_conf?this.props.children:p))}}il.Item=rl,il.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelWidth:(e,t,n)=>{if(!tn(e[t]))return Jt("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelList:f.arrayOf(f.shape({id:f.string,label:f.string}))},il.defaultProps={tabPosition:"left"},il.contextType=Bt;class ll extends r{render(){return t.createElement(A.TabPane,this.props,this.props.children)}}ll.displayName="QmTabPane";class al extends r{render(){const{items:e,size:n,tabPosition:r,tabBarGutter:i,className:l,authConfig:a}=this.props,o=n||this.context.size||"",s=jn("tabs"),c={[s]:!0,[`${s}--lg`]:"large"===o,[`${s}--sm`]:"small"===o},d=Object.assign(Object.assign({},Hn(this.props,["items","authConfig"])),{size:o,tabBarGutter:null!=i?i:["top","bottom"].includes(r)?30:0}),u=[];t.Children.map(this.props.children,(e=>{var t;In(e)&&!Rn(e)&&"QmTabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&u.push(e)}));const p=e?[...e]:u.map((e=>{let{key:t,props:n}=e;return{key:t,label:n.tab,disabled:n.disabled,closable:n.closable,forceRender:n.forceRender,children:n.children}}));if(a){const{fieldList:e=[]}=a||{};for(let t=0;t<p.length;t++){const n=p[t],r=e.find((e=>e.dataIndex===n.key)),{visible:i=1,disabled:l}=r||{};i?l&&(n.disabled=!0):(p.splice(t,1),t--)}}return t.createElement(A,vn({},d,{items:p,className:Fe(c,l)}))}}al.TabPane=ll,al.contextType=Bt,al.defaultProps={tabPosition:"top"};class ol extends r{constructor(){super(...arguments),this.titleRef=t.createRef(),this.$drawer=null,this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1},this.afterVisibleChange=e=>{var t,n;const{loading:r}=this.props;e?(this.opened=!0,he(r)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(n=(t=this.props).onClosed)||void 0===n||n.call(t),this.setState({fullscreen:!1}))},this.toggleHandle=()=>{this.$drawer=Ri(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){var n;const{visible:r,open:i,loading:l,destroyOnClose:a}=this.props,o=null!=i?i:r,s=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:c}=this.state;o&&o!==s&&(!a&&this.opened||he(l)&&this.setState({spinning:!0})),this.$drawer&&c!==t.fullscreen&&Ci(this.$drawer,c?{width:"100%"}:{width:Dn(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{title:n,showHeader:r,showFullScreen:i}=this.props;return t.createElement(t.Fragment,null,t.createElement("span",{ref:this.titleRef,className:Fe("text")},r&&n),i&&t.createElement("button",{type:"button",className:Fe("full-screen"),onClick:this.toggleHandle},t.createElement(e?Be:Ue)))}render(){var e;const{spinning:n,sloading:r}=this.state,{visible:i,open:l,size:a,className:o,loading:s,showHeader:c,maskClosable:d,onClose:u}=this.props,p=this.context.global,h=a||this.context.size||"",m=jn("drawer"),f={[m]:!0,"no-header":!c,[`${m}--lg`]:"large"===h,[`${m}--sm`]:"small"===h};return t.createElement(P,vn({},Hn(this.props,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=l?l:i,maskClosable:null!==(e=null!=d?d:null==p?void 0:p.maskClosable)&&void 0!==e&&e,className:Fe(f,o),title:this.renderTitle(),footer:null,onClose:u,afterOpenChange:this.afterVisibleChange}),this.props.children,(s||r||n)&&t.createElement(Di,{spinning:!0,className:Fe("spinning")}))}}ol.contextType=Bt,ol.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Drawer","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:f.bool},ol.defaultProps={width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null};const sl="10vh";var cl;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(cl||(cl={}));class dl extends r{constructor(){super(...arguments),this.draggleRef=t.createRef(),this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0},this.onStart=(e,t)=>{const{clientWidth:n,clientHeight:r}=window.document.documentElement,i=this.draggleRef.current.getBoundingClientRect();i&&this.setState({bounds:{left:-i.left+t.x,right:n-(i.right-t.x)-1,top:-i.top+t.y,bottom:r-(i.bottom-t.y)-1}})},this.toggleHandle=e=>{const t=Ri(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body"),{width:r,height:i,showHeader:l}=this.props,{fullscreen:a}=this.state;a?(Ci(t,{width:Dn(r||"60%"),height:"auto",top:sl}),Ci(n,{height:i?Dn(i):this.defaultHeight,maxHeight:"auto"===i?this.defaultHeight:""})):(Ci(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Ci(n,{height:`calc(100vh - ${cl[l?this.$size:"none"]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.afterVisibleChange=()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - ${sl} - ${sl} - ${cl[this.props.showHeader?this.$size:"none"]}px)`}componentDidUpdate(e,t){var n;const{visible:r,open:i,loading:l,destroyOnClose:a}=this.props,o=null!=i?i:r,s=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:c}=this.state;if(o&&o!==s){if(!a&&this.opened||he(l)&&this.setState({spinning:!0}),!a&&this.opened)return;setTimeout((()=>{this.opened=!0,he(l)&&this.setState({spinning:!1})}),400)}c!==t.fullscreen&&(c?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:n}=this.state,{title:r,showHeader:i,showFullScreen:l}=this.props;return t.createElement("div",{onMouseOver:()=>{n&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},t.createElement("span",{className:Fe("text")},i&&r),l&&t.createElement("button",{type:"button",className:Fe("full-screen"),onClick:this.toggleHandle},t.createElement(e?Be:Ue)))}render(){var e;const{spinning:n,sloading:r,fullscreen:i,disabled:l,bounds:a,position:o}=this.state,{visible:s,open:c,height:d,className:u,loading:p,draggable:h,showHeader:m,maskClosable:f,bodyStyle:g,onClose:v}=this.props,y=this.context.global,b=jn("modal"),x={height:d?Dn(d):this.defaultHeight,maxHeight:"auto"===d?this.defaultHeight:"",overflow:"auto"},E={[b]:!0,"no-header":!m,[`${b}--lg`]:"large"===this.$size,[`${b}--sm`]:"small"===this.$size};return t.createElement(_,vn({},Hn(this.props,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=c?c:s,maskClosable:null!==(e=null!=f?f:null==y?void 0:y.maskClosable)&&void 0!==e&&e,className:Fe(E,u),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},x,g),onCancel:v,afterClose:this.afterVisibleChange,modalRender:e=>t.createElement(Pt,{nodeRef:this.draggleRef,bounds:a,position:o,disabled:!h||l||i,onStart:(e,t)=>this.onStart(e,t)},t.createElement("div",{ref:this.draggleRef},e))}),this.props.children,(p||r||n)&&t.createElement(Di,{spinning:!0,className:Fe("spinning")}))}}dl.contextType=Bt,dl.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Modal","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:f.bool},dl.defaultProps={width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:sl}};const ul=n(void 0),pl=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var hl={operations:function(e){const t=e.split(" "),n=[];let r=0;n[r]=[];for(let e=0;e<t.length;e++)pl.includes(t[e])?(n[r]=n[r].join(" "),r++,n[r]=[]):n[r].push(t[e]);return n[r]=n[r].join(" "),n},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let n=0,r=(e=Array.isArray(e)?e:[e]).length;n<r;n++)t+="number"==typeof e[n]?e[n]:"'"+e[n]+"'",n<r-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,n){return e.split(t).join(n)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),e=this.find_replace(e," NIN "," nin ")}};const ml=["==","<",">","<=",">=","!=","like","likes","in","nin"];var fl=function(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const n=e.charAt(r);"("===n&&t++,")"===n&&t--}return 0===t},gl=function(e,t){let n="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?n+=" "+e[t]+" ":n+=e[t];const r=n.split(" ").filter((e=>""!==e));for(let e=0;e<r.length;e++)ml.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),ml.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return e=r.join(" ")};const vl=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,yl=["string","number","boolean","symbol"],bl=e=>yl.includes(typeof e),xl=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),El=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(vl,"\\$1"),"i");window.__query__=function(){return((e,t,n)=>{e=null!=e?e:"";let r=!0;switch(t){case"like":r=null!==e.toString().match(El(n));break;case"likes":r=n.split(/,|,/).some((t=>null!==e.toString().match(El(t))));break;case"in":bl(n)&&(n=[n]),Array.isArray(n)&&(r=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":bl(n)&&(n=[n]),Array.isArray(n)&&(r=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":r=(xl(e)?e.slice(0,10):e)!=n;break;case"<":r=(xl(e)?e.slice(0,10):e)<n;break;case"<=":r=(xl(e)?e.slice(0,10):e)<=n;break;case">":r=(xl(e)?e.slice(0,10):e)>n;break;case">=":r=(xl(e)?e.slice(0,10):e)>=n;break;default:r=(xl(e)?e.slice(0,10):e)==n}return r})(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const Sl=hl.stringify,wl=hl.array_format,Cl=fl,Tl=(e,t,n)=>{let r=[];t=hl.replace_symbols(t);try{if(n){const n=new Function("record",`return ${gl(t,"record")};`);r=ra(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${gl(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)n(e,t)&&r.push(e[t])}}catch(t){en("Table","组件 `initialFilter` 参数有误!"),r=e}return r},Nl=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Nl(e.children)):t.push(e)})),t},Il=e=>e.filter((e=>(e.children&&(e.children=Il(e.children)),!e.hidden&&!e.noAuth))),Rl=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Rl(e.children))})),t},Ol=(e,t)=>e.map((e=>(e.children&&(e.children=Ol(e.children,t)),null==t||t(e),e))),kl=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=kl(n.children,t);if(e)return e}}return null},Ll=e=>{const t=e.children;return t?t[0].children?Ll(t[0]):t[0]:e},Al=e=>{const t=e.children;return t?t[t.length-1].children?Al(t[t.length-1]):t[t.length-1]:e},Pl=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),_l=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=_l(n.children,t);if(e)return e}}return null},Hl=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Hl(e.children))})),t},Fl=e=>{let t=1;const n=(e,r)=>{var i;if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{e.fixed?r.fixed=e.fixed:delete r.fixed,n(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=null!==(i=e.colSpan)&&void 0!==i?i:1};e.forEach((e=>{e.level=1,n(e,null)}));const r=[];for(let e=0;e<t;e++)r.push([]);return Rl(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},Dl=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const r=e.parentNode;if(n.top+=e.offsetTop,n.left+=e.offsetLeft,r&&r!==document.documentElement&&r!==document.body&&(n.top-=r.scrollTop,n.left-=r.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Dl(e.offsetParent,t,n)}return n},$l=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Ml=(e,t)=>fe(e,((e,n,r)=>{ge(n,t[r])||(e[r]=se(n)&&se(t[r])?Ml(n,t[r]):n)})),ql=(e,t)=>{var n;return null!==(n=me(e,t))&&void 0!==n?n:""},jl=(e,t,n,r)=>{r>=0&&null!=n&&(n=Number(n).toFixed(r)),ve(e,t,null!=n?n:"")},Vl=(e,t)=>{if(!t.includes("|"))return ql(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(ql(e,t))})),n.every((e=>!e))?"":n.join(" | ")},Kl=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),zl=e=>{const t=(e=e.toString()).split("."),n="-"===t[0].charAt(0)?"-":"";let r=n?t[0].slice(1):t[0],i="";for(;r.length>3;)i=`,${r.slice(-3)}${i}`,r=r.slice(0,r.length-3);return r&&(i=r+i),`${n}${i}${t[1]?`.${t[1]}`:""}`},Wl=(e,t)=>{const n=e.toString();if(!Kl(n)||0===t)return e;const r=Number.parseFloat(n).toString(),i=r.indexOf(".");if(-1===i)return r+"."+"0".repeat(t);const l=Math.max(0,t-(r.length-i-1));return r+"0".repeat(l)},Bl=(e,t)=>e?g(e,t):null,Ul=(e,t)=>e?g(e).format(t):"",Gl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Yl=e=>{const n=[];if(t.isValidElement(e)){const{children:r}=e.props;t.Children.forEach(r,(e=>{n.push(...Yl(e))}))}else n.push(e);return n},Xl=e=>Yl(e).join(""),Zl=e=>e.filter((e=>!e._group)),Ql=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="";if(Array.isArray(e)){let r=0;for(let i=0,l=e.length;i<l;i++){const l=e[i];if(!l.fieldName)continue;const a=Array.isArray(l.condition)?wl(l.condition):Sl(l.condition,"^");n+=`${l.bracketLeft} ${t?`${l.fieldName}|${l.fieldType}`:l.fieldName} ${l.expression} ${a} ${l.bracketRight} ${l.logic} `,r=l.logic.length}n=n.slice(0,-1*r-2)}else{const r=5;for(const r in e){const[i,l]=r.includes("|")?r.split("|"):[r,""],a=e[r];for(const e in a){n+=`${t?`${i}|${l}`:i} ${e} ${Array.isArray(a[e])?wl(a[e]):Sl(a[e],"^")} and `}}n=n.slice(0,-1*r)}return n.replace(/\s+/g," ").trim()},Jl=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((n=>{const r=JSON.stringify((t=>{const n=[];return e.forEach((e=>n.push(ql(t,e)))),n})(n));t[r]=t[r]||[],t[r].push(n)})),Object.keys(t).map((e=>t[e]))},ea=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].dataIndex===t)return[e[n]];if(Array.isArray(e[n].children)){const r=ea(e[n].children,t);if(r)return[e[n],r].flat()}}},ta=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].rowKey===t)return[t];if(Array.isArray(e[n].children)){const r=ta(e[n].children,t);if(r)return[e[n].rowKey,r].flat()}}},na=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=na(n.children,t);if(e)return e}if(t(n))return n}return null},ra=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&ra(e.children,t),t(e)||e.children&&e.children.length))),ia=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),la=80,aa="1",oa="0",sa=400,ca=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],da={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var ua,pa,ha;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(ua||(ua={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(pa||(pa={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ha||(ha={}));const ma={items:f.arrayOf(f.shape({type:f.string.isRequired,fieldName:f.string.isRequired})),initialValues:f.object,initialExtras:f.object,layout:f.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:f.number,customClass:f.string,compactMode:f.bool,labelWidth:f.oneOfType([f.number,f.string]),labelAlign:f.oneOf(["left","right"]),labelWrap:f.bool,formType:f.oneOf(["default","search","onlyShow"]),disabled:f.bool,uniqueKey:f.string,defaultRows:f.number,defaultExpand:f.bool,searchButtonCols:f.number,scrollToFirstError:f.bool,authConfig:f.object,isAutoFocus:f.bool,isCollapse:f.bool,isFieldsDefine:f.bool,isSearchBtn:f.bool,isSubmitBtn:f.bool,fieldsChange:f.func,onValuesChange:f.func,onFieldsChange:f.func,onFinish:f.func,onFinishFailed:f.func,onReset:f.func,onCollapse:f.func},fa={layout:"horizontal",labelWidth:la,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:On,onFieldsChange:On,onFinish:On,onFinishFailed:On,onReset:On,onCollapse:On},ga=(e,t)=>{if(!e)return null;if(t===pa.week){const t=e.match(/^(\d{4})-(\d+)/);return t?g().year(Number(t[1])).week(Number(t[2])):null}if(t===pa.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?g().year(Number(t[1])).quarter(Number(t[2])):null}return g(e,t)},va=(e,t)=>e?g(e).format(t):"",ya=e=>""===e||null==e,ba=(e,t)=>{var n;if(!e)return"";if(!t.includes("|"))return e[t];const r=t.split("|");let i="";for(let t=0,l=r.length;t<l;t++){i+=(null!==(n=e[r[t].trim()])&&void 0!==n?n:"")+(t===l-1?"":" | ")}return i},xa=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),l=n[r].split("|");i.forEach(((t,n)=>e[t]=e[l[n]]))}else e[t[r]]=e[n[r]]},Ea=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),l=n[r].split("|");i.forEach(((t,n)=>e[t]=e[l[n]]))}else e[t[r]]=e[n[r]]},Sa=(e,t,n)=>e.map((e=>{const r={value:e[t],text:e[n]};return e.disabled&&(r.disabled=!0),he(e.isLeaf)||(r.isLeaf=!!e.isLeaf),he(e.selectable)||(r.selectable=!!e.selectable),Array.isArray(e.children)&&(r.children=Sa(e.children,t,n)),r})),wa=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=wa(n.children,t);if(e)return e}}return null},Ca=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=[];return e.forEach((e=>{e.value==t.split(",")[n]&&r.push(e),Array.isArray(e.children)&&r.push(...Ca(e.children,t,n+1))})),r},Ta=e=>In(e)||"string"==typeof e,Na=e=>In(e)?Yl(e).join(""):null!=e?e:"",Ia=(e,t,n,r)=>{var i;const l={};return l.filters=(null===(i=e.filters)||void 0===i?void 0:i.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],l.table={columns:e.columns||[],rowKey:e.valueName},l.fieldsDefine={valueKey:e.valueKey||e.valueName},l.fieldAliasMap={[r?"textKey":t]:e.displayName[0],[r?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(l.table.fetch={api:n(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(l.echoRequest={fetchApi:n(e.echoSetting.api),formatter:t=>{var n;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(n=t.key)&&void 0!==n?n:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(l.echoRequest.fieldAliasMap={[r?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(l.tree={fetch:{api:n(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const n={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>n[e.tableField]=e.treeField)),n}}),e.emmediateSetting&&(l.columns=e.emmediateSetting.columns,l.request={fetchApi:n(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),l};var Ra={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{"曾":"ZENG","沈":"SHEN","嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬤":"MO","嬷":"MO","蹒":"PAN","蹊":"XI","丬":"PAN","霰":"XIAN","莘":"XIN","豉":"CHI","饧":"XING","筠":"JUN","长":"CHANG","帧":"ZHEN","峙":"SHI","郍":"NA","芎":"XIONG","谁":"SHUI"}};const Oa="阿",ka="鿿",La=1,Aa=2,Pa=3;let _a,Ha=null;function Fa(e){return e||null===Ha?("object"==typeof Intl&&Intl.Collator?(_a=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Ha=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Ha=!1,Ha):Ha}function Da(e){const t=Ra.UNIHANS,n=Ra.PINYINS,r=Ra.EXCEPTIONS,i={source:e};if(e in r)return i.type=Aa,i.target=r[e],i;let l,a=-1;if(e.charCodeAt(0)<256)return i.type=La,i.target=e,i;if(l=_a.compare(e,Oa),l<0)return i.type=Pa,i.target=e,i;if(0===l)i.type=Aa,a=0;else{if(l=_a.compare(e,ka),l>0)return i.type=Pa,i.target=e,i;0===l&&(i.type=Aa,a=t.length-1)}if(i.type=Aa,a<0){let n=0,r=t.length-1;for(;n<=r;){a=~~((n+r)/2);const i=t[a];if(l=_a.compare(e,i),0===l)break;l>0?n=a+1:r=a-1}}return l<0&&a--,i.target=n[a],i.target||(i.type=Pa,i.target=i.source),i}function $a(e){return"string"==typeof e&&Fa()?e.split("").map((e=>Da(e))):e}var Ma={isSupported:Fa,parse:$a,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Ra)})))},genToken:Da,convertToPinyin:(e,t,n)=>$a(e).map((e=>t&&e.type===Aa?e.target.toLowerCase():e.target)).join(n||"")};var qa={patcher:function(e){e.EXCEPTIONS={"嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬷":"MO","蹊":"XI","丬":"PAN","霰":"XIAN","豉":"CHI","饧":"XING","帧":"ZHEN","芎":"XIONG","谁":"SHUI","钶":"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&("FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target)}};Ma.isSupported()&&qa.shouldPatch(Ma.genToken)&&Ma.patchDict(qa);const ja=e=>{const{value:n,bordered:r}=e;return t.createElement(O,{value:n,title:n,bordered:r,readOnly:!0})};ja.displayName="FormItemView";const{Option:Va}=$,Ka=e=>{const{$$form:n}=t.useContext(ul),{value:r,items:i,multiple:l,loading:a,onChange:o,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=Xt("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,readOnly:f,disabled:g,onClear:v}=e.option,{itemList:y=[],filterable:b=!0,listHeight:x=sa,collapseTags:E,maxTagTextLength:S,dropdownStyle:w,openPyt:C=!0}=d,T=_n(y)?i:y,N=e=>{var t;return(null===(t=T.find((t=>t.value===e)))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},I=e=>l?(null==e?void 0:e.map((e=>N(e))).join(","))||"":N(e);return n.isOnlyShow?t.createElement(ja,{value:I(r),bordered:h}):t.createElement($,vn({value:r,mode:l?"multiple":void 0,popupClassName:`form-popper__${c}`,dropdownStyle:w,placeholder:p,style:u,loading:a,bordered:h,allowClear:m,disabled:g,showSearch:b,listHeight:x,maxTagCount:E?"responsive":void 0,maxTagTextLength:S},l?{title:I(r)}:null,{filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"",i=Ma.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,I(e),T)})(e)},onClear:v}),T.map((e=>t.createElement(Va,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class za extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:h,validateTrigger:m,rules:f=[],onChange:g=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(l),className:Fe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Dn(d)},required:e.getFormItemRequired(f)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:o,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(Ka,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{g(t,n,r),e.setViewValue(o,n)}}))),h&&t.createElement(D,null,e.renderFormItemButton(o,h)),p&&t.createElement(D,{flex:Dn(p.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}za.contextType=ul;const Wa=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{label:a,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToCheckbox:u,falseValue:p=oa,trueValue:h=aa}=o,m=e=>Xt(e===h?"am.form.trueText":"am.form.falseText");return t.createElement(M,{checked:r===h,style:s,disabled:d||n.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==i||i(e),l(e,m(e))})(t?h:p)}},u?a:null)};class Ba extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option,{labelToCheckbox:m}=o;return t.createElement(H.Item,{label:m?" ":e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Wa,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Ba.contextType=ul;class Ua extends r{constructor(){super(...arguments),this.linkRef=t.createRef(),this.state={visible:!1},this.getFormFieldsConfig=e=>Tn(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.saveFormFieldsConfig=(e,t)=>Tn(this,void 0,void 0,(function*(){const n=this.context.global,r=null==n?void 0:n.saveComponentConfigApi;if(r)try{yield r({[e]:t})}catch(e){}})),this.resetFieldsHandle=e=>{const t=e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName))||Fn(e);return Object.assign(t,{hidden:e.hidden})}));this.changeHandle(t),this.setLocalFields(t)}}get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}componentDidMount(){this.initLocalfields()}getLocalFields(){if(!this.formUniqueKey)return;const e=JSON.parse(localStorage.getItem(this.formUniqueKey));if(e||this.getFormFieldsConfig(this.formUniqueKey).then((e=>{var t;e?(localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()):(null===(t=this.context.global)||void 0===t?void 0:t.getComponentConfigApi)&&this.setLocalFields(this.props.items)})).catch((()=>{})),!e)return;return ye(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:n}=t,r=e.find((e=>e.fieldName===n));return r?(he(r.hidden)||(t.hidden=r.hidden),t):t})):e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return he(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(this.formUniqueKey));ge(t,n)||(localStorage.setItem(this.formUniqueKey,JSON.stringify(t)),this.saveFormFieldsConfig(this.formUniqueKey,t))}initLocalfields(){const e=this.getLocalFields();e&&this.changeHandle(e)}changeHandle(e){const{fieldsChange:t}=this.props;null==t||t([...e])}popupRender(){const{items:e}=this.props;return t.createElement(ul.Consumer,null,(n=>{const r=n.$$form;return t.createElement("div",{className:Fe("ant-dropdown-menu","fields-list")},t.createElement("div",{className:"reset"},t.createElement($n,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(r.getOriginItems())},Xt("qm.table.columnFilter.reset"))),t.createElement(Vt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:e,setList:t=>{const n=t.map((e=>e.fieldName)),i=e.map((e=>e.fieldName));if(ge(n,i))return;r.setExpandHandle(!0);const l=ia(t);this.changeHandle(l),this.setLocalFields(l)}},e.map((n=>{var i;return t.createElement("li",{key:n.fieldName,className:"item",style:n.noAuth?{display:"none"}:void 0},t.createElement(M,{disabled:(null===(i=n.rules)||void 0===i?void 0:i.findIndex((e=>e.required)))>-1,checked:!n.hidden,onChange:t=>{const{checked:r}=t.target;n.hidden=!r,this.changeHandle(e),this.setLocalFields(e)}}),t.createElement(Ge,{className:"handle",title:Xt("qm.form.draggable")}),t.createElement("span",{className:"title"},r.getFormItemLabel(n.label)))}))))}))}render(){const{visible:e}=this.state,n=jn("form-fields-filter");return t.createElement(ul.Consumer,null,(r=>{const{$size:i}=r.$$form,l={[n]:!0,[`${n}--lg`]:"large"===i,[`${n}--sm`]:"small"===i};return t.createElement(q,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:Fe(l),placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,onOpenChange:e=>{this.setState({visible:e})}},t.createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},t.createElement(Ye,null)))}))}}Ua.contextType=Bt;const Ga=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(ul),{value:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},placeholder:c=Xt("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h,onFocus:m,onBlur:f,onEnter:g,onClear:v}=e.option,{prefix:y,suffix:b,password:x,maxLength:E,pattern:S,toUpper:w,toTrim:C,autoFocus:T,autoComplete:N,secretType:I}=o,R=I&&(p||h),k=t.useRef();t.useEffect((()=>{var e;const t=()=>null==v?void 0:v(),n=null===(e=k.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return u&&n&&n.addEventListener("click",t),()=>{null==n||n.removeEventListener("click",t)}}),[]);const L=e=>{null==l||l(e),a(e)},A=x?O.Password:O,P=R?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e=e.toString(),"finance"===t&&(e=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","))(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e}(i,I):i;return r.isOnlyShow?t.createElement(ja,{value:(e=>e&&x?new Array(e.length).fill("*").join(""):e)(P),bordered:d}):t.createElement(A,{ref:e=>{k.current=e,"function"==typeof n&&n(e)},value:P,autoComplete:x?"new-password":N,autoFocus:T,placeholder:c,style:s,title:x?"":P,prefix:y,suffix:b,maxLength:E,bordered:d,allowClear:u,readOnly:p,disabled:h,onFocus:e=>{null==m||m(e.target.value,e)},onBlur:t=>{var n;let r=null!==(n=t.target.value)&&void 0!==n?n:"";if(C){const e=r.trim();r!==e&&(r=e,L(r))}(t=>{const{onBlur:n}=e;null==n||n(t)})(r),null==f||f(r,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==g||g(n,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=k.current)||void 0===t||t.blur())}},onChange:e=>{let t=e.target.value;be(S)&&(t=S.test(t)?t:null!=i?i:""),w&&(t=t.toUpperCase()),L(t)}})}));Ga.displayName="VInput";class Ya extends r{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Ga,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Ya.contextType=ul;const Xa=e=>{const{$$form:n}=t.useContext(ul),{value:r=[],onChange:i,onValuesChange:l}=e,{options:a={},placeholder:o=Xt("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{prefix:p,suffix:h,maxLength:m}=a,f=e=>{const t=e.every((e=>!e))?[]:e;null==i||i(t),l(t,g(t))},g=e=>e.join(" - ");return n.isOnlyShow?t.createElement(ja,{value:g(r),bordered:s}):t.createElement(O.Group,null,t.createElement(O,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:p,suffix:h,maxLength:m,allowClear:c,bordered:s,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;f([t,r[1]])}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),t.createElement(O,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:p,suffix:h,maxLength:m,bordered:s,allowClear:c,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;f([r[0],t])}}))};class Za extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(s),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(o)},required:e.getFormItemRequired(u)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Xa,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(l,t)}}))),c&&t.createElement(D,{flex:Dn(c.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},c)))))}}Za.contextType=ul;const Qa=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(ul),{value:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},placeholder:c=Xt("qm.form.inputPlaceholder"),bordered:d=!0,readOnly:u,disabled:p,onFocus:h,onBlur:m,onEnter:f}=e.option,{step:g=1,min:v,max:y,precision:b,autoFocus:x,stringMode:E,textAlign:S="left",controls:w=!0,formatter:C,parser:T}=o,N=t.useRef(),I=t.useRef(i),R=e=>{const t=ya(e)?"":ce(e)?e.toFixed(b):new Ft(e).toFixed(b);return"function"==typeof C?C(t):t},O={[S]:!0,controls:w};return r.isOnlyShow?t.createElement(ja,{value:R(i),bordered:d}):t.createElement(j,{ref:e=>{N.current=e,"function"==typeof n&&n(e)},value:i,className:Fe(O),placeholder:c,style:Object.assign({width:"100%"},s),step:g,min:v,max:y,controls:w,precision:b,autoFocus:x,stringMode:E,formatter:C,parser:T,bordered:d,readOnly:u,disabled:p,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{An((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(I.current),null==m||m(I.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==f||f(i,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=N.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!E&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{I.current=e,null==l||l(e),a(e,R(e))})(t)}})}));Qa.displayName="VInputNumber";class Ja extends r{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Qa,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Ja.contextType=ul;const eo=e=>{const{$$form:n}=t.useContext(ul),{value:r=[],onChange:i,onValuesChange:l}=e,{options:a={},placeholder:o=Xt("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{step:p=1,min:h=0,max:m,textAlign:f="left",controls:g=!0,precision:v,formatter:y,parser:b}=a,x=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),E(e)},E=e=>{const t=e.every((e=>null===e))?[]:[...e];null==i||i(t),l(t,S(t))},S=e=>ya(e)?"":e.map((e=>ya(e)?"":Number(e).toFixed(v))),w={[f]:!0,controls:g};return n.isOnlyShow?t.createElement(ja,{value:S(r),bordered:s}):t.createElement(O.Group,null,t.createElement(j,{value:r[0],className:Fe("site-input-left",w),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:p,min:h,max:m,controls:g,precision:v,formatter:y,parser:b,bordered:s,readOnly:d,disabled:u,onChange:e=>{E([e,r[1]])},onBlur:()=>{x(r)}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),t.createElement(j,{value:r[1],className:Fe("site-input-right",w),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:p,min:h,max:m,controls:g,precision:v,formatter:y,parser:b,bordered:s,readOnly:d,disabled:u,onChange:e=>{E([r[0],e])},onBlur:()=>{x(r)}}))};class to extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(s),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(o)},required:e.getFormItemRequired(u)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(eo,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(l,t)}}))),c&&t.createElement(D,{flex:Dn(c.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},c)))))}}var no;to.contextType=ul,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(no||(no={}));const{Search:ro}=O;class io extends r{constructor(e){var t;super(e),t=this,this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||en("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||en("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&en("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Tn(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(!t||_n(u))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=me(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&xa(e,this.alias,c),d&&Ea(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,a){const t=ba(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==l||l([e])}}}catch(e){}this.setState({loading:!1})})),this.todoOpen=e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)},this.createFilters=e=>{const{fieldName:t}=this.props.option,{filterAliasMap:n}=this.searchHelper,r=""!==e?e:void 0,i=("function"==typeof n?n():n)||[],l={[t]:r};return(Array.isArray(i)?i:[i]).forEach((e=>{if(se(e))for(const t in e)l[t]="function"==typeof e[t]?e[t](r):r;else l[e]=r})),l},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=kn,formatter:i=(e=>e)}=t.fetch;return new Promise(((l,a)=>Tn(this,void 0,void 0,(function*(){var o;const s=xe({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});if(!r(s))return a();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=me(e.data,t.fetch.dataKey))&&void 0!==o?o:[];l(n)}else a()}catch(e){a(e)}finally{An((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=ba(e,this.alias[r]);void 0!==i&&(t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i))}for(const n in this.extras){const r=ba(e,this.extras[n]);void 0!==r&&t.SET_FIELDS_EXTRA({[n]:r})}},this.resetSearchHelperValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return Tn(t,void 0,void 0,(function*(){const{fieldName:t}=this.props.option,r=e.filter((e=>{var r;return null===(r=ba(e,this.alias[t]))||void 0===r?void 0:r.toString().toLowerCase().includes(n.toLowerCase())}));if(1===r.length)return this.closeSearchHelper(r[0]);this.openSearchHelper(n)}))},this.openSearchHelper=(e,t)=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:r}=this.searchHelper,i=(null!=r?r:kn)(n.state.formData);(null==i?void 0:i.then)?i.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==i&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias)r!==n&&t.SET_FIELDS_VALUE({[r]:ba(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:ba(e,this.extras[n])});const r=ba(e,this.alias[n]);this.triggerChange(r),this.searchHelperChangeHandle(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.closeButNotSelect=()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:l}=this.props,{type:a,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=Xt("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:Xt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${no[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:Object.assign({},this.deriveParams,c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(ja,{value:l,bordered:p}):t.createElement(t.Fragment,null,t.createElement(ro,{ref:e=>this[`${a}_Ref`]=e,value:l,title:l,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:h,readOnly:m,disabled:f,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:i=!0,table:l}=this.searchHelper;this.triggerBlur(n),this._is_change&&!r&&(n?i?(null===(t=null==l?void 0:l.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e,n))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(n):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!r&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):An((()=>this.clearSearchHelperValue())))}}),t.createElement(dl,b,t.createElement(ip,x)))}}io.contextType=ul;class lo extends r{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ia(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[]}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(io,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}lo.contextType=ul;const ao=e=>{class n extends r{constructor(){var e;super(...arguments),e=this,this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var n,r;const i=e.target,l=null==t?void 0:t.target,a=!i||!l,o=(null===(n=this.$el)||void 0===n?void 0:n.contains(i))||(null===(r=this.$el)||void 0===r?void 0:r.contains(l)),s=this.$el===i,c=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),d=c.some((e=>null==e?void 0:e.contains(i)))||c.includes(l);let u;u=!(a||o||s||d),this.setState({clickOutside:u})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}}componentDidMount(){this.event1=Lt(document,"mousedown",this.mousedownHandler),this.event2=Lt(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:n}=this.props,{clickOutside:r}=this.state;return t.createElement(e,vn({ref:n},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return n.displayName=`OutsideClick(${e.displayName||e.name})`,t.forwardRef(((e,r)=>t.createElement(n,vn({},e,{forwardedRef:r}))))};function oo(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function so(e,t,n,r){var i=Dt.unstable_batchedUpdates?function(e){Dt.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,i,r)}}}var co=d((function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,l=a(),o=a();u(t,(function(){return{}}));var c=a(!1);return!c.current&&Or()&&(o.current=r(),l.current=o.current.parentNode,c.current=!0),s((function(){null==n||n(e)})),s((function(){return null===o.current.parentNode&&null!==l.current&&l.current.appendChild(o.current),function(){var e;null===(e=o.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(o.current)}}),[]),o.current?Dt.createPortal(i,o.current):null}));function uo(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var po;function ho(e){var t=e.prefixCls,n=e.motion,r=e.animation,i=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:i?{motionName:i}:null)}function mo(t){var n=t.prefixCls,r=t.visible,i=t.zIndex,l=t.mask,a=t.maskMotion,o=t.maskAnimation,s=t.maskTransitionName;if(!l)return null;var c={};return(a||s||o)&&(c=Xn({motionAppear:!0},ho({motion:a,prefixCls:n,transitionName:s,animation:o}))),e.createElement(li,ai({},c,{visible:r,removeOnLeave:!0}),(function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:Fe("".concat(n,"-mask"),r)})}))}function fo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function go(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fo(Object(n),!0).forEach((function(t){yo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vo(e){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vo(e)}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bo={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function xo(){if(void 0!==po)return po;po="";var e=document.createElement("p").style;for(var t in bo)t+"Transform"in e&&(po=t);return po}function Eo(){return xo()?"".concat(xo(),"TransitionProperty"):"transitionProperty"}function So(){return xo()?"".concat(xo(),"Transform"):"transform"}function wo(e,t){var n=Eo();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function Co(e,t){var n=So();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var To,No=/matrix\((.*)\)/,Io=/matrix3d\((.*)\)/;function Ro(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Oo(e,t,n){var r=n;if("object"!==vo(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):To(e,t);for(var i in t)t.hasOwnProperty(i)&&Oo(e,i,t[i])}function ko(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}function Lo(e){return ko(e)}function Ao(e){return ko(e,!0)}function Po(e){var t=function(e){var t,n,r,i=e.ownerDocument,l=i.body,a=i&&i.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),r=Math.floor(t.top),{left:n-=a.clientLeft||l.clientLeft||0,top:r-=a.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=Lo(r),t.top+=Ao(r),t}function _o(e){return null!=e&&e==e.window}function Ho(e){return _o(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Fo=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Do=/^(top|right|bottom|left)$/,$o="currentStyle",Mo="runtimeStyle",qo="left";function jo(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function Vo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Ko(e,t,n){"static"===Oo(e,"position")&&(e.style.position="relative");var r=-999,i=-999,l=jo("left",n),a=jo("top",n),o=Vo(l),s=Vo(a);"left"!==l&&(r=999),"top"!==a&&(i=999);var c,d="",u=Po(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[Eo()]||"",wo(e,"none")),"left"in t&&(e.style[o]="",e.style[l]="".concat(r,"px")),"top"in t&&(e.style[s]="",e.style[a]="".concat(i,"px")),Ro(e);var p=Po(e),h={};for(var m in t)if(t.hasOwnProperty(m)){var f=jo(m,n),g="left"===m?r:i,v=u[m]-p[m];h[f]=f===m?g+v:g-v}Oo(e,h),Ro(e),("left"in t||"top"in t)&&wo(e,d);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=jo(b,n),E=t[b]-u[b];y[x]=b===x?h[x]+E:h[x]-E}Oo(e,y)}function zo(e,t){var n=Po(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(So());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(e),i={x:r.x,y:r.y};"left"in t&&(i.x=r.x+t.left-n.left),"top"in t&&(i.y=r.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue(So());if(r&&"none"!==r){var i,l=r.match(No);l?((i=(l=l[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,Co(e,"matrix(".concat(i.join(","),")"))):((i=r.match(Io)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,Co(e,"matrix3d(".concat(i.join(","),")")))}else Co(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function Wo(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Bo(e){return"border-box"===To(e,"boxSizing")}"undefined"!=typeof window&&(To=window.getComputedStyle?function(e,t,n){var r=n,i="",l=Ho(e);return(r=r||l.defaultView.getComputedStyle(e,null))&&(i=r.getPropertyValue(t)||r[t]),i}:function(e,t){var n=e[$o]&&e[$o][t];if(Fo.test(n)&&!Do.test(t)){var r=e.style,i=r[qo],l=e[Mo][qo];e[Mo][qo]=e[$o][qo],r[qo]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[qo]=i,e[Mo][qo]=l}return""===n?"auto":n});var Uo=["margin","border","padding"],Go=-1,Yo=2,Xo=1;function Zo(e,t,n){var r,i,l,a=0;for(i=0;i<t.length;i++)if(r=t[i])for(l=0;l<n.length;l++){var o=void 0;o="border"===r?"".concat(r).concat(n[l],"Width"):r+n[l],a+=parseFloat(To(e,o))||0}return a}var Qo={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Jo(e,t,n){var r=n;if(_o(e))return"width"===t?Qo.viewportWidth(e):Qo.viewportHeight(e);if(9===e.nodeType)return"width"===t?Qo.docWidth(e):Qo.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],l="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),a=Bo(e),o=0;(null==l||l<=0)&&(l=void 0,(null==(o=To(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===r&&(r=a?Xo:Go);var s=void 0!==l||a,c=l||o;return r===Go?s?c-Zo(e,["border","padding"],i):o:s?r===Xo?c:c+(r===Yo?-Zo(e,["border"],i):Zo(e,["margin"],i)):o+Zo(e,Uo.slice(r),i)}Wo(["Width","Height"],(function(e){Qo["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],Qo["viewport".concat(e)](n))},Qo["viewport".concat(e)]=function(t){var n="client".concat(e),r=t.document,i=r.body,l=r.documentElement[n];return"CSS1Compat"===r.compatMode&&l||i&&i[n]||l}}));var es={position:"absolute",visibility:"hidden",display:"block"};function ts(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0];return 0!==i.offsetWidth?r=Jo.apply(void 0,t):function(e,t,n){var r,i={},l=e.style;for(r in t)t.hasOwnProperty(r)&&(i[r]=l[r],l[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(l[r]=i[r])}(i,es,(function(){r=Jo.apply(void 0,t)})),r}function ns(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Wo(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Qo["outer".concat(t)]=function(t,n){return t&&ts(t,e,n?0:Xo)};var n="width"===e?["Left","Right"]:["Top","Bottom"];Qo[e]=function(t,r){var i=r;return void 0!==i?t?(Bo(t)&&(i+=Zo(t,["padding","border"],n)),Oo(t,e,i)):void 0:t&&ts(t,e,Go)}}));var rs={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Ho,offset:function(e,t,n){if(void 0===t)return Po(e);!function(e,t,n){if(n.ignoreShake){var r=Po(e),i=r.left.toFixed(0),l=r.top.toFixed(0),a=t.left.toFixed(0),o=t.top.toFixed(0);if(i===a&&l===o)return}n.useCssRight||n.useCssBottom?Ko(e,t,n):n.useCssTransform&&So()in document.body.style?zo(e,t):Ko(e,t,n)}(e,t,n||{})},isWindow:_o,each:Wo,css:Oo,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:ns,getWindowScrollLeft:function(e){return Lo(e)},getWindowScrollTop:function(e){return Ao(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)rs.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};ns(rs,Qo);var is=rs.getParent;function ls(e){if(rs.isWindow(e)||9===e.nodeType)return null;var t,n=rs.getDocument(e).body,r=rs.css(e,"position");if(!("fixed"===r||"absolute"===r))return"html"===e.nodeName.toLowerCase()?null:is(e);for(t=is(e);t&&t!==n&&9!==t.nodeType;t=is(t))if("static"!==(r=rs.css(t,"position")))return t;return null}var as=rs.getParent;function os(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=ls(e),i=rs.getDocument(e),l=i.defaultView||i.parentWindow,a=i.body,o=i.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===a||r===o||"visible"===rs.css(r,"overflow")){if(r===a||r===o)break}else{var s=rs.offset(r);s.left+=r.clientLeft,s.top+=r.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+r.clientWidth),n.bottom=Math.min(n.bottom,s.top+r.clientHeight),n.left=Math.max(n.left,s.left)}r=ls(r)}var c=null;rs.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===rs.css(e,"position")&&(e.style.position="fixed"));var d=rs.getWindowScrollLeft(l),u=rs.getWindowScrollTop(l),p=rs.viewportWidth(l),h=rs.viewportHeight(l),m=o.scrollWidth,f=o.scrollHeight,g=window.getComputedStyle(a);if("hidden"===g.overflowX&&(m=l.innerWidth),"hidden"===g.overflowY&&(f=l.innerHeight),e.style&&(e.style.position=c),t||function(e){if(rs.isWindow(e)||9===e.nodeType)return!1;var t=rs.getDocument(e),n=t.body,r=null;for(r=as(e);r&&r!==n&&r!==t;r=as(r))if("fixed"===rs.css(r,"position"))return!0;return!1}(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,u),n.right=Math.min(n.right,d+p),n.bottom=Math.min(n.bottom,u+h);else{var v=Math.max(m,d+p);n.right=Math.min(n.right,v);var y=Math.max(f,u+h);n.bottom=Math.min(n.bottom,y)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function ss(e){var t,n,r;if(rs.isWindow(e)||9===e.nodeType){var i=rs.getWindow(e);t={left:rs.getWindowScrollLeft(i),top:rs.getWindowScrollTop(i)},n=rs.viewportWidth(i),r=rs.viewportHeight(i)}else t=rs.offset(e),n=rs.outerWidth(e),r=rs.outerHeight(e);return t.width=n,t.height=r,t}function cs(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,l=e.height,a=e.left,o=e.top;return"c"===n?o+=l/2:"b"===n&&(o+=l),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:o}}function ds(e,t,n,r,i){var l=cs(t,n[1]),a=cs(e,n[0]),o=[a.left-l.left,a.top-l.top];return{left:Math.round(e.left-o[0]+r[0]-i[0]),top:Math.round(e.top-o[1]+r[1]-i[1])}}function us(e,t,n){return e.left<n.left||e.left+t.width>n.right}function ps(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function hs(e,t,n){var r=[];return rs.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function ms(e,t){return e[t]=-e[t],e}function fs(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function gs(e,t){e[0]=fs(e[0],t.width),e[1]=fs(e[1],t.height)}function vs(e,t,n,r){var i=n.points,l=n.offset||[0,0],a=n.targetOffset||[0,0],o=n.overflow,s=n.source||e;l=[].concat(l),a=[].concat(a);var c={},d=0,u=os(s,!(!(o=o||{})||!o.alwaysByViewport)),p=ss(s);gs(l,p),gs(a,t);var h=ds(p,t,i,l,a),m=rs.merge(p,h);if(u&&(o.adjustX||o.adjustY)&&r){if(o.adjustX&&us(h,p,u)){var f=hs(i,/[lr]/gi,{l:"r",r:"l"}),g=ms(l,0),v=ms(a,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(ds(p,t,f,g,v),p,u)||(d=1,i=f,l=g,a=v)}if(o.adjustY&&ps(h,p,u)){var y=hs(i,/[tb]/gi,{t:"b",b:"t"}),b=ms(l,1),x=ms(a,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(ds(p,t,y,b,x),p,u)||(d=1,i=y,l=b,a=x)}d&&(h=ds(p,t,i,l,a),rs.mix(m,h));var E=us(h,p,u),S=ps(h,p,u);if(E||S){var w=i;E&&(w=hs(i,/[lr]/gi,{l:"r",r:"l"})),S&&(w=hs(i,/[tb]/gi,{t:"b",b:"t"})),i=w,l=n.offset||[0,0],a=n.targetOffset||[0,0]}c.adjustX=o.adjustX&&E,c.adjustY=o.adjustY&&S,(c.adjustX||c.adjustY)&&(m=function(e,t,n,r){var i=rs.clone(e),l={width:t.width,height:t.height};return r.adjustX&&i.left<n.left&&(i.left=n.left),r.resizeWidth&&i.left>=n.left&&i.left+l.width>n.right&&(l.width-=i.left+l.width-n.right),r.adjustX&&i.left+l.width>n.right&&(i.left=Math.max(n.right-l.width,n.left)),r.adjustY&&i.top<n.top&&(i.top=n.top),r.resizeHeight&&i.top>=n.top&&i.top+l.height>n.bottom&&(l.height-=i.top+l.height-n.bottom),r.adjustY&&i.top+l.height>n.bottom&&(i.top=Math.max(n.bottom-l.height,n.top)),rs.mix(i,l)}(h,p,u,c))}return m.width!==p.width&&rs.css(s,"width",rs.width(s)+m.width-p.width),m.height!==p.height&&rs.css(s,"height",rs.height(s)+m.height-p.height),rs.offset(s,{left:m.left,top:m.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:l,targetOffset:a,overflow:c}}function ys(e,t,n){var r=n.target||t,i=ss(r),l=!function(e,t){var n=os(e,t),r=ss(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return vs(e,i,n,l)}ys.__getOffsetParent=ls,ys.__getVisibleRectForElement=os;var bs=Or()?e.useLayoutEffect:e.useEffect,xs=function(t,n){var r=e.useRef(!0);bs((function(){return t(r.current)}),n),bs((function(){return r.current=!1,function(){r.current=!0}}),[])};function Es(e,t){var n=null,r=null;var i=new Ot((function(e){var i=Qn(e,1)[0].target;if(document.documentElement.contains(i)){var l=i.getBoundingClientRect(),a=l.width,o=l.height,s=Math.floor(a),c=Math.floor(o);n===s&&r===c||Promise.resolve().then((function(){t({width:s,height:c})})),n=s,r=c}}));return e&&i.observe(e),function(){i.disconnect()}}function Ss(e){return"function"!=typeof e?null:e()}function ws(e){return"object"===Bn(e)&&e?e:null}var Cs=function(e,n){var r=e.children,i=e.disabled,l=e.target,a=e.align,o=e.onAlign,s=e.monitorWindowResize,c=e.monitorBufferTime,d=void 0===c?0:c,u=t.useRef({}),p=t.useRef(),h=t.Children.only(r),m=t.useRef({});m.current.disabled=i,m.current.target=l,m.current.align=a,m.current.onAlign=o;var f=function(e,n){var r=t.useRef(!1),i=t.useRef(null);function l(){window.clearTimeout(i.current)}return[function t(a){if(l(),r.current&&!0!==a)i.current=window.setTimeout((function(){r.current=!1,t()}),n);else{if(!1===e(a))return;r.current=!0,i.current=window.setTimeout((function(){r.current=!1}),n)}},function(){r.current=!1,l()}]}((function(){var e=m.current,t=e.disabled,n=e.target,r=e.align,i=e.onAlign,l=p.current;if(!t&&n&&l){var a,o=Ss(n),s=ws(n);u.current.element=o,u.current.point=s,u.current.align=r;var c=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),l=i.width,a=i.height;if(l||a)return!0}}return!1}(o)?a=ys(l,o,r):s&&(a=function(e,t,n){var r,i,l=rs.getDocument(e),a=l.defaultView||l.parentWindow,o=rs.getWindowScrollLeft(a),s=rs.getWindowScrollTop(a),c=rs.viewportWidth(a),d=rs.viewportHeight(a),u={left:r="pageX"in t?t.pageX:o+t.clientX,top:i="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=o+c&&i>=0&&i<=s+d,h=[n.points[0],"cc"];return vs(e,u,go(go({},n),{},{points:h}),p)}(l,s,r)),function(e,t){e!==document.activeElement&&oo(t,e)&&"function"==typeof e.focus&&e.focus()}(c,l),i&&a&&i(l,a),!0}return!1}),d),g=Qn(f,2),v=g[0],y=g[1],b=Qn(t.useState(),2),x=b[0],E=b[1],S=Qn(t.useState(),2),w=S[0],C=S[1];return xs((function(){E(Ss(l)),C(ws(l))})),t.useEffect((function(){var e,t;u.current.element===x&&((e=u.current.point)===(t=w)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(t);if(cn(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(n&&l>1)return!1;r.add(t);var o=l+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],i[s],o))return!1;return!0}if(t&&i&&"object"===Bn(t)&&"object"===Bn(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every((function(n){return e(t[n],i[n],o)}))}return!1}(e,t)}(u.current.align,a)||v()})),t.useEffect((function(){return Es(p.current,v)}),[p.current]),t.useEffect((function(){return Es(x,v)}),[x]),t.useEffect((function(){i?y():v()}),[i]),t.useEffect((function(){if(s)return so(window,"resize",v).remove}),[s]),t.useEffect((function(){return function(){y()}}),[]),t.useImperativeHandle(n,(function(){return{forceAlign:function(){return v(!0)}}})),t.isValidElement(h)&&(h=t.cloneElement(h,{ref:lr(h.ref,p)})),h},Ts=t.forwardRef(Cs);function Ns(){Ns=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var l=t&&t.prototype instanceof p?t:p,a=Object.create(l.prototype),o=new T(i||[]);return r(a,"_invoke",{value:E(e,n,o)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function h(){}function m(){}var f={};s(f,l,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(N([])));v&&v!==t&&n.call(v,l)&&(f=v);var y=m.prototype=p.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,l,a,o){var s=d(e[r],e,l);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Bn(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,o)}))}o(s.arg)}var l;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return l=l?l.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(i,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw l;return I()}for(n.method=i,n.arg=l;;){var a=n.delegate;if(a){var o=S(a,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=d(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var l=i.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function N(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=m,r(y,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:h,configurable:!0}),h.displayName=s(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,l){void 0===l&&(l=Promise);var a=new x(c(t,n,r,i),l);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),s(y,o,"Generator"),s(y,l,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=N,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],a=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var o=n.call(l,"catchLoc"),s=n.call(l,"finallyLoc");if(o&&s){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(o){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return r(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var l=i;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var a=l?l.completion:{};return a.type=e,a.arg=t,l?(this.method="next",this.next=l.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Is(e,t,n,r,i,l,a){try{var o=e[l](a),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,i)}function Rs(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var l=e.apply(t,n);function a(e){Is(l,r,i,a,o,"next",e)}function o(e){Is(l,r,i,a,o,"throw",e)}a(void 0)}))}}Ts.displayName="Align";var Os=["measure","alignPre","align",null,"motion"],ks=e.forwardRef((function(t,n){var r=t.visible,i=t.prefixCls,l=t.className,o=t.style,c=t.children,d=t.zIndex,u=t.stretch,h=t.destroyPopupOnHide,m=t.forceRender,f=t.align,g=t.point,v=t.getRootDomNode,y=t.getClassNameFromAlign,b=t.onAlign,x=t.onMouseEnter,E=t.onMouseLeave,S=t.onMouseDown,w=t.onTouchStart,C=t.onClick,T=a(),N=a(),I=Qn(p(),2),R=I[0],O=I[1],k=function(t){var n=Qn(e.useState({width:0,height:0}),2),r=n[0],i=n[1];return[e.useMemo((function(){var e={};if(t){var n=r.width,i=r.height;-1!==t.indexOf("height")&&i?e.height=i:-1!==t.indexOf("minHeight")&&i&&(e.minHeight=i),-1!==t.indexOf("width")&&n?e.width=n:-1!==t.indexOf("minWidth")&&n&&(e.minWidth=n)}return e}),[t,r]),function(e){var t=e.offsetWidth,n=e.offsetHeight,r=e.getBoundingClientRect(),l=r.width,a=r.height;Math.abs(t-l)<1&&Math.abs(n-a)<1&&(t=l,n=a),i({width:t,height:n})}]}(u),L=Qn(k,2),A=L[0],P=L[1];var _=function(e,t){var n=Qn(yr(null),2),r=n[0],i=n[1],l=a();function o(e){i(e,!0)}function c(){Qr.cancel(l.current)}return s((function(){o("measure")}),[e]),s((function(){"measure"===r&&t(),r&&(l.current=Qr(Rs(Ns().mark((function e(){var t,n;return Ns().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Os.indexOf(r),(n=Os[t+1])&&-1!==t&&o(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),s((function(){return function(){c()}}),[]),[r,function(e){c(),l.current=Qr((function(){o((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r,(function(){u&&P(v())})),H=Qn(_,2),F=H[0],D=H[1],$=Qn(p(0),2),M=$[0],q=$[1],j=a();function V(){var e;null===(e=T.current)||void 0===e||e.forceAlign()}function K(e,t){var n=y(t);R!==n&&O(n),q((function(e){return e+1})),"align"===F&&(null==b||b(e,t))}xs((function(){"alignPre"===F&&q(0)}),[F]),xs((function(){"align"===F&&(M<3?V():D((function(){var e;null===(e=j.current)||void 0===e||e.call(j)})))}),[M]);var z=Xn({},ho(t));function W(){return new Promise((function(e){j.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=z[e];z[e]=function(e,n){return D(),null==t?void 0:t(e,n)}})),e.useEffect((function(){z.motionName||"motion"!==F||D()}),[z.motionName,F]),e.useImperativeHandle(n,(function(){return{forceAlign:V,getElement:function(){return N.current}}}));var B=Xn(Xn({},A),{},{zIndex:d,opacity:"motion"!==F&&"stable"!==F&&r?0:void 0,pointerEvents:r||"stable"===F?void 0:"none"},o),U=!0;null==f||!f.points||"align"!==F&&"stable"!==F||(U=!1);var G=c;return e.Children.count(c)>1&&(G=e.createElement("div",{className:"".concat(i,"-content")},c)),e.createElement(li,ai({visible:r,ref:N,leavedClassName:"".concat(i,"-hidden")},z,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:h,forceRender:m}),(function(t,n){var r=t.className,a=t.style,o=Fe(i,l,R,r);return e.createElement(Ts,{target:g||v,key:"popup",ref:T,monitorWindowResize:!0,disabled:U,align:f,onAlign:K},e.createElement("div",{ref:n,className:o,onMouseEnter:x,onMouseLeave:E,onMouseDownCapture:S,onTouchStartCapture:w,onClick:C,style:Xn(Xn({},a),B)},G))}))}));ks.displayName="PopupInner";var Ls=e.forwardRef((function(t,n){var r=t.prefixCls,i=t.visible,l=t.zIndex,a=t.children,o=t.mobile,s=(o=void 0===o?{}:o).popupClassName,c=o.popupStyle,d=o.popupMotion,u=void 0===d?{}:d,p=o.popupRender,h=t.onClick,m=e.useRef();e.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return m.current}}}));var f=Xn({zIndex:l},c),g=a;return e.Children.count(a)>1&&(g=e.createElement("div",{className:"".concat(r,"-content")},a)),p&&(g=p(g)),e.createElement(li,ai({visible:i,ref:m,removeOnLeave:!0},u),(function(t,n){var i=t.className,l=t.style,a=Fe(r,s,i);return e.createElement("div",{ref:n,className:a,onClick:h,style:Xn(Xn({},l),f)},g)}))}));Ls.displayName="MobilePopupInner";var As=["visible","mobile"],Ps=e.forwardRef((function(t,n){var r=t.visible,i=t.mobile,l=or(t,As),a=Qn(p(r),2),o=a[0],c=a[1],d=Qn(p(!1),2),u=d[0],h=d[1],m=Xn(Xn({},l),{},{visible:o});s((function(){c(r),r&&i&&h(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[r,i]);var f=u?e.createElement(Ls,ai({},m,{mobile:i,ref:n})):e.createElement(ks,ai({},m,{ref:n}));return e.createElement("div",null,e.createElement(mo,m),f)}));Ps.displayName="Popup";var _s=e.createContext(null);function Hs(){}function Fs(){return""}function Ds(e){return e?e.ownerDocument:window.document}var $s=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var Ms=function(t){var n=function(n){hr(i,e.Component);var r=gr(i);function i(t){var n,l;return cr(this,i),Gn(fr(n=r.call(this,t)),"popupRef",e.createRef()),Gn(fr(n),"triggerRef",e.createRef()),Gn(fr(n),"portalContainer",void 0),Gn(fr(n),"attachId",void 0),Gn(fr(n),"clickOutsideHandler",void 0),Gn(fr(n),"touchOutsideHandler",void 0),Gn(fr(n),"contextMenuOutsideHandler1",void 0),Gn(fr(n),"contextMenuOutsideHandler2",void 0),Gn(fr(n),"mouseDownTimeout",void 0),Gn(fr(n),"focusTime",void 0),Gn(fr(n),"preClickTime",void 0),Gn(fr(n),"preTouchTime",void 0),Gn(fr(n),"delayTimer",void 0),Gn(fr(n),"hasPopupMouseDown",void 0),Gn(fr(n),"onMouseEnter",(function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)})),Gn(fr(n),"onMouseMove",(function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)})),Gn(fr(n),"onMouseLeave",(function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Gn(fr(n),"onPopupMouseEnter",(function(){n.clearDelayTimer()})),Gn(fr(n),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&oo(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Gn(fr(n),"onFocus",(function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))})),Gn(fr(n),"onMouseDown",(function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()})),Gn(fr(n),"onTouchStart",(function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()})),Gn(fr(n),"onBlur",(function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)})),Gn(fr(n),"onContextMenu",(function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)})),Gn(fr(n),"onContextMenuClose",(function(){n.isContextMenuToShow()&&n.close()})),Gn(fr(n),"onClick",(function(e){if(n.fireEvents("onClick",e),n.focusTime){var t;if(n.preClickTime&&n.preTouchTime?t=Math.min(n.preClickTime,n.preTouchTime):n.preClickTime?t=n.preClickTime:n.preTouchTime&&(t=n.preTouchTime),Math.abs(t-n.focusTime)<20)return;n.focusTime=0}n.preClickTime=0,n.preTouchTime=0,n.isClickToShow()&&(n.isClickToHide()||n.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!n.state.popupVisible;(n.isClickToHide()&&!r||r&&n.isClickToShow())&&n.setPopupVisible(!n.state.popupVisible,e)})),Gn(fr(n),"onPopupMouseDown",(function(){var e;(n.hasPopupMouseDown=!0,clearTimeout(n.mouseDownTimeout),n.mouseDownTimeout=window.setTimeout((function(){n.hasPopupMouseDown=!1}),0),n.context)&&(e=n.context).onPopupMouseDown.apply(e,arguments)})),Gn(fr(n),"onDocumentClick",(function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),i=n.getPopupDomNode();oo(r,t)&&!n.isContextMenuOnly()||oo(i,t)||n.hasPopupMouseDown||n.close()}})),Gn(fr(n),"getRootDomNode",(function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=er(n.triggerRef.current);if(t)return t}catch(e){}return Dt.findDOMNode(fr(n))})),Gn(fr(n),"getPopupClassNameFromAlign",(function(e){var t=[],r=n.props,i=r.popupPlacement,l=r.builtinPlacements,a=r.prefixCls,o=r.alignPoint,s=r.getPopupClassNameFromAlign;return i&&l&&t.push(function(e,t,n,r){for(var i=n.points,l=Object.keys(e),a=0;a<l.length;a+=1){var o=l[a];if(uo(e[o].points,i,r))return"".concat(t,"-placement-").concat(o)}return""}(l,a,e,o)),s&&t.push(s(e)),t.join(" ")})),Gn(fr(n),"getComponent",(function(){var t=n.props,r=t.prefixCls,i=t.destroyPopupOnHide,l=t.popupClassName,a=t.onPopupAlign,o=t.popupMotion,s=t.popupAnimation,c=t.popupTransitionName,d=t.popupStyle,u=t.mask,p=t.maskAnimation,h=t.maskTransitionName,m=t.maskMotion,f=t.zIndex,g=t.popup,v=t.stretch,y=t.alignPoint,b=t.mobile,x=t.forceRender,E=t.onPopupClick,S=n.state,w=S.popupVisible,C=S.point,T=n.getPopupAlign(),N={};return n.isMouseEnterToShow()&&(N.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(N.onMouseLeave=n.onPopupMouseLeave),N.onMouseDown=n.onPopupMouseDown,N.onTouchStart=n.onPopupMouseDown,e.createElement(Ps,ai({prefixCls:r,destroyPopupOnHide:i,visible:w,point:y&&C,className:l,align:T,onAlign:a,animation:s,getClassNameFromAlign:n.getPopupClassNameFromAlign},N,{stretch:v,getRootDomNode:n.getRootDomNode,style:d,mask:u,zIndex:f,transitionName:c,maskAnimation:p,maskTransitionName:h,maskMotion:m,ref:n.popupRef,motion:o,mobile:b,forceRender:x,onClick:E}),"function"==typeof g?g():g)})),Gn(fr(n),"attachParent",(function(e){Qr.cancel(n.attachId);var t,r=n.props,i=r.getPopupContainer,l=r.getDocument,a=n.getRootDomNode();i?(a||0===i.length)&&(t=i(a)):t=l(n.getRootDomNode()).body,t?t.appendChild(e):n.attachId=Qr((function(){n.attachParent(e)}))})),Gn(fr(n),"getContainer",(function(){if(!n.portalContainer){var e=(0,n.props.getDocument)(n.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",n.portalContainer=e}return n.attachParent(n.portalContainer),n.portalContainer})),Gn(fr(n),"setPoint",(function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Gn(fr(n),"handlePortalUpdate",(function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)})),Gn(fr(n),"triggerContextValue",{onPopupMouseDown:n.onPopupMouseDown}),l="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,n.state={prevPopupVisible:l,popupVisible:l},$s.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),n}return ur(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=so(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=so(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=so(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=so(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Qr.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?function(e,t,n){return Xn(Xn({},e[t]||{}),n)}(r,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:r}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var r=this,i=1e3*t;if(this.clearDelayTimer(),i){var l=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(e,l),r.clearDelayTimer()}),i)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var n=this.state.popupVisible,r=this.props,i=r.children,l=r.forceRender,a=r.alignPoint,o=r.className,s=r.autoDestroy,c=e.Children.only(i),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,a&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=Fe(c&&c.props&&c.props.className,o);u&&(d.className=u);var p=Xn({},d);ar(c)&&(p.ref=lr(this.triggerRef,c.ref));var h,m=e.cloneElement(c,p);return(n||this.popupRef.current||l)&&(h=e.createElement(t,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!n&&s&&(h=null),e.createElement(_s.Provider,{value:this.triggerContextValue},m,h)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,r={};return void 0!==n&&t.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=t.popupVisible),r}}]),i}();return Gn(n,"contextType",_s),Gn(n,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Fs,getDocument:Ds,onPopupVisibleChange:Hs,afterPopupVisibleChange:Hs,onPopupAlign:Hs,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),n}(co);let qs=class extends r{constructor(e){var n;super(e),n=this,this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||en("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||en("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:r}=n.alias;n.setRecords(Ee([...n._records.filter((e=>t.includes(e[r]))),...e],r));const i=n.recordsToDict();n.setItemList(i),n.triggerChange(i.map((e=>e.value)));const{closed:l}=n.searchHelper;n.setVisible(!1,(()=>{setTimeout((()=>null==l?void 0:l(n._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;ge(n,r)||ge(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:l={},formatter:a=(e=>e),dataKey:o,callback:s,fieldAliasMap:c}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof c?c():c||{},{value:u}=this.props;if(i){if(_n(u))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(a(Object.assign(Object.assign({},l),{keys:u})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=me(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==r&&(e[r]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==n&&(e[n]=e[d.textKey])})),i=i.filter((e=>u.includes(e[r])));const l=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(l),this.setViewValue(u),null==s||s(i)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:l,visible2:a,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:h={},placeholder:m=Xt("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,E={visible:l,title:Xt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${no[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:xe({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),w=s.filter((e=>null==c?void 0:c.includes(e.value))),T=t.createElement("ul",{className:"ant-dropdown-menu"},w.length?w.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Xt("qm.table.config.emptyText"))),N=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=jn("form-multiple-search-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(ja,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(Ms,{popupVisible:!y&&a,popup:T,popupClassName:Fe(O),popupStyle:{minWidth:N},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:da,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement($,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:m,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},h),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Xe,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(dl,E,t.createElement(ip,S)))}};qs.contextType=ul,qs=Cn([ao],qs);class js extends r{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ia(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(qs,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(a,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}js.contextType=ul;const{Search:Vs}=O;class Ks extends r{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||en("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||en("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&en("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Tn(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(!t||_n(u))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=me(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&xa(e,this.alias,c),d&&Ea(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,a){const t=ba(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==l||l([e])}}}catch(e){}this.setState({loading:!1})})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=ba(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:ba(e,this.extras[n])})},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias)r!==n&&t.SET_FIELDS_VALUE({[r]:ba(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:ba(e,this.extras[n])});const r=ba(e,this.alias[n]);this.triggerChange(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:l=""}=this.props,{type:a,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=Xt("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:Xt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${no[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:xe({},c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return n.isOnlyShow?t.createElement(ja,{value:l,bordered:p}):t.createElement(t.Fragment,null,t.createElement(Vs,{ref:e=>this[`${a}_Ref`]=e,value:l,title:l,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:h,readOnly:m,disabled:f,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),t.createElement(dl,b,t.createElement(sp,x)))}}Ks.contextType=ul;class zs extends r{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ia(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Ks,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n)=>{f(t,n),e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}zs.contextType=ul;let Ws=class extends r{constructor(e){var n;super(e),n=this,this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||en("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||en("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:r}=n.alias;n.setRecords(Ee([...n._records.filter((e=>t.includes(e[r]))),...e],r));const i=n.recordsToDict();n.setItemList(i),n.triggerChange(i.map((e=>e.value)));const{closed:l}=n.searchHelper;n.setVisible(!1,(()=>{setTimeout((()=>null==l?void 0:l(n._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;ge(n,r)||ge(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:l={},formatter:a=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof s?s():s||{},{value:d}=this.props;if(i){if(_n(d))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(a(Object.assign(Object.assign({},l),{keys:d})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=me(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==c?void 0:c.valueKey)&&c.valueKey!==r&&(e[r]=e[c.valueKey]),(null==c?void 0:c.textKey)&&c.textKey!==n&&(e[n]=e[c.textKey])})),i=i.filter((e=>d.includes(e[r])));const l=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(l),this.setViewValue(d)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:l,visible2:a,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:h={},placeholder:m=Xt("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,E={visible:l,title:Xt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${no[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:xe({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),w=s.filter((e=>null==c?void 0:c.includes(e.value))),T=t.createElement("ul",{className:"ant-dropdown-menu"},w.length?w.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Xt("qm.table.config.emptyText"))),N=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=jn("form-multiple-tree-table-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(ja,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(Ms,{popupVisible:!y&&a,popup:T,popupClassName:Fe(O),popupStyle:{minWidth:N},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:da,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement($,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:m,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},h),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Xe,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(dl,E,t.createElement(sp,S)))}};Ws.contextType=ul,Ws=Cn([ao],Ws);class Bs extends r{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ia(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Ws,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(a,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Bs.contextType=ul;const Us=new Array(2).fill("");class Gs extends r{constructor(e){var t;super(e),t=this,this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Us},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||en("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||en("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;this._is_change=!1,null==t||t(e),n(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(Us),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:n}=this.alias,r=e.map((e=>({value:e[t],text:e[n]})));this.setRecords(e),this.setItemList(r),this.setTextValue(r.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:_n(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=kn,formatter:i=(e=>e)}=t.fetch;return new Promise(((l,a)=>Tn(this,void 0,void 0,(function*(){var o;const s=xe({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!r(s))return a();this.setState({loading:!0});const e=yield t.fetch.api(s);if(An((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=me(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return l(n)}}catch(e){this.setState({loading:!1})}a()}))))},this.resetSearchHelperValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Tn(t,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:n}=this.alias,r=e.filter((e=>{var r;const i=null===(r=e[n])||void 0===r?void 0:r.toString().toLowerCase();return t.some((e=>null==i?void 0:i.includes(e.toLowerCase())))}));if(2===r.length)return this.closeSearchHelper(r);this.openSearchHelper()}))},this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;ge(t,n)||ge(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:i}=this.props.option;if(!ge(r[i],this._ceho_data)&&(this._ceho_data=r[i],this.setItemList(r[i]),n.length)){const e=Us.map(((e,t)=>{var l,a;return null!==(a=null===(l=r[i].find((e=>e.value===n[t])))||void 0===l?void 0:l.text)&&void 0!==a?a:""}));this.setTextValue(e)}}getItemList(){var e;return Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:n}=this.alias,{fetchApi:r,params:i={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(r){if(_n(c))return this.setRecords([]);this.setState({loading:!0});try{const o=yield r(l(Object.assign(Object.assign({},i),{keys:c})));if(200===o.code){let r=Array.isArray(o.data)?o.data:null!==(e=me(o.data,a))&&void 0!==e?e:[];r.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==n&&(e[n]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),r=r.filter((e=>c.includes(e[n]))).slice(0,2);const i=r.map((e=>({value:e[n],text:e[t]})));this.setRecords(r),this.setItemList(i),this.setTextValue(i.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}))}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){var e;const{$$form:n}=this.context;this.props;const{visible:r,loading:i,textValue:l}=this.state,{fieldName:a,options:o={},searchHelper:s={},placeholder:c=Xt("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||s,m=l.every((e=>ya(e)))?"":l.join(" - "),f={visible:r,title:Xt("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${no[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},g=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:xe({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(ja,{value:m,bordered:d}):t.createElement(t.Fragment,null,t.createElement(O.Group,null,t.createElement(O,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:c[0],allowClear:!1,bordered:d,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?l.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):l.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;h||(this._is_change=!0,this.setTextValue([t,l[1]]))}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:p,readOnly:!0}),t.createElement(O.Search,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:c[1],loading:i,bordered:d,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?l.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):l.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:h||(this._is_change=!0,this.setTextValue([l[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),t.createElement(dl,f,t.createElement(pp,g)))}}Gs.contextType=ul;class Ys extends r{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ia(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(c),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Gs,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{m(t,r),e.setViewValue(a,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(a,u)),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ys.contextType=ul;const Xs=e=>{const{$$form:n}=t.useContext(ul),{value:r,items:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,h=_n(p)?i:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return n.isOnlyShow?t.createElement(ja,{value:m(r),bordered:c}):t.createElement(M.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u,onChange:e=>{(e=>{null==l||l(e),a(e,m(e))})(e)}},h.map((e=>t.createElement(M,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Zs extends r{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}getItemList(){var e;return Tn(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Xs,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Zs.contextType=ul;const Qs=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},style:o={},allowClear:s=!0,readOnly:c,disabled:d=n.isFormDisabled}=e.option,{allowHalf:u,count:p=5,tooltips:h}=a,m=e=>h?h[Math.ceil(e)-1]:e.toString();return t.createElement(V,{value:r,count:p,style:o,allowHalf:u,allowClear:s,tooltips:h,disabled:d||n.isOnlyShow,onChange:e=>{(e=>{null==i||i(e),l(e,m(e))})(e)}})};class Js extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Qs,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Js.contextType=ul;const ec=e=>{const{$$form:n}=t.useContext(ul),{value:r,items:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u=n.isFormDisabled}=e.option,{itemList:p=[]}=o,h=_n(p)?i:p,m=e=>{var t,n;return null!==(n=null===(t=h.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==n?n:""};return n.isOnlyShow?t.createElement(ja,{value:m(r),bordered:c}):t.createElement(K.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u||n.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),a(e,m(e))})(t)}},h.map((e=>t.createElement(K,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class tc extends r{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(ec,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}tc.contextType=ul;const nc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{label:a,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToSwitch:u,falseValue:p=oa,trueValue:h=aa}=o;return t.createElement(t.Fragment,null,t.createElement(z,{checked:r===h,style:s,disabled:d||n.isOnlyShow,checkedChildren:t.createElement(je,null),unCheckedChildren:t.createElement(Ze,null),onChange:e=>{(e=>{null==i||i(e),l(e,Xt(e===h?"am.form.trueText":"am.form.falseText"))})(e?h:p)}}),u?t.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},a):null)};class rc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option,{labelToSwitch:m}=o;return t.createElement(H.Item,{label:m?" ":e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(nc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}rc.contextType=ul;const ic=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},style:o={},placeholder:s=Xt("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p,onBlur:h,onEnter:m}=e.option,{showCount:f,maxLength:g,autoSize:v}=a,y=Object.assign({},{minRows:1,maxRows:3},v);return t.createElement(O.TextArea,{value:r,placeholder:s,style:o,maxLength:g,showCount:f,autoSize:y,bordered:c,allowClear:d,readOnly:u||n.isOnlyShow,disabled:p,onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),null==h||h(n,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==m||m(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==i||i(e),l(e)})(t)}})};class lc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ic,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}lc.contextType=ul;const ac=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{fieldName:a,options:o={},style:s={},placeholder:c=Xt("qm.form.datePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{dateType:m="date",format:f,disabledDate:v,minDateTime:y,maxDateTime:b,shortCuts:x=!0}=o,E=t.createRef(),S=e=>{e&&"date"===m&&(e=e.slice(0,10)+" 00:00:00"),null==i||i(e),l(e,w(e))},w=e=>ya(e)?"":["date","exactdate"].includes(m)?e.slice(0,10):e,C=e=>{let t=va(g().subtract(e,"day"),pa[m]);"date"===m&&(t=t.slice(0,10)),S(t),E.current.blur(),E.current.focus()};return n.isOnlyShow?t.createElement(ja,{value:w(r),bordered:d}):t.createElement(gn,{ref:E,style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${a}`,picker:ua[m],format:f,bordered:d,showToday:!1,showTime:"datetime"===m&&{defaultValue:g("00:00:00","HH:mm:ss")},allowClear:u,disabled:h,inputReadOnly:p,disabledDate:null!=v?v:e=>((e,t)=>{let[n,r]=t;return n&&r?e.isBefore(n,"day")||e.isAfter(r,"day"):n?e.isBefore(n,"day"):!!r&&e.isAfter(r,"day")})(e,[y,b]),renderExtraFooter:x&&m.includes("date")?()=>"function"==typeof x?x():t.createElement(t.Fragment,null,t.createElement(W,{color:"processing",onClick:()=>C(0)},Xt("qm.form.datePickers")[0]),t.createElement(W,{color:"processing",onClick:()=>C(1)},Xt("qm.form.datePickers")[1]),t.createElement(W,{color:"processing",onClick:()=>C(7)},Xt("qm.form.datePickers")[2]),t.createElement(W,{color:"processing",onClick:()=>C(30)},Xt("qm.form.datePickers")[3])):void 0,value:ga(r,pa[m]),onChange:(e,t)=>{S(va(e,pa[m]))}})};class oc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ac,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}oc.contextType=ul;const sc=e=>[g().subtract(e,"day"),g()],cc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{fieldName:a,options:o={},style:s={},placeholder:c=Xt("qm.form.daterangePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h=n.isFormDisabled}=e.option,{dateType:m="date",format:f,disableds:v=[!1,!1],allowEmpty:y,disabledDate:b,minDateTime:x,maxDateTime:E,shortCuts:S=!0}=o,w={[Xt("qm.form.dateRangePickers")[0]]:sc(7),[Xt("qm.form.dateRangePickers")[1]]:sc(30),[Xt("qm.form.dateRangePickers")[2]]:sc(90),[Xt("qm.form.dateRangePickers")[3]]:sc(180)},C=e=>ya(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return n.isOnlyShow?t.createElement(ja,{value:C(r),bordered:d}):t.createElement(gn.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${a}`,picker:ua[m],format:f,bordered:d,showTime:"datetime"===m&&{defaultValue:[g("00:00:00","HH:mm:ss"),g("23:59:59","HH:mm:ss")]},allowClear:u,allowEmpty:y,disabled:h?[!0,!0]:v,inputReadOnly:p,disabledDate:null!=b?b:e=>((e,t)=>{let[n,r]=t;return n&&r?e.isBefore(n,"day")||e.isAfter(r,"day"):n?e.isBefore(n,"day"):!!r&&e.isAfter(r,"day")})(e,[x,E]),ranges:S&&m.includes("date")?w:void 0,value:_n(r)?null:[ga(null==r?void 0:r[0],pa[m]),ga(null==r?void 0:r[1],pa[m])],onChange:(e,t)=>{(e=>{"date"===m&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==i||i(e),l(e,C(e))})([va(null==e?void 0:e[0],pa[m]),va(null==e?void 0:e[1],pa[m])])}})};class dc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(cc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}dc.contextType=ul;const uc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{fieldName:a,options:o={},style:s={},placeholder:c=Xt("qm.form.timePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",hourStep:f=1,minuteStep:g=1,secondStep:v=1}=o;return n.isOnlyShow?t.createElement(ja,{value:r,bordered:d}):t.createElement(yn,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${a}`,bordered:d,showNow:!0,hourStep:f,minuteStep:g,secondStep:v,allowClear:u,disabled:h,inputReadOnly:p,format:ha[m],value:ga(r,ha[m]),onChange:(e,t)=>{(e=>{const t=va(e,ha[m]);null==i||i(t),l(t)})(e)}})};class pc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(uc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}pc.contextType=ul;const hc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{fieldName:a,options:o={},style:s={},placeholder:c=Xt("qm.form.timerangePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h=n.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:f=[!1,!1],allowEmpty:g,hourStep:v=1,minuteStep:y=1,secondStep:b=1}=o,x=e=>ya(e)?"":e.join(" - ");return n.isOnlyShow?t.createElement(ja,{value:x(r),bordered:d}):t.createElement(yn.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${a}`,bordered:d,showNow:!1,hourStep:v,minuteStep:y,secondStep:b,allowClear:u,allowEmpty:g,disabled:h?[!0,!0]:f,inputReadOnly:p,format:ha[m],value:_n(r)?null:[ga(null==r?void 0:r[0],ha[m]),ga(null==r?void 0:r[1],ha[m])],onChange:(e,t)=>{(e=>{const t=[va(null==e?void 0:e[0],ha[m]),va(null==e?void 0:e[1],ha[m])];null==i||i(t),l(t,x(t))})(e)}})};class mc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(hc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}mc.contextType=ul;class fc extends r{constructor(e){super(e),this.searchRef=t.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=_t(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:n}=this.props.option,{fieldAliasMap:r,fieldsDefine:i,echoRequest:l}=this.searchHelper;if(r||en("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(e)||en("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&en("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&en("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getItemText=()=>Tn(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t){if(_n(u))return this._prevValue=void 0;try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=me(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&xa(e,this.alias,c),d&&Ea(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,a){const t=ba(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==l||l([e])}}}catch(e){}}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias){const i=ba(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:ba(e,this.extras[n])})},this.fetchHandle=Se(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:n}=this.context,{fieldName:r}=this.props.option;for(const t in this.alias)t!==r&&n.SET_FIELDS_VALUE({[t]:ba(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:ba(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=ba(e,this.alias[r]);this.triggerChange(i),this.setState({inputText:void 0}),t&&t()},this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(e){var t,n,r,i,l,a,o;const s=(null===(n=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===n?void 0:n.params)||(null===(r=e.option.request)||void 0===r?void 0:r.params),c=(null===(l=null===(i=this.props.option.searchHelper)||void 0===i?void 0:i.request)||void 0===l?void 0:l.params)||(null===(a=this.props.option.request)||void 0===a?void 0:a.params);if(ge(s,c)||this.getItemList(),null===this._prevValue)return;const d=this.getItemValue();this._prevValue!==d&&d!==(null===(o=this._record)||void 0===o?void 0:o[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=d}getItemList(e){var t;return Tn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:r,params:i={},formatter:l=(e=>e),dataKey:a}=this.searchHelper.request||this.props.option.request||{};if(r){this.setState({loading:!0});try{const o=yield r(l(Object.assign(Object.assign({},i),{[n]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=me(o.data,a))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:n,loading:r,itemList:i,inputText:l}=this.state,{value:a}=this.props,{fieldName:o,options:s={},style:c={},placeholder:d=Xt("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{listHeight:f=sa}=s,{hideHeader:g,onlySelect:v=!0}=this.searchHelper||s,y=this.searchHelper.columns||[],b=jn("form-immediate"),x=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,E=t.createElement(R,{spinning:r},i.length?t.createElement("table",{cellSpacing:0,cellPadding:0,className:Fe("table")},!g&&t.createElement("thead",null,t.createElement("tr",null,y.filter((e=>!e.hidden)).map((e=>t.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),t.createElement("tbody",null,i.map(((e,n)=>t.createElement("tr",{key:n,className:this.state.activeIndex===n?"active":"",onMouseEnter:()=>{this.setState({activeIndex:n})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},y.filter((e=>!e.hidden)).map((n=>t.createElement("td",{key:n.dataIndex},me(e,n.dataIndex))))))))):t.createElement(Fi,null));return t.createElement(Bt.Consumer,null,(r=>{const s={[b]:!0,[`${b}--lg`]:"large"===(null==r?void 0:r.size),[`${b}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(ja,{value:a,bordered:u}):t.createElement(Ms,{action:m?[]:["click"],popupVisible:!m&&n,popup:E,popupClassName:Fe(s,`form-popper__${o}`),popupStyle:{minWidth:x,maxHeight:f},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:da,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:d,allowClear:p,bordered:u,readOnly:h,disabled:m,style:Object.assign({width:"100%"},c),value:null!=l?l:a,title:a,onFocus:()=>{!i.length&&this.fetchHandle(a)},onBlur:e=>{v&&!this._clicking&&l!==a&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(i[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const n=40===e.keyCode?++t%i.length:(--t+i.length)%i.length;this.setState({activeIndex:n})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),v?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}fc.contextType=ul;class gc extends r{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ia(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(fc,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";f(t,arguments.length>1?arguments[1]:void 0),e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}gc.contextType=ul;class vc extends r{render(){var e;const{$$form:n}=this.context,{type:r,label:i,fieldName:l,className:a,style:o={},collapse:s={}}=this.props.option,{expand:c}=n.state,{showLimit:d,remarkItems:u=[],onCollapse:p=On}=s,h=[];if(u.length){const t=null!==(e=n.getBlockDerivedItems().find((e=>e[0].fieldName===l)))&&void 0!==e?e:[],r=null!=d?d:t.length-1;t.slice(r+1).forEach((e=>{var t;const r=u.find((t=>t.fieldName===e.fieldName));if(!r)return;const i=r.showLabel?`${e.label}:`:"",l=null!==(t=n.getViewValue(e.fieldName))&&void 0!==t?t:"";""!==l&&h.push(Object.assign(Object.assign({},e),{text:`${i}${l}`}))}))}return t.createElement(H.Item,{labelCol:{span:0},wrapperCol:{span:24}},t.createElement(Vn,{id:l,label:i,className:a,extra:h.map((e=>e.text)).join(" | "),style:Object.assign({},o),collapse:c[l],onCollapseChange:e=>{n.setState((t=>({expand:Object.assign({},t.expand,{[l]:e})}))),p(e)}}))}}vc.contextType=ul;const yc=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:yc(e.children,t,n,r)}):e)),bc=e=>{const{$$form:n}=t.useContext(ul),{value:r,items:i,multiple:l,loading:a,onChange:o,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=Xt("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,asyncLoad:f,readOnly:g,disabled:v}=e.option,{itemList:y,filterable:b=!0,listHeight:x=sa,checkStrictly:E,checkStrategy:S="SHOW_CHILD",collapseTags:w,defaultExpandAll:C=!f,defaultExpandedKeys:T,dropdownStyle:N,openPyt:I=!0}=d,[R,O]=t.useState(_n(y)?i:y),k=t.useRef(R);bi((()=>{const e=_n(y)?i:y;f?ge(e,k.current)||(O(e),k.current=e):O(e)}),[y,i]);const L=e=>{var t;return(null===(t=wa(R,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},A=e=>l?(null==e?void 0:e.map((e=>L(e))).join(","))||"":L(e);return n.isOnlyShow?t.createElement(ja,{value:A(r),bordered:h}):t.createElement(B,vn({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:l,treeCheckable:l,treeCheckStrictly:E,showCheckedStrategy:B[S],popupClassName:`form-popper__${c}`,dropdownStyle:N,placeholder:p,listHeight:x,style:u,loading:a,bordered:h,allowClear:m,disabled:v,treeDefaultExpandAll:C,treeDefaultExpandedKeys:T,showSearch:b,maxTagCount:w?"responsive":void 0,loadData:f?e=>{let{key:t,children:n}=e;return Tn(void 0,void 0,void 0,(function*(){var e;if(!f||n)return;const{fetchApi:r,params:i,dataKey:l,textKey:a="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=f;if(r)try{const n=yield r(c(Object.assign(Object.assign({},i),{[o]:t})));if(200===n.code){const r=Array.isArray(n.data)?n.data:null!==(e=me(n.data,l))&&void 0!==e?e:[],i=yc(R,t,o,Sa(r,o,a));O(i),null==s||s(r)}}catch(e){}}))}:void 0,treeData:R},l?{title:A(r)}:null,{filterTreeNode:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=Ma.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(I?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,A(e),R)})(e)}}))};class xc extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=Sa(n,l,a);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(l),className:Fe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Dn(d)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(bc,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Dn(p.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}xc.contextType=ul;const Ec=e=>{const{$$form:n}=t.useContext(ul),{value:r,multiple:i,items:l}=e,{fieldName:a,options:o={},style:s={},placeholder:c=Xt("qm.form.selectPlaceholder"),bordered:d=!0,allowClear:u=!0,asyncLoad:p,readOnly:h,disabled:m}=e.option,{itemList:f,changeOnSelect:g,checkStrictly:v,checkStrategy:y="SHOW_PARENT",filterable:b=!0,dropdownStyle:x,openPyt:E=!0}=o,[S,w]=t.useState(_n(f)?l:f),C=t.useRef(S);bi((()=>{const e=_n(f)?l:f;p?ge(e,C.current)||(w(e),C.current=e):w(e)}),[f,l]);const T=e=>Ca(S,null!=e?e:"").map((e=>e.text)).join("/"),N=e=>i?(null==e?void 0:e.map((e=>T(e))).join(","))||"":T(e);return n.isOnlyShow?t.createElement(ja,{value:N(r),bordered:d}):t.createElement(U,vn({value:(e=>_n(e)?[]:i?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:S,multiple:i,maxTagCount:"responsive",changeOnSelect:g||v,showCheckedStrategy:U[y],popupClassName:`form-popper__${a}`,dropdownStyle:x,placeholder:c,style:s,bordered:d,allowClear:u,disabled:m,showSearch:b&&!p&&{filter:(e,t)=>t.some((t=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=Ma.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(E?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:p?e=>Tn(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!p||n.children)return;const{fetchApi:r,params:i,dataKey:l,textKey:a="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=p;if(r)try{const e=yield r(c(Object.assign(Object.assign({},i),{[o]:n.value})));if(200===e.code){const r=Array.isArray(e.data)?e.data:null!==(t=me(e.data,l))&&void 0!==t?t:[],i=yc(S,n.value,o,Sa(r,o,a));w(i),null==s||s(r)}}catch(e){}})):void 0},i?{title:N(r)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:r}=e;null==n||n(t),r(t,N(t),S)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return i?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class Sc extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=Sa(n,l,a);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:n}=this.props,{itemList:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(l),className:Fe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Dn(d)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(Ec,{option:this.props.option,multiple:n,items:r,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Dn(p.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Sc.contextType=ul;const wc=["110000","120000","310000","500000"],Cc=["810000","820000"],Tc=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Nc=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Ic=e=>Ma.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Rc=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...wc,...Cc].includes(e))):Object.keys(e[t])).map((r=>({l:Ic(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Rc(e,r,n+1)})))},Oc=(e,t)=>t.map((t=>({l:Ic(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class kc extends r{constructor(e){super(e),this.searchRef=t.createRef(),this.scrollRef=t.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),At(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Oc(Wt,wc)},{l:"Z2",n:"港澳",c:"",p:"",children:Oc(Wt,Cc)}]}createProvince(){var e;return(null!==(e=Rc(Wt,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Nc.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...wc,...Cc].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t.createElement(K.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},t.createElement(K.Button,{value:"0"},Xt("qm.form.citySelectType.0")),t.createElement(K.Button,{value:"1"},Xt("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:n}=this.state;return("0"===n?Tc:Nc).map((n=>t.createElement("li",{key:n.value,className:Fe({tag:!0,actived:n.value===e}),onClick:()=>this.scrollHandle(n.value.toString())},n.text)))}renderSelect(){const{value:e}=this.props;return t.createElement($,{size:"small",placeholder:Xt("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var n;return((null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t.createElement($.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:n}=this.state;return("0"===n?this.provinces:this.letterCities).map(((n,r)=>{var i;return t.createElement("div",{key:r},t.createElement("dt",{ref:e=>this[`${n.l}Ref`]=e},n.n,":"),t.createElement("dd",null,null===(i=n.children)||void 0===i?void 0:i.map((n=>t.createElement("li",{key:n.c,className:Fe({actived:n.c===e}),onClick:()=>this.clickHadnle(n.c)},n.n)))))}))}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:l={},style:a={},placeholder:o=Xt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=jn("form-city-select"),h=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=this.createTextValue(r),f=t.createElement("div",{className:"container",style:Object.assign({},a)},t.createElement("div",{className:"city-drop"},t.createElement("div",{className:"city-drop-toper"},t.createElement("div",{className:"city-drop-toper__type"},this.renderType()),t.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),t.createElement("div",{className:"city-drop-letter"},this.renderLetter()),t.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},t.createElement("dl",null,this.renderCity(r)))));return t.createElement(Bt.Consumer,null,(r=>{const l={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(ja,{value:m,bordered:s}):t.createElement(Ms,{action:u?[]:["click"],popupVisible:!u&&n,popup:f,popupClassName:Fe(l,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:da,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,readOnly:d,disabled:u,style:Object.assign({width:"100%"},a),value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}kc.contextType=ul;class Lc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(kc,{option:this.props.option,onValuesChange:(t,n)=>{h(t,n),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Lc.contextType=ul;const Ac=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:Ac(e,n)})))};class Pc extends r{constructor(e){super(e),this.searchRef=t.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const n=Ac(Wt,"86")||[];this.state={results:n,visible:!1,values:[],tabs:[n.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:n}=this.props;t!==n&&this.state.values.join(",")!==(null!=n?n:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var n,r;return null===(r=null===(n=this.state.tabs[t])||void 0===n?void 0:n.find((t=>t.value===e)))||void 0===r?void 0:r.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const n=this.state.tabs.slice(0,1);for(let r=0;r<t.length;r++){const i=wa(e,t[r]);if(i&&_n(i.children)){this.isFetch&&this.getStreetList(t[r]);break}Array.isArray(null==i?void 0:i.children)&&(n[r+1]=null==i?void 0:i.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:n})}getStreetList(e){var t;return Tn(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:r,formatter:i=(e=>e),dataKey:l,valueKey:a="value",textKey:o="text"}=n;if(r)try{const n=yield r(i({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=me(n.data,l))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[a]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,n=this.state.tabs.map(((n,r)=>{var i;const l=(null===(i=n.find((t=>t.value===e[r])))||void 0===i?void 0:i.text)||`${Xt("qm.form.selectPlaceholder").replace("...","")}(${Xt("qm.form.regionSelectLabel")[r]})`;return t.createElement(al.TabPane,{key:r.toString(),tab:l},t.createElement("div",{className:"region-box"},n.map((n=>t.createElement("span",{key:n.value,className:Fe({"region-box__item":!0,actived:e.includes(n.value.toString())}),title:n.text,onClick:()=>{let{values:e}=this.state;e[r]=n.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},n.text)))))}));return n.length?t.createElement(al,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},n):t.createElement(Fi,null)}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:l={},style:a={},placeholder:o=Xt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=jn("form-region-select"),h=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=t.createElement("div",{className:"container"},this.renderTabs());let f=this.prevText;if(!n){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(f=e,this.prevText=f)}return t.createElement(Bt.Consumer,null,(r=>{const l={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(ja,{value:f,bordered:s}):t.createElement(Ms,{action:u?[]:["click"],popupVisible:!u&&n,popup:m,popupClassName:Fe(l,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:da,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,style:Object.assign({width:"100%"},a),readOnly:d,disabled:u,value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&An((()=>this.initial()))}})))}))}}Pc.contextType=ul;class _c extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Pc,{option:this.props.option,onValuesChange:(t,n)=>{h(t,n),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}_c.contextType=ul;const Hc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fileTypes:h,fileSize:m,draggable:f,editable:g,fileDirection:v,onPreview:y,onRemove:b,onSortChange:x,onEditChange:E}=a,{action:S,headers:w,params:C,withCredentials:T=!1,dataKey:N="",downloadWithHeaders:I,fieldAliasMap:R,beforeUpload:O,button:k}=o,A="function"==typeof R?R():R||{};return t.createElement(el,{name:"file",action:S,multiple:u,headers:w,data:C,withCredentials:T,downloadWithHeaders:I,beforeUpload:O,maxCount:p,fileTypes:h,fileSize:m,draggable:f,editable:g,fileDirection:v,disabled:c,readOnly:n.isOnlyShow||d,button:k,showUploadList:{showDownloadIcon:!0,downloadIcon:t.createElement(Ke,null)},fileList:r,onChange:e=>{let{fileList:t}=e;(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in A)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[A[i]])||"";return e.response&&200!==n.code&&L.error(n.message||Xt("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(N?me(n.data,N):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&l(t)})(t)},onPreview:y,onRemove:b,onSortChange:x,onEditChange:E})};class Fc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Hc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,"")}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Fc.contextType=ul;const Dc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fixedSize:h,quality:m,openCropper:f,fileTypes:g,fileSize:v,draggable:y,onRemove:b,onSortChange:x}=a,{action:E,headers:S,params:w,withCredentials:C=!1,dataKey:T="",popupClassName:N,fieldAliasMap:I,beforeUpload:R}=o,O="function"==typeof I?I():I||{};return t.createElement(od,{name:"file",action:E,multiple:u,headers:S,data:w,withCredentials:C,popupClassName:N,beforeUpload:R,maxCount:p,fixedSize:h,quality:m,openCropper:f,fileTypes:g,fileSize:v,draggable:y,disabled:c,readOnly:n.isOnlyShow||d,fileList:r,onChange:e=>{let{fileList:t}=e;(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in O)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[O[i]])||"";return e.response&&200!==n.code&&L.error(n.message||Xt("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(T?me(n.data,T):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&l(t)})(t)},onRemove:b,onSortChange:x})};class $c extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Dc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,"")}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}$c.contextType=ul;const Mc=e=>{const{$$form:n}=t.useContext(ul),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o,style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{tinymce:u,thresholdSize:p,onResizeEditor:h}=a;return t.createElement(id,{value:r,tinymce:u,upload:o,thresholdSize:p,style:Object.assign({width:"100%"},s),disabled:d||c||n.isOnlyShow,onResizeEditor:h,onChange:e=>{(e=>{null==i||i(e),l(e)})(e)}})};class qc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Mc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||la)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}qc.contextType=ul;class jc extends r{constructor(e){var n;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=t.createRef(),this.formRef=t.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(n=this.props.cols)&&void 0!==n?n:4,collapse:!!this.props.defaultExpand},this.resizeObserveHandler=()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let n=Math.floor(t/300);n=24%n==0?n:n-1,n=n<1?1:n,n=n>8?8:n,n!==this.state.flexCols&&this.setState({flexCols:n})},this.resizeListenerHandle=Se(this.resizeObserveHandler,10),this.getFormItems=_t((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=_t((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{se(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onValuesChange)||void 0===r||r.call(n,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onFieldsChange)||void 0===r||r.call(n,e,t)},this.finishHandle=e=>{var t,n;null===(n=(t=this.props).onFinish)||void 0===n||n.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=e=>{let{values:t,errorFields:n}=e;var r,i;null===(i=(r=this.props).onFinishFailed)||void 0===i||i.call(r,n)},this.openValidateInfo=e=>{const n=t.createElement("ul",null,e.map((e=>{const{label:n}=this.formItems.find((t=>t.fieldName===e.name[0]));return t.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof n?`${n}: `:"")+e.errors.join(","),"]")})));G.error({message:Xt("qm.form.validatePrompt"),description:n,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&At(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})},this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){var e,t;return null!==(t=null!==(e=this.props.size)&&void 0!==e?e:this.context.size)&&void 0!==t?t:""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isFormDisabled(){return this.props.disabled}get isCompactMode(){var e;const t=this.context.global;return null!==(e=this.props.compactMode)&&void 0!==e?e:"small"===this.$size&&!!(null==t?void 0:t.compactModeInSmallSize)}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){qi(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){ji(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&en("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return Object.assign({},n)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>se(e.extra))).forEach((n=>{var r;t[n.fieldName]=null!==(r=e[n.fieldName])&&void 0!==r?r:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>se(e.collapse))).forEach((t=>{var n;e[t.fieldName]=null!==(n=t.collapse.defaultExpand)&&void 0!==n&&n})),Object.assign({},e)}getInitialValue(e,t){var n;const{type:r,options:i}=e;return t=null!=t?t:void 0,ca.includes(r)&&(t=null!=t?t:[]),"CHECKBOX"!==r&&"SWITCH"!==r||(t=null!==(n=null!=t?t:null==i?void 0:i.falseValue)&&void 0!==n?n:oa),t}createFormValue(e){const t={};return this.flattenItems.forEach((n=>{t[n.fieldName]=this.getInitialValue(n,e[n.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=Fn(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t!==this.getViewValue(e)&&this.setState((n=>({viewData:Object.assign({},n.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){var t,n;e!==this.state.collapse&&(this.setState({collapse:e}),null===(n=(t=this.props).onCollapse)||void 0===n||n.call(t,e),An((()=>{var t,n;return null===(n=(t=this.props).onCollapse)||void 0===n?void 0:n.call(t,e)})))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:n}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!n||setTimeout((()=>this.CREATE_FOCUS(n)))}getFormItemLabel(e){var t,n,r,i,l;if(Ta(e))return Na(e);if(se(e)){const{fieldName:a,label:o,options:s={}}=e;if(Ta(o))return Na(o);const{itemList:c=[]}=s,d=null!==(r=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([a])[a])&&void 0!==n?n:this._initialValues[a])&&void 0!==r?r:null===(i=c[0])||void 0===i?void 0:i.value;return(null===(l=c.find((e=>e.value===d)))||void 0===l?void 0:l.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,n=this.dividers.length;t<n;t++){const n=this.formItems.findIndex((e=>e===this.dividers[t]));let r=this.formItems.findIndex((e=>e===this.dividers[t+1]));r=r>-1?r:void 0,e.push(this.formItems.slice(n,r).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:n}=e;var r,i;if("DIVIDER"===t)return!0;const l=this.getBlockDerivedItems();for(let e=0,t=l.length;e<t;e++){const t=l[e],a=this.dividers.find((e=>e.fieldName===t[0].fieldName)),o=null!==(i=null===(r=null==a?void 0:a.collapse)||void 0===r?void 0:r.showLimit)&&void 0!==i?i:t.length-1;for(let e=1;e<t.length;e++){if(t[e].fieldName===n&&e>o)return this.state.expand[t[0].fieldName]}}return!0}formatFormValue(e){var t,n;for(const r in e){const i=e[r];if(ya(i)&&(e[r]=""),Array.isArray(i)&&i.forEach(((t,n)=>{ya(t)&&(e[r][n]="")})),r.includes("|")&&Array.isArray(i)){const[l,a]=r.split("|");e[l]=null!==(t=i[0])&&void 0!==t?t:"",e[a]=null!==(n=i[1])&&void 0!==n?n:""}}if(this.isFilterType)for(const t in e)_n(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Tn(this,void 0,void 0,(function*(){const{authConfig:r}=this.props;if(!r)return;let i=Hn(r,["fetch"]);if(r.fetch){const{api:t,params:n,dataKey:l}=r.fetch;try{const r=yield t(n);200===r.code&&(i=null!==(e=l?me(r.data,l):r.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(i.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,n=i.fieldList.find((e=>e.dataIndex===t));if(n){const r=this.originItems.find((e=>e.fieldName===t)),{visible:i=1,disabled:l,secretName:a}=n;i||(e.noAuth=!0,r.noAuth=!0),l&&(e.disabled=!0,r.disabled=!0),a&&(e.options?e.options.secretType=a:e.options={secretType:a},r.options=Object.assign({},r.options,{secretType:a})),this.setFieldAuth(t,{visible:i,disabled:l,secretName:a})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return t.createElement(Ya,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t.createElement(Za,{option:e})}INPUT_NUMBER(e){return t.createElement(Ja,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t.createElement(to,{option:e})}SEARCH_HELPER(e){return t.createElement(lo,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t.createElement(js,{option:e})}TREE_TABLE_HELPER(e){return t.createElement(zs,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t.createElement(Bs,{option:e})}RANGE_SEARCH_HELPER(e){return t.createElement(Ys,{option:e})}CHECKBOX(e){return t.createElement(Ba,{option:e})}MULTIPLE_CHECKBOX(e){return t.createElement(Zs,{option:e})}RATE(e){return t.createElement(Js,{option:e})}RADIO(e){return t.createElement(tc,{option:e})}SWITCH(e){return t.createElement(rc,{option:e})}TEXT_AREA(e){return t.createElement(lc,{option:e})}DATE(e){return t.createElement(oc,{option:e})}RANGE_DATE(e){return t.createElement(dc,{option:e})}TIME(e){return t.createElement(pc,{option:e})}RANGE_TIME(e){return t.createElement(mc,{option:e})}SELECT(e){return t.createElement(za,{option:e})}MULTIPLE_SELECT(e){return t.createElement(za,{option:e,multiple:!0})}IMMEDIATE(e){return t.createElement(gc,{option:e})}DIVIDER(e){return t.createElement(vc,{option:e})}TREE_SELECT(e){return t.createElement(xc,{option:e})}MULTIPLE_TREE_SELECT(e){return t.createElement(xc,{option:e,multiple:!0})}CASCADER(e){return t.createElement(Sc,{option:e})}MULTIPLE_CASCADER(e){return t.createElement(Sc,{option:e,multiple:!0})}CITY_SELECT(e){return t.createElement(Lc,{option:e})}REGION_SELECT(e){return t.createElement(_c,{option:e})}UPLOAD_FILE(e){return t.createElement(Fc,{option:e})}UPLOAD_IMG(e){return t.createElement($c,{option:e})}TINYMCE(e){return t.createElement(qc,{option:e})}renderFormLabel(e){if(Ta(e)||!se(e))return e;const{type:n,fieldName:r,label:i,options:l={},onChange:a=On}=e,{itemList:o=[]}=l;return"SELECT"===n?t.createElement(H.Item,{name:r,noStyle:!0},t.createElement(Ka,{option:e,items:o,loading:!1,onValuesChange:(e,t)=>a(e,t)})):"CHECKBOX"===n?t.createElement(t.Fragment,null,t.createElement("span",{style:{paddingRight:5}},i),t.createElement(H.Item,{name:r,noStyle:!0},t.createElement(Wa,{option:e,onValuesChange:e=>a(e)}))):null}renderFormItemExtra(e){const{fieldName:n,isTooltip:r,style:i={},render:l}=e,{extra:a}=this.state;if(r)return t.createElement(Y,{className:"extra-tooltip",title:a[n]},t.createElement(Qe,{style:{marginLeft:4}}));const o=this.formItems.find((e=>e.fieldName===n));return t.createElement("div",{className:"extra-text",title:l?"":a[n],style:i},t.createElement("span",{className:"extra-overflow-cut"},l?l(o,this):a[n]))}renderFormItemButton(e,t){const n=this.formItems.find((t=>t.fieldName===e)),r="function"==typeof t?t(n):t;return this.isOnlyShow?null:r}renderFormItem(e){const{label:n,fieldName:r,invisible:i,tooltip:l,className:a,labelWidth:o=this.props.labelWidth,validateTrigger:s,rules:c=[],style:d={},render:u}=e;return _n(this.state.formData)?null:t.createElement(H.Item,{label:this.renderFormLabel(n),name:r,rules:c,tooltip:l,hidden:i,className:Fe(a),style:Object.assign({width:"100%"},d),labelCol:{flex:this.verticalLayout?"initial":Dn(o)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(n)}},null==u?void 0:u(e,this))}createFormItem(e){return de(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(en("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:n,defaultRows:r,isFieldsDefine:i}=this.props,l=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:n=0}=e;for(let e=0;e<t;e++)l.push({});l.push(e);for(let e=0;e<n;e++)l.push({})}));const a=24/e,o=[],s=l.reduce(((e,t)=>{const{selfCol:n=1}=t,r=e+n;return o.push(r),r}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=l.map(((n,r)=>{let{selfCol:i=1}=n;const{type:l,fieldName:s}=n;i=i>=24||"DIVIDER"===l||"TINYMCE"===l?e:i;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(n);return u&&d.push(o[r]),t.createElement(D,{key:null!=s?s:r,className:s,span:i*a,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},l?this.createFormItem(Fn(n)):null)}));return i&&"default"===n&&u.push(t.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:n,collapse:r}=this.state,{searchButtonCols:i,isSearchBtn:l,isFieldsDefine:a=!0}=this.props;if(!this.isFilterType)return null;const o=24/n,s=i||1,c=n-e%n-s;return l?t.createElement(D,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t.createElement(N,{style:{marginBottom:12}},t.createElement($n,{type:"primary",size:this.$size,icon:t.createElement(Xe,null),onClick:()=>this.SUBMIT_FORM()},Xt("qm.form.search")),t.createElement($n,{size:this.$size,icon:t.createElement(Je,null),onClick:()=>this.RESET_FORM()},Xt("qm.form.reset")),a?this.createFieldsDefine():null,this.showFilterCollapse&&t.createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t.createElement(De,null):t.createElement($e,null)," ",Xt(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:n,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const i=24/e;return r&&"default"===n?t.createElement(F,{gutter:0},t.createElement(D,{key:"-",span:i},t.createElement(H.Item,null,t.createElement(N,{style:{marginBottom:12}},t.createElement($n,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Xt("qm.form.save")),t.createElement($n,{size:this.$size,onClick:()=>this.RESET_FORM()},Xt("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:n,fieldsChange:r}=this.props;return t.createElement(Ua,{uniqueKey:e,items:n,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){const[n,r]=yield this.VALIDATE_FIELDS(),i=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[Xt("qm.form.searchHelperTips")],warnings:[]})));n||i.length?t((n||[]).concat(i)):e(r)}))))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}GET_FORM_DATA(){return Tn(this,void 0,void 0,(function*(){try{const e=yield this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}))}VALIDATE_FIELDS(e){return Tn(this,void 0,void 0,(function*(){try{return[null,yield this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}))}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}SUBMIT_FORM(){return Tn(this,void 0,void 0,(function*(){try{yield this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}))}RESET_FORM(){var e,t;const n=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),r=this.flattenItems.map((e=>e.fieldName)).filter((e=>!n.includes(e)));r.length&&this.formRef.current.resetFields(r),this.setState((e=>{const t=Object.keys(e.other),n=Object.keys(this._initialOthers),r=t.filter((e=>!n.includes(e))),i={};return r.forEach((e=>i[e]=void 0)),{other:Object.assign({},this._initialOthers,i)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(t=(e=this.props).onReset)||void 0===t||t.call(e)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){en("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:r,fieldsChange:i}=this.props,l=r.find((t=>t.fieldName===e));if(!l)return en("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!se(t))return en("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(l.noAuth)return en("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||ve(l,n,t[n]));n&&(i?i([...r]):en("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:n,layout:r,disabled:i,labelWidth:l,labelAlign:a,labelWrap:o,customClass:s}=this.props,c=jn("form"),d={required:"${label}"+Xt("qm.form.requiredTips")},u={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return t.createElement("div",{ref:this.wrapperRef,className:Fe(u,e),style:n},t.createElement(H,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:a,labelWrap:o,colon:!1,disabled:i,labelCol:{flex:this.verticalLayout?"initial":Dn(l)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t.createElement(ul.Provider,{value:this.provide},t.createElement(F,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}jc.contextType=Bt,jc.propTypes=ma,jc.defaultProps=fa;const Vc={onActivate:m.func,onAddUndo:m.func,onBeforeAddUndo:m.func,onBeforeExecCommand:m.func,onBeforeGetContent:m.func,onBeforeRenderUI:m.func,onBeforeSetContent:m.func,onBeforePaste:m.func,onBlur:m.func,onChange:m.func,onClearUndos:m.func,onClick:m.func,onContextMenu:m.func,onCommentChange:m.func,onCopy:m.func,onCut:m.func,onDblclick:m.func,onDeactivate:m.func,onDirty:m.func,onDrag:m.func,onDragDrop:m.func,onDragEnd:m.func,onDragGesture:m.func,onDragOver:m.func,onDrop:m.func,onExecCommand:m.func,onFocus:m.func,onFocusIn:m.func,onFocusOut:m.func,onGetContent:m.func,onHide:m.func,onInit:m.func,onKeyDown:m.func,onKeyPress:m.func,onKeyUp:m.func,onLoadContent:m.func,onMouseDown:m.func,onMouseEnter:m.func,onMouseLeave:m.func,onMouseMove:m.func,onMouseOut:m.func,onMouseOver:m.func,onMouseUp:m.func,onNodeChange:m.func,onObjectResizeStart:m.func,onObjectResized:m.func,onObjectSelected:m.func,onPaste:m.func,onPostProcess:m.func,onPostRender:m.func,onPreProcess:m.func,onProgressState:m.func,onRedo:m.func,onRemove:m.func,onReset:m.func,onSaveContent:m.func,onSelectionChange:m.func,onSetAttrib:m.func,onSetContent:m.func,onShow:m.func,onSubmit:m.func,onUndo:m.func,onVisualAid:m.func,onSkinLoadError:m.func,onThemeLoadError:m.func,onModelLoadError:m.func,onPluginLoadError:m.func,onIconsLoadError:m.func,onLanguageLoadError:m.func},Kc=Object.assign({apiKey:m.string,id:m.string,inline:m.bool,init:m.object,initialValue:m.string,onEditorChange:m.func,value:m.string,tagName:m.string,cloudChannel:m.string,plugins:m.oneOfType([m.string,m.array]),toolbar:m.oneOfType([m.string,m.array]),disabled:m.bool,textareaName:m.string,tinymceScriptSrc:m.string,rollback:m.oneOfType([m.number,m.oneOf([!1])]),scriptLoading:m.shape({async:m.bool,defer:m.bool,delay:m.number})},Vc),zc=e=>"function"==typeof e,Wc=e=>e in Vc,Bc=e=>e.substr(2),Uc=(e,t,n,r,i)=>((e,t,n,r,i,l,a)=>{const o=Object.keys(i).filter(Wc),s=Object.keys(l).filter(Wc),c=o.filter((e=>void 0===l[e])),d=s.filter((e=>void 0===i[e]));c.forEach((e=>{const t=Bc(e),r=a[t];n(t,r),delete a[t]})),d.forEach((n=>{const i=r(e,n),l=Bc(n);a[l]=i,t(l,i)}))})(i,e.on.bind(e),e.off.bind(e),((t,n)=>r=>{var i;return null===(i=t(n))||void 0===i?void 0:i(r,e)}),t,n,r);let Gc=0;const Yc=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return Gc++,e+"_"+n+Gc+String(t)},Xc=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Zc=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),Qc=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Jc=()=>({listeners:[],scriptId:Yc("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),ed=(()=>{let e=Jc();return{load:(t,n,r,i,l,a)=>{const o=()=>((e,t,n,r,i,l)=>{const a=t.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=e,a.src=n,a.async=r,a.defer=i;const o=()=>{a.removeEventListener("load",o),l()};a.addEventListener("load",o),t.head&&t.head.appendChild(a)})(e.scriptId,t,n,r,i,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?a():(e.listeners.push(a),e.scriptLoading||(e.scriptLoading=!0,l>0?setTimeout(o,l):o()))},reinitialize:()=>{e=Jc()}}})(),td=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class nd extends e.Component{constructor(t){var n,r,i,l;super(t),n=this,this.rollbackTimer=void 0,this.valueCursor=void 0,this.rollbackChange=()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0},this.handleBeforeInput=e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}},this.handleBeforeInputSpecial=e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)},this.handleEditorChange=e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}},this.handleEditorChangeSpecial=e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)},this.initialise=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;var t,r,i;const l=n.elementRef.current;if(!l)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,n=e.parentNode;for(;null!=n;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected})(l)){if(0===e)setTimeout((()=>n.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>n.initialise(e+1)),100)}return}const a=td(n.view);if(!a)throw new Error("tinymce should have been loaded into global scope");const o=Object.assign(Object.assign({},n.props.init),{selector:void 0,target:l,readonly:n.props.disabled,inline:n.inline,plugins:(s=null===(t=n.props.init)||void 0===t?void 0:t.plugins,c=n.props.plugins,Zc(s).concat(Zc(c))),toolbar:null!==(r=n.props.toolbar)&&void 0!==r?r:null===(i=n.props.init)||void 0===i?void 0:i.toolbar,setup:e=>{n.editor=e,n.bindHandlers({}),n.inline&&!Xc(l)&&e.once("PostRender",(t=>{e.setContent(n.getInitialValue(),{no_events:!0})})),n.props.init&&zc(n.props.init.setup)&&n.props.init.setup(e)},init_instance_callback:e=>{var t,r;const i=n.getInitialValue();n.currentContent=null!==(t=n.currentContent)&&void 0!==t?t:e.getContent(),n.currentContent!==i&&(n.currentContent=i,e.setContent(i),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const l=null!==(r=n.props.disabled)&&void 0!==r&&r;Qc(n.editor,l?"readonly":"design"),n.props.init&&zc(n.props.init.init_instance_callback)&&n.props.init.init_instance_callback(e)}});var s,c;n.inline||(l.style.visibility=""),Xc(l)&&(l.value=n.getInitialValue()),a.init(o)},this.id=this.props.id||Yc("tiny-react"),this.elementRef=e.createRef(),this.inline=null!==(l=null!==(r=this.props.inline)&&void 0!==r?r:null===(i=this.props.init)||void 0===i?void 0:i.inline)&&void 0!==l&&l,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,n;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const n=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const r of[t,n])if(r)try{e.selection.moveToBookmark(r),this.valueCursor=r;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(n=this.props.disabled)&&void 0!==n&&n;Qc(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,r,i,l;null!==td(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&ed.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),null!==(t=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)&&void 0!==t&&t,null!==(r=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.defer)&&void 0!==r&&r,null!==(l=null===(i=this.props.scriptLoading)||void 0===i?void 0:i.delay)&&void 0!==l?l:0,this.initialise)}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,n;return(null===(n=null===(t=null===(e=td(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:t="div"}=this.props;return e.createElement(t,{ref:this.elementRef,id:this.id})}renderIframe(){return e.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){Uc(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,n=t(e),r=t(this.props);!n&&r?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):n&&!r&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}var rd;nd.propTypes=Kc,nd.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(rd||(rd={}));class id extends r{constructor(){super(...arguments),this.defaultOption={height:400,plugins:"preview importcss searchreplace autolink save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",menubar:"file edit view insert format tools table help",toolbar:"undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl"}}render(){var e;const{size:n,className:r,style:i,tinymce:l={},upload:a={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:d,onResizeEditor:u,onChange:p}=this.props,h=this.context.global,m=this.context.locale,f=n||this.context.size||"",g=jn("tinymce"),v={[g]:!0,[`${g}--lg`]:"large"===f,[`${g}--sm`]:"small"===f},y={init:Object.assign(Object.assign({height:l.height||this.defaultOption.height,plugins:l.plugins||this.defaultOption.plugins,toolbar:l.toolbar||this.defaultOption.toolbar,menubar:l.menubar||this.defaultOption.menubar,font_family_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",font_size_formats:"10px 12px 14px 16px 18px 20px 24px 36px 48px 56px 72px",language:rd[m],skin:"tinymce-5"},Hn(l,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>Tn(this,void 0,void 0,(function*(){const{action:n,headers:r,dataKey:i}=a,l=`data:image/jpeg;base64,${e.base64()}`,s=new FormData;s.append("file",e.blob(),e.filename());const c=e.blob().size;if(n&&c/1024/1024>o)try{const e=yield fetch(n,{method:"POST",body:s,headers:r});if(!e.ok)throw new Error(Xt("qm.upload.uploadError"));const l=yield e.json();if(200===l.code){const e=i?me(l.data,i):l.data;t(e)}}catch(e){L.error(Xt("qm.uploadCropper.uploadError"))}else t(l)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:n,offsetHeight:r}=e.editorContainer;null==u||u({width:n,height:r},t)}))}}),value:d,disabled:c,tinymceScriptSrc:s||(null===(e=null==h?void 0:h.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return t.createElement("div",{className:Fe(v,r),style:i},t.createElement(nd,y))}}id.contextType=Bt,id.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Tinymce","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class ld extends r{constructor(){super(...arguments),this.imgRef=t.createRef()}componentDidMount(){const e=wn(this.props,["className","style","src","alt","imgStyle"]),t={};for(const n in e)void 0!==this.props[n]&&(t[n]=this.props[n]);this.cropper=new Ht(this.imgRef.current,t)}componentWillUnmount(){this.destroy(),this.cropper=null}reset(){return this.cropper.reset()}clear(){return this.cropper.clear()}initCrop(){return this.cropper.crop()}replace(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(e,t)}enable(){return this.cropper.enable()}disable(){return this.cropper.disable()}destroy(){return this.cropper.destroy()}move(e,t){return this.cropper.move(e,t)}moveTo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.moveTo(e,t)}relativeZoom(e,t){return this.cropper.zoom(e,t)}zoomTo(e,t){return this.cropper.zoomTo(e,t)}rotate(e){return this.cropper.rotate(e)}rotateTo(e){return this.cropper.rotateTo(e)}scaleX(e){return this.cropper.scaleX(e)}scaleY(e){return this.cropper.scaleY(e)}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.scale(e,t)}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(e)}setData(e){return this.cropper.setData(e)}getContainerData(){return this.cropper.getContainerData()}getImageData(){return this.cropper.getImageData()}getCanvasData(){return this.cropper.getCanvasData()}setCanvasData(e){return this.cropper.setCanvasData(e)}getCropBoxData(){return this.cropper.getCropBoxData()}setCropBoxData(e){return this.cropper.setCropBoxData(e)}getCroppedCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(e)}setAspectRatio(e){return this.cropper.setAspectRatio(e)}setDragMode(e){return this.cropper.setDragMode(e)}render(){const{className:e,style:n,src:r,alt:i,imgStyle:l}=this.props,a={[jn("cropper")]:!0};return t.createElement("div",{className:Fe(a,e),style:n},t.createElement("img",{ref:this.imgRef,src:r,alt:i,style:Object.assign({maxWidth:"100%"},l)}))}}ld.defaultProps={src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0};class ad extends r{constructor(){super(...arguments),this.cropperRef=t.createRef(),this.state={src:""},this.confirmHandle=()=>Tn(this,void 0,void 0,(function*(){const{quality:e}=this.props,{type:t,name:n,uid:r}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((e=>Tn(this,void 0,void 0,(function*(){let i=new File([e],n,{type:t});Object.assign(i,{uid:r});const{fileTypes:l=[],fileSize:a}=this.props;if(!(!l.length||l.includes(i.name.slice(i.name.lastIndexOf(".")+1).toLowerCase())))return L.warning(Xt("qm.upload.tooltip",{type:l.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(i);const o=this.beforeUploadRef(i,[i]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(i);if(!1===o)return this.rejectRef("not upload");if(o&&"function"==typeof o.then)try{const e=yield o,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(i=e),this.resolveRef(i)}catch(e){this.rejectRef(e)}}else en("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),t,e),yield Ln(100),this.onClose()})),this.onOk=()=>{this.confirmHandle()},this.onClose=()=>{this.setSrc("")}}get previewSize(){const{fixedSize:e}=this.props;return{width:"380px",height:e?`calc(380px * ${e[1]/e[0]})`:"auto"}}setSrc(e){this.setState({src:e})}renderUpload(){const{children:e,beforeCrop:n}=this.props,r=Array.isArray(e)?e[0]:e;if(!r)return null;const i=r.props,{beforeUpload:l}=i,a=wn(i,["beforeUpload"]);return this.beforeUploadRef=l,t.createElement(r.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((r,i)=>Tn(this,void 0,void 0,(function*(){const i=()=>r(k.LIST_IGNORE);if(n&&!(yield n(e,t)))return void i();this.fileRef=e,this.resolveRef=r,this.rejectRef=i;const l=new FileReader;l.onload=()=>{this.setSrc(l.result),l.onload=null},l.readAsDataURL(e)}))))}))}scaleHandle(e){this.cropperRef.current.relativeZoom(e,void 0)}rotateHandle(e){this.cropperRef.current.rotate(e)}renderCropper(){const{fixedSize:e}=this.props;return t.createElement("div",{className:"cropper-preview"},t.createElement("div",{className:"cropper-area"},t.createElement("div",{className:"img-cropper"},t.createElement(ld,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),t.createElement("div",{className:"actions"},t.createElement(N,{size:"small"},t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(et,null),onClick:()=>this.scaleHandle(.2)},Xt("qm.uploadCropper.zoomIn")),t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(tt,null),onClick:()=>this.scaleHandle(-.2)},Xt("qm.uploadCropper.zoomOut")),t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(nt,null),onClick:()=>this.rotateHandle(90)},Xt("qm.uploadCropper.rotatePlus")),t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(rt,null),onClick:()=>this.rotateHandle(-90)},Xt("qm.uploadCropper.rotateSubtract"))))),t.createElement("div",{className:"preview-area"},t.createElement("div",{className:"preview",style:this.previewSize})))}render(){const{className:e}=this.props,{src:n}=this.state,r=jn("cropper-preview");return t.createElement(t.Fragment,null,this.renderUpload(),n&&t.createElement(_,{open:!0,wrapClassName:Fe(r,e),title:Xt("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}ad.contextType=Bt;class od extends r{constructor(){super(...arguments),this.state={previewVisible:!1,currentIndex:0},this.uploadRef=t.createRef(),this.isFocused=!1,this.createSortable=()=>{this.props.draggable&&(this.sortableInstance=kt.create(this.getFileListNode(),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:e=>{const{oldIndex:t,newIndex:n}=e,{fileList:r=[],onSortChange:i,onChange:l}=this.props;if(t!==n){const e=[...r],[a]=e.splice(t,1);e.splice(n,0,a),null==i||i(e),null==l||l({fileList:e})}}}))},this.getFileListNode=()=>Ri(this.uploadRef.current,jn("upload-img")).querySelector(".ant-upload-list"),this.beforeUpload=(e,t)=>new Promise(((n,r)=>Tn(this,void 0,void 0,(function*(){const{fileTypes:i=[],fileSize:l,beforeUpload:a}=this.props,o=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!l||e.size/1024/1024<l,c=o&&s;if(o||L.warning(Xt("qm.upload.tooltip",{type:i.join(",")})),s||L.warning(Xt("qm.upload.sizeLimit",{size:l})),!c)return k.LIST_IGNORE;if(a){const i=a(e,t);if(!0===i)return n(e);if(!1===i)return r("not upload");if(i&&"function"==typeof i.then)try{const e=yield i;n(e)}catch(e){r(e)}}else n(e)})))),this.handlePreview=e=>{var t;this.setState({currentIndex:(null===(t=this.props.fileList)||void 0===t?void 0:t.findIndex((t=>t.url===e.url)))||0,previewVisible:!0})},this.handlePaste=e=>Tn(this,void 0,void 0,(function*(){const{fileList:t=[],action:n,data:r,headers:i,onChange:l}=this.props;if(this.isFocused&&this.showUploadButton&&n)for(const a of e.clipboardData.items)if("file"===a.kind&&a.type.startsWith("image/")){const e=a.getAsFile(),o=Date.now(),s=new File([e],`screenshot-${o}.png`,{type:e.type});Object.assign(s,{uid:`rc-upload-${o}`});try{yield this.beforeUpload(s,[...t,s]);const e=new FormData;if(e.append("file",s),r)for(const t in r)e.append(t,r[t]);const a="string"==typeof n?n:yield n(s),o=yield fetch(a,{method:"POST",body:e,headers:i});if(!o.ok)throw new Error(Xt("qm.upload.uploadError"));const c=yield o.json();null==l||l({file:s,fileList:[...t,{uid:s.uid,lastModified:s.lastModified,lastModifiedDate:s.lastModifiedDate,name:s.name,type:s.type,size:s.size,response:c,status:"done",percent:100,originFileObj:s}]})}catch(e){}}}))}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}get showUploadButton(){var e,t;const n=null!==(t=null===(e=this.props.fileList)||void 0===e?void 0:e.length)&&void 0!==t?t:0;return!this.props.maxCount||n<this.props.maxCount}componentDidMount(){this.createSortable(),document.addEventListener("paste",this.handlePaste)}componentDidUpdate(e){const{fileList:t}=e,{fileList:n}=this.props;t===n||this.showUploadButton||(this.isFocused=!1)}componentWillUnmount(){var e;null===(e=this.sortableInstance)||void 0===e||e.destroy(),document.removeEventListener("paste",this.handlePaste)}render(){const{previewVisible:e,currentIndex:n}=this.state,{fileList:r=[],fixedSize:i,quality:l,fileTypes:a,fileSize:o,draggable:s,disabled:c,readOnly:d,className:u,popupClassName:p,openCropper:h,beforeCrop:m}=this.props,f=jn("upload-img"),g={[f]:!0,[`${f}--lg`]:"large"===this.$size,[`${f}--sm`]:"small"===this.$size},v=c||d,y=t.createElement(k,vn({className:Fe(g,u)},Hn(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,disabled:v,onPreview:this.handlePreview,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,n,r,i)=>t.createElement("div",{className:Fe("upload-item",{handle:s})},e,!v&&t.createElement(Ze,{title:Xt("qm.upload.remove"),className:"icon",onClick:()=>i.remove()}))}),t.createElement("span",{ref:this.uploadRef},!this.showUploadButton||d&&r.length?null:t.createElement(t.Fragment,null,t.createElement("p",{className:"ant-upload-drag-icon"},t.createElement(it,null)),t.createElement("p",{className:"ant-upload-text"},Xt("qm.uploadCropper.dragableText")),t.createElement("button",{className:Fe("ant-upload-button",{disabled:v}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{this.isFocused=!0},onBlur:()=>{this.isFocused=!1}},Xt("qm.uploadCropper.pasteText")))));return t.createElement(t.Fragment,null,h?t.createElement(ad,{className:p,fixedSize:i,quality:l,fileTypes:a,fileSize:o,beforeCrop:m},y):y,t.createElement("div",{style:{display:"none"}},t.createElement(X.PreviewGroup,{preview:{visible:e,current:n,rootClassName:p,onVisibleChange:e=>{this.setState({previewVisible:e})}}},r.map(((e,n)=>{var r;return t.createElement(X,{key:null!==(r=e.uid)&&void 0!==r?r:n,src:e.url,alt:""})})))))}}od.contextType=Bt,od.defaultProps={name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0};const sd=(e,t,n)=>{let r;for(let i=0;i<e.length;i++){const l=e[i];if(l.children)if(l.children.some((e=>e[n]===t)))r=l[n];else{const e=sd(l.children,t,n);e&&(r=e)}}return r},cd=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&cd(e.children,t),t(e)||e.children&&e.children.length))),dd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...dd(e.children,t)),t(e)&&n.push(e)})),n},ud=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=ud(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},pd=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:pd(e.children,t,n,r)}):e)),hd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...hd(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},md=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][n]===t)return[t];if(Array.isArray(e[r].children)){const i=md(e[r].children,t,n);if(i)return[e[r][n],i].flat()}}},fd=(e,t)=>{var n;const r=(null===(n=e.children)||void 0===n?void 0:n.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...fd(e,t)))),r},gd=t.forwardRef(((e,n)=>{const{className:r,style:i,filterable:l=!0,multiple:a,draggable:o,dataSource:s,fetch:c,asyncLoad:d,checkStrictly:u,checkStrategy:p="SHOW_CHILD",placeholder:h=Xt("qm.form.inputPlaceholder"),fieldsDefine:m,value:f,height:g,defaultSelectedKeys:v=[],defaultExpandAll:y=!0,showSearchBar:b=!0,showCollapse:x=!0,onSelectChange:E,onCheckChange:S,onDragStart:w,onDragChange:C,onExpand:T}=e,{size:N}=t.useContext(Bt),I=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:N)&&void 0!==n?n:""}),[e.size,N]),R=(null==m?void 0:m.valueKey)||"value",k=(null==m?void 0:m.textKey)||"text";null==m||m.children;const L=t.useRef(null),A=Vi(L),[P,_]=t.useState(g),[H,F]=t.useState(!1),D=Wi((()=>{_(L.current.offsetHeight-X.current.offsetHeight-10)}),5);zi((()=>{g||D()}),[A.height]);const[$,M]=t.useState([]),[q,j]=t.useState({}),[V,K]=t.useState([]),[z,W]=t.useState([]),[B,U]=t.useState(""),[G,Y]=t.useState(y),X=t.useRef(null),Q=t.useRef([]),J=t.useRef([]);t.useEffect((()=>{Array.isArray(s)&&(ee(s),K(te(s)),j({}))}),[s]),t.useEffect((()=>{ie()}),[]),bi((()=>{ie()}),[null==c?void 0:c.params]),bi((()=>{W(re())}),[q]),t.useImperativeHandle(n,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],r=ud($,(t=>e===t[R]));r&&(Array.isArray(r.children)?r.children.push(...n):r.children=[...n],ee([...$]))},REMOVE_RECORD:e=>{var t;const n=sd($,e,R);if(void 0===n&&$.find((t=>t[R]===e)))ee($.filter((t=>t[R]!==e)));else{const r=ud($,(e=>n===e[R]));if(!r)return;const i=null===(t=r.children)||void 0===t?void 0:t.findIndex((t=>e===t[R]));i>=0&&(r.children.splice(i,1),ee([...$]))}},UPDATE_RECORD:(e,t)=>{const n=ud($,(t=>e===t[R]));n&&(xe(n,t),ee([...$]))}})));const ee=e=>{M(e),Q.current=e,J.current=hd(e,R)},te=e=>{if(a)return v;const t=dd(e,(e=>v.includes(e[k])));return 1===t.length?[t[0][R]]:[]},ne=e=>{var t;return(null===(t=md($,e,R))||void 0===t?void 0:t.slice(0,-1))||[]},re=()=>{if(y)return J.current;const e=[];return V.forEach((t=>{if(a){if("SHOW_ALL"===p&&!J.current.includes(t)&&e.push(...ne(t)),"SHOW_CHILD"===p&&e.push(...ne(t)),"SHOW_PARENT"===p){const n=wa($,t);if(n){const r=ne(t),i=fd(n,R);e.push(...r,...[t,...i].filter((e=>J.current.includes(e))))}}}else e.push(...ne(t))})),[...new Set(e)]},ie=()=>Tn(void 0,void 0,void 0,(function*(){var e;if(!c)return;const{api:t,params:n,dataKey:r,afterFetch:i,callback:l}=c;try{F(!0);const a=yield t(n);if(200===a.code){let t=Array.isArray(a.data)?a.data:null!==(e=me(a.data,r))&&void 0!==e?e:[];t="function"==typeof i?yield i(t):t,ee(t),K(te(t)),j({}),null==l||l(t)}}catch(e){}F(!1)})),le=e=>`${e}|${Ma.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ae=jn("search-tree"),oe={[ae]:!0,[`${ae}--lg`]:"large"===I,[`${ae}--sm`]:"small"===I};return t.createElement("div",{ref:L,className:Fe(oe,r),style:i},t.createElement("div",{ref:X,className:"topper"},b&&t.createElement(O.Search,{value:B,size:I,placeholder:h,allowClear:!0,onChange:e=>(e=>{if(!l)return;const t=cd(Q.current,(t=>{if(!e)return!0;const n=t[k]||"";return-1!==le(n).indexOf(e)}));U(e),M(t),y||e?W(hd(t,R)):j({})})(e.target.value)}),x&&t.createElement("a",{className:"trigger",onClick:()=>{Y(!G),W(G?[]:J.current)}},G?t.createElement(De,null):t.createElement($e,null)," ",Xt(G?"qm.form.collect":"qm.form.spread"))),t.createElement(Di,{spinning:H},t.createElement(Z,{fieldNames:{title:k,key:R,children:"children"},multiple:a,draggable:o,blockNode:o,checkable:a,selectable:!a,height:P,disabled:e.disabled,checkStrictly:u,selectedKeys:null!=f?f:V,checkedKeys:null!=f?f:V,expandedKeys:z,treeData:$,loadData:d?e=>{let{key:t,children:n}=e;return Tn(void 0,void 0,void 0,(function*(){var e;if(!c||n)return;const{api:r,params:i,dataKey:l,formatter:a=(e=>e),afterFetch:o}=c;try{const n=yield r(a(Object.assign(Object.assign({},i),{[R]:t})));if(200===n.code){let r=Array.isArray(n.data)?n.data:null!==(e=me(n.data,l))&&void 0!==e?e:[];r="function"==typeof o?yield o(r):r;const i=pd(Q.current,t,R,r);ee(i)}}catch(e){}}))}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!B)return!1;const t=e[k]||"";return-1!==le(t).indexOf(B)},onDragStart:w,onDragEnter:e=>{W(e.expandedKeys)},onDrop:e=>{const t=e.node.key,n=e.dragNode.key,r=e.node.pos.split("-"),i=e.dropPosition-Number(r[r.length-1]),l=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][R]===t)return n(e[r],r,e);e[r].children&&l(e[r].children,t,n)}},a=[...$];let o;if(l(a,n,((e,t,n)=>{n.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===i)l(a,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,n=[];l(a,t,((t,r,i)=>{n=i,e=r})),-1===i?n.splice(e,0,o):n.splice(e+1,0,o)}else l(a,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));ee(a)},onDragEnd:e=>{null==C||C(e,$)},onExpand:(e,t)=>{_n(e)&&Y(!1),J.current.every((t=>e.includes(t)))&&Y(!0),W(e),null==T||T(e,t)},onSelect:e=>{K(e);const t=dd(Q.current,(t=>e.includes(me(t,R))));null==E||E(a?t:t[0])},onCheck:e=>{u&&(e=e.checked),K(e),"SHOW_CHILD"===p&&(e=e.filter((e=>!J.current.includes(e)))),"SHOW_PARENT"===p&&(e=e.filter(((e,t,n)=>!n.includes(sd($,e,R)))));const t=dd(Q.current,(t=>e.includes(me(t,R))));null==S||S(a?t:t[0])}})))}));gd.displayName="QmSearchTree";const vd=n(void 0),yd={dataIndex:f.string.isRequired,title:f.string.isRequired,description:f.string,colSpan:f.number,width:f.number,minWidth:f.number,fixed:f.oneOf(["left","right"]),align:f.oneOf(["left","center","right"]),theadAlign:f.oneOf(["left","center","right"]),printFixed:f.bool,hidden:f.bool,noAuth:f.bool,noFixed:f.bool,ellipsis:f.bool,className:f.string,theadClassName:f.string,children:f.array,sorter:f.oneOfType([f.bool,f.func]),filter:f.shape({type:f.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:f.arrayOf(f.shape({text:f.string,value:f.oneOfType([f.string,f.number])})),style:f.object}),precision:f.number,displayPrecision:f.number,formatType:f.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:f.bool,canCopy:f.bool,editRender:f.func,dictItems:f.arrayOf(f.shape({text:f.string,value:f.oneOfType([f.string,f.number])})),summation:f.shape({sumBySelection:f.bool,displayWhenNotSelect:f.bool,dataKey:f.string,unit:f.string,render:f.func}),groupSummary:f.shape({dataKey:f.string,unit:f.string,render:f.func}),shouldCellUpdate:f.func,headRender:f.func,render:f.func};f.arrayOf(f.shape(yd)).isRequired,f.func,f.array,f.oneOfType([f.string,f.func]).isRequired,f.number,f.bool,f.bool,f.shape({api:f.func.isRequired,params:f.object.isRequired,formatter:f.func,beforeFetch:f.func,afterFetch:f.func,stopToFirst:f.bool,dataKey:f.string,callback:f.func}),f.bool,f.bool,f.string,f.string,f.bool,f.bool,f.bool,f.bool,f.oneOfType([f.object,f.func]),f.oneOfType([f.object,f.func]),f.array,f.func,f.bool,f.object,f.object,f.shape({type:f.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:f.array,selectedRowKeys:f.array,hideSelectAll:f.bool,checkStrictly:f.bool,filterable:f.bool,selectByClickRow:f.bool,selectFirstRowOnChange:f.bool,clearableAfterFetched:f.bool,selectAllOnCurrentPage:f.bool,fetchSelectedRows:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),fetchAllRowKeys:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),disabled:f.func,onChange:f.func,onSelect:f.func,onSelectAll:f.func}),f.shape({currentRowKey:f.oneOfType([f.number,f.string]),disabled:f.func,onChange:f.func}),f.shape({virtual:f.bool,doubleXScrollbar:f.bool}),f.shape({virtual:f.bool,expandIconColumn:f.string}),f.shape({defaultExpandAllRows:f.bool,defaultExpandedRowKeys:f.array,expandedRowKeys:f.array,hideExpandAll:f.bool,rowExpandable:f.func,expandedRowClassName:f.string,expandedRowRender:f.func,onExpand:f.func,onChange:f.func}),f.shape({cellMerge:f.bool,onCellMerge:f.func,onSelectChange:f.func}),f.shape({groupItems:f.arrayOf(f.shape({dataIndex:f.string.isRequired,titleIndex:f.string,color:f.string,backgroundColor:f.string})),fetch:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),onChange:f.func}),f.func,f.bool,f.bool,f.bool,f.bool,f.shape({current:f.number,pageSize:f.number,pageSizeOptions:f.array,showSizeChanger:f.bool,showQuickJumper:f.bool}),f.shape({fileName:f.string,fetch:f.shape({api:f.func.isRequired,params:f.object}),beforeExport:f.func,cellStyle:f.bool,hideIcon:f.bool}),f.shape({showLogo:f.bool}),f.shape({fetch:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),fieldList:f.arrayOf(f.object)}),f.shape({position:f.oneOf(["top","bottom"]),hideAlert:f.bool,hideClearButton:f.bool}),f.oneOf(["left","right"]),f.func,f.func,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.func,f.func,f.func,f.func,f.func,f.func,f.func,f.func,f.func;const bd={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},xd=10,Ed="1",Sd="0",wd="YYYY-MM-DD",Cd="YYYY-MM-DD HH:mm:ss",Td="YYYYMMDDHHmmss",Nd={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var Id;function Rd(t){const n=e.useRef();n.current=t;const r=e.useCallback((function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return null===(e=n.current)||void 0===e?void 0:e.call(n,...r)}),[]);return r}!function(e){e.left="flex-start",e.right="flex-end"}(Id||(Id={}));const Od=Object.assign({},e).useId;let kd=0;var Ld=Od?function(e){const t=Od();return e||t}:function(t){const[n]=e.useState(`qm_unique_${kd}`);return e.useEffect((()=>{kd+=1}),[]),t||n};let Ad=[];const Pd={getFocusInstance:function(){var e;return null!==(e=Ad[0])&&void 0!==e?e:null},getInstance:function(e){var t;return null!==(t=Ad.find((t=>t.id===e)))&&void 0!==t?t:null},focus:function(e){const t=this.getInstance(e);t&&0!==Ad.findIndex((e=>e===t))&&(this.deregister(e),Ad=[t,...Ad])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),Ad=[{id:e,vm:t},...Ad])},deregister:function(e){e&&(Ad=Ad.filter((t=>t.id!==e)))}};class _d{constructor(){this.state={required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]},this.addToRequired=e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)},this.removeFromRequired=e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)},this.addToValidate=e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)},this.removeFromValidate=e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)},this.addToEdited=e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)},this.removeFromEdited=e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)},this.addToInserted=e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)},this.removeFromInserted=e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)},this.addToUpdated=e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)},this.removeFromUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)},this.addToRemoved=e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)},this.removeFromRemoved=e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)},this.clearAllLog=()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]}}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}const Hd={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollX:50,virtualScrollY:150,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored"};function Fd(e){return void 0!==e}function Dd(t,n){const{defaultValue:r,value:i,onChange:l,postState:a}=n||{},[o,s]=e.useState((()=>Fd(i)?i:Fd(r)?"function"==typeof r?r():r:"function"==typeof t?t():t)),c=Fd(i)?i:o,d=a?a(c):c,u=Rd(l),[p,h]=e.useState([c]);zi((()=>{const e=p[0];o!==e&&u(o,e)}),[p]),zi((()=>{Fd(i)||s(i)}),[i]);return[d,Rd((e=>{s(e),h([c])}))]}let $d;const Md=()=>{var e;if(Nn)return 0;if(void 0!==$d)return $d;const t=document.createElement("div");t.className="qm-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),$d=n-i,$d},qd=e=>e.map((e=>{const t=Object.assign({},e);return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=qd(t.children)),t})),jd=(e,n)=>{const{fetch:r,columns:i,height:l,minHeight:a,maxHeight:o,border:s=!0,rowSelection:c,summation:d,expandable:u,treeConfig:p,webPagination:h,scrollPagination:m,showSuperSearch:f,showFastSearch:g,showGroupSummary:v,showTableImport:y,showClipboard:b,showSelectCollection:x,footRender:E}=e,{tableRef:S,getRowKey:w,tableFullData:C,tableData:T,selectionKeys:N,sorter:I,filters:R,superFilters:O,pagination:k,mergedTdCells:L}=n,{selectionRows:A,summaries:P}=S.current,{expandIconColumn:_=""}=p||{},H=e=>{const t=(e=>{const t=[],n=[],r=[];for(let i=0;i<e.length;i++){const l=e[i];"left"===l.fixed?t.push(l):"right"===l.fixed?n.push(l):r.push(l)}return[...t,...r,...n]})(qd(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Hd.selectionColumn,title:"radio"===t?Xt("qm.table.config.selectionText"):"",width:Hd.selectionColumnWidth,fixed:"left",type:t}})(c),r=(null==(i=u)?void 0:i.expandedRowRender)?{dataIndex:Hd.expandableColumn,title:"",width:Hd.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return n&&t.unshift(n),r&&t.unshift(r),Il(t)},F=t.useMemo((()=>!!(null==r?void 0:r.api)),[null==r?void 0:r.api]),D=t.useMemo((()=>!F&&!!h),[F,h]),$=t.useMemo((()=>F&&!!m),[F,m]),M=t.useMemo((()=>(F||D)&&!$),[F,D,$]),q=t.useMemo((()=>!!(l||a||o)),[l,a,o]),j=t.useMemo((()=>H(i)),[i]),V=t.useMemo((()=>Nl(j)),[j]),K=t.useMemo((()=>V.filter((e=>"function"==typeof e.editRender))),[V]),z=t.useMemo((()=>V.filter((e=>!!e.summation))),[V]),W=t.useMemo((()=>V.filter((e=>"left"===e.fixed))),[V]),B=t.useMemo((()=>V.filter((e=>"right"===e.fixed))),[V]),U=t.useMemo((()=>(e=>{const t=[];return e.forEach((e=>{const n=C.find((t=>w(t,t.index)===e.rowKey)),r=V.findIndex((t=>t.dataIndex===e.dataIndex));if(!n||r<0)return;const i={row:n.index,col:r,rowSpan:e.rowSpan,colSpan:e.colSpan};t.push(i);for(let n=1;n<e.colSpan;n++)for(let r=0;r<e.rowSpan;r++)t.push({row:i.row+r,col:i.col+n,rowSpan:0,colSpan:0});for(let n=1;n<e.rowSpan;n++)for(let r=0;r<e.colSpan;r++)t.push({row:i.row+n,col:i.col+r,rowSpan:0,colSpan:0})})),t})(L)),[L,V,C]),G=t.useMemo((()=>{var e,t;const n=V.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(e.dataIndex)));return _&&n.some((e=>e.dataIndex===_))?_:null!==(t=null===(e=n[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[V,_]),Y=t.useMemo((()=>z.length>0),[z]),X=t.useMemo((()=>!!E||Y),[E,Y]),Z=t.useMemo((()=>Fl(j).length>1),[j]),Q=t.useMemo((()=>s||Z),[s,Z]),J=t.useMemo((()=>V.some((e=>e.sorter))),[V]),ee=t.useMemo((()=>V.some((e=>e.filter))),[V]),te=t.useMemo((()=>z.some((e=>!!e.summation.dataKey))),[z]),ne=t.useMemo((()=>!F&&!!y),[F,y]),re=t.useMemo((()=>!!b&&K.length>0),[b,K]),ie=t.useMemo((()=>!!x&&"checkbox"===(null==c?void 0:c.type)),[x,c]),le=t.useMemo((()=>!!f&&ee),[f,ee]),ae=t.useMemo((()=>!F&&!!g&&ee),[F,g,ee]),oe=t.useMemo((()=>!!v&&V.some((e=>!!e.groupSummary))),[V]),se=t.useMemo((()=>{var e;return!!(null===(e=null==d?void 0:d.groupItems)||void 0===e?void 0:e.length)}),[d]),ce=t.useMemo((()=>C.some((e=>Array.isArray(e.children)))),[C]),de=t.useMemo((()=>!T.length),[T]),ue=t.useMemo((()=>(()=>{const e={};return z.forEach((t=>{const{dataIndex:n,precision:r,displayPrecision:i,summation:l}=t,{sumBySelection:a,displayWhenNotSelect:o,unit:s}=l,c=se?Zl(S.current.tableFullData):S.current.tableFullData,d=!A.length&&!!o;let u=(!a||d?c:A).reduce(((e,t)=>{if(null==t?void 0:t[Hd.summaryIgnore])return e;const r=ql(t,n);return Kl(r)?e.plus(r):e}),new Ft(0));!Object.keys(P).includes(n)||a&&!d||(u=new Ft(ql(P,n))),jl(e,n,u.toNumber());let p=r>=0?u.toFixed(r):u.toString();i>=0&&""!==p&&(p=Wl(p,i)),p=zl(p),jl(e,`${n}_text`,s?`${p} ${s}`:p)})),[e]})()),[T,N,P]),pe=t.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(z)),[z]),he=t.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((n=>{null!==e[n]&&t.push(`${n}|${e[n]}`)})),t.join(",")})(I),n=((e,t)=>{const n=[];if(Object.keys(e).length)for(const t in e){const[r,i]=t.split("|"),l=e[t];Object.keys(l).forEach((e=>{n.push({type:i,bracketLeft:"",fieldName:r,expression:e,value:l[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{n.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),n.length&&(n[n.length-1].logic=""),n})(R,O),i=t?{[Hd.sorterFieldName]:t}:null,l=n.length?{[Hd.filterFieldName]:n}:null,a=pe?{[Hd.groupSummary.summaryFieldName]:pe,usedJH:1}:null,o=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:null,s={[Hd.currentPageName]:k.current,[Hd.pageSizeName]:k.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),l),a),o),s)}),[null==r?void 0:r.params,k.current,k.pageSize,I,R,O,pe]);return{isFetch:F,isWebPagination:D,isScrollPagination:$,showPagination:M,shouldUpdateHeight:q,tableColumns:j,flattenColumns:V,editableColumns:K,summationColumns:z,leftFixedColumns:W,rightFixedColumns:B,derivedMergeCells:U,treeExpandIndex:G,showSummary:Y,showFooter:X,isHeadGroup:Z,bordered:Q,isHeadSorter:J,isHeadFilter:ee,isServiceSummation:te,isSelectCollection:ie,isTableImport:ne,isTableClipboard:re,isSuperSearch:le,isFastSearch:ae,isGroupSummary:oe,isGroupSubtotal:se,isTreeTable:ce,isTableEmpty:de,summationRows:ue,fetchParams:he}};function Vd(){const{locale:t}=e.useContext(Bt);return{t:Xt,$locale:t}}const Kd=(e,n)=>{const{rowKey:r,height:i,dataSource:l,summation:a,fetch:o,initialSorter:s,initialFilter:c,rowSelection:d,expandable:u,tableConfig:p,treeConfig:h,authConfig:m,ignorePageIndex:f,columnsChange:g,onChange:v,onDataChange:y,onDataLoad:b,onScrollEnd:x,onFetchError:E}=e,{getRowKey:S,tableRef:w,tableElementRef:C,tableBodyRef:T,$size:N,tableColumns:I,flattenColumns:R,editableColumns:O,tableFullData:k,pagination:L,layout:A,filters:P,sorter:_,superFilters:H,fetchParams:F,selectionKeys:D,rowExpandedKeys:$,highlightKey:M,summationColumns:q,shouldUpdateHeight:j,isFetch:V,isTreeTable:K,isWebPagination:z,isScrollPagination:W,isServiceSummation:B,isGroupSubtotal:U,doLayout:G,setTableData:Y,setTableFlatColumns:X,setTableFullData:Z,setTableOriginData:Q,setTableFlatData:J,setAllTableData:ee,setDeriveRowKeys:te,setPagination:ne,setSpinning:re,setSorter:ie,setFilters:le,setSuperFilters:ae,setSelectionKeys:oe,setRowExpandedKeys:se,setHighlightKey:ce,setSelectionRows:de,setScrollXLoad:ue,setScrollYLoad:pe,setScrollXStore:he,setScrollYStore:fe,computeVirtualX:ge,computeVirtualY:ve,setFieldAuth:ye,setResizeState:be,setSummaries:xe,setPermission:Ee,setRecordsMap:Se,resetTableScroll:Ce,clearElementStore:Te,clearRecordsMap:Ne}=n,{t:Ie}=Vd(),{store:Re,scrollBarRef:Oe}=w.current,ke=Number.parseInt(t.version)>=18?Dt.flushSync:null,Le=t.useRef(Object.assign({},F)),Ae=t.useRef(new Map),Pe=t.useRef(!1),_e=Vi(C);zi((()=>{qe(),w.current.scrollXLoad?Ve(Oe.current.scrollLeft):Ke(),G()}),[I]),zi((()=>{He()}),[_e,N,i,A.tableAutoHeight]),bi((()=>{It(),Rt(),Ot(),V||(z&>(),dt(l)),s&&ie(s),c&&le(c)}),[l,null==o?void 0:o.params]),bi((()=>{const e=lt(F,Le.current);e||V&&(null==d?void 0:d.clearableAfterFetched)&&kt(),!e&&F[Hd.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?gt():V&&st(),Le.current=F}),[F]),bi((()=>{z&&wt(),W||Ce(),nt()}),[L.current,L.pageSize]),bi((()=>{w.current.scrollYLoad&&Be(Oe.current.scrollTop),V||De(k.length),G()}),[k]),bi((()=>{K&&w.current.scrollYLoad&&(vt(),wt())}),[$]);const He=()=>{const{scrollXLoad:e,scrollYLoad:t,resizeState:n}=w.current,{width:r,height:i}=n,{width:l,height:a}=_e,o=l!==r,s=a!==i;G(),o&&e&&Ke(),s&&j&&t&&Ue(),be(Object.assign({},n,{width:l,height:a}))},Fe=()=>{M&&T.current.setClickedValues([M,""]),"radio"===(null==d?void 0:d.type)&&D.length&&T.current.setClickedValues([D[0],""])},De=e=>{e!==L.total&&ne((t=>Object.assign({},t,{total:e})))},$e=e=>{Pe.current=e},Me=Wi((e=>{ht(),null==x||x(e)})),qe=()=>{ue(R.length>Hd.virtualScrollX)},je=function(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).length>Hd.virtualScrollY;(null==p?void 0:p.virtual)&&(e=!0),(null==h?void 0:h.virtual)&&(e=!0),pe(e)},Ve=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollXStore:t}=w.current,{startIndex:n,endIndex:r,offsetSize:i}=t,{toVisibleIndex:l,visibleSize:a}=ge(e,A.tableWidth),o=Math.max(0,l-1-i),s=l+a+i;(l<=n||l>=r-a-1)&&(n===o&&r===s||(he(Object.assign({},t,{startIndex:o,endIndex:s})),Ke()))},Ke=()=>{ze(),We()},ze=()=>{const{scrollXLoad:e,scrollXStore:t}=w.current;if(!e)return;const n=[],r=[],i=[];for(let e=0;e<R.length;e++){const l=R[e];l.fixed?"left"===l.fixed?n.push(l):i.push(l):e>=t.startIndex&&e<t.endIndex&&r.push(l)}ke?queueMicrotask((()=>ke((()=>X([...n,...r,...i]))))):X([...n,...r,...i])},We=()=>{const{elementStore:e,scrollXStore:t,scrollXLoad:n}=w.current,{tableBodyWidth:r,gutterWidth:i}=A;let l="",a="";if(n){l=`${R.slice(0,t.startIndex).filter((e=>!e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)}px`,a=`${scrollY?r-i:r}px`}e.$tableBody.style.marginLeft=l,e.$tableXspace.style.width=a},Be=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=w.current,{startIndex:n,endIndex:r,offsetSize:i,visibleSize:l,rowHeight:a}=t,{toVisibleIndex:o}=ve(e,a),s=Math.max(0,o-1-i),c=o+l+i;(o<=n||o>=r-l-1)&&(n===s&&r===c||(fe(Object.assign({},t,{startIndex:s,endIndex:c})),Ue()))},Ue=()=>{const{tableFlatData:e}=w.current;Et(e),(e=>{const{elementStore:t,scrollYStore:n,scrollYLoad:r}=w.current,{startIndex:i,rowHeight:l}=n;let a="",o="";r&&(a=`${Math.max(0,i*l)}px`,o=e.length*l+"px"),t.$tableBody.style.marginTop=a,t.$tableYspace.style.height=o})(e)},Ge=e=>U?Ye(Xe(e,0)):e,Ye=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Ye(e.children)),delete e.children,t.push(e)})),t},Xe=(e,t)=>{var n;const i=null===(n=a.groupItems)||void 0===n?void 0:n[t];if(!i)return e.forEach(((t,n)=>{t._rowSpan=0===n?e.length:0,t._colSpan=1})),e;return Jl(e,[i.dataIndex]).map((e=>{const n={children:Xe(e,t+1),_group:i.dataIndex};return"function"!=typeof r&&jl(n,r.toString(),Gl()),i.titleIndex&&jl(n,i.titleIndex,ql(e[0],i.titleIndex)),jl(n,i.dataIndex,ql(e[0],i.dataIndex)),q.forEach((e=>{var t;const{dataIndex:r}=e,i=null===(t=n.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Hd.summaryIgnore])return e;const n=Number(ql(t,r));return Number.isNaN(n)?e:e+n}),0);jl(n,r,i)})),n}))},Ze=e=>{oe(e),de((e=>{const{selectionRows:t,recordsMap:n}=w.current,r=new Map;t.forEach((e=>r.set(S(e,e.index),e)));const i=[];for(let t=0,l=e.length;t<l;t++){const l=r.get(e[t])||n.get(e[t]);l&&i.push(l)}return i})(e))},Qe=e=>{const{type:t,checkStrictly:n=!0}=d||{},r=Array.isArray(e)?e:D;let i=[];return w.current.treeTable&&!n&&r.forEach((e=>{i.push(...((e,t)=>{var n;const{disabled:r}=d||{},{deriveRowKeys:i,recordsMap:l}=w.current,a=_l(i,e);let o=[];if(!a)return o;let s=et((null==a?void 0:a.children)||[]);return r&&(s=s.filter((e=>!l.has(e)||!r(l.get(e))))),o=[...new Set([...t,...s])],((null===(n=ta(i,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=_l(i,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=r?[...o,e]:o.filter((t=>t!==e))})),o})(e,r))})),i="radio"===t?r.slice(0,1):[...new Set([...r,...i])],i},Je=e=>{const{allRowKeys:t,flattenRowKeys:n,deriveRowKeys:r}=w.current,{defaultExpandAllRows:i,expandedRowRender:l}=u||{},a=Array.isArray(e)?e:$;if(w.current.treeTable){l&&en("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];M&&e.unshift(M);let o=[];return e.forEach((e=>{const t=ta(r,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=i?t:[...new Set([...a,...o])],o.filter((e=>!n.includes(e)))}return u?i?t.slice(0):[...a]:[]},et=e=>{const t=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&t.push(...et(e[n].children)),t.push(e[n].rowKey);return t},tt=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...tt(e.children,t)),e.rowKey===t&&e.parentRowKey&&n.push(e.parentRowKey)})),n.length&&n.push(...tt(e,n[n.length-1])),n},nt=Wi((()=>{null==v||v(L,it(P),rt(_),H,{currentDataSource:xt()})})),rt=e=>{const t={};for(const n in e)null!==e[n]&&(t[n]=e[n]);return t},it=e=>{const t={};for(const n in e){if(!n.includes("|"))continue;const[r,i]=n.split("|");t[`${r}|${i}`]=e[n]}return t},lt=(e,t)=>{const n=Object.keys(Ml(e,t));return 1===n.length&&(n.includes(Hd.currentPageName)||n.includes(Hd.pageSizeName))},at=()=>Tn(void 0,void 0,void 0,(function*(){var t;if(!m)return;let n=Hn(m,["fetch"]);if(m.fetch){const{api:e,params:r,dataKey:i}=m.fetch;try{const l=yield e(r);200===l.code&&(n=null!==(t=i?me(l.data,i):l.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:r=1}=n;Ee((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!r})))}if(Array.isArray(n.fieldList)){const{originColumns:t}=w.current,r=Ol(e.columns,(e=>{const{dataIndex:r}=e,i=n.fieldList.find((e=>e.dataIndex===r));if(i){const{visible:n=1,disabled:l,secretName:a}=i,o=kl(t,r);ye(r,{visible:n,disabled:l,secretName:a}),n||(e.noAuth=!0,o.noAuth=!0),a&&(e.formatType=`secret-${a}`,o.formatType=`secret-${a}`)}}));null==g||g(r)}})),ot=()=>Tn(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:r=(e=>e),beforeFetch:i=kn,afterFetch:l,callback:s}=o;if(!i(F))return;const c=!!(null===(e=null==a?void 0:a.fetch)||void 0===e?void 0:e.api);re(!0);try{const[e,i]=c?yield Promise.all([o.api(r(F)),a.fetch.api(r(F))]):[yield o.api(r(F))];if(w.current.unMounted)return;if(c?200===e.code&&200===i.code:200===e.code){const r=null!==(t=o.dataKey)&&void 0!==t?t:Hd.dataKey;let a=null!==(n=me(e.data,r))&&void 0!==n?n:[];a="function"==typeof l?yield l(a):a;const c=me(e.data,r.replace(/[^.]+$/,Hd.totalKey))||a.length||0,d=Math.max(Math.ceil(c/L.pageSize),1);if(F[Hd.currentPageName]>d)return mt(Object.assign(Object.assign({},L),{current:d}));dt(Pe.current?w.current.tableFullData.concat(a):a),De(c),ut((null==i?void 0:i.data)||e.data),null==s||s(e.data,e)}}catch(e){null==E||E(e)}var d,u;d=o,u="stopToFirst",Object.prototype.hasOwnProperty.call(d,u)&&(o.stopToFirst=!1),re(!1),$e(!1)})),st=Wi(ot),ct=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=ct(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:n}=L;return!V||W?e:(t-1)*n+e})(t)),e))),dt=e=>{const t=Ge(ct(e));Ct(t),Tt(t),Ze(Qe()),se(Je()),pt(),null==b||b(t)},ut=e=>{var t,n,r;if(!B)return;const i=null!==(n=null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:Hd.summationKey,l=null!==(r=i?me(e,i):e)&&void 0!==r?r:{},o={};q.filter((e=>!!e.summation.dataKey)).forEach((e=>{jl(o,e.dataIndex,Number(ql(l,e.summation.dataKey)))})),xe(o)},pt=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=xt();if(e.length){const t=S(e[0],e[0].index);Ze([t])}else Ze([])}},ht=()=>{if(!W)return;const e=ft();Pe.current||L.current>=e||($e(!0),mt(Object.assign(Object.assign({},L),{current:L.current+1})))},mt=e=>{let{current:t,pageSize:n}=e;ne((e=>Object.assign({},e,{current:t,pageSize:n})))},ft=()=>{const{pageSize:e,total:t}=L;return Math.ceil(t/e)||1},gt=()=>{mt(Object.assign({},L,{current:1}))},vt=()=>{const{scrollYLoad:e,deriveRowKeys:t}=w.current;if(!w.current.treeTable||!e)return;const n=yt(t,(()=>{const{allTableData:e,allRowKeys:t}=w.current,{rowExpandable:n}=u||{},r=[];return"function"==typeof n&&e.forEach(((e,i)=>!n(e)&&r.push(t[i]))),r.length?$.filter((e=>!r.includes(e))):$})());Ae.current.clear(),n.forEach(((e,t)=>Ae.current.set(e,t)))},yt=(e,t)=>{const n=[];return e.forEach((e=>{if(e.children&&n.push(...yt(e.children,t)),void 0===e.parentRowKey)n.push(e.rowKey);else if(t.includes(e.parentRowKey)){e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1))&&n.push(e.rowKey)}})),n},bt=()=>{const{current:e,pageSize:t}=L;return w.current.tableFullData.slice((e-1)*t,e*t)},xt=()=>z?bt():w.current.tableFullData,Et=e=>{const{scrollYLoad:t,scrollYStore:n}=w.current;if(!t)return Y(e);const{startIndex:r,endIndex:i}=n;ke?queueMicrotask((()=>ke((()=>Y(e.slice(r,i)))))):Y(e.slice(r,i))},St=()=>{let e=xt();w.current.treeTable&&(null==h?void 0:h.virtual)&&(e=(e=>{const{recordsMap:t,allRowKeys:n}=w.current,r=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];Ae.current.has(i)&&r.push(t.get(i))}return r})()),je(e),J(e)},wt=()=>{St(),Ue()},Ct=e=>{Z(e),ee(e),te(e),Nt(),vt(),wt()},Tt=e=>{Q(e)},Nt=()=>{Ne(),w.current.allTableData.forEach((e=>Se(S(e,e.index),e)))},It=()=>{ie({})},Rt=()=>{le({})},Ot=()=>{ae([])},kt=()=>{Ze([])};return{initialTable:()=>{at(),Fe(),qe(),je(),V?ot():dt(l)},checkDataIndex:()=>{const e=R.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&en("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:Ct,getTableData:ot,handleTableData:Et,createWebPageData:bt,createTableData:dt,createGroupData:Ge,createSelectionKeys:Qe,createRowExpandedKeys:Je,setSelectionKeysEffect:Ze,findParentRowKeys:tt,getAllChildRowKeys:et,doFieldValidate:(e,t,n,r)=>{if(!Array.isArray(e))return en("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Re.removeFromRequired({x:n,y:r}),Re.removeFromValidate({x:n,y:r}),e.forEach((e=>{var i;e.required&&_n(t)&&Re.addToRequired({x:n,y:r,text:e.message||O.find((e=>{let{dataIndex:t}=e;return t===r})).title+Ie("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(i=e.validator)||void 0===i?void 0:i.call(e,t))||Re.addToValidate({x:n,y:r,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:r,removed:i}=Re.state,l=we(n,i),a=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:a(e),validate:a(t),inserted:n.filter((e=>!l.includes(e))),updated:r.filter((e=>![...we(r,n),...we(r,i)].includes(e))),removed:i.filter((e=>!l.includes(e)))}},dataChange:()=>{null==y||y(w.current.tableFullData)},tableChange:nt,toLastPage:()=>{const e=ft();L.current!==e&&mt(Object.assign({},L,{current:e}))},toFirstPage:gt,getPageCount:ft,pagerChangeHandle:mt,triggerScrollXEvent:e=>{Ve(e)},triggerScrollYEvent:e=>{Be(e)},scrollBottomDebouncer:Me,clearTableSorter:It,clearTableFilter:Rt,clearSuperFilters:Ot,clearRowSelection:kt,clearRowHighlight:()=>{ce("")},clearTableLog:()=>{Re.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=w.current;Te(),Re.destroy(),e.deregister(t)}}},zd=(e,n)=>{const{height:r,minHeight:i,maxHeight:l,ellipsis:a,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,topElementRef:u,tableElementRef:p,$size:h,tableColumns:m,flattenColumns:f,leftFixedColumns:g,derivedMergeCells:v,layout:y,scrollX:b,scrollY:x,showFooter:E,showPagination:S,isFullScreen:w,setLayout:C,setScrollX:T,setScrollY:N,setElementStore:I,setScrollXStore:R,setScrollYStore:O,setShouldToTop:k}=n,L=t.useRef(x),A=t.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=y,n={};return i&&Object.assign(n,{minHeight:`${$l(i)}px`}),l&&Object.assign(n,{maxHeight:`${$l(l)}px`}),w?Object.assign(Object.assign({},n),{maxHeight:"",minHeight:"",height:`${e}px`}):r?Object.assign(Object.assign({},n),{height:"auto"!==r?`${$l(r)}px`:`${t}px`}):n}),[r,l,i,w,y]),P=()=>{const{elementStore:e,scrollYLoad:t,resizeState:n}=d.current;if(!e.$table.offsetParent)return;const r=e.$table.offsetHeight,i=o?e.$header.offsetHeight:y.headerHeight,l=E?e.$footer.offsetHeight:y.footerHeight,a=r-i-l,s=e.$tableBody.offsetHeight,c=t||s>a;let u=0;if(w){const t=e.$toper?e.$toper.offsetHeight+xd:0,r=e.$pager?e.$pager.offsetHeight+xd:0;u=n.winHeight-t-r-20}(t||a!==y.viewportHeight)&&F(a),L.current=c,N(c),C((e=>Object.assign({},e,{headerHeight:i,footerHeight:l,viewportHeight:a,tableBodyHeight:s,tableFullHeight:u})))},_=e=>{const{scrollXStore:t,isIE:n,scrollBarRef:r}=d.current,i=r.current.scrollLeft,{toVisibleIndex:l,visibleSize:a}=H(i,e),o=n?5:0,s=Math.max(0,l-1-o),c=Math.max(l+a+o,t.endIndex);R(Object.assign({},t,{visibleSize:a,offsetSize:o,startIndex:s,endIndex:c}))},H=(e,t)=>{const n=e+t;let r=-1,i=0,l=0;for(let t=0,a=f.length;t<a;t++){const a=f[t];if(i+=a.width||a.renderWidth,-1===r&&e<i&&(r=t),r>=0&&(l++,i>n))break}return{toVisibleIndex:Math.max(0,r),visibleSize:Math.max(8,l)}},F=e=>{const{scrollBarRef:t,scrollYStore:n,isIE:r}=d.current,i=t.current.scrollTop,{rowHeight:l}=n,{toVisibleIndex:a}=D(i,l),o=Math.max(8,Math.ceil(e/l)+2),s=r?5:0,c=Math.max(0,a-1-s),u=Math.max(a+o+s,n.endIndex);O(Object.assign({},n,{visibleSize:o,offsetSize:s,startIndex:c,endIndex:u}))},D=(e,t)=>{const n=Math.floor(e/t);return{toVisibleIndex:Math.max(0,n)}},$=(e,t)=>{const{scrollBarRef:n,elementStore:r,scrollYStore:i,scrollYLoad:l,tableFlatData:a}=d.current;if(void 0!==t&&t>=0)n.current.SET_SCROLL_TOP(t*i.rowHeight);else if(l){const t=a.findIndex((t=>e===c(t,t.index)));t>=0&&n.current.SET_SCROLL_TOP(t*i.rowHeight)}else{const t=r.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);t&&n.current.SET_SCROLL_TOP(t.offsetTop)}};return{createElementStore:()=>{I("$toper",u.current),I("$table",p.current)},tableStyles:A,getSpan:(e,t,n,r,i)=>{let l=1,a=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:n,columnIndex:r,tableData:i});Array.isArray(o)?(l=o[0],a=o[1]):se(o)&&(l=o.rowSpan,a=o.colSpan)}if(v.length>0){const e=v.find((e=>e.row===n&&e.col===r));e&&(l=e.rowSpan,a=e.colSpan)}return{rowSpan:l,colSpan:a}},getStickyLeft:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Ll(kl(m,e)).dataIndex);let t=0;for(let n=0;n<f.length;n++){const r=f[n];if(r.dataIndex===e)break;t+=r.width||r.renderWidth||0}return t},getStickyRight:(e,t)=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Al(kl(m,e)).dataIndex);const n="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let n=[];return e.forEach((e=>{e.colSpan>0&&n.length>0&&(t.push(n),n=[]),n.push(e)})),n.length>0&&t.push(n),t.map((e=>{const[t,n]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...n,...t.reverse()]})).flat()})(f):f;let r=0;for(let t=n.length-1;t>=0;t--){const i=n[t];if(i.dataIndex===e)break;r+=i.width||i.renderWidth||0}return r},scrollXToColumn:(e,t)=>{const{scrollBarRef:n}=d.current,r=void 0===t?f.findIndex((t=>t.dataIndex===e)):t;if(r<0)return;const i=g.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),l=f.slice(0,r).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);n.current.SET_SCROLL_LEFT(l-i)},scrollYToRecord:$,rowInViewport:e=>{const{scrollBarRef:t,scrollYStore:n}=d.current,{viewportHeight:r,gutterWidth:i}=y,l=e*n.rowHeight;return!(l<t.current.scrollTop||l+n.rowHeight>t.current.scrollTop+(b?r-i:r))},calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current,n=t.winHeight-e.$table.getBoundingClientRect().top-(S?no["small"!==h?"middle":h]+xd:0)-xd;C((e=>Object.assign({},e,{tableAutoHeight:n})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&$("",0),k(!0)},computeVirtualX:H,computeVirtualY:D,doLayout:()=>{a?P():An((()=>P())),(()=>{const{elementStore:e,scrollXLoad:t}=d.current,n=e.$table.clientWidth,r=L.current?y.gutterWidth:0,{defaultColumnWidth:i}=Hd,l=[];let a=0;if(f.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,a+=e.width):(e.renderWidth=void 0,l.push(e))})),l.length>0){const e=f.reduce(((e,t)=>e+(t.width||t.minWidth||i)),0);if(e<=n-r){T(!1);const t=n-r-e;if(1===l.length)l[0].renderWidth=(l[0].minWidth||i)+t;else{const e=t/l.reduce(((e,t)=>e+(t.minWidth||i)),0);let n=0;l.forEach(((t,r)=>{if(0===r)return;const l=Math.floor((t.minWidth||i)*e);n+=l,t.renderWidth=(t.minWidth||i)+l})),l[0].renderWidth=(l[0].minWidth||i)+t-n}}else T(!0),l.forEach((e=>{e.renderWidth=e.minWidth||i}));C((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,n)})))}else a=f.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||i)),0),T(a>n),C((e=>Object.assign(Object.assign({},e),{tableBodyWidth:a})));C((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&_(n)})()}}};function Wd(t){let{handler:n,delay:r=0}=t;const i=function(t,n){var r=this;const i=e.useRef(null),l=e.useRef(0);e.useEffect((()=>()=>{clearTimeout(i.current),i.current=null}),[]);const a=e.useCallback((function(){const e=Date.now();if(!l.current||e-l.current>n){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];t.apply(r,a),l.current=e}}),[t,n]);return a}(n,r),l=Rd(r>0?i:n);e.useEffect((()=>(window.addEventListener("resize",l),()=>window.removeEventListener("resize",l))),[l])}const Bd=e=>{const{total:n}=e,{tableRef:r,selectionKeys:i,isHeadSorter:l,isHeadFilter:a,isTreeTable:o,clearTableSorter:s,clearTableFilter:c,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:p}=t.useContext(vd),{infoBarConfig:h,rowSelection:m,rowHighlight:f}=r.current.props,{allTableData:g,invalidRowKeys:v}=r.current,{hideAlert:y,hideClearButton:b}=h||{},x=t.useMemo((()=>!y),[y]),E=t.useMemo((()=>!b&&!!(l||a||m||f)),[b,l,a,m,f]),S={[`${jn("table")}__alert`]:!0};return x?t.createElement("div",{className:Fe(S)},t.createElement("i",{className:"svgicon icon"},t.createElement(lt,null)),t.createElement("span",null,Xt("qm.table.alert.total",{total:o?g.length:n}),m?`,${Xt("qm.table.alert.selected",{total:Math.max(i.length-v.length,0)})}`:""),E&&t.createElement("em",{onClick:()=>{c(),d(),u(),p(),An((()=>s()))}},Xt("qm.table.alert.clear"))):null},Ud=t.forwardRef(((e,n)=>{const{isFullScreen:r,open:i=!0}=e,{setFullScreen:l}=t.useContext(vd),a=()=>{l(!r)};t.useImperativeHandle(n,(()=>({clickHandle:a})));const o=jn("table");return i?t.createElement("span",{className:`${o}-full-screen`,title:Xt(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>a()},t.createElement("i",{className:"svgicon icon"},r?t.createElement(Be,null):t.createElement(Ue,null))):null}));Ud.displayName="FullScreen";const Gd=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{getTableData:i}=t.useContext(vd),l=()=>{i()};t.useImperativeHandle(n,(()=>({clickHandle:l})));const a=jn("table");return r?t.createElement("span",{className:`${a}-reload`,title:Xt("qm.table.refresh.text"),onClick:()=>l()},t.createElement("i",{className:"svgicon icon"},t.createElement(Je,null))):null}));Gd.displayName="Reload";const Yd=()=>{const e={dateFormat:e=>{const t=e?g(e).format(wd):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?g(e).format(Cd):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?g(e).format(Cd.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Kl(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>zl(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,n,r)=>{var i,l,a,o;const{dictItems:s,precision:c,displayPrecision:d,formatType:u,editRender:p}=n,h=s||(null===(i=null==p?void 0:p(r,n))||void 0===i?void 0:i.items)||[];let m=null!==(o=null!==(a=null===(l=h.find((e=>e.value==t)))||void 0===l?void 0:l.text)&&void 0!==a?a:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(m=t.map((e=>{var t,n;return null!==(n=null===(t=h.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==n?n:e})).join(",")),c>=0&&""!==m&&(m=Kl(m)?new Ft(m).toFixed(c):m),d>=0&&""!==m&&(m=Wl(m,d)),u){const t=e[`${Pn(u)}Format`];t?m=t(m):en("Table","字段的格式化类型 `formatType` 配置不正确")}return m},n=e=>In(e)?Yl(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,r,i,l)=>{const a=ql(e,r.dataIndex),o=r.render?r.render(a,e,r,i,l):t(a,r,e);return n(o)}}},Xd=t.forwardRef(((e,n)=>{var r,i,l,a;const{tableColumns:o,open:s=!0}=e,{global:c}=t.useContext(Bt),{tableRef:d,flattenColumns:u,summationRows:p,showSummary:h,getSpan:m}=t.useContext(vd),{tablePrint:f,showHeader:g}=d.current.props,{getTitleFromCellValue:v}=Yd(),y=null!==(i=null===(r=null==c?void 0:c.print)||void 0===r?void 0:r.leftLogo)&&void 0!==i?i:"",b=null!==(a=null===(l=null==c?void 0:c.print)||void 0===l?void 0:l.rightLogo)&&void 0!==a?a:"",x=!(!y&&!b),E=t.useMemo((()=>Fn(Pl(o,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn]))),[o]),S=t.useMemo((()=>Fn(Pl(u,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn]))),[u]),w=t.useMemo((()=>Fn(o.filter((e=>e.printFixed)))),[o]),C=e=>{const t=Object.assign({},ea(E,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?C(t):t},T=(e,t)=>Ce(Te(Ne(e),t),Ie((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Re(...n,((e,n)=>{if(Array.isArray(e))return T(e.concat(n),t)}))}))),N=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(C(e))})),n=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const n=e.filter((e=>e.dataIndex===t));return n.length<=1?n[0]:T(n,"dataIndex")[0]})))(n),t.push(Fl(n))})),t},I=()=>{const{tableFullData:e}=d.current,t=(e=>{const t=[];let n=[],r=0,i=0;for(;i<e.length;){const l=e[i];r+=l.width||l.renderWidth||l.minWidth||Hd.defaultColumnWidth,r<=Hd.printWidth?(n.push(l),i===e.length-1&&t.push(n),i++):i>0?(e.splice(0,i),w.length&&e.unshift(...w),t.push(n),n=[],r=0,i=0):(l.width=Hd.printWidth,n.push(l),t.push(n),i++)}return t})([...S]),n=N(t);let r=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let i=0;i<t.length;i++)r+=R(n[i],t[i],e),r+='<div class="page-break"></div>';return r+"</body></html>"},R=(e,t,n)=>{const{showLogo:r=!0}=f;let i='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${t.map((e=>{let{width:t,minWidth:n,renderWidth:r}=e;return`<col style="width:${t||r||n||Hd.defaultColumnWidth}px">`})).join("")}</colgroup>`,g&&(i+=["<thead>",r&&x?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',y?`<img src="${y}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',b?`<img src="${b}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Xl(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(i+=`<tbody>${Hl(n).map((e=>`<tr>${t.map(((t,r)=>{const{rowSpan:i,colSpan:l}=m(e,t,e.index,r,n);if(!i||!l)return null;return`<td rowspan="${i}" colspan="${l}">${r<=0?`<span style="padding-left:${e._level*Hd.treeTable.textIndent}px"></span>`:""}${v(e,t,e.index,r)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),h&&p.length&&(i+=["<tfoot>",p.map((e=>`<tr>${t.map(((t,r)=>{const{dataIndex:i,summation:l}=t,a=(null==l?void 0:l.render)?l.render(n):ql(e,`${i}_text`);return`<td>${0===r&&""===a?Xt("qm.table.config.summaryText"):In(a)?Yl(a).join(""):a}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},O=()=>{var e;null===(e=((e,t)=>{const{filename:n,type:r,isDownload:i}=e,l=`${n}.${r}`;if(window.Blob){const e=new Blob([t],{type:`text/${r}`});if(!i)return Promise.resolve({type:r,content:t,blob:e});Zi(e,l)}})({filename:"print",type:"html",isDownload:!1},I()))||void 0===e||e.then((e=>{let{content:t,blob:n}=e,r=document.createElement("iframe");r.setAttribute("frameborder","0"),r.setAttribute("width","100%"),r.setAttribute("height","0"),r.style.display="none",document.body.appendChild(r),d.current.isIE?(r.contentDocument.write(t),r.contentDocument.execCommand("print"),r.parentNode.removeChild(r),r=null):(r.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{r.parentNode.removeChild(r),r=null}))},r.src=URL.createObjectURL(n))}))};t.useImperativeHandle(n,(()=>({clickHandle:O})));const k=jn("table");return s?t.createElement("span",{className:`${k}-print`,title:Xt("qm.table.print.text"),onClick:()=>O()},t.createElement("i",{className:"svgicon icon"},t.createElement(at,null))):null}));Xd.displayName="TablePrint";const Zd="606060",Qd="thin",Jd="d4d4d4",eu=(e,t)=>{t&&(e.height=Math.floor(.75*t))},tu=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},nu=()=>({top:{style:Qd,color:{argb:Jd}},left:{style:Qd,color:{argb:Jd}},bottom:{style:Qd,color:{argb:Jd}},right:{style:Qd,color:{argb:Jd}}}),ru=e=>{const{children:t}=e;return t&&t.length?ru(t[0]):e},iu=e=>{const{precision:t,formatType:n}=e,r=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:r?`0${r}%`:"0%"}:"finance"===n?{numFmt:r?`#,##0${r}`:"#,##0"}:r?{numFmt:`0${r}`}:null},lu=()=>{const{tableRef:e,getSpan:n,showSummary:r,isHeadGroup:i}=t.useContext(vd),{spanMethod:l,showHeader:a}=e.current.props,o=(e,t)=>{var n,r,i;return null!==(i=null!==(r=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==r?r:t)&&void 0!==i?i:""};return{exportXLSX:(t,o,s,c)=>Tn(void 0,void 0,void 0,(function*(){const{columns:d,footSummation:u}=t,{scrollYStore:{rowHeight:p}}=e.current,h=Nl(d),m=Fl(d),f=[],g=[],v=[],y=[];let b=0;const x={};h.forEach((e=>{const{dataIndex:t,width:n,minWidth:r,renderWidth:i}=e;x[t]=Xl(e.title),v.push({key:t,width:(n||i||r||Hd.defaultColumnWidth)/8})})),a&&(i?m.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:r,rowSpan:i}=e,l=ru(e),a=h.findIndex((e=>{let{dataIndex:t}=e;return t===l.dataIndex}));n[l.dataIndex]=Xl(e.title),0!==r&&(r>1||i>1)&&y.push({s:{r:t,c:a},e:{r:t+i-1,c:a+r-1}})})),f.push(n)})):(h.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;(n>1||r>1)&&y.push({s:{r:b,c:t},e:{r:b+r-1,c:t+n-1}})})),f.push(x)),b+=f.length);const E=Hl(o).map(((e,t)=>{const r={};return h.forEach(((i,a)=>{if("function"==typeof l){const{rowSpan:r,colSpan:l}=n(e,i,t,a,o);(l>1||r>1)&&y.push({s:{r:t+b,c:a},e:{r:t+b+r-1,c:a+l-1}})}const s=["percent","finance"].includes(i.formatType);r[i.dataIndex]=s?ql(e,i.dataIndex):c(e,t,i,a)})),r._level=e._level,r}));b+=E.length,r&&u&&s(h,o).forEach(((e,t)=>{const n={};h.forEach(((t,r)=>{const{dataIndex:i,summation:l}=t,a=(null==l?void 0:l.render)?l.render(o):ql(e,i);n[i]=0===r&&""===a?Xt("qm.table.config.summaryText"):In(a)?Yl(a).join(""):a})),g.push(n)}));const{sheetName:S,useStyle:w}=t,C=new zt.Workbook,T=C.addWorksheet(S);T.columns=v,a&&T.addRows(f).forEach((e=>{w&&eu(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),n=kl(d,t.key),{align:r,theadAlign:i}=n;tu(e,i||r),w&&Object.assign(e,{font:{bold:!0,color:{argb:Zd}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:nu()})}))})),T.addRows(E).forEach(((e,t)=>{const{_level:n}=E[t];w&&eu(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),r=kl(d,t.key),{align:i}=r;tu(e,i),Object.assign(e,iu(r)),w&&Object.assign(e,{font:{color:{argb:Zd}},border:nu()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),r&&u&&T.addRows(g).forEach((e=>{w&&eu(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),n=kl(d,t.key),{align:r}=n;tu(e,r),Object.assign(e,iu(n)),w&&Object.assign(e,{font:{color:{argb:Zd}},border:nu()})}))})),y.forEach((e=>{let{s:t,e:n}=e;T.mergeCells(t.r+1,t.c+1,n.r+1,n.c+1)}));const N=yield C.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const n=e=>{let t=e;const n=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),r=-1!==e.indexOf('"');return r&&(t=t.replace(/"/g,'""')),(n||r)&&(t='"'+t+'"'),t},r="\ufeff"+(e=>{let t,r,i,l,a="";for(t=0;t<e.rows.length;t+=1){for(i=e.rows[t],r=0;r<i.cells.length;r+=1)l=i.cells[r],a=a+(r?",":"")+n(l.textContent.trim());a+="\r\n"}return a})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var i;return((e,t,n)=>{t=t||"",n=n||512;const r=window.atob(e),i=[];let l;for(l=0;l<r.length;l+=n){const e=r.slice(l,l+n),t=new Array(e.length);let a;for(a=0;a<e.length;a+=1)t[a]=e.charCodeAt(a);const o=new window.Uint8Array(t);i.push(o)}return new window.Blob(i,{type:t})})((i=r,window.btoa(unescape(encodeURIComponent(i)))),"application/csv")},importXLSX:(e,t)=>{const{columns:n,file:r}=e,i=Nl(n),l=new FileReader;l.onerror=()=>{L.error(Xt("qm.table.import.error"))},l.onload=e=>{const n=i.map((e=>Xl(e.title))),r=new zt.Workbook,l=e.target;l?r.xlsx.load(l.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),l=e.findIndex((e=>e&&e.length>0)),a=e[l],s=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,a);if(s){const r=e.slice(l+1).map((e=>{const t={};e.forEach(((e,n)=>{var r;let i=e;Array.isArray(null==i?void 0:i.richText)&&(i=i.richText.map((e=>e.text)).join("")),se(i)&&"text"in i&&(i=i.text),Oe(i)&&(i=Ul(i,Cd)),(null==i?void 0:i.formula)&&(i=null!==(r=i.result)&&void 0!==r?r:i.value),t[a[n]]=i}));const r={};return n.forEach(((e,n)=>{var l;const{dataIndex:a,dictItems:s}=i[n];Array.isArray(s)&&((null===(l=t[e])||void 0===l?void 0:l.toString().includes(","))?t[e]=t[e].split(",").map((e=>o(s,e))).filter((e=>""!==e)):t[e]=o(s,t[e])),jl(r,a,t[e])})),r}));null==t||t(r)}else L.error(Xt("qm.table.import.error"))}else L.error(Xt("qm.table.import.error"))})):L.error(Xt("qm.table.import.error"))},l.readAsArrayBuffer(r)}}},au=e=>{const{fileType:n,onChange:r}=e;let i,l;const a=jn("table"),o=e=>{const t=e.name,n=t.lastIndexOf("."),r=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:r}},s=()=>Tn(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return i||(i=document.createElement("form"),l=document.createElement("input"),i.className=`${a}--file-form`,l.name="file",l.type="file",i.appendChild(l),document.body.appendChild(i)),new Promise(((e,n)=>{const r=!t.type;l.multiple=!!t.multiple,l.accept=r?"":`.${t.type}`,l.onchange=a=>{const{files:s}=a.target,c=s[0];let d="";if(!r)for(let e=0;e<s.length;e++){const{type:n}=o(s[e]);if(t.type!==n){d=n;break}}d?(L.warning(Xt("qm.upload.notType",{type:d})),n()):e(c),document.body.removeChild(i),i=null,l=null},i.reset(),l.click()}))})({type:n});null==r||r(e.name,e)}catch(e){}}));return t.createElement($n,{onClick:()=>s()},Xt("qm.upload.text"))},ou=e=>{const{columns:n,onClose:r}=e,{tableRef:i,createTableData:l,dataChange:a}=t.useContext(vd),{beforeTableImport:o}=i.current.props,{importXLSX:s}=lu(),c=t.useRef(null),[d,u]=t.useState(!1),[p,h]=t.useState(!0),m=e=>e.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))),[f,g]=t.useState([{type:"INPUT",label:Xt("qm.table.export.fileName"),fieldName:"fileName",render:(e,n)=>{const{fileName:r}=n.GET_FIELDS_VALUE(["fileName"]);return t.createElement(t.Fragment,null,r?t.createElement("span",null,r):t.createElement(au,{fileType:n.state.formData.fileType,onChange:(e,t)=>{n.SET_FIELDS_VALUE({fileName:e,file:t}),t&&h(!1)}}))}},{type:"SELECT",label:Xt("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:Xt("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:Xt("qm.table.import.fillText"),value:"fill"},{text:Xt("qm.table.import.addText"),value:"add"},{text:Xt("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{f.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,g([...f])}},{type:"INPUT_NUMBER",label:Xt("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:i.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),v=jn("table");return t.createElement("div",{className:`${v}-import__setting`},t.createElement(jc,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:f,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r(),style:{marginRight:8}},Xt("qm.table.export.closeButton")),t.createElement($n,{type:"primary",loading:d,disabled:p,onClick:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();e||(u(!0),s({columns:m(n),file:t.file},(e=>Tn(void 0,void 0,void 0,(function*(){const{tableFullData:n,store:s}=i.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof o)try{e=yield o(e)}catch(e){}if("fill"===t.importType&&l(e),"add"===t.importType&&l([...n,...e]),"insert"===t.importType){const{tableFullData:n}=i.current,r=t.posIndex,a=n.slice(0,r).concat(e).concat(n.slice(r));l(a)}e.forEach((e=>{s.addToInserted(e)})),a(),L.success(Xt("qm.table.import.success",{total:e.length})),u(!1),r()})))))}))},Xt("qm.table.import.text"))))},su=t.forwardRef(((e,n)=>{const{tableColumns:r,open:i=!0}=e,[l,a]=t.useState(!1),o=()=>{a(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s={[`${jn("table")}-import`]:!0},c={visible:l,title:Xt("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:Fe(s),title:Xt("qm.table.import.textNoSpace"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(ot,null))),t.createElement(dl,c,t.createElement(ou,{columns:r,onClose:()=>a(!1)})))}));su.displayName="TableImport";const cu=e=>{const{columns:n,onChange:r}=e,{$size:i}=t.useContext(vd),l=t.useRef([]),[a,o]=t.useState(!1),[s,c]=t.useState(n);bi((()=>{u()}),[s]),t.useEffect((()=>{d()}),[n]);const d=()=>{const e=[];n.forEach(((t,r)=>{const i=t.colSpan;i>1&&n.slice(r+1,r+i).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(n.slice(r,r+i))})),l.current=e},u=()=>{const e=[];s.forEach((t=>{const{colSpan:n,dataIndex:r}=t;if(0===n)return;if(1===n)return e.push(t);const i=l.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===i)return e.push(t);e.push(...l.current[i].map(((e,n)=>{let{dataIndex:r}=e;const i=s.find((e=>e.dataIndex===r));return n>0&&void 0!==t.hidden&&(i.hidden=t.hidden),i})))})),null==r||r(e)},p=jn("table"),h={[`${p}__popper`]:!0,"column-filter__popper":!0,[`${p}--lg`]:"large"===i,[`${p}--sm`]:"small"===i},m=[`${p}-column-filter`,{selected:a}];return t.createElement(Ms,{action:["click"],popupVisible:a,popup:t.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"main"},t.createElement(Vt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),n=s.map((e=>e.dataIndex));ge(t,n)||c(ia(e))}},s.map((e=>((e,n)=>{const{colSpan:r}=e;if(0===r)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=["svgicon","handle",`${n}-handle`];return t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(M,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,c([...s])}}),t.createElement("i",{className:Fe(i),title:Xt("qm.table.columnFilter.draggable")},t.createElement(Ge,null)),t.createElement("span",{className:"text"},Xl(e.title)))})(e,"main")))))),popupClassName:Fe(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{o(e)},builtinPlacements:Nd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Fe(m),title:Xt("qm.table.columnFilter.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(st,null)),t.createElement("span",null,Xt("qm.table.columnFilter.text"))))},du=e=>{const{defaultValue:n,onClose:r,onOk:i}=e,{tableRef:l,selectionKeys:a,pagination:o,showSummary:s}=t.useContext(vd),{rowSelection:c}=l.current.props,d=t.useRef(null),[u,p]=t.useState(!1),h=t.useMemo((()=>Object.assign({},{fileName:`${g().format(Td)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:a.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},n,{columns:Fn(n.columns||[])})),[]),[m,f]=t.useState([{type:"INPUT",label:Xt("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:Xt("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:Xt("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:Xt("qm.table.export.all"),value:"all"},{text:Xt("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==c?void 0:c.type)},{text:Xt("qm.table.export.custom"),value:"custom"}]},onChange:e=>{m.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,f([...m])}},options:{min:1},disabled:!0},{type:"INPUT",label:Xt("qm.table.columnFilter.text"),fieldName:"columns",render:(e,n)=>t.createElement(cu,{columns:n.state.formData.columns,onChange:e=>{n.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:Xt("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:Xt("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),v=jn("table");return t.createElement("div",{className:`${v}-export__setting`},t.createElement(jc,{ref:d,initialValues:h,items:m,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r(),style:{marginRight:8}},Xt("qm.table.export.closeButton")),t.createElement($n,{type:"primary",loading:u,onClick:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield d.current.GET_FORM_DATA();if(!e){p(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);i(t),yield Ln(1e3),p(!1),r()}}))},Xt("qm.table.export.text"))))},uu=t.forwardRef(((e,n)=>{var r;const{tableColumns:i,open:l=!0}=e,{global:a}=t.useContext(Bt),{tableRef:o,flattenColumns:s,pagination:c,fetchParams:d,isFetch:u,isGroupSubtotal:p,showSummary:h,getSpan:m}=t.useContext(vd),{exportExcel:f,fetch:v,showHeader:y}=o.current.props,{getTitleFromCellValue:b}=Yd(),[x,E]=t.useState(!1),[S,w]=t.useState(!1),C=t.useMemo((()=>{var e;return!!(null===(e=null==f?void 0:f.fetch)||void 0===e?void 0:e.api)}),[f]),T=t.useMemo((()=>!c.total||S),[c.total,S]),N=t.useMemo((()=>Pl(i,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn])),[i]),I=t.useMemo((()=>Pl(s,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn])),[s]),R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.map(((e,r)=>{const i=Object.assign(Object.assign({},e),{index:r,pageIndex:r}),l=t?`${t}.${i.index+1}`:`${i.index+1}`;return i.indexPath=l,i._level=n,Array.isArray(e.children)&&(i.children=R(e.children,l,n+1)),I.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&jl(i,t,ql(i,t))})),i}))},O=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,i=(p?Zl(t):t).reduce(((e,t)=>{if(null==t?void 0:t[Hd.summaryIgnore])return e;const n=Number(ql(t,r));return Number.isNaN(n)?e:e+n}),0);jl(n,r,i)})),[n]},k=(e,t,n,r)=>{const{precision:i,formatType:l}=n;let a=b(e,n,t,r);return i>=0&&!l&&""!==a&&(a=Number(a)),a},{exportXLSX:A,exportCSV:P}=lu(),_=e=>Tn(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:r=(e=>e),afterFetch:i,dataKey:l}=v;let a=[];try{w(!0);const o=yield n(Object.assign(Object.assign({},r(d)),{[Hd.currentPageName]:1,[Hd.pageSizeName]:null!=e?e:c.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=me(o.data,l))&&void 0!==t?t:[];e="function"==typeof i?yield i(e):e,a=R(e)}}catch(e){}return w(!1),a})),H=e=>{var t;const n=null===(t=null==a?void 0:a.table)||void 0===t?void 0:t.recordExportLog;try{null==n||n({fileName:e})}catch(e){}},F=(e,t)=>{const{columns:n,footSummation:r}=e,i=Fl(n),l=Nl(n);let a='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${l.map((e=>{let{width:t,minWidth:n,renderWidth:r}=e;return`<col style="width:${t||r||n||Hd.defaultColumnWidth}px">`})).join("")}</colgroup>`,y&&(a+=["<thead>",i.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Xl(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(a+=`<tbody>${Hl(t).map((e=>`<tr>${l.map(((n,r)=>{const{rowSpan:i,colSpan:l}=m(e,n,e.index,r,t);return i&&l?`<td rowspan="${i}" colspan="${l}">${k(e,e.index,n,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),h&&r&&(a+=["<tfoot>",O(l,t).map((e=>`<tr>${l.map(((n,r)=>{const{dataIndex:i,summation:l}=n,a=(null==l?void 0:l.render)?l.render(t):ql(e,i);return`<td>${0===r&&""===a?Xt("qm.table.config.summaryText"):In(a)?Yl(a).join(""):a}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},D=null!==(r=null==f?void 0:f.fileName)&&void 0!==r?r:`${g().format(Td)}.xlsx`,$=D.slice(D.lastIndexOf(".")+1).toLowerCase(),M=()=>{if(T)return L.warning(Xt("qm.table.export.warnText"));var e;C?(e=D,Tn(void 0,void 0,void 0,(function*(){w(!0);try{const{api:t,params:n}=f.fetch,r=yield t(Object.assign(Object.assign(Object.assign({columns:I.map((e=>{const{title:t,dataIndex:n,hidden:r}=e,{type:i}=e.filter||{};return{title:t,dataIndex:n,type:i,hidden:r}}))},d),n),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Hd.currentPageName]:void 0,[Hd.pageSizeName]:void 0}));r.data&&(Zi(r.data,e),H(e))}catch(e){}w(!1)}))):E(!0)};t.useImperativeHandle(n,(()=>({clickHandle:M})));const q={[`${jn("table")}-export`]:!0},j={visible:x,title:Xt("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>E(!1)},V={fileName:D.slice(0,D.lastIndexOf(".")),fileType:$,columns:N,useStyle:(null==f?void 0:f.cellStyle)?1:0};return t.createElement(t.Fragment,null,l&&t.createElement("span",{className:Fe(q),title:Xt("qm.table.export.textNoSpace"),onClick:()=>M()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ke,null))),t.createElement(dl,j,t.createElement(du,{defaultValue:V,onClose:()=>E(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:Il(e.columns)}),Tn(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:n,exportType:r,startIndex:i=1,endIndex:l}=t,{tableFullData:a,selectionRows:s}=o.current;let c=[];if(u?("all"===r&&(c=yield _()),"custom"===r&&(c=yield _(l),c=c.slice(i-1))):("all"===r&&(c=a.slice(0)),"custom"===r&&(c=a.slice(i-1,l||void 0))),"selected"===r&&(c=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==f?void 0:f.beforeExport))try{c=null==f?void 0:f.beforeExport(c)}catch(e){}if("xlsx"===n){const n=yield A(t,c,O,k);Zi(n,`${e}.xlsx`),H(`${e}.xlsx`)}if("csv"===n){const n=P(t,F(t,c));Zi(n,`${e}.csv`),H(`${e}.csv`)}}))}})))}));uu.displayName="TableExport";const pu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,tableBodyRef:l,dataChange:a}=t.useContext(vd),{beforeClipboard:o}=i.current.props,s=t.useRef(null),[c,d]=t.useState([{type:"INPUT_NUMBER",label:Xt("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:Xt("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:n.map(((e,t)=>({value:t,text:Xl(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:Xt("qm.table.clipboard.content"),fieldName:"content",placeholder:Xt("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[u,p]=t.useState(!1),h=jn("table");return t.createElement("div",{className:`${h}-clipboard__setting`},t.createElement("h3",{className:"info"},Xt("qm.table.clipboard.supportText")),t.createElement(jc,{ref:s,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r(),style:{marginRight:8}},Xt("qm.table.export.closeButton")),t.createElement($n,{type:"primary",loading:u,onClick:()=>Tn(void 0,void 0,void 0,(function*(){var e;const[t,c]=yield s.current.GET_FORM_DATA();if(t)return;const{tableFullData:d,store:u}=i.current;p(!0);const h=c.content.trim().replace(/(\r|\n)$/,"");let m=h.replace(/"[^"]+"/g,"^");((null===(e=h.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{m=m.replace(/\^/,e)}));let f=m.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{f=yield o(f,f[0].map(((e,t)=>n[c.colIndex+t].dataIndex)))}catch(t){}f.forEach(((e,t)=>{e.forEach(((e,r)=>{var l,a;const o=d[c.rowIndex-1+t],s=n[c.colIndex+r];if(o&&s){let t=!1;if(s.editRender){const e=s.editRender(o,s);t=!(e.disabled||(null===(l=e.extra)||void 0===l?void 0:l.disabled)||(null===(a=i.current.fieldAuth[s.dataIndex])||void 0===a?void 0:a.disabled))}t&&s.dictItems&&(t=s.dictItems.some((t=>t.value==e))),t&&(jl(o,s.dataIndex,e),u.addToUpdated(o))}}))})),l.current.forceUpdate(),a(),L.success(Xt("qm.table.clipboard.success",{total:f.length})),p(!1),r()}))},Xt("qm.table.clipboard.text"))))},hu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{flattenColumns:i}=t.useContext(vd),[l,a]=t.useState(!1),o=t.useMemo((()=>(e=>e.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))))(i)),[i]),s=()=>{a(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={[`${jn("table")}-clipboard`]:!0},d={visible:l,title:Xt("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:Fe(c),title:Xt("qm.table.clipboard.textNoSpace"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(ct,null))),t.createElement(dl,d,t.createElement(pu,{columns:o,onClose:()=>a(!1)})))}));hu.displayName="TableClipboard";const mu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,$size:l,selectionKeys:a,setSelectionKeysEffect:o}=t.useContext(vd),{rowKey:s,rowSelection:c}=i.current.props,d=t.useRef(null),u=Vi(d),p=e=>e.map((e=>{var t;const n={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(n.children=p(e.children)),n})),[h,m]=t.useState([{title:Xt("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...p(n.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))))]),[f]=t.useState((()=>{const{disabled:e}=c||{},t=i.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[g,v]=t.useState(300),y=Wi((()=>{const e=d.current;v(e.offsetHeight-2*no[l]-30)}),5);return zi((()=>{y()}),[u.width]),t.createElement("div",{ref:d,style:{height:"100%"}},t.createElement(rp,{size:l,columns:h,dataSource:f,rowKey:s,height:g,rowSelection:{type:"checkbox",selectedRowKeys:a,onChange:e=>o(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),t.createElement("div",{style:{height:10}}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r()},Xt("qm.table.selectCollection.closeButton"))))},fu=t.forwardRef(((e,n)=>{const{columns:r,open:i=!0}=e,{tableRef:l,getRowKey:a,selectionKeys:o,isFetch:s,isTableEmpty:c,setSelectionKeysEffect:d,setSelectionRows:u}=t.useContext(vd),{rowSelection:p}=l.current.props,[h,m]=t.useState(!1),f=t.useRef(!1);bi((()=>{!f.current&&g()}),[c]);const g=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=p;if(s&&t)try{const r=yield t.api(Object.assign({},{selectedKeys:o},t.params));if(200===r.code){let i=Array.isArray(r.data)?r.data:null!==(e=me(r.data,t.dataKey))&&void 0!==e?e:[];i=i.filter((e=>!n(e))),d(i.map(((e,t)=>a(e,t)))),u(i),f.current=!0}}catch(e){}})),v=()=>{m(!0)};t.useImperativeHandle(n,(()=>({clickHandle:v})));const y=jn("table"),b={visible:h,title:Xt("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>m(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:`${y}-select-collection`,title:Xt("qm.table.selectCollection.text"),onClick:()=>v()},t.createElement("i",{className:"svgicon icon"},t.createElement(dt,null))),t.createElement(dl,b,t.createElement(mu,{columns:r,onClose:()=>m(!1)})))}));fu.displayName="SelectCollection";const gu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Bt),{tableRef:i,getRowKey:l,$size:a,flattenColumns:o,pagination:s,createWebPageData:c,setPagination:d,scrollYToRecord:u,setHighlightKey:p,setShouldToTop:h,isTreeTable:m,isWebPagination:f}=t.useContext(vd),{uniqueKey:g}=i.current.props,v=t.useRef(null),y=t.useRef(null),b=t.useRef([]),x=t.useRef(""),E=t.useRef(-1),S=t.useRef("stop");bi((()=>{const e=Hl(c()).findIndex((e=>l(e,e.index)===x.current));u("",e)}),[s.current]);const w=e=>{let t;switch(e){case"text":case"textarea":default:t="INPUT";break;case"number":t="INPUT_NUMBER";break;case"date":t="DATE";break;case"checkbox":case"radio":t="SELECT"}return t},C=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>{var t;return{type:w(e.filter.type),fieldName:e.dataIndex,label:Xl(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:null!==(t=e.dictItems)&&void 0!==t?t:[]},onChange:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA(),[n,r]=yield y.current.GET_FORM_DATA(),i=ke(Object.assign({},t,r),_n);R(i)}))}})),T={case:0,fullchar:0},N=t.useMemo((()=>o.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[o]),[I,R]=t.useState({}),[k,L]=t.useState(T),[A]=t.useState(C([N[0]])),[P]=t.useState(C(N.slice(1))),[H,F]=t.useState(0),D=t.useMemo((()=>!Object.keys(I).length),[I]);bi((()=>{S.current="ready"}),[I,k]);const $=e=>{L(Object.assign({},k,e))},q=(e,t,n)=>new Promise(((r,i)=>{_.confirm({title:Xt("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{n(),r()}})})),j=e=>Tn(void 0,void 0,void 0,(function*(){if(!Object.keys(I).length)return _.warning({title:Xt("qm.button.confirmPrompt"),content:Xt("qm.table.fastSearch.queryCondition")});if("ready"===S.current&&(S.current="stop",b.current=(e=>{const{allTableData:t}=i.current,n=[];for(let i=0,l=t.length;i<l;i++){const l=t[i];let a=!0;for(const t in e){const{type:n}=N.find((e=>e.dataIndex===t)).filter;let i=ql(l,t),o=!0;if("text"===n||"textarea"===n?o=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(i):(i="string"==typeof(r=i)&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(r)?i.slice(0,10):i,o=i==e[t]),!o){a=!1;break}}a&&n.push(l)}var r;return n})(I),F(b.current.length)),!b.current.length)return p(""),_.warning({title:Xt("qm.button.confirmPrompt"),content:Xt("qm.table.fastSearch.notMatch")});"next"===e&&(E.current=E.current<0?0:E.current+1,E.current>b.current.length-1&&(yield q(Xt("qm.table.fastSearch.toTheEnd"),(()=>E.current=0),(()=>E.current=b.current.length-1)))),"prev"===e&&(E.current=E.current<0?b.current.length-1:E.current-1,E.current<0&&(yield q(Xt("qm.table.fastSearch.toStart"),(()=>E.current=b.current.length-1),(()=>E.current=0))));const t=b.current[E.current],n=l(t,t.index);let r=t.index;if(m&&f){const e=ta(i.current.deriveRowKeys,n)[0];r=i.current.tableFullData.findIndex((t=>l(t,t.index)===e))}((e,t)=>{if(x.current=e,f){const{pageSize:e}=s,n=Math.ceil((t+1)/e);h(!1),d(Object.assign({},s,{current:n}))}else u(e)})(n,r),p(n)})),V=()=>{v.current.RESET_FORM(),y.current.RESET_FORM()},K=t.useMemo((()=>g?`fastSearch_${g}`:""),[g]),[z,W]=t.useState([]),[B,U]=t.useState(""),[G,Y]=t.useState("");bi((()=>{if(G){const{filters:e,config:t}=z.find((e=>e.value===G)).list;v.current.SET_FIELDS_VALUE(Hn(e,P.map((e=>e.fieldName)))),y.current.SET_FIELDS_VALUE(Hn(e,A.map((e=>e.fieldName)))),R(e),L(t)}else V(),R({}),L(T)}),[G]),t.useEffect((()=>{X()}),[]);const X=()=>Tn(void 0,void 0,void 0,(function*(){if(!K)return;let e=yield Kt.getItem(K);e||(e=yield Z(K),Array.isArray(e)&&(yield Kt.setItem(K,e))),Array.isArray(e)&&e.length&&(W(e),Y(e[0].value))})),Z=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),Q=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),J=jn("table");return t.createElement("div",{className:`${J}-fast-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"top"},t.createElement("div",{className:"container"},t.createElement(al,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t.createElement("span",null,Xt("qm.table.alert.total",{total:H}))},t.createElement(al.TabPane,{tab:Xt("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t.createElement(jc,{ref:v,items:A,cols:1,labelWidth:110})),t.createElement(al.TabPane,{tab:Xt("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t.createElement(jc,{ref:y,items:P,cols:1,labelWidth:110})))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:B,placeholder:Xt("qm.table.highSearch.configText"),disabled:D,onChange:e=>{const{value:t}=e.target;U(t)}}),t.createElement($n,{type:"primary",disabled:!B||D,style:{marginLeft:"10px"},onClick:()=>Tn(void 0,void 0,void 0,(function*(){if(!K)return en("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Gl(),t=[...z,{text:B,value:e,list:{filters:I,config:k}}];W(t),Y(e),U(""),yield Kt.setItem(K,t),yield Q(K,t)}))},Xt("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Hd.rowHeightMaps[a]}px`}},t.createElement("span",null,Xt("qm.table.fastSearch.savedSetting"))),t.createElement("ul",null,z.map((e=>t.createElement("li",{key:e.value,className:Fe({selected:e.value===G}),title:e.text,onClick:()=>{return t=e.value,void Y(t!==G?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:Xt("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Tn(void 0,void 0,void 0,(function*(){if(!n)return;const e=z.filter((e=>e.value!==n));W(e),n===G&&Y(""),yield Kt.setItem(K,e),yield Q(K,e)}))}},t.createElement(ut,null))))),!z.length&&t.createElement("div",{style:{padding:xd}},t.createElement(Fi,null)))))),t.createElement("div",{className:"bottom"},t.createElement("div",null,t.createElement(M,{checked:!!k.case,onChange:e=>$({case:e.target.checked})},Xt("qm.table.fastSearch.matchCase")),t.createElement(M,{checked:!!k.fullchar,onChange:e=>$({fullchar:e.target.checked})},Xt("qm.table.fastSearch.matchFullchar"))),t.createElement("div",null,t.createElement($n,{onClick:()=>V()},Xt("qm.table.fastSearch.clear"))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${no[a]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>n(),style:{marginRight:8}},Xt("qm.table.fastSearch.closeButton")),t.createElement($n,{type:"primary",style:{marginRight:8},onClick:()=>j("prev")},Xt("qm.table.fastSearch.queryPrev")),t.createElement($n,{type:"primary",onClick:()=>j("next")},Xt("qm.table.fastSearch.queryNext"))))},vu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{$size:i}=t.useContext(vd),[l,a]=t.useState(!1),o=()=>{a(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=jn("table"),c={visible:l,title:Xt("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${no[i]+20}px`},onClose:()=>a(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${s}-super-search`,title:Xt("qm.table.fastSearch.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(pt,null))),t.createElement(dl,c,t.createElement(gu,{onClose:()=>a(!1)})))}));vu.displayName="FastSearch";const yu=e=>{const{columns:n,group:r,summary:i}=e,{tableRef:l,$size:a,pagination:o,fetchParams:s,isFetch:c}=t.useContext(vd),{fetch:d}=l.current.props,u=e=>{var t;const r=n.find((t=>t.dataIndex===e));return{title:r.title,precision:r.precision,dictItems:null!==(t=r.dictItems)&&void 0!==t?t:[]}},p=r.map((e=>Object.assign({dataIndex:e.group},u(e.group)))),h=i.map((e=>e.summary===Hd.groupSummary.total.value?{dataIndex:e.summary,title:Hd.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},u(e.summary)),{formula:e.formula}))),m=t.useMemo((()=>Object.assign({},s,{[Hd.sorterFieldName]:void 0,[Hd.groupSummary.summaryFieldName]:i.map((e=>`${e.formula}|${e.summary}`)).join(","),[Hd.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[Hd.currentPageName]:1})),[s,r,i]),[f,v]=t.useState(((e,t)=>[{title:Xt("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...t.map((e=>{var t;const r=null===(t=n.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let i=r?{summation:r}:null;return e.dataIndex===Hd.groupSummary.total.value&&(i={dataIndex:Hd.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?i:null)}))])(p,h)),[y]=t.useState(c?[]:(e=>{const t=Jl(e,r.map((e=>e.group))),n=[];return t.forEach((e=>{const t={};f.forEach((n=>{const{dataIndex:r}=n;"index"!==r&&jl(t,r,ql(e[0],r))})),i.forEach((n=>{const r=n.summary!==Hd.groupSummary.total.value?n.summary:Hd.groupSummary.recordTotalIndex,i=n.formula;"count"===i&&jl(t,r,e.length),"sum"===i&&jl(t,r,Le(e,r)),"max"===i&&jl(t,r,Ae(e,r)[r]),"min"===i&&jl(t,r,Pe(e,r)[r]),"avg"===i&&jl(t,r,(Le(e,r)/e.length).toFixed(2))})),n.push(t)})),n})(l.current.tableFullData)),b=Object.assign(Object.assign({size:a,height:400},c?{fetch:{api:d.api,params:m,dataKey:null==d?void 0:d.dataKey}}:{dataSource:y}),{columns:f,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${g().format(Td)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)});return t.createElement(rp,b)},bu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Bt),{tableRef:i,$size:l,flattenColumns:a}=t.useContext(vd),{uniqueKey:o}=i.current.props,s=t.useRef(null),c=t.useRef(null),[d,u]=t.useState(!1),[p,h]=t.useState([]),[m,f]=t.useState(""),[g,v]=t.useState("");bi((()=>{if(g){const{group:e,summary:t}=p.find((e=>e.value===g)).list;C(e),R(t)}else{const e=_();C((null==e?void 0:e.group)||[]),R((null==e?void 0:e.summary)||[])}}),[g]),t.useEffect((()=>{H()}),[]);const y=t.useMemo((()=>o?`summary_${o}`:""),[o]),b=t.useMemo((()=>a.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex)))),[a]),x=b.filter((e=>!e.groupSummary)).map((e=>({text:Xl(e.title),value:e.dataIndex}))),E=[Hd.groupSummary.total,...b.filter((e=>!!e.groupSummary)).map((e=>({text:Xl(e.title),value:e.dataIndex})))],S=[{text:Xt("qm.table.groupSummary.sumText"),value:"sum"},{text:Xt("qm.table.groupSummary.maxText"),value:"max"},{text:Xt("qm.table.groupSummary.minText"),value:"min"},{text:Xt("qm.table.groupSummary.avgText"),value:"avg"},{text:Xt("qm.table.groupSummary.countText"),value:"count"}],[w,C]=t.useState([]),[T,N]=t.useState([{title:Xt("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement($n,{type:"text",onClick:()=>{s.current.REMOVE_RECORDS(n)}},Xt("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:Xt("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:x.map((e=>Object.assign(Object.assign({},e),{disabled:w.findIndex((t=>t.group===e.value))>-1})))})}]),[I,R]=t.useState([]),[k,L]=t.useState([{title:Xt("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement($n,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(n)}},Xt("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:Xt("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:E.map((e=>Object.assign(Object.assign({},e),{disabled:I.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:Xt("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Hd.groupSummary.total.value?S.slice(S.length-1):S})}]),A=t.useMemo((()=>{const e=w.length&&w.every((e=>Object.values(e).every((e=>""!==e)))),t=I.length&&I.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[w,I]),P=()=>{y&&sessionStorage.setItem(y,JSON.stringify({group:w.filter((e=>!!e.group)),summary:I.filter((e=>!!e.summary))}))},_=()=>{if(!y)return;const e=sessionStorage.getItem(y);return e?JSON.parse(e):null},H=()=>Tn(void 0,void 0,void 0,(function*(){if(!y)return;const e=_();if(e){const{group:t,summary:n}=e;C(t),R(n)}let t=yield Kt.getItem(y);t||(t=yield F(y),Array.isArray(t)&&(yield Kt.setItem(y,t))),Array.isArray(t)&&t.length&&(h(t),!e&&v(t[0].value))})),F=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),$=jn("table"),M={visible:d,title:Xt("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>u(!1)};return t.createElement("div",{className:`${$}-group-summary__setting`},t.createElement("div",{className:"main"},t.createElement("div",{style:{width:"30%"}},t.createElement(rp,{ref:s,size:l,columns:T,dataSource:w,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>N(e),onDataChange:e=>{C(e)}},t.createElement($n,{type:"primary",icon:t.createElement(ht,null),onClick:()=>{s.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"container line"},t.createElement(rp,{ref:c,size:l,columns:k,dataSource:I,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>L(e),onDataChange:e=>{R(e)}},t.createElement($n,{type:"primary",icon:t.createElement(ht,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:l,value:m,placeholder:Xt("qm.table.groupSummary.configText"),disabled:A,onChange:e=>{const{value:t}=e.target;f(t)}}),t.createElement($n,{type:"primary",disabled:!m||A,style:{marginLeft:"10px"},onClick:()=>Tn(void 0,void 0,void 0,(function*(){if(!y)return en("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Gl(),t=[...p,{text:m,value:e,list:{group:w.filter((e=>!!e.group)),summary:I.filter((e=>!!e.summary))}}];h(t),v(e),f(""),yield Kt.setItem(y,t),yield D(y,t)}))},Xt("qm.table.groupSummary.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Hd.rowHeightMaps[l]}px`}},t.createElement("span",null,Xt("qm.table.groupSummary.savedSetting"))),t.createElement("ul",null,p.map((e=>t.createElement("li",{key:e.value,className:Fe({selected:e.value===g}),title:e.text,onClick:()=>{return t=e.value,void v(t!==g?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:Xt("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Tn(void 0,void 0,void 0,(function*(){if(!n)return;const e=p.filter((e=>e.value!==n));h(e),n===g&&v(""),yield Kt.setItem(y,e),yield D(y,e)}))}},t.createElement(ut,null))))),!p.length&&t.createElement("div",{style:{padding:xd}},t.createElement(Fi,null)))))),t.createElement(dl,M,t.createElement(yu,{columns:b,group:w,summary:I})),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>n(),style:{marginRight:8}},Xt("qm.table.groupSummary.closeButton")),t.createElement($n,{type:"primary",disabled:A,onClick:()=>(P(),void u(!0))},Xt("qm.table.groupSummary.confirmButton"))))},xu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,[i,l]=t.useState(!1),a=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:a})));const o=jn("table"),s={visible:i,title:Xt("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${o}-group-summary`,title:Xt("qm.table.groupSummary.text"),onClick:()=>a()},t.createElement("i",{className:"svgicon icon"},t.createElement(mt,null))),t.createElement(dl,s,t.createElement(bu,{onClose:()=>l(!1)})))}));xu.displayName="GroupSummary";const Eu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Bt),{tableRef:i,$size:l,flattenColumns:a,setSuperFilters:o,clearTableFilter:s}=t.useContext(vd),{uniqueKey:c}=i.current.props,d=t.useRef(null),[u,p]=t.useState([]),[h,m]=t.useState([]),[f,g]=t.useState(""),[v,y]=t.useState("");bi((()=>{p(v?h.find((e=>e.value===v)).list:_()||[])}),[v]),t.useEffect((()=>{H()}),[]);const b=t.useMemo((()=>c?`superSearch_${c}`:""),[c]),x=t.useMemo((()=>a.filter((e=>!!e.filter))),[a]),E=Ql(u),S=t.useMemo((()=>!(E&&Cl(E))),[E]),w=t.useMemo((()=>!!u.length&&S),[u,S]),C=[{value:"and",text:Xt("qm.table.highSearch.andText")},{value:"or",text:Xt("qm.table.highSearch.orText")}],T=a.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:Xl(e.title)}))),N=e=>["in","nin"].includes(e),I=(e,t)=>{let n;switch(e){case"number":n="number";break;case"date":n="date";break;case"checkbox":case"radio":n=t?"select-multiple":"select";break;default:n="text"}return n},R=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:Xt("qm.table.highSearch.gtText")},{value:"<",text:Xt("qm.table.highSearch.ltText")},{value:">=",text:Xt("qm.table.highSearch.gteText")},{value:"<=",text:Xt("qm.table.highSearch.lteText")},{value:"==",text:Xt("qm.table.highSearch.eqText")},{value:"!=",text:Xt("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:Xt("qm.table.highSearch.inText")},{value:"nin",text:Xt("qm.table.highSearch.ninText")},{value:"==",text:Xt("qm.table.highSearch.eqText")},{value:"!=",text:Xt("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:Xt("qm.table.highSearch.likeText")},{value:"==",text:Xt("qm.table.highSearch.eqText")},{value:"!=",text:Xt("qm.table.highSearch.neqText")}]}return t},[k,L]=t.useState([{title:Xt("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement($n,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(n)}},Xt("qm.table.highSearch.removeText")))},{title:Xt("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:Xt("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:T,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:Xt("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,r;const i=Object.values(t)[0],l=null===(n=x.find((e=>e.dataIndex===i)))||void 0===n?void 0:n.filter.type,a=R(l);e.fieldType=l,e.expression=i?null===(r=a[0])||void 0===r?void 0:r.value:"",e.condition=N(e.expression)?[]:"",i||(e.bracketLeft=e.bracketRight="")}})},{title:Xt("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:Xt("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=x.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:R(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=N(e.expression)?[]:""}}}},{title:Xt("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,r;const i=x.find((t=>t.dataIndex===e.fieldName)),l=null==i?void 0:i.filter.type,a=null!==(r=null!==(n=null===(t=null==i?void 0:i.filter)||void 0===t?void 0:t.items)&&void 0!==n?n:null==i?void 0:i.dictItems)&&void 0!==r?r:[];return{type:I(l,N(e.expression)),editable:!0,items:a,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:Xt("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:Xt("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:C,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),A=()=>{s(),o(u.map((e=>Hn(e,["index","pageIndex"])))),P(),n()},P=()=>{b&&sessionStorage.setItem(b,JSON.stringify(u.filter((e=>!!e.fieldName))))},_=()=>{if(!b)return;const e=sessionStorage.getItem(b);return e?JSON.parse(e):null},H=()=>Tn(void 0,void 0,void 0,(function*(){if(!b)return;const e=_();e&&p(e);let t=yield Kt.getItem(b);t||(t=yield F(b),Array.isArray(t)&&(yield Kt.setItem(b,t))),Array.isArray(t)&&t.length&&(m(t),!e&&y(t[0].value))})),F=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),$=jn("table");return t.createElement("div",{className:`${$}-super-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement(rp,{ref:d,size:l,columns:k,dataSource:u,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>L(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(n)&&("bracketLeft"===n&&(e[n]=e[n]?"":"("),"bracketRight"===n&&(e[n]=e[n]?"":")"),p([...u]))},onDataChange:e=>{p(e)}},t.createElement($n,{type:"primary",icon:t.createElement(ht,null),onClick:()=>{d.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Hd.highSearch.showSQL&&E&&t.createElement("code",{className:"lang-js"},E)),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:l,value:f,placeholder:Xt("qm.table.highSearch.configText"),disabled:S,onChange:e=>{const{value:t}=e.target;g(t)}}),t.createElement($n,{type:"primary",disabled:!f||S,style:{marginLeft:"10px"},onClick:()=>Tn(void 0,void 0,void 0,(function*(){if(!b)return en("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Gl(),t=[...h,{text:f,value:e,list:u.filter((e=>!!e.fieldName))}];m(t),y(e),g(""),yield Kt.setItem(b,t),yield D(b,t)}))},Xt("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Hd.rowHeightMaps[l]}px`}},t.createElement("span",null,Xt("qm.table.highSearch.savedSetting"))),t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.value,className:Fe({selected:e.value===v}),title:e.text,onClick:()=>{return t=e.value,void y(t!==v?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:Xt("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Tn(void 0,void 0,void 0,(function*(){if(!n)return;const e=h.filter((e=>e.value!==n));m(e),n===v&&y(""),yield Kt.setItem(b,e),yield D(b,e)}))}},t.createElement(ut,null))))),!h.length&&t.createElement("div",{style:{padding:xd}},t.createElement(Fi,null)))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>n(),style:{marginRight:8}},Xt("qm.table.highSearch.closeButton")),t.createElement($n,{type:"primary",disabled:w,onClick:()=>A()},Xt("qm.table.highSearch.searchButton"))))},Su=t.forwardRef(((e,n)=>{const{open:r=!0}=e,[i,l]=t.useState(!1),a=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:a})));const o=jn("table"),s={visible:i,title:Xt("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${o}-super-search`,title:Xt("qm.table.highSearch.text"),onClick:()=>a()},t.createElement("i",{className:"svgicon icon"},t.createElement(ft,null))),t.createElement(dl,s,t.createElement(Eu,{onClose:()=>l(!1)})))}));Su.displayName="SuperSearch";const wu=t.forwardRef(((e,n)=>{const{tableColumns:r,showFullScreen:i,showReload:l,showPrint:a,showImport:o,showExport:s,showClipboard:c,showCollection:d,showFastSearch:u,showSuperSearch:p,showGroupSummary:h,showToolBox:m}=e,{global:f}=t.useContext(Bt),{tableRef:g,isFullScreen:v,$size:y}=t.useContext(vd),{uniqueKey:b,exportExcel:x}=g.current.props,E=t.useRef(null),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),T=t.useRef(null),N=t.useRef(null),I=t.useRef(null),R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),L=t.useRef(!1),A=t.useMemo((()=>b?`toolBox_${b}`:""),[b]),[P,_]=t.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),H={fullScreen:i,reload:l,print:a,import:o,export:s&&!(null==x?void 0:x.hideIcon),clipboard:c,collection:d,fastSearch:u,superSearch:p,groupSummary:h},[F,D]=t.useState(!1);bi((()=>{L.current&&(j(),L.current=!1)}),[P]),t.useEffect((()=>{$()}),[]),t.useImperativeHandle(n,(()=>({exportHandle:()=>{if(!T.current)return en("Table","执行导出需要配置 `exportExcel` 参数");T.current.clickHandle()}})));const $=()=>{if(!A||!m)return;const e=JSON.parse(localStorage.getItem(A));e||V(A).then((e=>{e&&(_(Object.assign({},P,e)),localStorage.setItem(A,JSON.stringify(e)))})).catch((()=>{})),e&&_(Object.assign({},P,e))},j=()=>{if(!A||!m)return;const e={};for(const t in P)P[t]&&(e[t]=P[t]);localStorage.setItem(A,JSON.stringify(e)),K(A,e)},V=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==f?void 0:f.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),K=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==f?void 0:f.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),z=e=>Tn(void 0,void 0,void 0,(function*(){D(!1),yield Ln(100),e.current.clickHandle()})),W=(e,t)=>{L.current=!0,_(Object.assign({},P,{[t]:e}))},B=jn("table"),U={"top-toolbox__popper":!0,[`${B}--lg`]:"large"===y,[`${B}--sm`]:"small"===y};return t.createElement(t.Fragment,null,i&&t.createElement(Ud,{ref:E,isFullScreen:v,open:!m||P.fullScreen}),l&&t.createElement(Gd,{ref:S,open:!m||P.reload}),a&&t.createElement(Xd,{ref:w,tableColumns:r,open:!m||P.print}),o&&t.createElement(su,{ref:C,tableColumns:r,open:!m||P.import}),s&&t.createElement(uu,{ref:T,tableColumns:r,open:(!m||P.export)&&!(null==x?void 0:x.hideIcon)}),c&&t.createElement(hu,{ref:N,open:!m||P.clipboard}),d&&t.createElement(fu,{ref:I,columns:r,open:!m||P.collection}),u&&t.createElement(vu,{ref:R,open:!m||P.fastSearch}),h&&t.createElement(xu,{ref:O,open:!m||P.groupSummary}),p&&t.createElement(Su,{ref:k,open:!m||P.superSearch}),m&&t.createElement(q,{open:F,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.fullScreen,style:{marginRight:6},onChange:e=>W(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.screen.full"))),onClick:()=>z(E)},{key:"reload",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.reload,style:{marginRight:6},onChange:e=>W(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.refresh.text"))),onClick:()=>z(S)},{key:"print",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.print,style:{marginRight:6},onChange:e=>W(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.print.text"))),onClick:()=>z(w)},{key:"import",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.import,style:{marginRight:6},onChange:e=>W(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.import.textNoSpace"))),onClick:()=>z(C)},{key:"export",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.export,style:{marginRight:6},onChange:e=>W(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.export.textNoSpace"))),onClick:()=>z(T)},{key:"clipboard",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.clipboard,style:{marginRight:6},onChange:e=>W(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.clipboard.textNoSpace"))),onClick:()=>z(N)},{key:"collection",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.collection,style:{marginRight:6},onChange:e=>W(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.selectCollection.text"))),onClick:()=>z(I)},{key:"fastSearch",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.fastSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.fastSearch.text"))),onClick:()=>z(R)},{key:"groupSummary",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.groupSummary,style:{marginRight:6},onChange:e=>W(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.groupSummary.text"))),onClick:()=>z(O)},{key:"superSearch",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.superSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.highSearch.text"))),onClick:()=>z(k)}];return t.createElement(Q,{items:e.filter((e=>H[e.key]))})})(),overlayClassName:Fe(U),overlayStyle:{minWidth:120},onOpenChange:e=>{D(e)}},t.createElement("span",{className:`${B}-toolbox`,title:Xt("qm.table.toolbox.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(gt,null)))))}));wu.displayName="ToolBox";const Cu=(e,t)=>e.map((e=>(e.children&&(e.children=Cu(e.children,t)),t(e)))),Tu=t.forwardRef(((e,n)=>{const{columns:r}=e,{global:i}=t.useContext(Bt),{tableRef:l,$size:a}=t.useContext(vd),{showColumnDefine:o,uniqueKey:s,onlyShowIcon:c,columnsChange:d}=l.current.props,u=t.useRef([]),[p,h]=t.useState(!1),m=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),f=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),g=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),v=t.useMemo((()=>s?`table_${s}`:""),[s]);bi((()=>{x(r)}),[r]),t.useLayoutEffect((()=>{E()}),[]),t.useImperativeHandle(n,(()=>({initialHandler:E})));const y=()=>{if(!v)return;const e=JSON.parse(localStorage.getItem(v));var t;if(e||(t=v,Tn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(v,JSON.stringify(e)),E()):(null==i?void 0:i.getComponentConfigApi)&&x(r)})).catch((()=>{})),!e)return;return ye(Rl(e).map((e=>e.dataIndex)),Rl(r).map((e=>e.dataIndex))).length>0?Cu(r,(t=>{const n=kl(e,t.dataIndex);return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Cu(e,(e=>{const t=kl(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},b=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=b(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),x=e=>{if(!v)return;const t=b(e),n=JSON.parse(localStorage.getItem(v));var r,a;l.current.columnsDefined&&!ge(t,n)&&(localStorage.setItem(v,JSON.stringify(t)),r=v,a=t,Tn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.saveComponentConfigApi;if(e)try{yield e({[r]:a})}catch(e){}})))},E=()=>{const e=y();var t;e&&(t=S(e),u.current=t,null==d||d(e))},S=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((n,r)=>{const i=n.colSpan;i>1&&e.slice(r+1,r+i).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(r,r+i))})),t},w=()=>{const e=t=>t.map((t=>{const n=kl(r,t.dataIndex)||Fn(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==d||d(e(l.current.originColumns))},C=e=>{const t=[];e.forEach((n=>{const{colSpan:r,dataIndex:i}=n;if(0===r)return;if(1===r)return t.push(n);const l=u.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===l)return t.push(n);t.push(...u.current[l].map(((t,r)=>{let{dataIndex:i}=t;const l=e.find((e=>e.dataIndex===i));return r>0&&(void 0!==n.hidden&&(l.hidden=n.hidden),void 0!==n.fixed?l.fixed=n.fixed:l.fixed&&delete l.fixed),l})))})),r.forEach(((e,n)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(n,0,e)})),null==d||d(t)},T=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,C(r))},N=(e,n)=>{var i;const{colSpan:l,noFixed:a}=e;if(0===l)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const o=Xl(e.title),s=["svgicon","handle",`${n}-handle`],c=t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(M,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,C(r)}}),t.createElement("i",{className:Fe(s),title:Xt("qm.table.columnFilter.draggable")},t.createElement(Ge,null)),t.createElement("span",{className:"text",title:o},o),"main"===n?t.createElement("span",{className:Fe("fixed",a?"disabled":"")},t.createElement("i",{className:"svgicon",title:Xt("qm.table.columnFilter.fixedLeft"),onClick:()=>T(e,"left")},t.createElement(vt,null)),t.createElement("i",{className:"svgicon",title:Xt("qm.table.columnFilter.fixedRight"),onClick:()=>T(e,"right")},t.createElement(yt,null))):"sub"!==n?t.createElement("span",{className:Fe("fixed",a?"disabled":"")},t.createElement("i",{className:"svgicon",title:Xt("qm.table.columnFilter.cancelFixed"),onClick:()=>T(e)},t.createElement(ut,null))):null);return!e.hidden&&(null===(i=e.children)||void 0===i?void 0:i.length)?t.createElement(J,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:I(e.children,e.dataIndex)},c):c},I=(e,n)=>t.createElement("div",{className:"column-filter--wrap"},t.createElement(Vt,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:t=>{const i=t.map((e=>e.dataIndex)),l=e.map((e=>e.dataIndex));ge(i,l)||((e,t)=>{kl(r,t).children=e,null==d||d([...r])})(ia(t),n)}},e.map((e=>N(e,"sub"))))),R=jn("table"),O={[`${R}__popper`]:!0,"column-filter__popper":!0,[`${R}--lg`]:"large"===a,[`${R}--sm`]:"small"===a},k=[`${R}-column-filter`,{selected:p}];return o?t.createElement(Ms,{action:["click"],popupVisible:p,popup:t.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"reset"},t.createElement($n,{type:"text",size:"small",onClick:w},Xt("qm.table.columnFilter.reset"))),t.createElement("div",{className:"left"},t.createElement(Vt,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:m,setList:e=>{const t=e.map((e=>e.dataIndex)),n=m.map((e=>e.dataIndex));ge(t,n)||C([...ia(e),...g,...f])}},m.map((e=>N(e,"left"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"main"},t.createElement(Vt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),n=g.map((e=>e.dataIndex));ge(t,n)||C([...m,...ia(e),...f])}},g.map((e=>N(e,"main"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"right"},t.createElement(Vt,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:f,setList:e=>{const t=e.map((e=>e.dataIndex)),n=f.map((e=>e.dataIndex));ge(t,n)||C([...m,...g,...ia(e)])}},f.map((e=>N(e,"right")))))),popupClassName:Fe(O),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{h(e)},builtinPlacements:Nd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Fe(k),title:c?Xt("qm.table.columnFilter.text"):void 0},t.createElement("i",{className:"svgicon icon"},t.createElement(st,null)),!c&&t.createElement("span",null,Xt("qm.table.columnFilter.text")))):null}));Tu.displayName="ColumnFilter";const Nu=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"})),Iu=e=>{const{column:n,filters:r}=e,{$size:i,setFilters:l,clearSuperFilters:a}=t.useContext(vd),o=t.useRef(null),s=t.useRef(null),c=t.useRef(null),[d,u]=t.useState(!1),[p,h]=t.useState(!1),[m,f]=t.useState({}),g=t.useMemo((()=>{const{dataIndex:e,filter:t}=n;return`${e}|${t.type}`}),[n]),v=t.useMemo((()=>{let e=!1;for(const t in r[g])if(!_n(r[g][t])||p){e=!0;break}return e}),[g,r,p]);t.useLayoutEffect((()=>{d&&setTimeout((()=>y()),20)}),[d]),t.useEffect((()=>{var e;ge(m[g],r[g])||f({[g]:r[g]||{}}),h(""===(null===(e=r[g])||void 0===e?void 0:e["=="]))}),[r]);const y=()=>{switch(n.filter.type){case"text":o.current.focus();break;case"number":s.current.focus();break;case"textarea":c.current.focus()}},b=e=>{e&&f(e),a(),l((e=>{for(const t in e){for(const n in e[t])if(_n(e[t][n])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][n])continue;delete e[t][n]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},r),m),e))),u(!1)},x={text:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O,{ref:o,size:i,placeholder:Xt("qm.table.filter.searchText",{text:Xl(e.title)}),style:{width:"180px"},value:null!==(r=null===(n=m[g])||void 0===n?void 0:n.like)&&void 0!==r?r:"",disabled:p,onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&b()}}),t.createElement("div",{style:{marginTop:8}},t.createElement(M,{checked:p,onChange:e=>{const{checked:t}=e.target,n=t?"":null;f((e=>Object.assign({},e,{[g]:{"==":n,like:null}}))),h(t)}},Xt("qm.table.filter.nullValue"))))},textarea:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O.TextArea,{ref:c,size:i,placeholder:Xt("qm.table.filter.searchAreaText",{text:Xl(e.title)}),style:{width:"220px"},value:null!==(r=null===(n=m[g])||void 0===n?void 0:n.likes)&&void 0!==r?r:"",disabled:p,onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),b())}}),t.createElement("div",{style:{marginTop:8}},t.createElement(M,{checked:p,onChange:e=>{const{checked:t}=e.target,n=t?"":null;f((e=>Object.assign({},e,{[g]:{"==":n,like:null}}))),h(t)}},Xt("qm.table.filter.nullValue"))))},number:e=>{const n=e=>{var t,n;return{value:null!==(n=null===(t=m[g])||void 0===t?void 0:t[e])&&void 0!==n?n:"",size:i,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||f((n=>Object.assign({},n,{[g]:Object.assign({},n[g],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&b()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(j,vn({ref:s},n(">"),{placeholder:Xt("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(j,vn({},n("<"),{placeholder:Xt("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(j,vn({},n("=="),{placeholder:Xt("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(j,vn({},n("!="),{placeholder:Xt("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const n=e=>{var t;return{value:Bl(null===(t=m[g])||void 0===t?void 0:t[e],wd),format:wd,size:i,onChange:t=>{f((n=>Object.assign({},n,{[g]:Object.assign({},n[g],{[e]:Ul(t,wd)})})))},onKeyDown:e=>{13===e.keyCode&&b()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(gn,vn({},n(">"),{placeholder:Xt("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(gn,vn({},n("<"),{placeholder:Xt("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(gn,vn({},n("=="),{placeholder:Xt("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(gn,vn({},n("!="),{placeholder:Xt("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("ul",null,t.createElement(K.Group,{style:{width:"100%"},value:null===(n=m[g])||void 0===n?void 0:n["=="],onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{"==":t}})))}},l.map((e=>t.createElement("li",{key:e.value},t.createElement(K,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("ul",null,t.createElement(M.Group,{style:{width:"100%"},value:null===(n=m[g])||void 0===n?void 0:n.in,onChange:e=>{f((t=>Object.assign({},t,{[g]:{in:e}})))}},l.map((e=>t.createElement("li",{key:e.value},t.createElement(M,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("div",{style:Object.assign({height:200},r.style)},t.createElement(gd,{multiple:!0,value:(null===(n=m[g])||void 0===n?void 0:n.in)||[],dataSource:l,onCheckChange:e=>{const t=e.map((e=>e.value));f((e=>Object.assign({},e,{[g]:{in:t}})))}}))}},E=()=>t.createElement(N,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t.createElement($n,{size:i,onClick:()=>(b({[g]:{}}),void h(!1))},Xt("qm.table.filter.reset")),t.createElement($n,{type:"primary",size:i,onClick:()=>b()},Xt("qm.table.filter.search"))),S=jn("table"),w={"head-filter__popper":!0,[`${S}--lg`]:"large"===i,[`${S}--sm`]:"small"===i},C=["cell--filter",{selected:d,actived:v}];return t.createElement(Ms,{action:["click"],popupVisible:d,popup:(()=>{const e=n.filter.type,r=x[e];return r?t.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t.createElement("div",null,r(n)),E()):(en("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:Fe(w),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{u(e)},builtinPlacements:Nd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("div",{className:Fe(C),title:Xt("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t.createElement("span",{className:"svgicon icon"},t.createElement(Nu,null))))},Ru=e=>{const{column:n}=e,{tableRef:r,bordered:i}=t.useContext(vd),{columns:l,resizable:a,columnsChange:o=On}=r.current.props,s=t.useMemo((()=>Al(n)),[n]),c={resizable:!0,"is--line":a&&!i};return t.createElement("div",{className:Fe(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n}=r.current,i=n.$resizableBar,a=t.offsetWidth/2,c=e.clientX,d=Dl(t,n.$table).left-n.$tableBody.parentNode.parentNode.scrollLeft+a;n.$table.classList.add("c--resize"),i.style.left=`${d}px`,i.style.display="block";const u=s.width||s.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,n=u+t;n<(s.minWidth||Hd.defaultColumnWidth)||(p=Math.floor(n),i.style.left=`${t+d}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),i.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(kl(l,s.dataIndex).width=p,o([...l]))},!1}})},Ou=e=>{const{selectionKeys:n}=e,{tableRef:r,getRowKey:i,fetchParams:l,createWebPageData:a,setSelectionKeysEffect:o,setInvalidRowKeys:s,setSpinning:c,isFetch:d,isWebPagination:u}=t.useContext(vd),{rowSelection:p}=r.current.props,{fetchAllRowKeys:h,selectAllOnCurrentPage:m,filterable:f,onSelectAll:g}=p,v=t.useRef([]),y=t.useMemo((()=>d&&!!h),[d,h]),b=t.useMemo((()=>!y&&!!m),[y,m]),x=t.useMemo((()=>(null==f||f)&&!b),[f,b]),E=()=>u?a():r.current.tableFullData,S=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>i(e,e.index)))},w=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:n}=p;if(y)return v.current.length?v.current:_e(t,S());if(!b)return n?t.filter((t=>!n(e.get(t)))):t;const l=n?E().filter((e=>!n(e))).map((e=>i(e,e.index))):E().map((e=>i(e,e.index)));return _e(l,S())})(),C=n.filter((e=>!w.includes(e))),T=n.length-C.length,N=T>0&&T<w.length,I=!!T&&T===w.length;s(C);const R=()=>Tn(void 0,void 0,void 0,(function*(){var e;const t=h;let n=[];c(!0);try{const r=yield t.api(l);if(200===r.code){n=Array.isArray(r.data)?r.data:null!==(e=me(r.data,t.dataKey))&&void 0!==e?e:[];const{disabled:l}=p;l&&(n=ye(n,E().filter((e=>l(e))).map((e=>i(e,e.index))))),v.current=n}}catch(e){}return c(!1),n})),O=e=>Tn(void 0,void 0,void 0,(function*(){let t=[];t=y?e?yield R():[]:e?w.slice(0):[],t=[...new Set([...t,...C])],o(t),null==g||g(e,t)})),k=()=>{const e=[{key:1,label:Xt("qm.table.selection.all"),onClick:()=>{O(!0)}},{key:2,label:Xt("qm.table.selection.invert"),onClick:()=>Tn(void 0,void 0,void 0,(function*(){let e=[];e=ye(n,y?yield R():w),e=[...new Set([...e,...C])],o(e)}))},{key:3,label:Xt("qm.table.selection.clear"),onClick:()=>{O(!1)}}];return t.createElement(Q,{items:e})};return t.createElement("div",{className:"cell--selection"},t.createElement(M,{checked:I,indeterminate:N,disabled:!w.length,onChange:e=>O(e.target.checked)}),x&&t.createElement(q,{overlayClassName:"all-selection__popper",dropdownRender:()=>k()},t.createElement($e,{className:"svgicon icon"})),b&&t.createElement(Y,{placement:"top",title:Xt("qm.table.selection.currentPage")},t.createElement(bt,{className:"info"})))},ku=e=>{const{style:n}=e,{tableRef:r,isTreeTable:i,setRowExpandedKeys:l}=t.useContext(vd),{expandable:a}=r.current.props,[o,s]=t.useState((null==a?void 0:a.defaultExpandAllRows)||!1);bi((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;l(o?e.filter((e=>!(i&&t.includes(e)))):[])}),[o]);const c={[`${jn("expand")}--icon`]:!0,expanded:o,collapsed:!o};return t.createElement("span",{className:Fe(c),title:"",onClick:e=>{e.stopPropagation(),s(!o)},style:n})},Lu=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),Au=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),Pu=e=>{const{tableColumns:n,sorter:r,filters:i}=e,{tableRef:l,layout:a,scrollY:o,flattenColumns:s,superFilters:c,selectionKeys:d,rightFixedColumns:u,treeExpandIndex:p,isFetch:h,isTreeTable:m,isGroupSubtotal:f,tableChange:g,setSorter:v,setElementStore:y,resetTableScroll:b,getStickyLeft:x,getStickyRight:E,createGroupData:S,createTableFullData:w}=t.useContext(vd),{ellipsis:C,resizable:T,multipleSort:N,rowSelection:I,expandable:R}=l.current.props,[O,k]=Hd.sortDirections,{tableOriginData:L}=l.current,A=t.useRef(null),P=t.useMemo((()=>L.some((e=>Array.isArray(e.children)))),[L]),_=t.useMemo((()=>!h),[h]),H=t.useMemo((()=>!h),[h]),F=t.useMemo((()=>!(null==R?void 0:R.hideExpandAll)),[R]),D=t.useMemo((()=>!!I&&(h?!(!I.selectAllOnCurrentPage&&!I.fetchAllRowKeys):!I.hideSelectAll)),[h,I]);bi((()=>{z(),g(),b()}),[r]),bi((()=>{U(),g(),b()}),[i]),bi((()=>{U(),g(),b()}),[c]),t.useEffect((()=>{!_n(r)&&An((()=>z())),!_n(i)&&An((()=>U()))}),[]),t.useLayoutEffect((()=>{$()}),[]);const $=()=>{y("$header",A.current)},M=(e,n,i)=>{var s,c,d;const{isIE:u}=l.current,{gutterWidth:p}=a,{dataIndex:h,colSpan:m,rowSpan:f,fixed:g,align:v,theadAlign:y,theadClassName:b="",sorter:S,filter:w,required:N,headRender:I}=e;if(0===m)return null;const R=y||v,O=["header--column",{"col--ellipsis":null!==(s=e.ellipsis)&&void 0!==s?s:C,"col--center":"center"===R,"col--right":"right"===R,"column--required":!!N,"column-has-sorter":S,"column-has-filter":w,"column--sort":!!r[h],"cell-fix-left":!u&&"left"===g,"cell-fix-right":!u&&"right"===g,"cell-fix-left-last":!u&&"left"===g&&!(null===(c=i[n+(null!=m?m:1)])||void 0===c?void 0:c.fixed),"cell-fix-right-first":!u&&"right"===g&&!(null===(d=i[n-1])||void 0===d?void 0:d.fixed),[b]:!!b}],k=u?null:{left:"left"===g?`${x(h)}px`:"",right:"right"===g?`${E(h,"thead")+(o?p:0)}px`:""},L=T&&![Hd.expandableColumn,Hd.selectionColumn].includes(h);return t.createElement("th",{key:h,className:Fe(O),colSpan:m,rowSpan:f,style:Object.assign({},k),onClick:t=>K(t,e)},t.createElement("div",{className:"cell--wrapper"},I?t.createElement("div",{className:"cell--text cell"},I(e,l.current.tableFullData)):t.createElement(t.Fragment,null,t.createElement("div",{className:"cell--text"},q(e)),w?V(e):null)),L&&t.createElement(Ru,{column:e}))},q=e=>{const{dataIndex:n,type:i,sorter:l,title:a,description:o}=e;if(n===Hd.selectionColumn&&"checkbox"===i){if("checkbox"===i)return t.createElement("div",{className:"cell"},D?t.createElement(Ou,{selectionKeys:d}):Xt("qm.table.config.selectionText"));if("radio"===i)return t.createElement("div",{className:"cell"},a)}const s=[];return s.push(t.createElement("div",{key:0,className:"cell",title:Xl(a)},m&&n===p&&F?t.createElement(ku,null):null,n===Hd.expandableColumn&&F?t.createElement(ku,null):a)),o&&s.push(t.createElement(Y,{key:1,placement:"top",title:o},t.createElement(bt,{className:"tip"}))),l&&s.push(j(r[n])),s},j=e=>{const n=["svgicon cell--sorter__asc",{actived:e===O}],r=["svgicon cell--sorter__desc",{actived:e===k}];return t.createElement("div",{key:2,className:"cell--sorter",title:Xt("qm.table.sorter.text")},t.createElement("span",{className:Fe(n)},t.createElement(Lu,null)),t.createElement("span",{className:Fe(r)},t.createElement(Au,null)))},V=e=>t.createElement(Iu,{column:e,filters:i}),K=(e,t)=>{const{sorter:n,dataIndex:i}=t;if(n){const e=r[i],t=e?e===k?null:k:O;N?(delete r[i],v(Object.assign({},r,{[i]:t}))):v(Object.assign({},{[i]:t}))}},z=()=>{_&&W()},W=e=>{const t=He(r,(e=>null!==e));for(const e in t){const n=s.find((t=>t.dataIndex===e));n?B(n,t[e]):delete t[e]}e||Object.keys(t).length||B({dataIndex:"index"},O)},B=(e,t)=>{const{tableFullData:n}=l.current,{dataIndex:r,sorter:i}=e,a=(e,n)=>{const i=ql(e,r),l=ql(n,r);return Number.isNaN(i-l)?t===O?i.toString().localeCompare(l.toString()):l.toString().localeCompare(i.toString()):t===O?i-l:l-i},o=f?S(Zl(n).sort("function"==typeof i?i:a)):n.sort("function"==typeof i?i:a).slice(0);w(o)},U=()=>{H&&G()},G=()=>{const e=c.length?Ql(c):Ql(i),t=""!==e?f?S(Tl(Zl(L),e,P)):Tl(L,e,P):L;w(t),W(!0)},X=Fl(n),Z=jn("table"),{tableBodyWidth:Q}=a;return t.createElement("div",{ref:A,className:`${Z}--header-wrapper`},t.createElement("table",{className:`${Z}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},(()=>{const{gutterWidth:e}=a;return t.createElement("colgroup",null,s.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})})),o&&t.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t.createElement("thead",null,(e=>{const{isIE:n}=l.current,r=["gutter",{"cell-fix-right":!!u.length}],i=n?null:{right:u.length?0:""};return e.map(((e,n)=>t.createElement("tr",{key:n,className:"header--row"},e.map(((t,n)=>M(t,n,e))),o&&t.createElement("th",{className:Fe(r),style:Object.assign({},i)}))))})(X))))},_u=t.createContext([]),Hu=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Fu=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),Du=(e,t)=>{var n;const r=e.target;return!("button"in e&&e.button>0)&&(!(r&&!Hu(r).contains(r))&&!(null===(n=t.current)||void 0===n?void 0:n.contains(r)))};function $u(t){let{ref:n,handler:r,enabled:i=!0,omitClassNames:l=[]}=t;const a=Rd(r),o=e.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});e.useEffect((()=>{if(!i)return;const e=e=>{Du(e,n)&&(o.current.isPointerDown=!0)},t=e=>{o.current.ignoreEmulatedMouseEvents?o.current.ignoreEmulatedMouseEvents=!1:r&&o.current.isPointerDown&&Du(e,n)&&Fu(e,l)&&(o.current.isPointerDown=!1,a(e))},s=e=>{o.current.ignoreEmulatedMouseEvents=!0,r&&o.current.isPointerDown&&Du(e,n)&&Fu(e,l)&&(o.current.isPointerDown=!1,a(e))},c=Hu(n.current);return c.addEventListener("mousedown",e,!0),c.addEventListener("mouseup",t,!0),c.addEventListener("touchstart",e,!0),c.addEventListener("touchend",s,!0),()=>{c.removeEventListener("mousedown",e,!0),c.removeEventListener("mouseup",t,!0),c.removeEventListener("touchstart",e,!0),c.removeEventListener("touchend",s,!0)}}),[r,n,a,o,i])}function Mu(){const[,t]=e.useReducer((e=>e+1),0);return t}const qu=e=>{const{selectionKeys:n,column:r,record:i,rowKey:l}=e,{tableRef:a,isTreeTable:o,getAllChildRowKeys:s}=t.useContext(vd),{rowSelection:c}=a.current.props,d=t.useMemo((()=>r.type||""),[r.type]),u=e=>{var t,r;const i=null===(t=c.checkStrictly)||void 0===t||t;if(!o||i)return!1;const l=_l(a.current.deriveRowKeys,e);return((e,t)=>{const n=new Set(t);let r=!1,i=!1;for(const t of e)if(n.has(t)?r=!0:i=!0,r&&i)break;return r&&i})(s(null!==(r=null==l?void 0:l.children)&&void 0!==r?r:[]),n)};return"radio"===d?(()=>{const e=c.disabled,r=null==e?void 0:e(i),a=!r&&n[0]===l;return t.createElement(K,{checked:a,disabled:r})})():(()=>{const e=c.disabled,r=null==e?void 0:e(i),a=!!n.includes(l);return t.createElement(M,{checked:a,indeterminate:u(l),disabled:r})})()},ju=e=>{const{record:n,rowKey:r,style:i}=e,{tableRef:l,rowExpandedKeys:a,setRowExpandedKeys:o}=t.useContext(vd),{expandable:s={}}=l.current.props,[c]=t.useState("function"==typeof s.rowExpandable&&!s.rowExpandable(n)),d=t.useMemo((()=>a.includes(r)),[a,r]);bi((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,n)}),[d]);const u={[`${jn("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t.createElement("span",{className:Fe(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?a.filter((e=>e!==r)):[...a,r];o(t)},style:i})},Vu=t.forwardRef(((e,n)=>{const{size:r,defaultValue:i,value:l,min:a,max:o,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,stringMode:h,allowClear:m,readOnly:f,disabled:g,formatter:v=(e=>e.toString()),parser:y=(e=>e),onFocus:b}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>o&&(t=o.toString()),t&&Number(t)<a&&(t=a.toString()),p>=0&&""!==t&&(t=new Ft(t).toFixed(p)),t},E=void 0!==l,[S,w]=t.useState(null!=i?i:""),C=v(E?l:S),T=y(C);bi((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,T)}),[S]);return t.createElement(O,{ref:n,size:r,value:C,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:m,readOnly:f,disabled:g,onChange:t=>{const n=y(t.target.value);let r=/^-?\d*(\.\d*)?$/.test(n)||""===n||"-"===n;if(0===p&&n.includes(".")&&(r=!1),a>=0&&n.startsWith("-")&&(r=!1),r){if(!h&&(Number(n)>Number.MAX_SAFE_INTEGER||Number(n)<Number.MIN_SAFE_INTEGER))return;(t=>{var n;E?null===(n=e.onChange)||void 0===n||n.call(e,t):w(t)})(n)}},onFocus:b,onBlur:()=>{var t;const n=x(T);null===(t=e.onBlur)||void 0===t||t.call(e,n,T)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(T),T))}})}));Vu.displayName="InputNumber";const{Search:Ku}=O,zu=t.forwardRef(((e,n)=>{var r,i,l,a,o,s;const{column:c,record:d,rowKey:u,columnKey:p}=e,{tableRef:h,tableBodyRef:m,$size:f,flattenColumns:g,updateTableData:v,doFieldValidate:y,dataChange:b}=t.useContext(vd),x=t.useContext(_u),E="table-editable__popper",S=Mu(),{store:w,fieldAuth:T}=h.current,N=(null===(r=c.editRender)||void 0===r?void 0:r.call(c,d,c))||{},I=t.useRef(null),R=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(!1),_=t.useRef({}),H=t.useRef({}),F=t.useRef([]),[D,q]=t.useState(!1),[j,V]=t.useState(!1),[K,W]=t.useState(!1),[B,U]=t.useState(N.items||[]),[G,Y]=t.useState(),X=(N.editable||ge(x,[u,p]))&&!N.disabled&&!(null===(i=T[p])||void 0===i?void 0:i.disabled),Z=`${u}|${p}`,Q=2===x.length?`${x[0]}|${x[1]}`:"",J=![...w.state.required,...w.state.validate].some((e=>{let{x:t,y:n}=e;return t===u&&n===p})),ee=(null===(l=w.state.required.find((e=>{let{x:t,y:n}=e;return t===u&&n===p})))||void 0===l?void 0:l.text)||"",te=(null===(a=w.state.validate.find((e=>{let{x:t,y:n}=e;return t===u&&n===p})))||void 0===a?void 0:a.text)||"",ne=w.state.edited.some((e=>{let{x:t,y:n}=e;return t===u&&n===p})),re=X||!J||D||K||j,ie=!!(null===(o=N.helper)||void 0===o?void 0:o.combinedDataIndex)&&("search-helper"===N.type||"tree-helper"===N.type),le=null===(s=N.type)||void 0===s?void 0:s.endsWith("multiple");t.useLayoutEffect((()=>{re&&Q===Z&&de()}),[x]),t.useLayoutEffect((()=>{const{items:e}=N;le&&e&&ce(e.map((e=>({[H.current.valueKey]:e.value,[H.current.textKey]:e.text}))))}),[]);const ae=()=>{v(),b()},oe=(e,t)=>{q(e),null==t||t()},ce=e=>{F.current=e},de=()=>{var e,t,n,r;const{type:i}=N;switch(i){case"text":null===(e=R.current)||void 0===e||e.focus();break;case"number":null===(t=k.current)||void 0===t||t.select();break;case"search-helper":null===(n=L.current)||void 0===n||n.focus();break;case"tree-helper":null===(r=A.current)||void 0===r||r.focus()}};t.useImperativeHandle(n,(()=>({focus:de})));const ue=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},pe=(e,t,n)=>{const{cornerSign:r=!0}=N.extra||{};w.addToUpdated(e),r&&w.addToEdited({x:t,y:n})},he=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",fe={text:(e,n,r)=>{const{dataIndex:i}=n,{type:l,extra:a={},rules:o=[],onInput:s,onChange:c,onEnter:d,onBlur:h}=N,m=ql(e,i),g=Object.assign({},{minRows:1,maxRows:4},a.autoSize),v=r?{rows:g.minRows,autoSize:g}:null,b=a.password?O.Password:r?O.TextArea:O;return t.createElement(b,vn({ref:R,size:f,value:m,maxLength:a.maxLength,showCount:a.showCount},v,{autoComplete:a.password?"new-password":"off",placeholder:a.placeholder||Xt("qm.table.editable.inputPlaceholder"),allowClear:a.allowClear,readOnly:a.readOnly,disabled:a.disabled,suffix:a.suffix,onChange:t=>{var n;const r=null!==(n=t.target.value)&&void 0!==n?n:"";jl(e,i,r),y(o,r,u,p),S(),null==s||s({[Z]:r}),P.current=!0},onFocus:()=>V(!0),onBlur:t=>{var n;V(!1);const r=null!==(n=t.target.value)&&void 0!==n?n:"";P.current&&(P.current=!1,pe(e,u,p),null==c||c({[Z]:r},e),null==h||h({[Z]:r},e),ae())},onKeyUp:t=>{var n;if(13===t.keyCode&&!t.shiftKey){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==d||d({[Z]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&d&&e.preventDefault()}}))},textarea:(e,t)=>fe.text(e,t,!0),number:(e,n)=>{var r;const{dataIndex:i,precision:l,formatType:a}=n,{type:o,extra:s={},rules:c=[],onInput:d,onChange:h,onEnter:m,onBlur:g}=N,v=ql(e,i);let b,x;return"finance"===a&&(b=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},x=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===a&&(b=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new Ft(e).times(100).toNumber()}`,x=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new Ft(e).times(.01).toString()),t.createElement(Vu,{ref:k,size:f,value:v,min:s.min,max:s.max,precision:l,stringMode:s.stringMode,prefix:s.prefix,suffix:null!==(r=s.suffix)&&void 0!==r?r:"percent"===a?"%":void 0,placeholder:s.placeholder||Xt("qm.table.editable.inputPlaceholder"),maxLength:s.maxLength,allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,formatter:b,parser:x,onChange:t=>{jl(e,i,t),y(c,t,u,p),S(),null==d||d({[Z]:t}),P.current=!0},onFocus:()=>V(!0),onBlur:(t,n)=>{if(V(!1),!P.current)return;P.current=!1;let r=s.stringMode?t:he(t);"percent"===a&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),jl(e,i,r),pe(e,u,p),null==h||h({[Z]:r},e),null==g||g({[Z]:r},e),ae()},onEnter:(t,n)=>{let r=s.stringMode?t:he(t);"percent"===a&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),null==m||m({[Z]:r},e)}})},select:(e,n,r)=>{var i;const{dataIndex:l,dictItems:a=[]}=n,{type:o,extra:s={},rules:c=[],items:d,onChange:h,onEnter:m}=N,g=d||a,v=ql(e,l);let b=v;return t.createElement($,{mode:r?"multiple":void 0,size:f,popupClassName:E,value:v||void 0,placeholder:s.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,listHeight:s.listHeight,maxTagCount:s.collapseTags?"responsive":void 0,maxTagTextLength:s.maxTagTextLength,disabled:s.disabled,style:{width:"100%"},showSearch:null===(i=s.filterable)||void 0===i||i,filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"";return`${r}|${Ma.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{jl(e,l,t),y(c,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e),ae()},onSelect:e=>{b=e},onInputKeyDown:t=>{13===t.keyCode&&An((()=>null==m?void 0:m({[Z]:b},e)))}},g.map((e=>t.createElement($.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>fe.select(e,t,!0),date:(e,n,r)=>{var i;const{dataIndex:l}=n,{type:a,extra:o={},rules:s=[],onChange:c}=N,d=r||"exactdate",h=ql(e,l);return t.createElement(gn,{size:f,popupClassName:E,value:null!==(i=Bl(h,pa[d]))&&void 0!==i?i:void 0,picker:ua[d],format:o.format,showTime:"datetime"===d,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:n}=o;return t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day")})(e),placeholder:o.placeholder,allowClear:o.allowClear,disabled:o.disabled,style:{width:"100%"},onChange:t=>{const n=Ul(t,pa[d]);jl(e,l,n),y(s,n,u,p),pe(e,u,p),null==c||c({[Z]:n},e),ae()}})},datetime:(e,t)=>fe.date(e,t,"datetime"),month:(e,t)=>fe.date(e,t,"month"),year:(e,t)=>fe.date(e,t,"year"),time:(e,n)=>{var r;const{dataIndex:i}=n,{type:l,extra:a={},rules:o=[],onChange:s}=N,c="HH:mm:ss",d=ql(e,i);return t.createElement(yn,{size:f,popupClassName:E,value:null!==(r=Bl(d,c))&&void 0!==r?r:void 0,format:a.format||c,placeholder:a.placeholder,allowClear:a.allowClear,disabled:a.disabled,style:{width:"100%"},onChange:t=>{const n=Ul(t,c);jl(e,i,n),y(o,n,u,p),pe(e,u,p),null==s||s({[Z]:n},e),ae()}})},checkbox:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],onChange:o}=N,{trueValue:s=Ed,falseValue:c=Sd,disabled:d}=l,h=ql(e,r);return t.createElement(M,{checked:h===s,disabled:d,onChange:t=>{const n=t.target.checked?s:c;jl(e,r,n),y(a,n,u,p),pe(e,u,p),null==o||o({[Z]:n},e),ae()}})},switch:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],onChange:o}=N,{trueValue:s=Ed,falseValue:c=Sd,disabled:d}=l,h=ql(e,r);return t.createElement(z,{checked:h===s,disabled:d,onChange:t=>{const n=t?s:c;jl(e,r,n),y(a,n,u,p),pe(e,u,p),null==o||o({[Z]:n},e),ae()}})},"search-helper":(e,n)=>{var r;const{dataIndex:i,precision:l}=n,{type:a,extra:o={},rules:s=[],helper:c={},onInput:d,onChange:h,onEnter:m}=N,v=Vl(e,ie?c.combinedDataIndex:i),b=c.fieldAliasMap;b||en("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(i)||en("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ie&&(c.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||en("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[i].includes("|")&&en("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const S=e=>{const{filterAliasMap:t}=c,n=""!==e?e:void 0,r=("function"==typeof t?t():t)||[],l={[i]:n};return(Array.isArray(r)?r:[r]).forEach((e=>{if(se(e))for(const t in e)l[t]="function"==typeof e[t]?e[t](n):n;else l[e]=n})),l},w=e=>{const{autoQueryAssign:t=!0}=c;t&&(_.current=S(e)),q(!0)},C=(t,r)=>{const{beforeOpen:i}=c,l=(null!=i?i:kn)({[Z]:v},e,n);(null==l?void 0:l.then)?l.then((()=>{w(t),null==r||r()})).catch((()=>{})):!1!==l&&(w(t),null==r||r())},T=e=>{const t={};for(const n in x){const r=x[n];n!==i&&(t[n]=Vl(e,r))}const n=x[i]?Vl(e,x[i]):"";O(n,t);const{closed:r}=c;oe(!1,(()=>ue(I.current))),de(),null==r||r(e)},R=()=>{const{onlySelect:e=!0}=c;P.current&&O(e?"":v),oe(!1,(()=>ue(I.current)))},O=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;var r;if(se(n)&&Object.keys(n).length)for(const t in n){const i=n[t],l=g.find((e=>e.dataIndex===t));if(l){jl(e,t,i,l.precision);const n=null===(r=l.editRender)||void 0===r?void 0:r.call(l,e,l);n&&Array.isArray(n.rules)&&y(n.rules,i,u,t)}else jl(e,t,i)}ie&&!t&&((e,t,n,r)=>{if(!t.includes("|"))return jl(e,t,n,r);const i=n.split("|")||[];t.split("|").forEach(((t,n)=>{var r;t&&jl(e,t,null===(r=i[n])||void 0===r?void 0:r.trim())}))})(e,c.combinedDataIndex,""),jl(e,i,t,l),y(s,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e),ae(),_.current={},P.current=!1,Y(void 0)},k={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{R()}},A=Object.assign(Object.assign({},c),{size:f,initialValue:Object.assign({},_.current,c.initialValue),onClose:e=>{e?T(e):R()}});return t.createElement(t.Fragment,null,t.createElement(Ku,{ref:L,value:null!=G?G:v,placeholder:o.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:r=!0,table:l}=c;if(P.current&&!D)return n&&r&&(null===(t=null==l?void 0:l.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=c,{beforeFetch:r=kn}=t.fetch;return new Promise(((i,l)=>Tn(void 0,void 0,void 0,(function*(){var a;const o=xe({},t.fetch.params,Object.assign(Object.assign({},n),S(e)),{currentPage:1,pageSize:500});if(!r(o))return l();W(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(a=me(e.data,t.fetch.dataKey))&&void 0!==a?a:[];i(n)}else l()}catch(e){l(e)}finally{An((()=>W(!1)))}}))))})(n).then((e=>function(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((t=>Vl(t,x[i]).toString().includes(e)));if(1===t.length)return T(t[0]);C(e)}(e,n))).catch((()=>O(""))):void O(n)},onChange:e=>{const{value:t}=e.target;null==d||d({[Z]:t}),P.current=!0,Y(t)},onKeyUp:t=>{var n;if(13===t.keyCode){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==m||m({[Z]:r},e)}},onDoubleClick:e=>{const{value:t}=e.target;C(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&C(e)}}),t.createElement(dl,k,t.createElement(ip,A)))},"search-helper-multiple":(e,n)=>{var r;const{dataIndex:i}=n,{type:l,items:a=[],extra:o={},rules:s=[],helper:c={},onInput:d,onChange:h,onEnter:m}=N,g=ql(e,i),v=c.fieldAliasMap;v||en("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||en("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:kn)({[Z]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{oe(!1,(()=>ue(I.current)))},w=t=>{jl(e,i,t),y(s,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e,F.current),ae()},T={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:xe({},c.initialValue),defaultSelectedKeys:g,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:r}=b;ce(Ee([...F.current.filter((e=>t.includes(e[r]))),...e],r));const i=F.current.map((e=>({text:e[n],value:e[r]}))),l=Ee([...i,...a],"value").filter((e=>t.includes(e.value)));U(l),w(l.map((e=>e.value)));const{closed:o}=c;oe(!1,(()=>ue(I.current))),null==o||o(F.current)})(e,t):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement($,{mode:"multiple",open:!1,value:g,placeholder:o.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==m||m({[Z]:g},e))},onDoubleClick:()=>{o.disabled||x()},onChange:e=>{const{valueKey:t}=b;ce(F.current.filter((n=>e.includes(n[t])))),w(e)}},B.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:o.disabled,icon:t.createElement(Xe,null),onClick:()=>{x()}})))),t.createElement(dl,T,t.createElement(ip,R)))},"tree-helper":(e,n)=>{var r,i;const{dataIndex:l,precision:a}=n,{type:o,extra:s={},rules:c=[],helper:d={},onChange:h,onEnter:m}=N,v=Vl(e,ie?d.combinedDataIndex:l),b=d.fieldAliasMap;b||en("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(l)||en("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ie&&(d.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||en("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[l].includes("|")&&en("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const S=t=>{const{beforeOpen:r}=d,i=(null!=r?r:kn)({[Z]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},w=()=>{oe(!1,(()=>ue(I.current)))},C=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;var r;if(se(n)&&Object.keys(n).length)for(const t in n){const i=n[t],l=g.find((e=>e.dataIndex===t));if(l){jl(e,t,i,l.precision);const n=null===(r=l.editRender)||void 0===r?void 0:r.call(l,e,l);n&&Array.isArray(n.rules)&&y(n.rules,i,u,t)}else jl(e,t,i)}jl(e,l,t,a),y(c,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e),ae()},T={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"30%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{w()}},R=Object.assign(Object.assign({},d),{defaultSelectedKeys:[v],size:f,onClose:e=>{e?(e=>{const t={};for(const n in x){const r=x[n];n!==l&&(t[n]=Vl(e,r))}const n=x[l]?Vl(e,x[l]):"";C(n,t);const{closed:r}=d;oe(!1,(()=>ue(I.current))),de(),null==r||r(e)})(e):w()}});return t.createElement(t.Fragment,null,t.createElement(Ku,{ref:A,value:v,allowClear:null===(i=s.allowClear)||void 0===i||i,readOnly:s.readOnly,disabled:s.disabled,placeholder:s.placeholder||Xt("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyUp:t=>{var n;if(13===t.keyCode){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==m||m({[Z]:r},e)}},onDoubleClick:()=>{S()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?S():C(""))}}),t.createElement(dl,T,t.createElement(cp,R)))},"tree-helper-multiple":(e,n)=>{var r;const{dataIndex:i}=n,{type:l,extra:a={},items:o=[],rules:s=[],helper:c={},onInput:d,onChange:h,onEnter:m}=N,g=ql(e,i),v=c.fieldAliasMap;v||en("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||en("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:kn)({[Z]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{oe(!1,(()=>ue(I.current)))},w=t=>{jl(e,i,t),y(s,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e,F.current),ae()},T={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:xe({},c.initialValue),defaultSelectedKeys:g,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=b;ce(e);const r=F.current.map((e=>({text:e[t],value:e[n]})));U(r),w(r.map((e=>e.value)));const{closed:i}=c;oe(!1,(()=>ue(I.current))),null==i||i(F.current)})(e):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement($,{mode:"multiple",open:!1,value:g,placeholder:a.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:a.allowClear,maxTagCount:a.collapseTags?"responsive":void 0,maxTagTextLength:a.maxTagTextLength,disabled:a.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==m||m({[Z]:g},e))},onDoubleClick:()=>{a.disabled||x()},onChange:e=>{const{valueKey:t}=b;ce(F.current.filter((n=>e.includes(n[t])))),w(e)}},B.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:a.disabled,icon:t.createElement(Xe,null),onClick:()=>{x()}})))),t.createElement(dl,T,t.createElement(cp,R)))},custom:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],render:o,onChange:s}=N;if(!o)return en("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const c=ql(e,r),d=t=>{jl(e,r,t),y(a,t,u,p),pe(e,u,p),null==s||s({[Z]:t},e),ae()},h=o(e,n,d);return t.isValidElement(h)?t.cloneElement(h,{value:c,disabled:l.disabled,readOnly:l.readOnly,popupClassName:E,onChange:d}):null}};return t.createElement(t.Fragment,null,re?(()=>{const{type:e}=N,n=fe[e];if(!n)return en("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!J}];return t.createElement("div",{ref:I,className:Fe(r)},n(d,c),!J&&t.createElement("div",{className:"cell-error"},ee||te))})():(()=>{const{disabled:n,extra:r={}}=N,{disabledColor:i,disabledBgColor:l}=r,a=["cell--show",{"is-cell-bg":n&&l}];return t.createElement(t.Fragment,null,t.createElement("span",{className:Fe(a),style:{color:n?i:""}},e.children),n&&l&&t.createElement("i",{className:"cell--bg",style:{background:l}}))})(),ne&&t.createElement("i",{className:"cell--sign"}))}));zu.displayName="CellEdit";const Wu=function(e){if(!t.isValidElement(e))return null;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.cloneElement(e,...r)},Bu=e=>{const{text:n,options:r,showMessage:i=!0,onCopy:l}=e;return Wu(e.children,{onClick:a=>{const o=t.Children.only(e.children),s=$t(n,r);null==l||l(n,s),s&&i&&L.success(Xt("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(a)}})};Bu.displayName="QmCopyToClipboard";const Uu=t.forwardRef(((n,r)=>{const{column:i,row:l,rowIndex:a,columnIndex:o,rowKey:s,showTitle:c}=n,{selectionKeys:d,treeExpandIndex:u,updateMark:p,isTreeTable:h}=t.useContext(vd),{dataIndex:m,canCopy:f,render:g,editRender:v,shouldCellUpdate:y}=i,{t:b}=Vd(),{renderText:x,getTitleFromCellNode:E}=Yd(),S=t.useRef(null),w=ql(l,m),[C,T]=function(t,n,r){const i=e.useRef({});return"value"in i.current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value}((()=>{const e=g?g(w,l,i,a,o):x(w,i,l);return[e,v?t.createElement(zu,{ref:r,column:i,record:l,rowKey:s,columnKey:m},e):null]}),[p,l,w,g,v],((e,t)=>{if(y){const[,n]=e,[,r]=t;return y(r,n,l)}return m===Hd.operationColumn||!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new Set;return function e(t,i){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(r.has(t))return!1;if(t===i)return!0;if(n&&l>1)return!1;r.add(t);const a=l+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],i[n],a))return!1;return!0}if(t&&i&&"object"==typeof t&&"object"==typeof i){const n=Object.keys(t);return n.length===Object.keys(i).length&&n.every((n=>e(t[n],i[n],a)))}return!1}(e,t)}(e,t,!0)}));t.useEffect((()=>{if([Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(m))return;const e=S.current.parentNode;c?e.title=E(C):e.removeAttribute("title")}),[c,C]);const N=e=>Array.isArray(e.children);return t.createElement("div",{ref:S,className:"cell"},(()=>{if(m===Hd.expandableColumn)return t.createElement(ju,{record:l,rowKey:s});if(m===Hd.selectionColumn)return t.createElement(qu,{selectionKeys:d,column:i,record:l,rowKey:s});if(T)return T;if(h&&m===u)return t.createElement(t.Fragment,null,(e=l._level)?t.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*Hd.treeTable.textIndent+"px"}}):null,t.createElement(ju,{key:"expand",record:l,rowKey:s,style:N(l)?{}:{visibility:"hidden"}}),C);var e;if(f){const e=E(C);return t.createElement("div",{className:"cell--copy"},t.createElement("span",{className:"text"},C),e&&t.createElement(Bu,{text:e},t.createElement(ct,{className:"icon",title:b("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return C})())}));Uu.displayName="Cell";const Gu={startX:0,startY:0,startOffsetX:0,startOffsetY:0,containerSizeX:0,containerSizeY:0},Yu={open:!1,offsetX:0,offsetY:0},Xu=t.forwardRef(((e,n)=>{const{tableRef:r,getRowKey:i,flattenColumns:l,mergedTdCells:a,setMergedCells:o}=t.useContext(vd),{areaSelection:s={}}=r.current.props,{elementStore:c,tableFlatData:d}=r.current,{t:u}=Vd(),p=t.useRef(document.onselectstart),h=t.useRef(null),m=t.useRef(null),[f,g]=t.useState(null),[v,y]=t.useState(null),[b,x]=t.useState(null);$u({ref:h,handler:()=>D()});const E=t.useRef(Gu),S=e=>{E.current=Object.assign({},E.current,e)};t.useEffect((()=>{const e=Lt(c.$tableBody,"mousedown",L),t=Lt(c.$tableBody,"contextmenu",O),n=Lt(document,"keydown",k);return()=>{e.remove(),t.remove(),n.remove()}}),[]);const w=()=>{g(null),y(null),x(null)};t.useImperativeHandle(n,(()=>({blur:w})));const C=()=>c.$tableBody.parentNode,T=e=>{const{offsetLeft:t,offsetTop:n,offsetWidth:r,offsetHeight:i}=e;return{rowKey:e.parentNode.getAttribute("data-row-key"),colIndex:Number(e.getAttribute("data-col-index")),l:t,t:n,w:r,h:i}},N=Wi(((e,t)=>{let n=null;const r=c.$tableBody.querySelectorAll("tbody > tr");for(let i=0;i<r.length;i++){if(r[i].offsetTop>t||r[i].offsetTop+r[i].offsetHeight<t)continue;const l=r[i].querySelectorAll("td");for(let t=0;t<l.length;t++)if(!(l[t].offsetLeft>e||l[t].offsetLeft+l[t].offsetWidth<e)){n=l[t];break}break}n&&y(T(n))}),5),I=Rd((()=>{const e=[];if(!f||!v)return e;const[t,n]=[f.colIndex,v.colIndex],[r,a]=[f.rowKey,v.rowKey];let[o,s]=[0,0];for(let e=0;e<d.length;e++){const t=i(d[e],d[e].index);if(t==r&&(o=e),t==a){s=e;break}}const c=l.slice(Math.min(t,n),Math.max(t,n)+1);return d.slice(o,s+1).forEach((t=>{for(let n=0;n<c.length;n++){const{dataIndex:r}=c[n];e.push({rowKey:i(t,t.index),dataIndex:r,cellValue:ql(t,r)})}})),e})),R=e=>{var t;o(e),null===(t=s.onCellMerge)||void 0===t||t.call(s,e),An((()=>w()))},O=Rd((e=>{s.cellMerge&&f&&H(e.clientX,e.clientY)?(e.preventDefault(),F(e)):(null==b?void 0:b.open)&&D()})),k=e=>{27===e.keyCode&&w()},L=Rd((e=>{e.stopPropagation();const t=(e=>{let t=e;for(;t;){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null})(e.target);if(1!==e.buttons||!t)return;D(),setTimeout((()=>{g(T(t)),y(T(t))}));const[n,r]=[c.$tableBody.getBoundingClientRect().top,C().getBoundingClientRect().left],{offsetWidth:i,offsetHeight:l}=C();S({startX:e.clientX,startY:e.clientY,startOffsetX:e.clientX-r,startOffsetY:e.clientY-n,containerSizeX:i,containerSizeY:l}),document.addEventListener("mousemove",A),document.addEventListener("mouseup",P),p.current=document.onselectstart,document.onselectstart=()=>!1})),A=e=>{const t=e.clientX-E.current.startX,n=e.clientY-E.current.startY,r=E.current.startOffsetX+t,i=E.current.startOffsetY+n;N(Math.min(r,E.current.containerSizeX),Math.min(i,E.current.containerSizeY))},P=()=>{var e;S(Gu),null===(e=s.onSelectChange)||void 0===e||e.call(s,I()),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",P),_()},_=()=>{document.onselectstart!==p.current&&(document.onselectstart=p.current)},H=(e,t)=>{const{top:n,left:r}=C().getBoundingClientRect(),[i,l]=[e-r,t-n],{el:a,et:o,ew:s,eh:c}=q();return!(i<a||i>a+s||l<o||l>o+c)},F=e=>{const{top:t,left:n,height:r}=m.current.getBoundingClientRect();x({open:!0,offsetX:e.clientX-n,offsetY:-1*(r-(e.clientY-t))})},D=()=>{x((e=>Object.assign(Object.assign({},e),{open:!1})))},$=()=>{if(!f||!v||(t=v,(e=f).rowKey===t.rowKey&&e.colIndex===t.colIndex))return w();var e,t;const[n,r]=f.t<=v.t?[f.rowKey,v.rowKey]:[v.rowKey,f.rowKey],[o,s]=[f.colIndex,v.colIndex];let[c,u]=[0,0],p=n;for(let e=0;e<d.length;e++){const t=d[e],l=i(t,t.index);if(l==n&&(p=l,c=e),l==r){u=e;break}}const h={rowKey:p,dataIndex:l[Math.min(o,s)].dataIndex,rowSpan:u-c+1,colSpan:Math.abs(s-o+1)};R([...a.filter((e=>!(e.rowKey===h.rowKey&&e.dataIndex===h.dataIndex))),h])},M=()=>{let e=f.rowKey;const t=f.colIndex;for(let t=0;t<d.length;t++){const n=d[t],r=i(n,n.index);if(r==e){e=r;break}}const n=e,r=l[t].dataIndex;R(a.filter((e=>!(e.rowKey===n&&e.dataIndex===r))))},q=()=>{const{w:e,h:t,l:n,t:r}=f;let{w:i,h:l,l:a,t:o}=v;return i=a-n>0?a-n+i:Math.abs(a-n)+e,l=o-r>0?o-r+l:Math.abs(o-r)+t,a=a>n?n:a,o=o>r?r:o,{sl:n,st:r,sw:e,sh:t,el:a,et:o,ew:i,eh:l}},j=jn("table");return t.createElement("div",{className:`${j}--area-select`},(()=>{if(!f||!v)return null;const{sl:e,st:n,sw:r,sh:i,el:l,et:a,ew:o,eh:s}=q(),{open:c,offsetX:d,offsetY:p}=b||Yu,g=t.createElement("ul",{ref:h,className:"ant-dropdown-menu"},t.createElement("li",{className:"ant-dropdown-menu-item",onClick:$},u("qm.table.areaSelect.mergeCell")),t.createElement("li",{className:"ant-dropdown-menu-item",onClick:M},u("qm.table.areaSelect.cancelMerge")));return t.createElement(t.Fragment,null,t.createElement("div",{className:"active-area",style:{left:e,top:n,width:r,height:i}}),t.createElement(Ms,{popupVisible:c,popup:g,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:"table-editable__popper",builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,p+4],overflow:{adjustX:1,adjustY:1}}}},t.createElement("div",{ref:m,className:"checked-area",style:{left:l,top:a,width:o,height:s}})))})())}));Xu.displayName="AreaSelect";const Zu=t.forwardRef(((e,n)=>{const{tableFlatColumns:r,tableData:i}=e,{getRowKey:l,tableRef:a,flattenColumns:o,editableColumns:s,leftFixedColumns:c,rightFixedColumns:d,derivedMergeCells:u,sorter:p,layout:h,showFooter:m,scrollX:f,scrollY:g,selectionKeys:v,rowExpandedKeys:y,highlightKey:b,isPingLeft:x,isPingRight:E,isTableEmpty:S,isTreeTable:w,isGroupSubtotal:C,isWebPagination:T,setElementStore:N,createTableFullData:I,setSelectionKeysEffect:R,setHighlightKey:O,getStickyLeft:k,getStickyRight:L,scrollXToColumn:A,scrollYToRecord:P,rowInViewport:_,dataChange:H,setPingLeft:F,setPingRight:D,setFullScreen:$,findParentRowKeys:M,getAllChildRowKeys:q,triggerScrollXEvent:j,triggerScrollYEvent:V,scrollBottomDebouncer:K}=t.useContext(vd),{height:z,minHeight:W,maxHeight:B,rowHeight:U,rowSelection:G,rowHighlight:Y,expandable:X,stripe:Z,summation:Q,rowStyle:J,cellStyle:ee,spanMethod:te,tableConfig:ne,areaSelection:re,nativeScrollBar:ie,ellipsis:le,showHeader:ae,rowDraggable:oe,onRowClick:ce,onRowDblclick:de,onRowContextmenu:ue,onRowEnter:pe}=a.current.props,he=t.useRef(null),me=t.useRef({}),fe=t.useRef(null),ve=t.useRef(null),ye=t.useRef(null),be=t.useRef({prevST:0,prevSL:0}),xe=a.current.scrollXLoad?r:o,Ee=t.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:n,tableFullHeight:r,tableAutoHeight:i}=h,l={};return S&&Object.assign(l,{minHeight:"100px"}),W&&Object.assign(l,{minHeight:$l(W)-e-n+"px"}),B&&Object.assign(l,{maxHeight:$l(B)-e-n+"px"}),z||r||i?Object.assign(Object.assign({},l),{maxHeight:"",minHeight:"",height:`${t}px`}):l}),[z,B,W,S,h]),Se=t.useMemo((()=>{const{scrollYStore:e}=a.current,{viewportHeight:t,gutterWidth:n}=h;return Math.floor((f?t-n:t)/e.rowHeight)}),[h,f]),[we,Ce]=t.useState([]),Te=Mu();$u({ref:he,omitClassNames:[".table-editable__popper"],handler:()=>{var e;ke([]),null===(e=ye.current)||void 0===e||e.blur()}}),t.useImperativeHandle(n,(()=>({setClickedValues:ke,createFocus:Re,forceUpdate:Te}))),bi((()=>{we.length&&a.current.tableManager.focus(a.current.uid)}),[we]),t.useLayoutEffect((()=>{Ie();const e=Lt(document,"keydown",Ne);return()=>e.remove()}),[]);const Ne=Rd((e=>{var t,n,r,o,c,d,u;const{keyCode:p}=e;if(a.current.uid===(null===(t=a.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id)&&(27===p&&(ke([]),O(""),$(!1)),we.length&&(Oi(document.activeElement,he.current)||"INPUT"!==(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)))){if(13===p&&("radio"===(null==G?void 0:G.type)||Y)){const t=null!==(o=null!==(r=v[0])&&void 0!==r?r:b)&&void 0!==o?o:null,n=null!==(c=i.find((e=>l(e,e.index)===t)))&&void 0!==c?c:null;n&&(null==pe||pe(n,e))}if(38===p||40===p){Si(e);const{allTableData:t}=a.current,n=T?Hl(i):t,r=n.length;let o=n.findIndex((e=>l(e,e.index)===we[0]));const s=38===p?(--o+r)%r:++o%r,c=n[s],h=l(c,c.index);"radio"!==(null==G?void 0:G.type)||(null===(d=G.disabled)||void 0===d?void 0:d.call(G,c))||R([h]),Y&&!(null===(u=Y.disabled)||void 0===u?void 0:u.call(Y,c))&&O(h),_(s)||(38===p&&P(h,s),40===p&&P(h,Se>s+1?0:s+1-Se)),ke([h,we[1]])}if(9===p){if(Si(e),!s.length)return ke([]);const t=s.length;let n=s.findIndex((e=>e.dataIndex===we[1]));const r=++n%t,i=s[r].dataIndex;ke([we[0],i]),A(i)}}})),Ie=()=>{N("$tableBody",he.current),N("$tableXspace",fe.current),N("$tableYspace",ve.current)},Re=(e,t)=>{var n;null===(n=me.current[`${e}-${t}`])||void 0===n||n.focus()},Oe=(e,t,n)=>{var r,i;const{dataIndex:a}=n;if([Hd.expandableColumn,Hd.operationColumn].includes(a))return;const o=l(t,t.index);ke([o,a]);const s=null===(r=n.editRender)||void 0===r?void 0:r.call(n,t,n),c=s&&!s.disabled,{type:d,selectByClickRow:u=!0,disabled:p=On}=G||{};!d||p(t)||c||(u||a===Hd.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:r=!0,onSelect:i}=G||{};if("radio"===n&&R([e]),"checkbox"===n){const n=!v.includes(e),l=w&&!r?Ae(e,v,n):Le(e,v,n);R(l),null==i||i(n,t,l)}})(o,t),[Hd.selectionColumn].includes(a)||(!Y||(null===(i=Y.disabled)||void 0===i?void 0:i.call(Y,t))||c||O(o),null==ce||ce(t,n,e))},ke=e=>{ge(e,we)||Ce(e)},Le=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),Ae=(e,t,n)=>{var r;const{disabled:i}=G||{},{deriveRowKeys:l,recordsMap:o}=a.current,s=_l(l,e);let c=[],d=q((null==s?void 0:s.children)||[]);i&&(d=d.filter((e=>!o.has(e)||!i(o.get(e))))),c=n?[...new Set([...t,e,...d])]:t.filter((t=>![e,...d].includes(t)));return((null===(r=ta(l,e))||void 0===r?void 0:r.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=_l(l,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>c.includes(e.rowKey)));c=r?[...c,e]:c.filter((t=>t!==e))})),c},Pe=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((e=>{const i=e.index,o=l(e,e.index);if(r.push(_e(e,i,o,n)),null==X?void 0:X.expandedRowRender){const{expandedRowClassName:n,rowExpandable:l=kn}=X;y.includes(o)&&l(e)&&r.push(t.createElement("tr",{key:`expand_${o}`,className:"body--row-expanded"},t.createElement("td",{colSpan:xe.length,className:"body--column",style:{paddingLeft:G?2*Hd.selectionColumnWidth:Hd.selectionColumnWidth}},t.createElement("div",{className:Fe("cell",n)},X.expandedRowRender(e,i)))))}if(!a.current.scrollYLoad&&(e=>Array.isArray(e.children))(e)){const t="function"!=typeof(null==X?void 0:X.rowExpandable)||X.rowExpandable(e);y.includes(o)&&t&&r.push(...Pe(e.children,n+1))}})),r},_e=function(e,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const{disabled:l}=G||{},a=["body--row",Object.assign({"body--row-striped":Z&&n%2!=0,"body--row-selected":v.includes(r)&&!(null==l?void 0:l(e)),"body--row-current":b===r},C?Me(e._group):null)];return t.createElement("tr",{key:r,"data-row-key":r,className:Fe(a)},xe.map(((t,l)=>He(t,l,e,n,r,i))))},He=(e,n,r,i,l,s)=>{var u,h,m;const{isIE:f}=a.current,{dataIndex:g,fixed:v,align:y,className:b=""}=e;a.current.scrollXLoad&&(n=o.findIndex((e=>e.dataIndex===g)));const{rowSpan:x,colSpan:E}=De(r,e,i,n);if(!x||!E)return null;const S=null!==(u=e.ellipsis)&&void 0!==u?u:le,w=!f&&"left"===v,T=!f&&"right"===v,N=["body--column",{"col--ellipsis":S,"col--center":"center"===y,"col--right":"right"===y,"column--sort":!!p[g],"cell-fix-left":w,"cell-fix-right":T,"cell-fix-left-last":w&&(null===(h=c[c.length-E])||void 0===h?void 0:h.dataIndex)===g,"cell-fix-right-first":T&&(null===(m=d[0])||void 0===m?void 0:m.dataIndex)===g,[b]:!!b}],I=T&&E>1?o.slice(n+1,n+E).reduce(((e,t)=>e+(t.width||t.renderWidth||0)),0):0,R=f?null:{left:w?`${k(g)}px`:"",right:T?L(g)-I+"px":""},O=J?"function"==typeof J?J(r,i):J:null,A=ee?"function"==typeof ee?ee(r,e,i,n):ee:null,P=C?$e(r._group):null,_=Object.assign({},R,U?{height:U}:null,P,O,A);return t.createElement("td",{key:g,"data-col-index":n,rowSpan:x>1?x:void 0,colSpan:E>1?E:void 0,className:Fe(N),style:_,onClick:t=>Oe(t,r,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:r}=n;[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(r)||null==de||de(t,n,e)})(t,r,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:r}=n;[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(r)||null==ue||ue(t,n,e)})(t,r,e)},t.createElement(Uu,{ref:e=>me.current[`${l}-${g}`]=e,row:r,column:e,rowIndex:i,columnIndex:n,rowKey:l,depth:s,showTitle:S}))},De=(e,t,n,r)=>{let l=1,a=1;if("function"==typeof te){const o=te({row:e,column:t,rowIndex:n,columnIndex:r,tableData:i});if(Array.isArray(o)?(l=o[0],a=o[1]):se(o)&&(l=o.rowSpan,a=o.colSpan),e===i[0]&&0===l){l=1;for(let e=1;e<i.length;e++){const{rowSpan:n}=De(i[e],t,i[e].index,r);if(n>0)break;l++}}}if(u.length>0){const e=u.find((e=>e.row===n&&e.col===r));e&&(l=e.rowSpan,a=e.colSpan)}return{rowSpan:l,colSpan:a}},$e=e=>{var t;const{backgroundColor:n,color:r}=null!==(t=Q.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:r}},Me=e=>{const t=Q.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},qe=jn("table");return t.createElement(t.Fragment,null,t.createElement(Xi,{ref:a.current.scrollBarRef,wrapClassName:`${qe}--body-wrapper`,wrapStyle:Ee,native:ie,showTopScrollbar:null==ne?void 0:ne.doubleXScrollbar,onScroll:e=>{const{elementStore:t,scrollXLoad:n,scrollYLoad:r}=a.current,{prevST:i,prevSL:l}=be.current,o=g?h.gutterWidth:0,{scrollTop:s,scrollLeft:c}=e;if(c!==l){ae&&(t.$header.scrollLeft=c),m&&(t.$footer.scrollLeft=c);const e=c>0,n=Math.ceil(c)+h.tableWidth<h.tableBodyWidth+o;x!==e&&F(e),E!==n&&D(n)}if(r&&s!==i&&V(s),n&&c!==l&&j(c),g&&s!==i){const n=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(s)+h.viewportHeight-o>=n&&K({type:"scroll",target:e,preventDefault:On,stopPropagation:On})}be.current.prevST=s,be.current.prevSL=c}},t.createElement("div",{ref:ve,className:"body--y-space"}),t.createElement("div",{ref:fe,className:"body--x-space",style:{width:g?h.tableBodyWidth-h.gutterWidth:h.tableBodyWidth}}),t.createElement(_u.Provider,{value:we},t.createElement("table",{ref:he,className:`${qe}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0",style:{width:0}},t.createElement("colgroup",null,xe.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})}))),oe?t.createElement(Vt,{itemKey:e=>l(e,e.index),tag:"tbody",animation:200,list:i,setList:e=>{const t=e.map((e=>l(e,e.index))),n=i.map((e=>l(e,e.index)));if(ge(t,n))return;const r=ia(e),o=[];a.current.tableFullData.forEach((e=>{i.includes(e)?o.push(r.shift()):o.push(e)})),I(o),H()}},i.map((e=>_e(e,e.index,l(e,e.index))))):t.createElement("tbody",null,Pe(i)))),!!re&&t.createElement(Xu,{ref:ye})))}));Zu.displayName="TableBody";const Qu=e=>{const{summationRows:n}=e,{tableRef:r,sorter:i,layout:l,scrollY:a,flattenColumns:o,leftFixedColumns:s,rightFixedColumns:c,setElementStore:d,getStickyLeft:u,getStickyRight:p}=t.useContext(vd),{footRender:h}=r.current.props,m=t.useRef(null);t.useLayoutEffect((()=>{f()}),[]);const f=()=>{d("$footer",m.current)},g=(e,n,o)=>{var d,h;const{isIE:m}=r.current,{gutterWidth:f}=l,{dataIndex:g,fixed:v,align:y,summation:b}=e,x=["footer--column","col--ellipsis",{"col--center":"center"===y,"col--right":"right"===y,"column--sort":!!i[g],"cell-fix-left":!m&&"left"===v,"cell-fix-right":!m&&"right"===v,"cell-fix-left-last":!m&&"left"===v&&(null===(d=s[s.length-1])||void 0===d?void 0:d.dataIndex)===g,"cell-fix-right-first":!m&&"right"===v&&(null===(h=c[0])||void 0===h?void 0:h.dataIndex)===g}],E=m?null:{left:"left"===v?`${u(g)}px`:"",right:"right"===v?`${p(g)+(a?f:0)}px`:""},S=(null==b?void 0:b.render)?b.render(r.current.tableFullData):ql(n,`${g}_text`),w=0===o&&""===S?Xt("qm.table.config.summaryText"):S;return t.createElement("td",{key:g,title:w,className:Fe(x),style:Object.assign({},E)},t.createElement("div",{className:"cell"},w))},v=jn("table"),{tableBodyWidth:y}=l;return t.createElement("div",{ref:m,className:`${v}--footer-wrapper`},h?h(o,r.current.tableFullData):t.createElement("table",{className:`${v}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:y?`${y}px`:""}},(()=>{const{gutterWidth:e}=l;return t.createElement("colgroup",null,o.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})})),a&&t.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t.createElement("tfoot",null,(()=>{const{isIE:e}=r.current,i=["gutter",{"cell-fix-right":!!c.length}],l=e?null:{right:c.length?0:""};return n.map(((e,n)=>t.createElement("tr",{key:n,className:"footer--row"},o.map(((t,n)=>g(t,e,n))),a&&t.createElement("td",{className:Fe(i),style:Object.assign({},l)}))))})())))};var Ju;!function(e){e.small="small",e.middle="default",e.large="default"}(Ju||(Ju={}));const ep=e=>{var n,r,i,l;const{current:a,pageSize:o,total:s,onChange:c}=e,{global:d}=t.useContext(Bt),{tableRef:u,$size:p,setElementStore:h}=t.useContext(vd),{uniqueKey:m,paginationConfig:f,infoBarConfig:g}=u.current.props,v=t.useRef(null),y=t.useMemo((()=>m?`tablePager_${m}`:""),[m]);t.useLayoutEffect((()=>{b(),w()}),[]);const b=()=>{h("$pager",v.current)},x=null!==(n=null==f?void 0:f.showSizeChanger)&&void 0!==n?n:Hd.pagination.showSizeChanger,E=null!==(r=null==f?void 0:f.showQuickJumper)&&void 0!==r?r:Hd.pagination.showQuickJumper,S=(null==f?void 0:f.pageSizeOptions)||(null===(l=null===(i=null==d?void 0:d.table)||void 0===i?void 0:i.pagination)||void 0===l?void 0:l.pageSizeOptions)||Hd.pagination.pageSizeOptions,w=()=>Tn(void 0,void 0,void 0,(function*(){if(!y)return;const e=yield C(y);e&&e!==o&&(c(a,e),localStorage.setItem(y,e.toString()))})),C=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t&&!localStorage.getItem(y))try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),T=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),N={[`${jn("table")}-pager`]:!0};return t.createElement("div",{ref:v,className:Fe(N)},t.createElement("div",{className:"pager-alert"},"bottom"===(null==g?void 0:g.position)&&t.createElement(Bd,{total:s})),t.createElement(ee,{size:Ju[p],showSizeChanger:x,showQuickJumper:E,pageSizeOptions:S,current:a,pageSize:o,total:s,onChange:(e,t)=>{c(e,t)},onShowSizeChange:(e,t)=>{y&&(T(y,t),localStorage.setItem(y,`${t}`))}}))},tp=()=>{const{layout:e}=t.useContext(vd),n=t.useMemo((()=>{const{headerHeight:t,viewportHeight:n}=e;return{top:`${t}px`,height:`${n}px`}}),[e]),r=jn("table");return t.createElement("div",{className:`${r}--empty`,style:n},t.createElement(Fi,null))},np=()=>{const{setElementStore:e}=t.useContext(vd),n=t.useRef(null);t.useLayoutEffect((()=>{r()}),[]);const r=()=>{e("$resizableBar",n.current)},i=jn("table");return t.createElement("div",{ref:n,className:`${i}--resizable-bar`})},rp=t.forwardRef(((e,n)=>{const r=((e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((n,r)=>(n[r]=void 0!==t[r]?t[r]:e[r],n)),{})))(bd,e),{rowKey:i,columns:l,loading:a,resizable:o,customClass:s,areaSelection:c,tablePrint:d,exportExcel:u,infoBarConfig:p,topSpaceAlign:h,showTableInfo:m,showFullScreen:f,showRefresh:g,showToolBox:v,showHeader:y}=r,{size:b}=t.useContext(Bt),x=t.useMemo((()=>{var e,t;return null!==(t=null!==(e=r.size)&&void 0!==e?e:b)&&void 0!==t?t:""}),[r.size,b]),E=t.useRef(null),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),T=t.useRef(null),N=Rd(((e,t)=>{const n="function"==typeof i?i(e,t):null==e?void 0:e[i];return void 0===n?(en("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),{tableRef:I,tableFullData:R,setElementStore:O,setOriginColumns:k,setTableFullData:L,setTableOriginData:A,setTableFlatData:P,setAllTableData:_,setDeriveRowKeys:H,setInvalidRowKeys:F,setFieldAuth:D,setColumnsDefined:$,setScrollXStore:M,setScrollYStore:q,setScrollXLoad:j,setScrollYLoad:V,setResizeState:K,setHandleState:z,setSummaries:W,setSelectionRows:B,setShouldToTop:U,setRecordsMap:G,setUnMounted:Y,clearElementStore:X,clearRecordsMap:Z}=((e,n)=>{let{getRowKey:r,$size:i}=n;const{rowHeight:l,dynamicThead:a}=e,o=t.useRef({props:e,uid:Ld(),tableManager:Pd,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],tableFlatData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!a,scrollBarRef:t.createRef(),scrollXStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0},scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:l||Hd.rowHeightMaps[i]},store:new _d,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},treeTable:!1,scrollXLoad:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],recordsMap:new Map,unMounted:!1,isIE:!Nn&&/MSIE|Trident/.test(navigator.userAgent)});var s;s=e,o.current.props=s;const c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return e.map((e=>{const a=r(e,e.index),o=n?`${n}#${a}`:`${a}`,s=i?`${i}.${e.index+1}`:`${e.index+1}`,d={level:l,rowKey:a,rowKeyPath:o,indexPath:s};return e.indexPath=s,e._level=l,Array.isArray(e.children)&&(d.children=c(e.children,a,o,s,l+1)),t?Object.assign({},d,{parentRowKey:t}):d}))},d=e=>{const t=[];return e.forEach((e=>{Array.isArray(e.children)?t.push(...d(e.children)):t.push(e.rowKey)})),t};return Object.assign(Object.assign({tableRef:o},o.current),{setElementStore:(e,t)=>{o.current.elementStore[e]=t},setOriginColumns:e=>{o.current.originColumns=e},setTableFullData:e=>{o.current.tableFullData=e},setTableFlatData:e=>{o.current.tableFlatData=e},setTableOriginData:e=>{o.current.tableOriginData=e},setAllTableData:e=>{const t=Hl(e);o.current.allTableData=t,o.current.allRowKeys=t.map((e=>r(e,e.index)))},setDeriveRowKeys:e=>{const t=o.current.tableFullData.some((e=>Array.isArray(e.children)));o.current.treeTable=t,o.current.deriveRowKeys=t?c(e,""):[],o.current.flattenRowKeys=t?d(o.current.deriveRowKeys):[]},setInvalidRowKeys:e=>{o.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{o.current.fieldAuth[e]=t},setColumnsDefined:e=>{o.current.columnsDefined=e},setScrollXStore:e=>{o.current.scrollXStore=e},setScrollYStore:e=>{o.current.scrollYStore=e},setResizeState:e=>{o.current.resizeState=e},setHandleState:e=>{o.current.handleState=e},setSummaries:e=>{o.current.summaries=e},setScrollXLoad:e=>{o.current.scrollXLoad=e},setScrollYLoad:e=>{o.current.scrollYLoad=e},setShouldToTop:e=>{o.current.shouldToTop=e},setSelectionRows:e=>{o.current.selectionRows=e},setRecordsMap:(e,t)=>{o.current.recordsMap.set(e,t)},setUnMounted:e=>{o.current.unMounted=e},clearElementStore:()=>{for(const e in o.current.elementStore)o.current.elementStore[e]=null},clearRecordsMap:()=>{o.current.recordsMap.clear()}})})(r,{getRowKey:N,$size:x}),{tableData:Q,setTableData:J,tableFlatColumns:ee,setTableFlatColumns:te,filters:ne,setFilters:re,sorter:ie,setSorter:le,superFilters:ae,setSuperFilters:oe,pagination:ce,setPagination:de,selectionKeys:ue,setSelectionKeys:pe,rowExpandedKeys:he,setRowExpandedKeys:me,highlightKey:fe,setHighlightKey:ye,updateMark:be,forceUpdate:xe,mergedTdCells:Ee,setMergedCells:Se,layout:we,setLayout:Ce,permission:Te,setPermission:Ne,spinning:Ie,setSpinning:Re,scrollX:Oe,setScrollX:ke,scrollY:Le,setScrollY:Ae,isPingLeft:Pe,setPingLeft:_e,isPingRight:He,setPingRight:De,isFullScreen:$e,setFullScreen:Me,updateTableData:qe}=(e=>{var n,r,i,l,a,o,s,c,d,u,p;const{uniqueKey:h,nativeScrollBar:m,initialSorter:f={},initialFilter:g={},paginationConfig:v,rowSelection:y,expandable:b,rowHighlight:x,mergedCells:E}=e,{global:S}=t.useContext(Bt),w={current:null!==(n=null==v?void 0:v.current)&&void 0!==n?n:Hd.pagination.current,pageSize:null!==(o=null!==(i=null!==(r=(()=>{if(h)return Number(localStorage.getItem(`tablePager_${h}`))||void 0})())&&void 0!==r?r:null==v?void 0:v.pageSize)&&void 0!==i?i:null===(a=null===(l=null==S?void 0:S.table)||void 0===l?void 0:l.pagination)||void 0===a?void 0:a.pageSize)&&void 0!==o?o:Hd.pagination.pageSize,total:0},C=null!==(c=null!==(s=null==y?void 0:y.selectedRowKeys)&&void 0!==s?s:null==y?void 0:y.defaultSelectedRowKeys)&&void 0!==c?c:[],T=null!==(u=null!==(d=null==b?void 0:b.expandedRowKeys)&&void 0!==d?d:null==b?void 0:b.defaultExpandedRowKeys)&&void 0!==u?u:[],[N,I]=t.useState([]),[R,O]=t.useState([]),[k,L]=t.useReducer(((e,t)=>ge(e,t)?e:t),g),[A,P]=t.useReducer(((e,t)=>ge(e,t)?e:t),f),[_,H]=t.useReducer(((e,t)=>ge(e,t)?e:t),[]),[F,D]=t.useState(w),[$,M]=t.useReducer(((e,t)=>ge(e,t)?e:t),C),[q,j]=t.useReducer(((e,t)=>ge(e,t)?e:t),T),[V,K]=t.useState(null!==(p=null==x?void 0:x.currentRowKey)&&void 0!==p?p:""),[z,W]=t.useReducer((e=>e+1),0),[B,U]=Dd([],{value:E}),[G,Y]=t.useState({gutterWidth:m?Md():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[X,Z]=t.useState({export:!0,import:!0,print:!0}),[Q,J]=t.useState(!1),[ee,te]=t.useState(!1),[ne,re]=t.useState(!1),[ie,le]=t.useState(!1),[ae,oe]=t.useState(!1),[se,ce]=t.useState(!1);return{tableData:N,setTableData:I,tableFlatColumns:R,setTableFlatColumns:O,filters:k,setFilters:L,sorter:A,setSorter:P,superFilters:_,setSuperFilters:H,pagination:F,setPagination:D,selectionKeys:$,setSelectionKeys:M,rowExpandedKeys:q,setRowExpandedKeys:j,highlightKey:V,setHighlightKey:K,updateMark:z,forceUpdate:W,mergedTdCells:B,setMergedCells:U,layout:G,permission:X,setPermission:Z,setLayout:Y,spinning:Q,setSpinning:J,scrollX:ee,setScrollX:te,scrollY:ne,setScrollY:re,isPingLeft:ie,setPingLeft:le,isPingRight:ae,setPingRight:oe,isFullScreen:se,setFullScreen:ce,updateTableData:()=>I([...N])}})(r),{isFetch:je,isWebPagination:Ve,isScrollPagination:Ke,showPagination:ze,shouldUpdateHeight:We,tableColumns:Be,flattenColumns:Ue,editableColumns:Ge,summationColumns:Ye,leftFixedColumns:Xe,rightFixedColumns:Ze,derivedMergeCells:Qe,treeExpandIndex:Je,showSummary:et,showFooter:tt,isHeadGroup:nt,bordered:rt,isHeadSorter:it,isHeadFilter:lt,isServiceSummation:at,isSelectCollection:ot,isTableImport:st,isTableClipboard:ct,isSuperSearch:dt,isFastSearch:ut,isGroupSummary:pt,isGroupSubtotal:ht,isTreeTable:mt,isTableEmpty:ft,summationRows:gt,fetchParams:vt}=jd(r,{getRowKey:N,tableRef:I,tableFullData:R,tableData:Q,sorter:ie,filters:ne,superFilters:ae,selectionKeys:ue,pagination:ce,mergedTdCells:Ee}),{createElementStore:yt,tableStyles:bt,getSpan:xt,getStickyLeft:Et,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Ct,rowInViewport:Tt,calcTableHeight:Nt,resetTableScroll:It,computeVirtualX:Rt,computeVirtualY:Ot,doLayout:kt}=zd(r,{getRowKey:N,tableRef:I,topElementRef:E,tableElementRef:S,$size:x,tableColumns:Be,flattenColumns:Ue,leftFixedColumns:Xe,derivedMergeCells:Qe,layout:we,scrollX:Oe,scrollY:Le,showFooter:tt,showPagination:ze,isFullScreen:$e,setLayout:Ce,setScrollX:ke,setScrollY:Ae,setElementStore:O,setScrollXStore:M,setScrollYStore:q,setShouldToTop:U}),{initialTable:Lt,checkDataIndex:At,createTableFullData:Pt,getTableData:_t,handleTableData:Ht,createWebPageData:Ft,createTableData:Dt,createGroupData:$t,createSelectionKeys:Mt,createRowExpandedKeys:qt,setSelectionKeysEffect:jt,findParentRowKeys:Vt,getAllChildRowKeys:Kt,doFieldValidate:zt,getTableLog:Wt,dataChange:Ut,tableChange:Gt,toLastPage:Yt,toFirstPage:Xt,getPageCount:Zt,pagerChangeHandle:Qt,triggerScrollXEvent:Jt,triggerScrollYEvent:tn,scrollBottomDebouncer:nn,clearTableSorter:rn,clearTableFilter:ln,clearSuperFilters:an,clearRowSelection:on,clearRowHighlight:sn,clearTableLog:cn,destroy:dn}=Kd(r,{getRowKey:N,tableRef:I,tableElementRef:S,tableBodyRef:w,$size:x,tableColumns:Be,flattenColumns:Ue,editableColumns:Ge,tableFullData:R,pagination:ce,layout:we,filters:ne,sorter:ie,superFilters:ae,fetchParams:vt,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,summationColumns:Ye,shouldUpdateHeight:We,isFetch:je,isTreeTable:mt,isWebPagination:Ve,isScrollPagination:Ke,isServiceSummation:at,isGroupSubtotal:ht,doLayout:kt,setTableData:J,setTableFlatColumns:te,setTableFullData:L,setTableOriginData:A,setTableFlatData:P,setAllTableData:_,setDeriveRowKeys:H,setPagination:de,setSpinning:Re,setSorter:le,setFilters:re,setSuperFilters:oe,setSelectionKeys:pe,setRowExpandedKeys:me,setHighlightKey:ye,setSelectionRows:B,setScrollXLoad:j,setScrollYLoad:V,setScrollXStore:M,setScrollYStore:q,computeVirtualX:Rt,computeVirtualY:Ot,setFieldAuth:D,setResizeState:K,setSummaries:W,setPermission:Ne,setRecordsMap:G,resetTableScroll:It,clearElementStore:X,clearRecordsMap:Z});((e,n)=>{const{columns:r,summation:i,rowSelection:l,expandable:a,rowHighlight:o}=e,{tableRef:s,tableBodyRef:c,$size:d,scrollX:u,pagination:p,selectionKeys:h,rowExpandedKeys:m,highlightKey:f,summationRows:g,showSummary:v,isWebPagination:y,isScrollPagination:b,isTreeTable:x,checkDataIndex:E,toLastPage:S,toFirstPage:w,getPageCount:C,setHandleState:T,scrollYToRecord:N,setSelectionKeysEffect:I,setOriginColumns:R,setRowExpandedKeys:O,setHighlightKey:k,setResizeState:L,setPingRight:A,setUnMounted:P,calcTableHeight:_,createSelectionKeys:H,createRowExpandedKeys:F,initialTable:D,destroy:$}=n,M=t.useRef(g);bi((()=>{if(!l)return;const{onChange:e}=l;"radio"===l.type&&c.current.setClickedValues(h.length?[h[0],""]:[]),h.__prevent__||null==e||e(h,s.current.selectionRows),delete h.__prevent__}),[h]),bi((()=>{if(!a)return;const{onChange:e}=a;m.__prevent__||null==e||e(m,m.map((e=>s.current.recordsMap.get(e)))),delete m.__prevent__}),[m]),bi((()=>{var e,t;x&&O(F()),o&&(c.current.setClickedValues(f?[f,""]:[]),null===(e=o.onChange)||void 0===e||e.call(o,f,null!==(t=s.current.recordsMap.get(f))&&void 0!==t?t:null))}),[f]),bi((()=>{var e;ge(g,M.current)||(M.current=g,v&&i&&(null===(e=i.onChange)||void 0===e||e.call(i,g)))}),[g]),bi((()=>{const e=H(l.selectedRowKeys);ge(e,h)||(e.__prevent__=!0,I(e),x&&O(F()))}),[null==l?void 0:l.selectedRowKeys]),bi((()=>{const e=F(a.expandedRowKeys);ge(e,m)||(e.__prevent__=!0,O(e))}),[null==a?void 0:a.expandedRowKeys]),bi((()=>{const{currentRowKey:e}=o;e!==f&&k(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),bi((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(y&&("after"===e?S():w()),N("","after"===e?1e5:0)),t&&p.current>C()&&S(),(e||t)&&T({insert:null,remove:!1})}),[p.total]),bi((()=>{A(u)}),[u]),bi((()=>{_()}),[d]),bi((()=>{s.current.scrollYLoad&&(e.height||e.maxHeight||en("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||en("Table","必须设置组件参数 `ellipsis`")),b&&(e.height||e.maxHeight||en("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,b]),Wd({handler:()=>{const{resizeState:e}=s.current,{winHeight:t}=e,n=window.innerHeight;n!==t&&(L(Object.assign({},e,{winHeight:n})),_())},delay:16}),t.useEffect((()=>(R(Fn(r)),D(),E(),An((()=>_())),()=>{$(),P(!0)})),[])})(r,{tableRef:I,tableBodyRef:w,$size:x,scrollX:Oe,pagination:ce,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,showSummary:et,summationRows:gt,isWebPagination:Ve,isScrollPagination:Ke,isTreeTable:mt,checkDataIndex:At,toLastPage:Yt,toFirstPage:Xt,getPageCount:Zt,setHandleState:z,scrollYToRecord:Ct,setOriginColumns:k,setSelectionKeysEffect:jt,setRowExpandedKeys:me,setHighlightKey:ye,setResizeState:K,setPingRight:De,setUnMounted:Y,calcTableHeight:Nt,createSelectionKeys:Mt,createRowExpandedKeys:qt,initialTable:Lt,destroy:dn});const un=t.useMemo((()=>({getRowKey:N,tableRef:I,tableBodyRef:w,$size:x,flattenColumns:Ue,editableColumns:Ge,leftFixedColumns:Xe,rightFixedColumns:Ze,treeExpandIndex:Je,sorter:ie,filters:ne,superFilters:ae,layout:we,bordered:rt,showFooter:tt,showSummary:et,summationRows:gt,scrollX:Oe,scrollY:Le,pagination:ce,fetchParams:vt,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,mergedTdCells:Ee,derivedMergeCells:Qe,updateMark:be,isFetch:je,isPingLeft:Pe,isPingRight:He,isHeadSorter:it,isHeadFilter:lt,isFullScreen:$e,isTableEmpty:ft,isHeadGroup:nt,isTreeTable:mt,isGroupSubtotal:ht,isWebPagination:Ve,dataChange:Ut,tableChange:Gt,getTableData:_t,setElementStore:O,createWebPageData:Ft,createTableFullData:Pt,updateTableData:qe,setSorter:le,setFilters:re,setSuperFilters:oe,setHighlightKey:ye,setRowExpandedKeys:me,setSelectionRows:B,setSelectionKeysEffect:jt,setInvalidRowKeys:F,setMergedCells:Se,getSpan:xt,getStickyLeft:Et,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Ct,rowInViewport:Tt,setPagination:de,setPingLeft:_e,setPingRight:De,setSpinning:Re,setFullScreen:Me,setShouldToTop:U,doFieldValidate:zt,createTableData:Dt,createGroupData:$t,findParentRowKeys:Vt,getAllChildRowKeys:Kt,triggerScrollXEvent:Jt,triggerScrollYEvent:tn,scrollBottomDebouncer:nn,resetTableScroll:It,clearTableSorter:rn,clearTableFilter:ln,clearSuperFilters:an,clearRowSelection:on,clearRowHighlight:sn})),[x,Ue,Ge,Xe,Ze,Je,ie,ne,ae,we,rt,tt,et,gt,Oe,Le,ce,vt,ue,he,fe,Qe,be,je,Pe,He,it,lt,$e,ft,nt,mt,ht,Ve]);((e,n)=>{const{getRowKey:r,tableRef:i,toolBoxRef:l,tableBodyRef:a,columnFilterRef:o,flattenColumns:s,editableColumns:c,pagination:d,fetchParams:u,selectionKeys:p,rowExpandedKeys:h,highlightKey:m,isFetch:f,dataChange:g,getTableData:v,handleTableData:y,createTableData:b,createTableFullData:x,calcTableHeight:E,scrollXToColumn:S,scrollYToRecord:w,doFieldValidate:C,setTableOriginData:T,setHandleState:N,setColumnsDefined:I,setSelectionKeysEffect:R,setRowExpandedKeys:O,setHighlightKey:k,setSelectionRows:L,setOriginColumns:A,forceUpdate:P,getTableLog:_,clearRowSelection:H,clearRowHighlight:F,clearTableSorter:D,clearTableFilter:$,clearSuperFilters:M,clearTableLog:q}=n,{columns:j,columnsChange:V}=i.current.props,K=(e,t,n)=>e.filter((e=>{const i=r(e,e.index);e.children&&(e.children=K(e.children,t,n));const l=t.includes(i);return l&&(null==n||n(e,i)),!l}));t.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{E()},DO_REFRESH:e=>Tn(void 0,void 0,void 0,(function*(){f&&(yield v(),null==e||e())})),GET_LOG:()=>_(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{f||(H(),F(),D(),$(),M(),q(),b([]))},CLEAR_LOG:()=>{q()},CREATE_FOCUS:(e,t)=>{a.current.createFocus(e,t)},FORCE_UPDATE:()=>{P()},DO_EXPORT:()=>{l.current.exportHandle()},SCROLL_TO_RECORD:e=>{w(e)},SCROLL_TO_COLUMN:e=>{S(e)},SET_SELECTION:(e,t)=>{const n=[...e];t&&(n.__prevent__=!0),R(n)},SET_EXPANDABLE:(e,t)=>{const n=[...e];t&&(n.__prevent__=!0),O(n)},SET_HIGHLIGHT:e=>{k(e)},SET_SELECTION_ROWS:e=>{L(e)},SET_TABLE_DATA:e=>{y(e)},DEFINE_INITIAL_COLUMNS:e=>{A(e),I(!0),o.current.initialHandler()},SET_TABLE_COLUMN:(e,t,n)=>{const r=kl(j,e);if(!r)return en("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!se(t))return en("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(r.noAuth)return en("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&ve(r,e,t[e]);n&&(V?V([...j]):en("Table","需要设置 `columnsChange` 参数"),P())},INSERT_RECORDS:(e,t)=>{const{store:n,tableFullData:l}=i.current,a=(Array.isArray(e)?e:[e]).filter((e=>se(e)));if(!a.length)return;a.forEach((e=>{s.forEach((t=>{const{dataIndex:n}=t;[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(n)||jl(e,n,ql(e,n))})),n.addToInserted(e)}));const o="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey),d=l;if(c)o?d.unshift(...a):d.push(...a);else{const e=na(l,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?o?e.children.unshift(...a):e.children.push(...a):e.children=a)}c&&N(Object.assign({},i.current.handleState,{insert:o?"before":"after"})),b(d),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:n}=i.current,l=(Array.isArray(e)?e:[e]).map((e=>se(e)?r(e,e.index):e));if(!l.length)return;let a=!1;const o=K(n,l,((e,n)=>{t.addToRemoved(e),c.forEach((r=>{const{dataIndex:i,editRender:l}=r,a=null==l?void 0:l(e,r);if(!a)return;const{rules:o=[],disabled:s}=a;!s&&o.length&&(t.removeFromRequired({x:n,y:i}),t.removeFromValidate({x:n,y:i}),t.removeFromEdited({x:n,y:i}))})),a=!0}));a&&(N(Object.assign({},i.current.handleState,{remove:!0})),x(o),R(p.filter((e=>!l.includes(e)))),l.includes(m)&&F(),O(h.filter((e=>!l.includes(e)))),g(),An((()=>{T(K(i.current.tableOriginData,l))})))},VALIDATE_FIELDS:(e,t)=>{i.current.allTableData.forEach((n=>{c.forEach((i=>{const{dataIndex:l,editRender:a}=i,o=null==a?void 0:a(n,i);if(!o)return;const s=r(n,n.index);if(e&&!e.includes(s))return;if(t&&!t.includes(l))return;const{rules:c=[],disabled:d}=o;d||C(c,ql(n,l),s,l)}))}));const{required:n,validate:l}=_(),a=[...n,...l];return a.length&&w(a[0].rowKey),P(),{required:n,validate:l}}})))})(n,{getRowKey:N,tableRef:I,toolBoxRef:C,tableBodyRef:w,columnFilterRef:T,flattenColumns:Ue,editableColumns:Ge,pagination:ce,fetchParams:vt,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,isFetch:je,dataChange:Ut,getTableData:_t,handleTableData:Ht,createTableData:Dt,createTableFullData:Pt,calcTableHeight:Nt,scrollXToColumn:wt,scrollYToRecord:Ct,doFieldValidate:zt,setTableOriginData:A,setHandleState:z,setColumnsDefined:$,setSelectionKeysEffect:jt,setRowExpandedKeys:me,setHighlightKey:ye,setSelectionRows:B,setOriginColumns:k,forceUpdate:xe,getTableLog:Wt,clearRowSelection:on,clearRowHighlight:sn,clearTableSorter:rn,clearTableFilter:ln,clearSuperFilters:an,clearTableLog:cn}),t.useLayoutEffect((()=>{yt(),I.current.tableManager.register(I.current.uid,null!=n?n:{current:null})}),[]);const pn=jn("table"),hn={[`${pn}--wrapper`]:!0,[`${pn}--lg`]:"large"===x,[`${pn}--sm`]:"small"===x,[`${pn}--maximize`]:$e,[s]:!!s},mn={[pn]:!0,"is--border":rt,"is--fixed":Xe.length||Ze.length,"is--sortable":it,"is--filterable":lt,"is--head-group":nt,"is--area-select":!!c,"is--ping-left":Pe,"is--ping-right":He};return t.createElement(vd.Provider,{value:un},t.createElement("div",{className:Fe(hn)},m&&t.createElement("div",{ref:E,className:`${pn}-top`},t.createElement("div",{className:`${pn}-top__space`},"bottom"!==(null==p?void 0:p.position)&&t.createElement(Bd,{total:ce.total}),t.createElement("div",{className:`${pn}-top__space-slot`,style:{justifyContent:Id[h]}},r.children)),t.createElement("div",{className:`${pn}-top__actions`},t.createElement(wu,{ref:C,showFullScreen:f,showReload:g&&je,showPrint:Te.print&&!!d,showImport:Te.import&&st,showExport:Te.export&&!!u,showClipboard:ct,showCollection:ot,showFastSearch:ut,showSuperSearch:dt,showGroupSummary:pt,showToolBox:v,tableColumns:Be}),t.createElement(Tu,{ref:T,columns:l}))),t.createElement(Di,{spinning:null!=a?a:Ie},t.createElement("div",{ref:S,className:Fe(mn),style:bt},t.createElement("div",{className:`${pn}--main-wrapper`},y&&t.createElement(Pu,{tableColumns:Be,sorter:ie,filters:ne}),t.createElement(Zu,{ref:w,tableFlatColumns:ee,tableData:Q}),tt&&t.createElement(Qu,{summationRows:gt})),rt&&t.createElement("div",{className:`${pn}--border-line`}),ft&&t.createElement(tp,null),o&&t.createElement(np,null))),ze&&t.createElement(ep,vn({},ce,{onChange:(e,t)=>Qt({current:e,pageSize:t})}))))}));rp.displayName="QmTable";const ip=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:l,selectionRows:a,defaultSelectedKeys:o=[],filters:s=[],table:c={},className:d,style:u,onClose:p}=e,{size:h}=t.useContext(Bt),m=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:h)&&void 0!==n?n:""}),[e.size,h]),f=t.useRef(null),g=t.useRef(null),v=t.useRef(null),y=Vi(f),[b,x]=t.useState(c),[E,S]=t.useState(),[w,C]=t.useState(o),[T,N]=t.useState(!1),[I,R]=t.useState(300),[O,k]=t.useState(s),[L,A]=t.useState((e=>[{title:Xt("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[P,_]=t.useState(xe({},null===(n=c.fetch)||void 0===n?void 0:n.params,l)),[H,F]=t.useState([]),D=()=>{const e=f.current,t=e.querySelector(".form-wrap");R(e.offsetHeight-t.offsetHeight-2*no[m]-30)},$=Wi(D,5);zi((()=>{$()}),[y.width]),bi((()=>{ge(s,O)||k(s)}),[s]),t.useEffect((()=>{M()}),[P]),t.useEffect((()=>{a&&v.current.SET_SELECTION_ROWS(a)}),[a]),t.useEffect((()=>{var e;l&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(l))}),[]);const M=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=b;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:l,beforeFetch:a=kn}=n;if(a(P)){N(!0);try{const t=yield r(P);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,l))&&void 0!==e?e:[];i||(C([]),yield Ln(0)),F(n)}}catch(e){}N(!1)}})),q=e=>{i||(S(e),p(e))},j=e=>{_(Object.assign({},P,e))},V={[`${jn("search-helper")}--wrapper`]:!0},K=b.webPagination?{dataSource:H,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:P})};return t.createElement("div",{ref:f,className:Fe(V,d),style:u},t.createElement("div",{className:"form-wrap"},O.length?t.createElement(jc,{ref:g,items:O,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>D(),onFinish:e=>j(e),onReset:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||j(t)}))}):null),t.createElement("div",null,t.createElement(rp,vn({ref:v,uniqueKey:r,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},K,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:w,onChange:(e,t)=>{C(e),S(i?t:t[0])}},paginationConfig:b.paginationConfig,columnsChange:e=>A(e),onRowDblclick:q,onRowEnter:q}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>p(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!E,onClick:()=>p(E,i?w:void 0)},Xt("qm.dialog.confirm"))))};ip.displayName="SearchHelper";const lp=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...lp(e.children)),e.children&&t.push(e.value)})),t},ap=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=ap(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},op=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&op(e.children,t),t(e)||e.children&&e.children.length))),sp=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:l,selectionRows:a,defaultSelectedKeys:o=[],filters:s=[],table:c={},tree:d={},className:u,style:p,onClose:h}=e,{size:m}=t.useContext(Bt),f=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:m)&&void 0!==n?n:""}),[e.size,m]),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=Vi(g),[x,E]=t.useState(c),[S,w]=t.useState(),[C,T]=t.useState(o),[N,I]=t.useState(!1),[R,k]=t.useState(300),[L,A]=t.useState(300),[P,_]=t.useState(s),[H,F]=t.useState((e=>[{title:Xt("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[D,$]=t.useState(xe({},null===(n=c.fetch)||void 0===n?void 0:n.params,l)),[M,q]=t.useState([]),j=()=>{const e=g.current,t=e.querySelector(".form-wrap"),n=e.querySelector(".input-wrap");k(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*no[f]-30)},V=Wi(j,5);zi((()=>{V()}),[b.width]),bi((()=>{ge(s,P)||_(s)}),[s]),t.useEffect((()=>{K()}),[D]),t.useEffect((()=>{a&&y.current.SET_SELECTION_ROWS(a)}),[a]),t.useEffect((()=>{var e;l&&(null===(e=v.current)||void 0===e||e.SET_FIELDS_VALUE(l)),te()}),[]);const K=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=x;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:l,beforeFetch:a=kn}=n;if(a(D)){I(!0);try{const t=yield r(D);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,l))&&void 0!==e?e:[];i||(T([]),yield Ln(0)),q(n)}}catch(e){}I(!1)}})),z=e=>{i||(w(e),h(e))},W=e=>{$(Object.assign({},D,e))},[B,U]=t.useState([]),[G,Y]=t.useState([]),[X,Q]=t.useState(""),J=t.useRef(B),ee=t.useRef([]);bi((()=>{Y(lp(B))}),[B]);const te=()=>Tn(void 0,void 0,void 0,(function*(){var e;if(!d.fetch)return;const{api:t,params:n,dataKey:r,valueKey:i="value",textKey:l="text"}=d.fetch;try{const a=yield t(n);if(200===a.code){const t=Array.isArray(a.data)?a.data:null!==(e=me(a.data,r))&&void 0!==e?e:[],n=Sa(t,i,l);U(n),J.current=n,ee.current=t}}catch(e){}})),ne=e=>`${e}|${Ma.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${jn("tree-table-helper")}--wrapper`]:!0},ie=x.webPagination?{dataSource:M,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},x.fetch),{params:D})};return t.createElement("div",{ref:g,className:Fe(re,u),style:p},t.createElement(_i,{defaultValue:200,style:{height:"100%"}},t.createElement(_i.Pane,{min:100,style:{overflowY:"auto"}},t.createElement(O.Search,{className:"input-wrap",value:X,style:{marginBottom:8},placeholder:Xt("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=op(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==ne(n).indexOf(e)}));Q(e),U(t)})(e.target.value)}),t.createElement(Z,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:G,treeData:B,filterTreeNode:e=>{if(!X)return!1;const t=e.text||"";return-1!==ne(t).indexOf(X)},onExpand:e=>{Y(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return en("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const r in t)n[r]=me(e,t[r]);W(n)})(ap(ee.current,(n=>me(n,t)===e[0]))||{})}})),t.createElement(_i.Pane,{className:"split-pane"},t.createElement("div",{className:"form-wrap"},P.length?t.createElement(jc,{ref:v,items:P,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>j(),onFinish:e=>W(e),onReset:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA();e||W(t)}))}):null),t.createElement("div",null,t.createElement(rp,vn({ref:y,uniqueKey:r,height:L,columns:H,rowKey:x.rowKey||"pageIndex"},ie,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{T(e),w(i?t:t[0])}},paginationConfig:x.paginationConfig,columnsChange:e=>F(e),onRowDblclick:z,onRowEnter:z}))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[f]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>h(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!S,onClick:()=>h(S,i?C:void 0)},Xt("qm.dialog.confirm"))))};sp.displayName="TreeTableHelper";const cp=e=>{var n,r,i;const{multiple:l,tree:a={},defaultSelectedKeys:o,className:s,style:c,onClose:d}=e,{size:u}=t.useContext(Bt),p=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:u)&&void 0!==n?n:""}),[e.size,u]),[h,m]=t.useState(),[f]=t.useState(null===(n=a.fetch)||void 0===n?void 0:n.params),g={[`${jn("tree-helper")}--wrapper`]:!0},v=a.fetch?Object.assign(Object.assign({},Hn(a.fetch,["params","valueKey","textKey"])),{params:f}):void 0;return t.createElement("div",{className:Fe(g,s),style:c},t.createElement(gd,{multiple:l,fetch:v,fieldsDefine:{valueKey:null===(r=a.fetch)||void 0===r?void 0:r.valueKey,textKey:null===(i=a.fetch)||void 0===i?void 0:i.textKey},asyncLoad:a.asyncLoad,checkStrictly:a.checkStrictly,checkStrategy:a.checkStrategy,defaultSelectedKeys:o,defaultExpandAll:a.defaultExpandAll,onSelectChange:e=>m(e),onCheckChange:e=>m(e)}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>d(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!h,onClick:()=>d(h)},Xt("qm.dialog.confirm"))))};cp.displayName="TreeHelper";const dp="_startSign",up="_endSign",pp=e=>{var n;const{uniqueKey:r,initialValue:i,filters:l=[],table:a={},onClose:o}=e,{size:s}=t.useContext(Bt),c=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:s)&&void 0!==n?n:""}),[e.size,s]),d=t.useRef(null),u=t.useRef(null),p=t.useRef(null),h=Vi(d),[m,f]=t.useState(a),[g,v]=t.useState(!1),[y,b]=t.useState([]),[x,E]=t.useState(300),[S,w]=t.useState(l),[C,T]=t.useState((e=>[{title:Xt("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},{title:Xt("qm.form.rangeSearchHelper")[0],dataIndex:dp,width:80,align:"right",render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)},...e||(a.columns||[]),{title:Xt("qm.form.rangeSearchHelper")[1],dataIndex:up,fixed:"right",width:80,render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)}])()),[N,I]=t.useState(xe({},null===(n=a.fetch)||void 0===n?void 0:n.params,i)),[R,O]=t.useState([]),k=t.useMemo((()=>y.map((e=>null==e?void 0:e.pageIndex))),[y]),A=t.useMemo((()=>2===k.length&&k.every((e=>void 0!==e))),[k]),P=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");E(e.offsetHeight-t.offsetHeight-2*no[c]-30)},_=Wi(P,5);zi((()=>{_()}),[h.width]),bi((()=>{ge(l,S)||w(l)}),[l]),t.useEffect((()=>{H()}),[N]);const H=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=m;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:l=kn}=n;if(l(N)){v(!0);try{const t=yield r(N);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[];O(n)}}catch(e){}v(!1)}})),F=(e,t)=>{delete e[t]},D=()=>{y.forEach((e=>{e&&(F(e,dp),F(e,up))})),b([])},$=e=>{D(),I(Object.assign({},N,e))},M=jn("range-helper"),q=m.webPagination?{dataSource:R,loading:g,webPagination:!0}:{fetch:Object.assign(Object.assign({},m.fetch),{params:N})};return t.createElement("div",{ref:d,className:`${M}--wrapper`},t.createElement("div",{className:"form-wrap"},S.length?t.createElement(jc,{ref:u,items:S,initialValues:i,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>w(e),onCollapse:()=>P(),onFinish:e=>$(e),onReset:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();e||$(t)}))}):null),t.createElement("div",null,t.createElement(rp,vn({ref:p,height:x,columns:C,rowKey:m.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=k[0]&&e.pageIndex<=k[1]?{backgroundColor:"#f5f5f5"}:{}},q,{columnsChange:e=>T(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[dp,up].includes(n)&&(n===dp&&(e[n]?(F(e,n),b([void 0,y[1]])):e.pageIndex>k[1]?L.warning(Xt("qm.searchHelper.rangeStartTip")):(y[0]&&F(y[0],n),e[n]="[",b([e,y[1]]))),n===up&&(e[n]?(F(e,n),b([y[0],void 0])):e.pageIndex<k[0]?L.warning(Xt("qm.searchHelper.rangeEndTip")):(y[1]&&F(y[1],n),e[n]="]",b([y[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===k[0]&&(e[dp]="["),e.pageIndex===k[1]&&(e[up]="]")}))}}),t.createElement($n,{type:"primary",icon:t.createElement(xt,null),title:Xt("qm.table.alert.clear"),onClick:()=>D()}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[c]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>o(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!A,onClick:()=>o(y.map((e=>(e=>{const t={};for(const n in e)[dp,up].includes(n)||(t[n]=e[n]);return t})(e))))},Xt("qm.dialog.confirm"))))};pp.displayName="RangeTableHelper";const hp=e=>null!=e;function mp(e,n,r,i){const[l,a]=t.useState(void 0);t.useLayoutEffect((()=>{const t="function"==typeof e?e():e;a(t||null)}));const[o,s]=t.useState(null),c=()=>{if(l){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:r,right:i,bottom:l,left:a}=e.getBoundingClientRect();return r>=0&&a>=0&&i<=t&&l<=n})(l)&&n&&l.scrollIntoView(i);const{left:e,top:t,width:r,height:a}=l.getBoundingClientRect(),o={left:e,top:t,width:r,height:a,radius:0};s((e=>JSON.stringify(e)!==JSON.stringify(o)?o:e))}else s(null)};t.useLayoutEffect((()=>{c()}),[l,n]),Wd({handler:c});return[t.useMemo((()=>{if(!o)return o;const e=(null==r?void 0:r.offset)||6,t=(null==r?void 0:r.radius)||2;return{left:o.left-e,top:o.top-e,width:o.width+2*e,height:o.height+2*e,radius:t}}),[o,r]),l]}const fp=8;const gp={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},vp={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},yp=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function bp(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:l,visibleFirst:a}=e,o=t/2,s={};return Object.keys(gp).forEach((e=>{const c=r&&vp[e]||gp[e],d=Object.assign(Object.assign({},c),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,yp.has(e)&&(d.autoArrow=!1),e){case"top":case"topLeft":case"topRight":d.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+i}const u=function(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?fp:r}}({contentRadius:l,limitVerticalRadius:!0});if(r)switch(e){case"topLeft":case"bottomLeft":d.offset[0]=-u.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=u.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=-u.arrowOffsetHorizontal-o;break;case"leftBottom":case"rightBottom":d.offset[1]=u.arrowOffsetHorizontal+o}d.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};const i=r&&"object"==typeof r?r:{},l={};switch(e){case"top":case"bottom":l.shiftX=2*t.arrowOffsetHorizontal+n,l.shiftY=!0,l.adjustY=!0;break;case"left":case"right":l.shiftY=2*t.arrowOffsetVertical+n,l.shiftX=!0,l.adjustX=!0}const a=Object.assign(Object.assign({},l),i);return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}(e,u,t,n),a&&(d.htmlRegion="visibleFirst")})),s}const xp={fill:"transparent",pointerEvents:"auto"},Ep=e=>{const{prefixCls:n,rootClassName:r,pos:i,showMask:l,style:a={},fill:o="rgba(0,0,0,0.5)",open:s,animated:c,zIndex:d}=e,u=`${n}-mask-${Ld()}`,p="object"==typeof c?null==c?void 0:c.placeholder:c;return t.createElement(Mt,{open:s,autoLock:!0},t.createElement("div",{className:Fe(`${n}-mask`,r),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},a)},l?t.createElement("svg",{style:{width:"100%",height:"100%"}},t.createElement("defs",null,t.createElement("mask",{id:u},t.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),i&&t.createElement("rect",{x:i.left,y:i.top,rx:i.radius,width:i.width,height:i.height,fill:"black",className:p?`${n}-placeholder-animated`:""}))),t.createElement("rect",vn({},i?null:xp,{x:"0",y:"0",width:"100%",height:"100%",fill:o,mask:`url(#${u})`})),i&&t.createElement(t.Fragment,null,t.createElement("rect",vn({},xp,{x:"0",y:"0",width:"100%",height:`${i.top}px`})),t.createElement("rect",vn({},xp,{x:"0",y:"0",width:i.left,height:"100%"})),t.createElement("rect",vn({},xp,{x:"0",y:i.top+i.height,width:"100%",height:`calc(100vh - ${i.top+i.height}px)`})),t.createElement("rect",vn({},xp,{x:i.left+i.width,y:"0",width:`calc(100vw - ${i.left+i.width}px)`,height:"100%"})))):null))},Sp=e=>{const{prefixCls:n,zIndex:r,open:i,onPause:l,onPlay:a}=e,[o,s]=Dd(void 0,{value:i,postState:e=>null==e||e}),c=t.useRef(null),d=t.useRef(!1),u=Rd((e=>{p(e),e.shiftKey&&32===e.keyCode&&h()}));t.useEffect((()=>{const e=Lt(document,"keyup",u);return()=>e.remove()}),[]);const p=e=>{e.stopPropagation(),e.preventDefault()},h=()=>{d.current?d.current=!1:(s(!o),o?null==l||l():null==a||a())};return t.createElement("div",{ref:c,className:`${n}-control`,style:{zIndex:r+1},onMouseDown:e=>{p(e);const t=c.current,n=t.offsetWidth,r=t.offsetHeight,i=window.innerWidth,l=window.innerHeight,a=e.clientX-Ii(t).x,o=e.clientY-Ii(t).y;return document.onmousemove=e=>{let s=e.clientX-a,c=e.clientY-o;s<0&&(s=0),s>i-n-1&&(s=i-n-1),c<0&&(c=0),c>l-r-1&&(c=l-r-1),Ci(t,{left:`${s}px`,top:`${c}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>h()},o?t.createElement(Et,null):t.createElement(St,null))},wp=e=>{const{prefixCls:n,current:r,total:i=0,cover:l,title:a,description:o,helper:s={},type:c,zIndex:d,onClose:u,onPrev:p,onNext:h,onFinish:m,className:f,indicatorsRender:g}=e,{t:v}=Vd(),y="primary"!==c?"primary":"default",b=Rd((e=>{w(e),40===e.keyCode&&(r<i-1?null==h||h():null==m||m()),38===e.keyCode&&r>0&&(null==p||p())}));t.useEffect((()=>{const e=Lt(document,"keyup",b);return()=>e.remove()}),[]);const x=hp(l)?t.createElement("div",{className:`${n}-cover`},l):null,E=hp(o)?t.createElement("div",{className:`${n}-description`},o):null;let S;S=g?g(r,i):[...Array.from({length:i}).keys()].map(((e,i)=>t.createElement("span",{key:e,className:Fe(i===r&&`${n}-indicator-active`,`${n}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return t.createElement("div",{className:Fe(`${n}-content`,f)},t.createElement("div",{className:`${n}-inner`},t.createElement(Ze,{className:`${n}-close`,onClick:u}),s.content&&t.createElement(J,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},t.createElement(wt,{className:Fe(`${n}-close`,"help-icon")})),x,t.createElement("div",{className:`${n}-header`},t.createElement("div",{className:`${n}-title`},a)),E,t.createElement("div",{className:`${n}-footer`},i>1&&t.createElement("div",{className:`${n}-indicators`},S),t.createElement(qn,{className:`${n}-buttons`},0!==r?t.createElement($n,{className:`${n}-prev-btn`,size:"small",onMouseDown:w,onClick:p},v("qm.tour.prevStep")):null,r===i-1?t.createElement($n,{className:`${n}-finish-btn`,type:y,size:"small",onClick:m},v("qm.tour.finish")):t.createElement($n,{className:`${n}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:h},v("qm.tour.nextStep"))))))},Cp=e=>{const{current:n,renderPanel:r}=e;return t.createElement(t.Fragment,null,"function"==typeof r?r(e,n):t.createElement(wp,e))},Tp={left:"50%",top:"50%",width:1,height:1},Np=t.forwardRef(((e,n)=>{const{steps:r=[],defaultCurrent:i,current:l,onChange:a,onClose:o,onFinish:s,open:c,type:d="default",mask:u=!0,arrow:p=!0,control:h=!0,overlayClassName:m,overlayStyle:f,placement:g,helper:v,zIndex:y,renderPanel:b,indicatorsRender:x,gap:E,animated:S=!0,scrollIntoViewOptions:w=!0}=e,C=wn(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),T=t.useRef(),[N,I]=Dd(0,{value:l,defaultValue:i}),[R,O]=Dd(void 0,{value:c,postState:e=>!(N<0||N>=r.length)&&(null!=e&&e)}),[k,L]=Dd(1051,{value:y,defaultValue:y}),[A,P]=t.useState(),_=t.useRef(R);t.useLayoutEffect((()=>{R&&!_.current&&I(0),_.current=R,P(R)}),[R]),t.useImperativeHandle(n,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>L(e)})));const{target:H,type:F,placement:D,trigger:$,delay:M,style:q,arrow:j,className:V,mask:K,scrollIntoViewOptions:z,zIndex:W,action:B}=r[N]||{},U=W||k,G=F||d,Y=R&&(null!=K?K:u),X=null!=z?z:w,[Z,Q]=mp(H,!!c,E,X),J=((e,t,n)=>{var r;return null!==(r=null!=n?n:t)&&void 0!==r?r:null===e?"center":"bottom"})(Q,g,D),ee=!!Q&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;t.useLayoutEffect((()=>{var e;null===(e=T.current)||void 0===e||e.forceAlign()}),[te,N]),bi((()=>{R&&(ie(),null==B||B(Q,N))}),[R,Q]);const ne=e=>{I(e),null==a||a(e)},re=()=>{O(!1),null==o||o(N)},ie=()=>{if(!Q)return;const e=[];!function t(n){if(1===n.nodeType){var r;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===wi(r=n,"display")||"hidden"===wi(r,"visibility")||"0"===wi(r,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Q),e.length&&e[0].focus()};if(void 0===Q)return null;const le=()=>Tn(void 0,void 0,void 0,(function*(){if(!$||!Q)return;const{left:e,top:t}=Q.getBoundingClientRect(),n=Q.offsetWidth,r=Q.offsetHeight,[i,l]=[e+n/2,t+r/2],a=new MouseEvent($,{bubbles:!0,cancelable:!0,button:0,clientX:i,clientY:l}),o=document.elementFromPoint(i,l);o&&(o.dispatchEvent(a),yield Ln(null!=M?M:320))})),ae="boolean"==typeof Y?Y:!!Y,oe="boolean"==typeof Y?void 0:Y,se=Object.assign({},f,q),ce=jn("tour"),de=[{[`${ce}-primary`]:"primary"===G},m,V],ue=bp({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(Ep,{zIndex:U,prefixCls:ce,pos:Z,showMask:ae,style:null==oe?void 0:oe.style,fill:null==oe?void 0:oe.color,open:A,animated:S,rootClassName:m}),t.createElement(Mt,{open:A,autoLock:!0},t.createElement(qt,vn({ref:T},C,{zIndex:U,builtinPlacements:ue,popupStyle:se,popupPlacement:J,popupVisible:A,popupClassName:Fe(de),prefixCls:ce,popup:()=>t.createElement(Cp,vn({key:"content",arrow:ee,prefixCls:ce,total:r.length,helper:v,renderPanel:b,indicatorsRender:x,onPrev:()=>Tn(void 0,void 0,void 0,(function*(){yield le(),ne(N-1)})),onNext:()=>Tn(void 0,void 0,void 0,(function*(){yield le(),ne(N+1)})),onClose:re,current:N,onFinish:()=>{re(),null==s||s()}},Object.assign({},r[N],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Q||document.body,forceRender:!1,destroyPopupOnHide:!0}),t.createElement("div",{className:Fe(m,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Z||Tp),{position:"fixed",pointerEvents:"none"})}))),h&&t.createElement(Mt,{open:R},t.createElement(Sp,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));Np.displayName="QmTour";const Ip=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Rp=e=>({_s:e,status:Ip[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),Op=e=>e?6:5,kp=(e,t,n,r,i)=>{clearTimeout(r.current);const l=Rp(e);t(l),n.current=l,null==i||i({current:l})},Lp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{enter:t=!0,exit:n=!0,preEnter:r,preExit:i,timeout:l,initialEntered:o,mountOnEnter:c,unmountOnExit:d,onStateChange:u}=e||{},[m,f]=p((()=>Rp(o?2:Op(c)))),g=a(m),v=a(),[y,b]=(e=>se(e)?[e.enter,e.exit]:[e,e])(l),x=h((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return Op(t)}})(g.current._s,d);e&&kp(e,f,g,v,u)}),[u,d]),E=h((e=>{const l=e=>{switch(kp(e,f,g,v,u),e){case 1:y>=0&&(v.current=setTimeout(x,y));break;case 4:b>=0&&(v.current=setTimeout(x,b));break;case 0:case 3:v.current=setTimeout((()=>l(e+1)),0)}},a=g.current.isEnter;"boolean"!=typeof e&&(e=!a),e?!a&&l(t?r?0:1:2):a&&l(n?i?3:4:Op(d))}),[x,u,t,n,r,i,y,b,d]);return s((()=>()=>clearTimeout(v.current)),[]),[m,E,x]},Ap=e=>{const{name:n,in:r,timeout:i,preEnter:l=!0,preExit:a}=e,[o,s]=Lp({timeout:i,preEnter:l,preExit:a,initialEntered:r});return zi((()=>{s()}),[r]),t.createElement(t.Fragment,null,t.Children.map(e.children,(e=>t.isValidElement(e)?Wu(e,{className:Fe(e.props.className,n,o.status)}):e)))};var Pp={previewWidth:1100,defaultDistance:.45,logoHeight:60};const _p=n(void 0);var Hp=null;function Fp(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),n=e.match(/MSIE\D?\d+/i),r=e.match(/OPR\D?\d+/i),i=e.match(/Firefox\D?\d+/i),l=e.match(/x64/i);if(!t&&!n&&l)return!0;if(i){if((i=i[0].match(/\d+/))[0]>=41||l)return!0}else if(r){if((r=r[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!n){var a=e.match(/Chrome\D?\d+/i);if(a&&(a=a[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Dp(e,t){var n;try{var r=navigator.userAgent,i=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(Fp()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void L.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!n)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{i&&r.match(/x64/i);if(e||t?n=i?e:t:Hp?n=Hp:((n=document.createElement("object")).setAttribute("width",0),n.setAttribute("height",0),n.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),i?n.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):n.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(n),Hp=n),!n||!n.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&Fp(),n}catch(e){L.error("getLodop 出错:"+e)}}Fp();const $p=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:n,deviceYDPI:r}=window.screen;if(n&&r)t[0]=n,t[1]=r;else{let n=document.createElement("DIV");n.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth.toString()),t[1]=parseInt(n.offsetHeight.toString()),null===(e=n.parentNode)||void 0===e||e.removeChild(n),n=null}return t})()[0];return Math.ceil(t)},Mp=t.forwardRef(((e,n)=>{const{templateRender:r,directPrint:i}=e,{global:l}=t.useContext(Bt),{$$preview:a}=t.useContext(_p),{state:o,isWindowsPrinter:s,pageSize:c}=a,d=t.useRef(null),u=t.useRef({}),p=t.useRef([]),h=t.useRef([]),m=t.useRef([]),[f,g]=t.useState(!0);t.useImperativeHandle(n,(()=>({createPreviewDom:O,createExportHtml:L,createPrintHtml:k,SHOW_PREVIEW:A,DIRECT_PRINT:P}))),bi((()=>{R()}),[o.form.printerType,o.form.setting.direction,o.form.setting.distance,o.form.setting.fixedLogo]),t.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const v=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*Pp.defaultDistance+10*Pp.defaultDistance:0;return("vertical"===e?c[0]:c[1])-t}),[o,s,c]),y=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*Pp.defaultDistance+10*Pp.defaultDistance:0;return("vertical"===e?c[1]:c[0])-t}),[o,s,c]),b=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return $p(v-10*(e.left-Pp.defaultDistance)-10*(e.right-Pp.defaultDistance))}),[o,v]),x=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return $p(y-10*(e.top-Pp.defaultDistance)-10*(e.bottom-Pp.defaultDistance))}),[o,y]),E=o.form.scale,S=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return{left:$p(10*e.left),right:$p(10*e.right),top:$p(10*e.top),bottom:$p(10*e.bottom)}}),[o]),w=t.useMemo((()=>{const{form:{printerType:e}}=o,{left:t,right:n,top:r,bottom:i}=S,l=b+t+n,a=Pp.previewWidth-l<=0?0:(Pp.previewWidth-l)/2,s=Math.abs((1-E)*l/2);let c=0;return E>1&&(c=s>a?-1*a:-1*s),E<1&&(c=l-2*s>Pp.previewWidth?0:a>0?s:(Pp.previewWidth-(l-2*s))/2),{width:`${b}px`,height:""+("stylus"===e?"auto":x+"px"),paddingLeft:`${t}px`,paddingRight:`${n}px`,paddingTop:`${r}px`,paddingBottom:`${i}px`,transform:`translateX(${c}px) scale(${E})`,opacity:f?0:1}}),[o,f,S,E,x,b]);p.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const C=()=>{var e,t,n,r;const i=null!==(t=null===(e=null==l?void 0:l.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",a=null!==(r=null===(n=null==l?void 0:l.print)||void 0===n?void 0:n.rightLogo)&&void 0!==r?r:"";return[`<tr style="height: ${Pp.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>","</tr>"].join("")},T=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},N=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=T().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(n=u.current.templateEl.children[0]).children[0]?n.insertBefore(t,n.children[0]):n.appendChild(t),e=null},I=()=>{const e=u.current.templateEl.children[0].children,t=[],n=[];for(let r=0;r<e.length;r++){if("template-cols"===e[r].getAttribute("type"))continue;const i=e[r].clientHeight;e[r].style.height=i+"px",n.push(i),t.push(e[r].outerHTML)}h.current=n,p.current=t},R=()=>{var e;if(!p.current.length)return;const{form:{setting:t,printerType:n}}=o;if(i)return m.current.push([T(),C(),...p.current]);const r=t.fixedLogo?x-Pp.logoHeight:x;let l=[];if(m.current=[],"stylus"===n)m.current.push([T(),...t.fixedLogo?[C()]:[],...p.current]);else{let e=0;for(let n=0,i=h.current.length;n<i;n++){const a=p.current[n],o=h.current[n];t.fixedLogo||0!==n||(e+=Pp.logoHeight),e+=o,e<=r?l.push(a):(m.current.push([T(),...t.fixedLogo?[C()]:[],...l]),l=[],e=0,n-=1),n===i-1&&l.length&&m.current.push([T(),...t.fixedLogo?[C()]:[],...l])}}t.fixedLogo||null===(e=m.current[0])||void 0===e||e.splice(1,0,C());for(let e=0,t=m.current.length;e<t&&e!==t-1;e++)m.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');a.setState({currentPage:1,totalPage:m.current.length}),O()},O=()=>{var e,t;const{currentPage:n}=o;let r=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;r+=null!==(t=null===(e=m.current[n-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",r+="</table>",u.current.previewEl.innerHTML=r,u.current.previewEl.parentNode.scrollTop=0},k=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...m.current[e-1]].join("")}else for(let e=0;e<m.current.length;e++)t+=m.current[e].join("");return t+="</table>",t},L=()=>{const e=[];for(let t=0;t<p.current.length;t++)e[t]=p.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+C()+T()+e.join("")+"</table>"},A=()=>Tn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();u.current.previewEl.innerHTML||(N(),yield Ln(0),I(),R(),g(!1))})),P=()=>Tn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();N(),yield Ln(0),I(),R(),g(!1),a.doPrint(k()),yield Ln(0),a.doClose()})),_=()=>{en("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},H={[jn("print-container")]:!0,"no-visible":i};return t.createElement("div",{ref:d,className:Fe(H)},t.createElement(Di,{wrapperClassName:"spin",spinning:f,tip:"Loading..."},t.createElement("div",{className:"preview"},t.createElement("div",{className:"origin-template",style:{width:`${b}px`,marginLeft:`-${Math.floor(b/2)}px`}},null==r?void 0:r()),t.createElement("div",{className:"workspace",style:w}))))}));Mp.displayName="Container";class qp extends r{constructor(){super(...arguments),this.formRef=t.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Xt("qm.print.setPanel.printParameter")},{type:"SELECT",label:Xt("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:Xt("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Xt("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Xt("qm.print.setPanel.vertical"),value:"vertical"},{text:Xt("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Xt("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Xt("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:Xt("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Xt("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]}],this.getInitialvalue=()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})},this.getInitialExtra=()=>({disleft:Xt("qm.print.setPanel.sizeUnit"),disright:Xt("qm.print.setPanel.sizeUnit"),distop:Xt("qm.print.setPanel.sizeUnit"),disbottom:Xt("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Tn(this,void 0,void 0,(function*(){const[e,t]=yield this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),this.cancelHandle=()=>{this.props.onClose()}}render(){const{formList:e}=this.state;return t.createElement(t.Fragment,null,t.createElement(jc,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Xt("qm.dialog.close")),t.createElement($n,{type:"primary",onClick:()=>this.confirmHandle()},Xt("qm.dialog.confirm"))))}}qp.contextType=Bt;class jp extends r{constructor(){var e,n,r;super(...arguments),this.provide={$$preview:this},this.containRef=t.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(n=this.props.defaultConfig)||void 0===n?void 0:n.copies)||1,scale:1,setting:{distance:{left:Pp.defaultDistance,right:Pp.defaultDistance,top:Pp.defaultDistance,bottom:Pp.defaultDistance},pageSize:"210*297",direction:(null===(r=this.props.defaultConfig)||void 0===r?void 0:r.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0},this.pageChangeHandle=e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))},this.exportClickHandle=()=>{this.doExport(this.containRef.current.createExportHtml())},this.printClickHandle=()=>Tn(this,void 0,void 0,(function*(){if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e=Object.assign(Object.assign({},this.state.form),{printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text});yield Kt.setItem(this.printerKey,e),yield this.savePrintConfig(this.printerKey,e)}catch(e){}})),this.doClose=()=>{var e,t;null===(t=(e=this.props).onClose)||void 0===t||t.call(e)},this.getPrintConfig=e=>Tn(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Tn(this,void 0,void 0,(function*(){const n=this.context.global,r=null==n?void 0:n.saveComponentConfigApi;if(r)try{yield r({[e]:t})}catch(e){}})),this.createStyle=()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ',this.doPrint=e=>{const t=Dp();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i,printerName:l,printerType:a,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=Pp,{left:d,right:u,top:p,bottom:h}=i.distance;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(l),t.SET_PRINT_COPIES(o),i.doubleSide&&("auto"===i.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===a&&("vertical"===i.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===i.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===a&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(p-c)+"mm",10*(d-c)+"mm",`RightMargin: ${10*(u-c)}mm`,`BottomMargin: ${"stylus"!==a?10*(h-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?r&&this.doClose():L.error(Xt("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=Dp();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i}}=this.state;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?r&&this.doClose():L.error(Xt("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===i.direction?1:2),t.SAVE_TO_FILE(`${g().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Xt("qm.print.laserPrinter"),value:"laser"},{text:Xt("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Dp(),t=[{text:Xt("qm.print.defaultPrinter"),value:-1}];try{const n=e.GET_PRINTER_COUNT();for(let r=0;r<n;r++)t.push({text:e.GET_PRINTER_NAME(r),value:r})}catch(e){en("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}componentDidMount(){var e,t;return Tn(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield Kt.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),se(n)&&(yield Kt.setItem(this.printerKey,n))),se(n)&&Object.keys(n).length&&xe(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:n}=this.props,{visible:r,form:i,currentPage:l,totalPage:a,printPage:o}=this.state,s=jn("print-preview"),c={visible:r,title:Xt("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[s]:!0};return e?t.createElement(t.Fragment,null,t.createElement("div",{className:Fe(d)},t.createElement("div",{className:"outer"},t.createElement("div",{className:"header"},t.createElement("span",null,Xt("qm.print.printer"),":",t.createElement($,{value:i.printerName,onChange:e=>{this.setState((t=>xe({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,Xt("qm.print.type"),":",t.createElement($,{value:i.printerType,onChange:e=>{this.setState((t=>xe({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,Xt("qm.print.copies"),":",t.createElement(j,{value:i.copies,min:1,precision:0,onChange:e=>{this.setState((t=>xe({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),t.createElement("span",null,Xt("qm.print.printPage.0"),t.createElement(j,{value:o,min:1,max:a,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),Xt("qm.print.printPage.1")),t.createElement("span",null,t.createElement(ee,{size:"small",current:l,pageSize:1,total:a,onChange:this.pageChangeHandle})),t.createElement("span",null,t.createElement($n,{type:"text",icon:t.createElement(st,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Xt("qm.print.setting"))),t.createElement("span",null,t.createElement($n,{type:"text",icon:t.createElement(Ke,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Xt("qm.print.export"))),t.createElement("span",null,t.createElement($n,{icon:t.createElement(at,null),type:"primary",onClick:this.printClickHandle},Xt("qm.print.print")))),t.createElement("div",{className:"main"},t.createElement(_p.Provider,{value:this.provide},t.createElement(Mp,{ref:this.containRef,templateRender:n,directPrint:!1}))),t.createElement("div",{className:"footer"},t.createElement("span",null,Xt("qm.print.scale"),":",t.createElement(te,{value:i.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>xe({},t,{form:{scale:e}})))}}),t.createElement("em",{className:"scale-text"},`${Math.floor(100*i.scale)}%`)),t.createElement("span",null,Xt("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t.createElement("span",null,Xt("qm.print.pageNumber"),":",Xt("qm.print.pagination",{currentPage:l,totalPage:a}))))),t.createElement(dl,c,t.createElement(qp,{setting:i.setting,onChange:e=>{this.setState((t=>xe({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t.createElement(_p.Provider,{value:this.provide},t.createElement(Mp,{ref:this.containRef,templateRender:n,directPrint:!0}))}}jp.contextType=Bt;class Vp extends r{constructor(){super(...arguments),this.previewRef=t.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Tn(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const n=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof n&&!n)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:n,uniqueKey:r,defaultConfig:i,preview:l,closeAfterPrint:a}=this.props,o={visible:e,title:Xt("qm.print.preview"),width:`${Pp.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:n,uniqueKey:r,defaultConfig:i,preview:l,closeAfterPrint:a,onClose:()=>{this.setState({visible:!1})}};return l?t.createElement(dl,o,t.createElement(jp,s)):e?t.createElement(jp,s):null},this.DO_PRINT=()=>Tn(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield Ln(0),this.setState({visible:!0}),yield Ln(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:n,icon:r,type:i,disabled:l,shape:a}=this.props,o={size:n||this.context.size||"",type:i,shape:a,icon:r,loading:e,disabled:l,click:this.clickHandle};return t.createElement(t.Fragment,null,this.props.children&&t.createElement($n,o,this.props.children),this.createRender())}}function Kp(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function zp(e){const t=Kp(e);return t?t.frameElement:null}function Wp(e){const t=Gp(e);return Bp([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Bp(e){return e.reduce(((e,t)=>null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}))}function Up(e,t){const n=zp(e);if(n&&n!==t){const r=[e.getBoundingClientRect()];let i=n,l=!1;for(;i;){const e=Wp(i);if(r.push(e),i=zp(i),l)break;i&&Kp(i)===t&&(l=!0)}return Bp(r)}return e.getBoundingClientRect()}function Gp(e){const t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}Vp.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:f.elementType},Vp.defaultProps={preview:!0,type:"primary",icon:t.createElement(at,null)},Vp.contextType=Bt;const Yp=Object.assign;class Xp{constructor(e,t){this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=eh.border,this.padding.style.borderColor=eh.padding,this.content.style.backgroundColor=eh.background,Yp(this.node.style,{borderColor:eh.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),t.appendChild(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,t){Jp(t,"margin",this.node),Jp(t,"border",this.border),Jp(t,"padding",this.padding),Yp(this.content.style,{height:e.height-t.borderTop-t.borderBottom-t.paddingTop-t.paddingBottom+"px",width:e.width-t.borderLeft-t.borderRight-t.paddingLeft-t.paddingRight+"px"}),Yp(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Zp{constructor(e,t){this.tip=e.createElement("div"),Yp(this.tip.style,{display:"flex",flexFlow:"row nowrap",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"3px 5px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),Yp(this.nameSpan.style,{color:"#ee78e6",borderRight:"1px solid #aaaaaa",paddingRight:"0.5rem",marginRight:"0.5rem"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),Yp(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,n){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(n)+"px"}updatePosition(e,t){const n=this.tip.getBoundingClientRect(),r=function(e,t,n){const r=Math.max(n.height,20),i=Math.max(n.width,60),l=5;let a;a=e.top+e.height+r<=t.top+t.height?e.top+e.height<t.top+0?t.top+l:e.top+e.height+l:e.top-r<=t.top+t.height?e.top-r-l<t.top+l?t.top+l:e.top-r-l:t.top+t.height-r-l;let o=e.left+l;e.left<t.left&&(o=t.left+l);e.left+i>t.left+t.width&&(o=t.left+t.width-i-l);return a+="px",o+="px",{style:{top:a,left:o}}}(e,t,{width:n.width,height:n.height});Yp(this.tip.style,r.style)}}class Qp{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const n=e.document;this.container=n.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Zp(n,this.container),this.rects=[],n.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const n=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>n.length;){const e=this.rects.pop();null==e||e.remove()}if(0===n.length)return;for(;this.rects.length<n.length;)this.rects.push(new Xp(this.window.document,this.container));const r={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};n.forEach(((e,t)=>{const n=Up(e,this.window),i=Gp(e);r.top=Math.min(r.top,n.top-i.marginTop),r.right=Math.max(r.right,n.left+n.width+i.marginRight),r.bottom=Math.max(r.bottom,n.top+n.height+i.marginBottom),r.left=Math.min(r.left,n.left-i.marginLeft);this.rects[t].update(n,i)})),t||(t=n[0].nodeName.toLowerCase(),n[0]),this.tip.updateText(t,r.right-r.left,r.bottom-r.top);const i=Up(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:r.top,left:r.left,height:r.bottom-r.top,width:r.right-r.left},{top:i.top+this.tipBoundsWindow.scrollY,left:i.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Jp(e,t,n){Yp(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const eh={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"};let th=null,nh=null;function rh(){null!=window.document&&(th=null,null!==nh&&(nh.remove(),nh=null))}class ih{constructor(e){this._lastHoveredNode=null,this.iframesListeningTo=new Set,this.onClick=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onMouseEvent=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onPointerDown=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))},this.onPointerMove=e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>Oi(t,window.document.querySelector(e)))))return this._selectIgnore=!0,rh();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var n,r,i;n=[t],r=null,i=!1,null!=window.document?(null!==th&&clearTimeout(th),null!=n&&(null===nh&&(nh=new Qp),nh.inspect(n,r),i&&(th=setTimeout((()=>rh()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=pe((e=>{var t;this._selectIgnore||null===(t=this.onSelect)||void 0===t||t.call(this,e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let n=e;const r=[];for(;n!==t&&null!==n;){let e=n.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,r=Array.from(n.classList).reverse();e<r.length;e++)t.test(r[e])&&n.classList.remove(r[e]);if(n.id&&/^rc-\w+/.test(n.id)&&n.removeAttribute("id"),n.id)e+=`#${n.id}`;else{const t=Array.from(n.parentElement.children).filter((e=>e.tagName===n.tagName)),r=n.className.trim();if(t.filter((e=>e.className.includes(r))).length<=1){if(r){const t=r.split(/\s+/);let n="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(n+=`.${t[e]}`);e+=n}}else n.getAttribute("name")?e+=`[name=${n.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(n)+1})`}n.nodeType!==Node.TEXT_NODE&&r.unshift(e),n=n.parentElement}return r.join(" > ")}(e))}),200,{leading:!1}),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){rh(),this.removeListenersOnWindow(window),this.iframesListeningTo.forEach((function(e){try{this.removeListenersOnWindow(e.contentWindow)}catch(e){}})),this.iframesListeningTo=new Set,this._isRunning=!1}registerListenersOnWindow(e){e&&"function"==typeof e.addEventListener&&(e.addEventListener("click",this.onClick,!0),e.addEventListener("mousedown",this.onMouseEvent,!0),e.addEventListener("mouseover",this.onMouseEvent,!0),e.addEventListener("mouseup",this.onMouseEvent,!0),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0))}removeListenersOnWindow(e){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("click",this.onClick,!0),e.removeEventListener("mousedown",this.onMouseEvent,!0),e.removeEventListener("mouseover",this.onMouseEvent,!0),e.removeEventListener("mouseup",this.onMouseEvent,!0),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0))}getEventTarget(e){return e.composed?e.composedPath()[0]:e.target}}function lh(e){return document.querySelector(e)}const ah=e=>{const{action:n,onConfirm:r,onCancel:i,onFinish:l}=e,{t:a}=Vd();return t.createElement(t.Fragment,null,t.createElement("div",{style:{height:100}},a("qm.table.config.emptyText")),t.createElement(qn,{style:{width:"100%",justifyContent:"flex-end"}},t.createElement($n,{size:"small",onClick:()=>null==i?void 0:i()},a("qm.guideTracker.closeButton")),t.createElement($n,{size:"small",onClick:()=>null==r?void 0:r()},a("add"===n?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),t.createElement($n,{size:"small",onClick:()=>null==l?void 0:l()},a("qm.guideTracker.finishButton"))))},oh={left:"50%",top:"50%",width:1,height:1},sh=t.forwardRef(((e,n)=>{const{open:r,current:i,defaultCurrent:l,steps:a=[],placement:o="bottom",control:s=!0,overlayClassName:c,overlayStyle:d,destroyOnHide:u,contentRender:p,zIndex:h,helper:m={},selectFilter:f=(e=>e),onSelect:g,onChange:v,onClose:y,onFinish:b}=e,{t:x}=Vd(),E=t.useRef(),S=t.useRef(a.length),[w,C]=Dd(0,{value:i,defaultValue:l}),[N,I]=Dd(void 0,{value:r,postState:e=>null!=e&&e}),[R,O]=Dd(1051,{value:h,defaultValue:h}),[k,L]=t.useState({}),[A,P]=t.useState(!1),[_,H]=t.useState(N),[F,D]=t.useState(!1),[$,M]=mp(k.node,!!r),[j,V]=t.useState(22),K=t.useRef(!1),z=t.useMemo((()=>w>=a.length?"add":"edit"),[w,a]),W=t.useMemo((()=>`${w+1} / ${a.length}`),[w,a]);t.useLayoutEffect((()=>{E.current=new ih({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),L({id:Gl(),node:e,path:t}),C(S.current),P(!0),U(),null==g||g(t,e)}})}),[]),t.useEffect((()=>(N?B():U(),N?setTimeout((()=>H(!0)),16):H(!1),()=>{U()})),[N]),t.useEffect((()=>{S.current=a.length}),[a]);const B=()=>{E.current.startHandle()},U=()=>{E.current.stopHandle()},G=e=>{e.stopPropagation(),e.preventDefault()};t.useImperativeHandle(n,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),GET_CURRENT_STEP:()=>({current:w,selector:k.path})})));const Y=jn("guide-tracker"),X=[{[`${Y}-primary`]:!0}],Z=bp({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(Mt,{open:N&&A,autoLock:!0},t.createElement(qt,{zIndex:R,builtinPlacements:Z,popupPlacement:o,popupVisible:N&&A,popupClassName:Fe(X,c),popupStyle:d,prefixCls:Y,popup:()=>{const e=()=>{P(!1),B()};return t.createElement("div",{className:`${Y}-content`},t.createElement("div",{className:`${Y}-inner`},t.createElement(Ze,{className:`${Y}-close`,onClick:()=>{null==y||y(w),e()}}),t.createElement(q,{open:F,trigger:["click"],dropdownRender:()=>a.length?t.createElement("div",{className:"ant-dropdown-menu step-list"},t.createElement(Vt,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.id)),n=a.map((e=>e.id));if(ge(t,n))return;const r=t.findIndex((e=>e===k.id)),i=-1!==r?r:w;C(i),null==v||v(ia(e),i)}},a.map(((e,n)=>t.createElement("li",{key:n,className:Fe("item",{actived:e.id===k.id})},t.createElement(Ge,{className:"handle",title:x("qm.form.draggable")}),t.createElement("span",{className:"box"},t.createElement("span",{className:"title",title:e.title,onClick:()=>{n!==w&&(L({id:e.id,node:lh(e.selector),path:e.selector}),C(n),V(22===j?j+1:j-1),null==v||v(a,n))}},e.title),t.createElement(T,{title:x("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const t=a.filter((t=>t.id!==e.id)),r=n===w;let i=n<=w?w-1:w;if(i=i<0?0:i,i=i>t.length?t.length:i,r&&t[i]){const{id:e,selector:n}=t[i];L({id:e,node:lh(n),path:n})}C(i),null==v||v(t,i)}},t.createElement(Ze,{className:"close-icon"})))))))):t.createElement(t.Fragment,null),overlayClassName:`${Y}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>D(e)},t.createElement(Ct,{className:Fe(`${Y}-close`,"menu-icon"),style:{width:j}})),m.content&&t.createElement(J,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:m.content,title:m.title},t.createElement(wt,{className:Fe(`${Y}-close`,"help-icon")})),t.createElement("div",{className:"panel-label"},t.createElement("span",{className:"title"},x("qm.guideTracker.label")),t.createElement("span",{className:"step"},x("qm.guideTracker.currentStep"),W)),p?p({id:k.id,selector:k.path,actionStatus:z,DO_CLOSE:e},w):t.createElement(ah,{action:z,onConfirm:()=>{null==v||v("add"===z?[...a,{id:k.id,selector:k.path,title:"Guide Title"}]:[...a],w),e()},onCancel:()=>{null==y||y(w),e()},onFinish:()=>{e(),null==y||y(w),null==b||b()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},t.createElement("div",{className:Fe(`${Y}-target-placeholder`),style:Object.assign(Object.assign({},$||oh),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:G,onClick:G}))),s&&t.createElement(Mt,{open:_},t.createElement(Sp,{zIndex:R,prefixCls:Y,onPause:()=>{K.current=A,P(!1),U()},onPlay:()=>{K.current?P(!0):B()}})))}));sh.displayName="QmGuideTracker";const ch=n=>{var r,i,l,a,o,s,c,d;const{content:u,image:p,width:h,height:m,font:f={},gap:g=[100,100],offset:v=[50,50],rotate:y=-22,zIndex:b=9,alpha:x=1,antiTamper:E=!0,grayscale:S,className:w,style:C}=n,T=t.useRef(null),N=t.useRef(new Map),I=null!==(r=f.fontSize)&&void 0!==r?r:16,R=null!==(i=f.fontWeight)&&void 0!==i?i:"normal",O=null!==(l=f.fontStyle)&&void 0!==l?l:"normal",k=null!==(a=f.fontFamily)&&void 0!==a?a:"sans-serif",L=null!==(o=f.color)&&void 0!==o?o:"rgba(0, 0, 0, 0.15)",A=null!==(s=f.textAlign)&&void 0!==s?s:"center",P=Array.isArray(u)?u:[u],_=g[0],H=g[1],F=_/2,D=H/2,$=null!==(c=v[0])&&void 0!==c?c:F,M=null!==(d=v[1])&&void 0!==d?d:D,q=t.useMemo((()=>{const e=$-F,t=M-D;return{position:"absolute",left:e>0?`${e}px`:0,top:t>0?`${t}px`:0,width:e>0?`calc(100% - ${e}px)`:"100%",height:t>0?`calc(100% - ${t}px)`:"100%",pointerEvents:"none",backgroundRepeat:"repeat",backgroundPosition:`${e>0?0:e}px ${t>0?0:t}px`,zIndex:b}}),[F,D,$,M,b]),j=(e,t)=>{var n;if(T.current){const r=N.current.get(T.current);r&&(T.current.contains(r)&&T.current.removeChild(r),N.current.delete(T.current));const i=document.createElement("div");i.setAttribute("style",(e=>Object.entries(e).map((e=>{let[t,n]=e;return`${r=t,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`;var r})).join(";"))(Object.assign(Object.assign({},q),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(n=T.current)||void 0===n||n.append(i),N.current.set(T.current,i)}},V=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[r,i]=(e=>{let t=120,n=64;if(!p&&e.measureText){e.font=`${I}px ${k}`;const r=P.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...r)),n=I*P.length+3*(P.length-1)}return[null!=h?h:t,null!=m?m:n]})(t),l=r*n,a=i*n,o=(_+r)*n,s=(H+i)*n,c=_/2*n,d=H/2*n,u=o/2,f=s/2,g=2*(_+r);e.width=2*o,e.height=2*s,t.globalAlpha=x,t.save(),t.translate(u,f),t.rotate(Math.PI/180*y),t.translate(-u,-f);const v=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),S&&(e=>{const t=e.getContext("2d");if(!t)return;const n=t.getImageData(0,0,e.width,e.height),{data:r}=n;for(let e=0;e<r.length;e+=4){const t=(r[e]+r[e+1]+r[e+2])/3;r[e]=t,r[e+1]=t,r[e+2]=t}t.putImageData(n,0,0)})(e),j(e.toDataURL(),g)},b=()=>{const e=Number(I)*n;t.font=`${O} normal ${R} ${e}px/${i}px ${k}`,t.fillStyle=L,t.textAlign=A,t.textBaseline="top",t.translate(l/2,0),P.forEach(((r,i)=>{t.fillText(null!=r?r:"",c,d+i*(e+3*n))})),v()};if(p){const e=new Image;e.onload=()=>{t.drawImage(e,c,d,l,a),v()},e.onerror=()=>{b()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=p}else b()},K=e=>Array.from(N.current.values()).includes(e);t.useEffect((()=>{V()}),[u,p,h,m,f,g,v,y,b,x,E,S]),function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=window&&"MutationObserver"in window,l=e.useRef(),a=()=>{l.current&&(l.current.disconnect(),l.current=void 0)};e.useLayoutEffect((()=>(a(),i&&t.current&&(l.current=new MutationObserver(n),l.current.observe(t.current,r)),()=>a())),[t])}(T,(e=>{if(E)for(const t of e){const e=Array.from(t.removedNodes).some((e=>K(e))),n="attributes"===t.type&&K(t.target);if(e||n){V();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=jn("watermark");return t.createElement("div",{ref:T,className:Fe(z,w),style:Object.assign({position:"relative"},C)},n.children)},dh=new Map,uh=new WeakMap;let ph,hh=0;function mh(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(uh.has(n)||(hh+=1,uh.set(n,hh.toString())),uh.get(n)):"0"):e[t]}`;var n})).toString()}function fh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ph;if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:l,elements:a}=function(e){const t=mh(e);let n=dh.get(t);if(!n){const r=new Map;let i=[];const l=new IntersectionObserver((t=>{t.forEach((t=>{var n;const l=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=l),null===(n=r.get(t.target))||void 0===n||n.forEach((e=>{e(l,t)}))}))}),e);i=l.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:l,elements:r},dh.set(t,n)}return n}(n),o=a.get(e)||[];return a.has(e)||a.set(e,o),o.push(t),l.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(a.delete(e),l.unobserve(e)),0===a.size&&(l.disconnect(),dh.delete(i))}}const gh=e=>{const{forceRender:n,height:r,placeholder:i=null,unmountIfInvisible:l,className:a,style:o}=e,{ref:s,inView:c,entry:d}=function(){let{root:e,rootMargin:n,threshold:r,triggerOnce:i,fallbackInView:l,trackVisibility:a,skip:o,delay:s,onChange:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var d;const[u,p]=t.useState(null),[h,m]=t.useState({inView:!1,entry:void 0}),f=t.useRef(c);t.useEffect((()=>{if(o||!u)return;let t;return t=fh(u,((e,n)=>{var r;m({inView:e,entry:n}),null===(r=f.current)||void 0===r||r.call(f,e,n),n.isIntersecting&&i&&t&&(t(),t=void 0)}),{root:e,rootMargin:n,threshold:r,trackVisibility:a,delay:s},l),()=>{t&&t()}}),[Array.isArray(r)?r.toString():r,u,e,n,i,o,a,l,s]);const g=null===(d=h.entry)||void 0===d?void 0:d.target,v=t.useRef();u||!g||i||o||v.current===g||(v.current=g,m({inView:!1,entry:void 0}));const y=[p,h.inView,h.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}(Object.assign({},e,{triggerOnce:!l}));t.useEffect((()=>{r||en("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[jn("lazy-load")]:!0};return t.createElement("div",{ref:s,className:Fe(u,a),style:o},n||c?e.children:t.createElement("div",{className:"placeholder",style:{height:r}},i))};class vh{constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class yh{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,r=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new yh(e[1],n,r,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const r=e.x-t.x,i=e.y-t.y,l=t.x-n.x,a=t.y-n.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,c=(t.x+n.x)/2,d=(t.y+n.y)/2,u=Math.sqrt(r*r+i*i),p=Math.sqrt(l*l+a*a),h=p/(u+p),m=c+(o-c)*h,f=d+(s-d)*h,g=t.x-m,v=t.y-f;return{c1:new vh(o+g,s+v),c2:new vh(c+g,d+v)}}constructor(e,t,n,r,i,l){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=r,this.startWidth=i,this.endWidth=l}length(){let e,t,n=0;for(let r=0;r<=10;r+=1){const i=r/10,l=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){const r=l-e,i=a-t;n+=Math.sqrt(r*r+i*i)}e=l,t=a}return n}point(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e}}class bh{constructor(e,t){var n=this;this.width=320,this.height=200,this.ratio=Math.max(window.devicePixelRatio||1,1),this.penColor="rgba(0,0,0,1)",this.backgroundColor="rgba(0,0,0,0)",this.canAddHistory=!1,this.openSmooth=!0,this.dotSize=0,this.throttle=16,this.minDistance=5,this.velocityFilterWeight=.7,this.compositeOperation="source-over",this.minWidth=.5,this.maxWidth=2.5,this.fontSize=16,this.eraserSize=20,this.lineHeight=1.25,this.degreeOfBlur=5,this.textInputPos={x:0,y:0},this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)},this.setTextInput=()=>{this.openSmooth||(this.textInput.setAttribute("class","signature__text-input"),this.textInput.setAttribute("contentEditable","true"),this.textInput.setAttribute("spellCheck","false"),this.canvas.parentNode.appendChild(this.textInput))},this.isTouchEvent=e=>"touches"in e,this.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)},this.removeListener=()=>{this.canvas.style.touchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("touchstart",this.onDrawStart),this.canvas.removeEventListener("touchmove",this.onDrawMove),document.removeEventListener("touchend",this.onDrawEnd),document.removeEventListener("touchcancel",this.onDrawEnd),this.canvas.removeEventListener("mousedown",this.onDrawStart),this.canvas.removeEventListener("mousemove",this.onDrawMove),document.removeEventListener("mouseup",this.onDrawEnd),this.textInput.removeEventListener("blur",this.onInputBlur)},this._isLeftButtonPressed=(e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,n;return{event:e,type:e.type,x:this.isTouchEvent(e)?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:this.isTouchEvent(e)?null===(n=e.touches[0])||void 0===n?void 0:n.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!n._drawingStroke)return;if(0===n._data.length)return void n._strokeBegin(e);const r=n._createPoint(e.x,e.y,e.pressure),i=n._data[n._data.length-1],l=i.points,a=l.length>0&&l[l.length-1],o=!!a&&r.distanceTo(a)<=n.minDistance,s=n._getPointGroupOptions(i);if(!a||!a||!o){const e=n._addPoint(r,s);t&&(a?e&&n._drawCurve(e,s):n._drawDot(r,s)),l.push({time:r.time,x:r.x,y:r.y,pressure:r.pressure})}},this._strokeEnd=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n._drawingStroke&&(t&&n._strokeUpdate(e),n._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const n=this.ctx,r=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=t.penColor,n.fill()},this._drawCurve=(e,t)=>{const n=this.ctx,r=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<i;n+=1){const l=n/i,a=l*l,o=a*l,s=1-l,c=s*s,d=c*s;let u=d*e.startPoint.x;u+=3*c*l*e.control1.x,u+=3*s*a*e.control2.x,u+=o*e.endPoint.x;let p=d*e.startPoint.y;p+=3*c*l*e.control1.y,p+=3*s*a*e.control2.y,p+=o*e.endPoint.y;const h=Math.min(e.startWidth+o*r,t.maxWidth);this._drawCurveSegment(u,p,h)}n.closePath(),n.fill()},this._drawCurveSegment=(e,t,n)=>{const r=this.ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1)},this._createPoint=(e,t,n)=>{const r=this.canvas.getBoundingClientRect();return new vh(e-r.left,t-r.top,n,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),r=yh.fromPoints(n,e);return n.shift(),r}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,n)=>{const r=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(r,n),l={end:i,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=i,l},this.onDrawStart=e=>{var t;e.preventDefault(),this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&(this._strokeBegin(this._pointerEventToSignatureEvent(e)),this.ctx.strokeStyle=this.penColor,this.ctx.lineWidth=this.maxWidth,"line"===this.mode&&this.createPencil(e),"eraser"===this.mode&&this.createEraser(e),"text"===this.mode&&this.createTextInput(e),null===(t=this.onStart)||void 0===t||t.call(this,e))},this.onDrawMove=e=>{e.preventDefault(),"text"!==this.mode&&(this._isLeftButtonPressed(e,!0)&&this._drawingStroke?window.requestAnimationFrame?window.requestAnimationFrame((()=>this.drawHandler(e))):this.drawHandler(e):this._strokeEnd(this._pointerEventToSignatureEvent(e)))},this.onDrawEnd=e=>{var t;this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),null===(t=this.onEnd)||void 0===t||t.call(this,e))},this.onInputBlur=e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()},this.drawHandler=e=>{switch(this.mode){case"line":this.drawLine(e);break;case"square":this.drawSquare(e);break;case"round":this.drawRound(e);break;case"arrow":this.drawArrow(e);break;case"mosaic":this.drawMosaic(e);break;case"text":this.drawText(e);break;case"eraser":this.drawEraser(e)}this.canAddHistory=!0},this.drawSquare=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,n,r-t,i-n),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=Math.min(r,t),a=Math.min(i,n),o=.5*(Math.max(r,t)-l),s=.5*(Math.max(i,n)-a),c=l+o,d=a+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(c,d,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=180*Math.atan2(n-i,t-r)/Math.PI,a=(l+25)*Math.PI/180,o=(l-25)*Math.PI/180,s=15*Math.cos(a),c=15*Math.sin(a),d=15*Math.cos(o),u=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(r,i),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(r,i);const p=r+s,h=i+c;this.ctx.lineTo(p,h);const m=r+d,f=i+u;this.ctx.lineTo(m,f),this.ctx.lineTo(r,i),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,n)=>{const r=e.width,i=e.data,l=[];return l[0]=i[4*(n*r+t)],l[1]=i[4*(n*r+t)+1],l[2]=i[4*(n*r+t)+2],l[3]=i[4*(n*r+t)+3],l},this.setAxisColor=(e,t,n,r)=>{const i=e.width,l=e.data;l[4*(n*i+t)]=r[0],l[4*(n*i+t)+1]=r[1],l[4*(n*i+t)+2]=r[2],l[4*(n*i+t)+3]=r[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=this.ctx.getImageData(t*this.ratio,n*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),i=r.width,l=r.height,a=i/this.degreeOfBlur,o=l/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=this.getAxisColor(r,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let i=0;i<this.degreeOfBlur;i++)for(let l=0;l<this.degreeOfBlur;l++)this.setAxisColor(r,t*this.degreeOfBlur+l,e*this.degreeOfBlur+i,n)}this.ctx.putImageData(r,t*this.ratio,n*this.ratio)},this.drawText=e=>{const{x:t,y:n}=this.textInputPos;if(0===t&&0===n)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const r=this.fontSize*this.lineHeight,i=this.width-t,l=e.target.innerText,a=[];let o="";for(let e=0;e<l.length;e++){const t=o+l[e];this.ctx.measureText(t).width>i&&o.length>0?(a.push(o),o=l[e]):o=t}a.push(o),a.forEach(((e,i)=>{this.ctx.fillText(e,t+1,n+i*r+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawPencil=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawEraser=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=n?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())},this.setInputStyle=()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}},this.drawBgColor=()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))},this.clearWorkSpace=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},this.addHistory=()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))},this.getLastHistory=()=>this._historyList[this._historyList.length-1],this.setLastHistory=()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()},this.clear=()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())},this.undo=()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()},this.setDrawMode=e=>{this.mode=e},this.setLineWidth=e=>{this.maxWidth=e},this.setPenColor=e=>{this.penColor=e},this.setFontSize=e=>{this.fontSize=e},this.isEmpty=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=this.canvas.width,e.height=this.canvas.height,this.backgroundColor?(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)):1!==this.ratio&&t.scale(this.ratio,this.ratio),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(n.canvas.width===n.width)return n.canvas.toDataURL(e,t);const r=document.createElement("canvas");r.width=n.width,r.height=n.height;return r.getContext("2d").drawImage(n.canvas,0,0,r.width,r.height),r.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;return n.toDataURL("image/jpeg",e)},this.initial(e,t)}initial(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&(this.canvas=e,this.ctx=e.getContext("2d"),this.textInput=document.createElement("div"),this.width=t.width||e.clientWidth||this.width,this.height=t.height||e.clientHeight||this.height,this.penColor=t.penColor||this.penColor,this.fontSize=t.fontSize||this.fontSize,this.backgroundColor=t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this._strokeMoveUpdate=this.throttle?function(e){let t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,l=0,a=null;const o=()=>{l=Date.now(),a=null,t=e.apply(n,r),a||(n=null,r=[])};return function(){const s=Date.now(),c=i-(s-l);n=this;for(var d=arguments.length,u=new Array(d),p=0;p<d;p++)u[p]=arguments[p];return r=u,c<=0||c>i?(a&&(clearTimeout(a),a=null),l=s,t=e.apply(n,r),a||(n=null,r=[])):a||(a=window.setTimeout(o,c)),t}}(this._strokeUpdate,this.throttle):this._strokeUpdate,this.minWidth=t.minWidth||this.minWidth,this.maxWidth=t.maxWidth||this.maxWidth,this.onStart=t.onStart,this.onEnd=t.onEnd,this.setCanvasSize(),this.setTextInput(),this.drawBgColor(),this.addListener())}update(){this.setCanvasSize(),this.clear()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}bh.dataURLToBlob=e=>{const t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),i=r.length,l=new Uint8Array(i);for(let e=0;e<i;++e)l[e]=r.charCodeAt(e);return new Blob([l],{type:n})},bh.canvasToDataURL=e=>e.toDataURL("image/png",1),bh.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const xh=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),Eh=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M839.111111 269.198222V122.908444A9.159111 9.159111 0 0 0 829.980444 113.777778H208.213333A9.159111 9.159111 0 0 0 199.111111 122.908444v146.289778c0 5.034667 4.124444 9.159111 9.130667 9.159111h64a9.159111 9.159111 0 0 0 9.159111-9.159111V196.067556h192v640h-105.159111a9.159111 9.159111 0 0 0-9.130667 9.130666v64c0 5.034667 4.124444 9.159111 9.130667 9.159111h301.738666a9.159111 9.159111 0 0 0 9.130667-9.159111v-64a9.159111 9.159111 0 0 0-9.130667-9.130666h-105.159111v-640h192v73.130666c0 5.034667 4.124444 9.159111 9.159111 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111z"})),Sh=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M887.65217391 606.59279489a31.26857185 31.26857185 0 0 1-31.26857185-31.26857087v-363.48819946L158.38608696 909.83354065a31.26857185 31.26857185 0 1 1-44.21962762-44.21962761l697.99751609-698.06906805h-363.48819945a31.26857185 31.26857185 0 0 1 0-62.46559075h439.04795087c17.17267109 0 31.26857185 13.95279489 31.26857086 31.19701891v439.04795087a31.26857185 31.26857185 0 0 1-31.3401238 31.26857087z"})),wh=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M606.4 103.424a64 64 0 0 1 0.704 0.64l320.256 280.32a64 64 0 0 1 7.104 89.024l-330.432 398.72 320.448 0.128a32 32 0 0 1 0 64.064H397.632a32.128 32.128 0 0 1-6.208-0.64h-20.736a64 64 0 0 1-42.304-16.064l-238.08-210.112A64 64 0 0 1 83.84 620.16l432.32-509.312a64 64 0 0 1 90.24-7.36zM242.048 537.536l-87.04 101.76a32 32 0 0 0 3.584 45.248l213.12 180.672a32 32 0 0 0 20.736 7.616l-0.64-0.064a32.192 32.192 0 0 1 5.76-0.512h102.016a32 32 0 0 0 18.176-10.496l40.96-47.232-316.672-276.992zM592.96 177.28a32 32 0 0 0-45.12 3.456L283.712 488.96l316.928 277.248 264.512-304.96a32 32 0 0 0 1.024-40.704l-3.904-4.16-268.928-238.72a32 32 0 0 0-0.384-0.32z"})),Ch=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M607.75537778 291.05948444H223.6416l115.34336-115.41617778a36.37248 36.37248 0 1 0-51.48216889-51.44576L132.61937778 279.04455111c-13.54410667 13.50769778-21.04433778 31.67573333-21.11715556 50.97244444a71.72551111 71.72551111 0 0 0 21.11715556 51.51857778l154.88341333 154.91982222a36.29966222 36.29966222 0 0 0 51.48216889 0 36.37248 36.37248 0 0 0 0-51.48216889l-121.46005333-121.16878222H607.75537778c130.70791111 0 237.02186667 106.16832 237.02186667 236.65777777s-106.31395555 236.65777778-237.02186667 236.65777778h-254.13404445a36.40888889 36.40888889 0 0 0 0 72.81777779h254.13404445c170.83050667 0 309.83964445-138.82709333 309.83964444-309.47555557 0-170.64846222-139.00913778-309.47555555-309.83964444-309.47555555"})),Th=t.forwardRef(((e,n)=>{const{open:r,width:i,height:l,imageName:a,penColor:o,minWidth:s,maxWidth:c,backgroundColor:d,className:u,style:p,onOk:h,onCancel:m}=e,{t:f}=Vd(),v=t.useRef(),y=t.useRef(null),b=t.useRef(null),x=t.useRef(null),E=[2,4,6],S=[14,16,18,20,24,28],w=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[C,T]=Dd(void 0,{value:r,postState:e=>null!=e&&e}),N=t.useMemo((()=>!!e.children),[e.children]),[I,R]=t.useState(N?"square":"line"),[O,k]=t.useState(E[0]),[L,A]=t.useState(N?w[0]:w[4]),[P,_]=t.useState(S[1]),[H,F]=t.useState("bottomLeft"),[D,M]=t.useState(!1),[j,V]=t.useState(!1);t.useEffect((()=>{var e,t;const n={width:null!=i?i:null===(e=b.current)||void 0===e?void 0:e.offsetWidth,height:null!=l?l:null===(t=b.current)||void 0===t?void 0:t.offsetHeight,maxWidth:O,mode:I,penColor:L,fontSize:P,backgroundColor:d,openSmooth:!N};return n.openSmooth&&Object.assign(n,{penColor:o,minWidth:s,maxWidth:c}),v.current=new bh(y.current,n),()=>v.current.destroy()}),[]);const K=e=>{var t,n;const[r,a]=[null!=i?i:null===(t=b.current)||void 0===t?void 0:t.offsetWidth,null!=l?l:null===(n=b.current)||void 0===n?void 0:n.offsetHeight],{width:o,height:s}=v.current;let c=!1;r&&r!==o&&(v.current.width=r,c=!0),a&&a!==s&&(v.current.height=a,c=!0),(c||e)&&v.current.update()};bi((()=>{N&&C&&K()}),[C,N]),bi((()=>{v.current.setDrawMode(I)}),[I]),bi((()=>{v.current.setLineWidth(O)}),[O]),bi((()=>{v.current.setPenColor(L)}),[L]),bi((()=>{v.current.setFontSize(P)}),[P]);const z=()=>Tn(void 0,void 0,void 0,(function*(){const e=N?b.current.parentNode:y.current;if(e)try{const t=yield jt(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===x.current||e.classList.contains("spinning")});return bh.canvasToDataURL(t)}catch(e){en("Signature","生成合成图片失败!")}})),W=()=>{v.current.clear(),null==m||m()};t.useImperativeHandle(n,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>v.current.clear(),UNDO:()=>v.current.undo(),IS_EMPTY:()=>v.current.isEmpty(),UPDATE:K,GET_DATE_URL:z})));const B=e=>{e&&F((()=>{const e=x.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},U=e=>t.createElement("div",{className:Fe("ant-dropdown-menu","content")},"text"!==e?t.createElement("div",{className:"lineWidth"},E.map((e=>t.createElement("span",{key:e,className:Fe("dot",`s${e}`,{active:e===O}),onClick:()=>k(e)})))):t.createElement("div",{className:"fontSize"},t.createElement($,{size:"small",value:P,options:S.map((e=>({value:e,label:e.toString()}))),onChange:e=>_(e)})),t.createElement("span",{className:"divider"}),t.createElement("div",{className:"penColor"},w.map((e=>t.createElement("span",{key:e,className:Fe("dot",{active:e===L}),style:{backgroundColor:e},onClick:()=>A(e)},t.createElement(je,{className:"icon"})))))),G=jn("signature"),Y={[G]:!0,"is-annotation":N},X=i?Object.assign(Object.assign({},p),{width:i}):p;return t.createElement("div",{className:Fe(Y,u),style:X},N&&t.createElement(t.Fragment,null,t.createElement("div",{ref:b,className:"content"},e.children),j&&t.createElement(Di,{spinning:!0,className:"spinning"})),t.createElement("div",{className:Fe("signature",{show:C})},t.createElement("canvas",{ref:y,className:I}),N&&t.createElement("div",{ref:x,className:"signature__tool-bar"},t.createElement("div",{className:"wrapper"},t.createElement("div",{className:Fe("actions",{hidden:D})},t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("square")},t.createElement(Tt,null))),t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("round")},t.createElement(xh,null))),t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("arrow")},t.createElement(Sh,null))),t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("line")},t.createElement(qe,null))),t.createElement(q,{dropdownRender:()=>U("text"),overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("text")},t.createElement(Eh,null))),t.createElement("button",{className:"btn",onClick:()=>Tn(void 0,void 0,void 0,(function*(){yield Tn(void 0,void 0,void 0,(function*(){V(!0);const e=yield z();if(e){const t=a?a.slice(0,a.lastIndexOf(".")>0?a.lastIndexOf("."):void 0):g().format(Td);Zi(bh.dataURLToBlob(e),`${t}.png`)}V(!1)})),W()}))},t.createElement(Ke,null)),t.createElement("button",{className:"btn",onClick:()=>R("eraser")},t.createElement(wh,null)),t.createElement("button",{className:"btn",onClick:()=>v.current.undo()},t.createElement(Ch,null)),t.createElement("button",{className:"btn",onClick:()=>v.current.clear()},t.createElement(xt,null)),t.createElement("span",{className:"divider"}),t.createElement("button",{className:"btn",onClick:()=>null==m?void 0:m()},t.createElement(Ze,null)),t.createElement("button",{className:"btn",onClick:()=>Tn(void 0,void 0,void 0,(function*(){V(!0),yield Ln(10);const e=yield z();V(!1),W(),null==h||h(e)}))},t.createElement(je,null))),t.createElement("button",{className:"btn btn-fold",title:f(D?"qm.divider.spread":"qm.divider.collect"),onClick:()=>M(!D)},D?t.createElement(It,null):t.createElement(Nt,null))))))}));Th.displayName="QmSignature";const Nh="1.10.5";export{fn as Calendar,gn as DatePicker,il as DcpAnchor,$n as DcpButton,vi as DcpCollapse,Sn as DcpConfigProvider,Bu as DcpCopyToClipboard,Hi as DcpCountup,ld as DcpCropper,Vn as DcpDivider,tl as DcpDownload,ol as DcpDrawer,Fi as DcpEmpty,jc as DcpForm,sh as DcpGuideTracker,gh as DcpLazyLoad,dl as DcpModal,Vp as DcpPrint,pp as DcpRangeTableHelper,Xi as DcpScrollbar,ip as DcpSearchHelper,gd as DcpSearchTree,Th as DcpSignature,qn as DcpSpace,Di as DcpSpin,_i as DcpSplit,rp as DcpTable,al as DcpTabs,id as DcpTinymce,Np as DcpTour,Ap as DcpTransition,cp as DcpTreeHelper,sp as DcpTreeTableHelper,el as DcpUploadFile,od as DcpUploadImg,ch as DcpWatermark,il as QmAnchor,$n as QmButton,vi as QmCollapse,Sn as QmConfigProvider,Bu as QmCopyToClipboard,Hi as QmCountup,ld as QmCropper,Vn as QmDivider,tl as QmDownload,ol as QmDrawer,Fi as QmEmpty,jc as QmForm,sh as QmGuideTracker,gh as QmLazyLoad,dl as QmModal,Vp as QmPrint,pp as QmRangeTableHelper,Xi as QmScrollbar,ip as QmSearchHelper,gd as QmSearchTree,Th as QmSignature,qn as QmSpace,Di as QmSpin,_i as QmSplit,rp as QmTable,al as QmTabs,id as QmTinymce,Np as QmTour,Ap as QmTransition,cp as QmTreeHelper,sp as QmTreeTableHelper,el as QmUploadFile,od as QmUploadImg,ch as QmWatermark,yn as TimePicker,Ma as pinyin,Nh as version};
|
|
1
|
+
import*as e from"react";import t,{createContext as n,Component as r,version as i,isValidElement as a,useRef as l,useLayoutEffect as o,useEffect as s,createRef as c,forwardRef as d,useImperativeHandle as u,useState as p,useCallback as h}from"react";import*as m from"prop-types";import f from"prop-types";import g from"dayjs";import"dayjs/locale/zh-cn";import v from"dayjs/plugin/localeData";import y from"dayjs/plugin/advancedFormat";import b from"dayjs/plugin/customParseFormat";import x from"dayjs/plugin/quarterOfYear";import E from"dayjs/plugin/weekOfYear";import S from"dayjs/plugin/weekday";import{ConfigProvider as w,Button as C,Popconfirm as T,Space as N,Empty as I,Spin as R,Input as O,Upload as k,message as L,Tabs as A,Drawer as P,Modal as _,Form as H,Row as F,Col as D,Select as $,Checkbox as M,Dropdown as q,InputNumber as j,Rate as V,Radio as K,Switch as z,Tag as W,TreeSelect as B,Cascader as U,notification as G,Tooltip as Y,Image as X,Tree as Z,Menu as Q,Popover as J,Pagination as ee,Slider as te}from"antd";export{Affix,Alert,Anchor,AutoComplete,Avatar,BackTop,Badge,Breadcrumb,Button,Card,Carousel,Cascader,Checkbox,Col,Collapse,Comment,ConfigProvider,Descriptions,Divider,Drawer,Dropdown,Empty,Form,Grid,Image,Input,InputNumber,Layout,List,Mentions,Menu,Modal,PageHeader,Pagination,Popconfirm,Popover,Progress,Radio,Rate,Result,Row,Segmented,Select,Skeleton,Slider,Space,Spin,Statistic,Steps,Switch,Table,Tabs,Tag,Timeline,Tooltip,Transfer,Tree,TreeSelect,Typography,Upload,message,notification}from"antd";import ne from"dayjs/plugin/weekYear";import re from"antd/es/calendar/generateCalendar";import"antd/es/calendar/style";import ie from"antd/es/date-picker/generatePicker";import"antd/es/date-picker/style/index";import ae from"antd/es/locale/zh_CN";import le from"antd/es/locale/en_GB";import{isArray as oe,isPlainObject as se,isNumber as ce,isFunction as de,isString as ue,throttle as pe,isUndefined as he,get as me,transform as fe,isEqual as ge,set as ve,xor as ye,isRegExp as be,merge as xe,uniqBy as Ee,debounce as Se,intersection as we,map as Ce,groupBy as Te,flatten as Ne,spread as Ie,mergeWith as Re,isDate as Oe,omitBy as ke,sumBy as Le,maxBy as Ae,minBy as Pe,union as _e,pickBy as He}from"lodash-es";import Fe from"classnames";import{UpOutlined as De,DownOutlined as $e,PaperClipOutlined as Me,EditOutlined as qe,CheckOutlined as je,EyeOutlined as Ve,DownloadOutlined as Ke,DeleteOutlined as ze,UploadOutlined as We,FullscreenExitOutlined as Be,FullscreenOutlined as Ue,HolderOutlined as Ge,UnorderedListOutlined as Ye,SearchOutlined as Xe,CloseOutlined as Ze,ExclamationCircleOutlined as Qe,ReloadOutlined as Je,ZoomInOutlined as et,ZoomOutOutlined as tt,RotateRightOutlined as nt,RotateLeftOutlined as rt,InboxOutlined as it,InfoCircleFilled as at,PrinterOutlined as lt,ImportOutlined as ot,SettingOutlined as st,CopyOutlined as ct,CheckSquareOutlined as dt,CloseCircleOutlined as ut,MonitorOutlined as pt,PlusOutlined as ht,PieChartOutlined as mt,FunnelPlotOutlined as ft,AppstoreAddOutlined as gt,StepBackwardOutlined as vt,StepForwardOutlined as yt,InfoCircleOutlined as bt,ClearOutlined as xt,PauseOutlined as Et,CaretRightOutlined as St,QuestionCircleOutlined as wt,MenuOutlined as Ct,BorderOutlined as Tt,RightOutlined as Nt,LeftOutlined as It}from"@ant-design/icons";import Rt from"react-countup";import Ot from"resize-observer-polyfill";import kt from"sortablejs";import Lt from"add-dom-event-listener";import At from"scroll-into-view-if-needed";import Pt from"react-draggable";import _t from"memoize-one";import Ht from"cropperjs";import Ft from"big.js";import Dt from"react-dom";import $t from"copy-to-clipboard";import Mt from"@rc-component/portal";import qt from"@rc-component/trigger";import jt from"html2canvas";import{ReactSortable as Vt}from"react-sortablejs";import Kt from"localforage";import zt from"exceljs";import Wt from"china-area-data";const Bt=n({locale:"zh-cn",size:"middle"});var Ut={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",countLimit:"数量不能超过 {count} 个",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传",remove:"删除文件"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选",nullValue:"空值"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",tabPanes:["查找条件","更多条件"],matchCase:"大小写匹配",matchFullchar:"全字符匹配",clear:"清空条件",queryPrev:"查找上一个",queryNext:"查找下一个"}}}};let Gt=Ut;function Yt(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const Xt=(...e)=>{const[t,n]=e;let r;const i=t.split(".");let a=Gt;for(let e=0,t=i.length;e<t;e++){if(r=a[i[e]],e===t-1)return Yt(r,n);if(!r)return"";a=r}return""},Zt=e=>{Gt=e||Gt,Gt.name&&g.locale(Gt.name)};class Qt extends Error{constructor(e){super(e),this.name="QmDesignError"}}function Jt(e,t){throw new Qt(`[${e}] ${t}`)}function en(e,t){console.warn(new Qt(`[${e}] ${t}`))}const tn=e=>"number"==typeof e||void 0===e||(["px","rem","em","vw","vh","%"].some((t=>e.endsWith(t)))||e.startsWith("calc")),nn=e=>["","small","middle","large"].includes(e);g.extend(v),g.extend(y),g.extend(b),g.extend(x),g.extend(E),g.extend(S);var rn={},an=[];function ln(e,t){if(!e&&void 0!==console){var n=an.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function on(e,t){if(!e&&void 0!==console){var n=an.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function sn(e,t,n){t||rn[n]||(e(!1,n),rn[n]=!0)}function cn(e,t){sn(ln,e,t)}function dn(e,t){sn(on,e,t)}cn.preMessage=function(e){an.push(e)},cn.resetWarned=function(){rn={}},cn.noteOnce=dn,g.extend(b),g.extend(y),g.extend(S),g.extend(v),g.extend(E),g.extend(ne),g.extend((function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=(e||"").replace("Wo","wo");return r.bind(this)(t)}}));var un={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},pn=function(e){return un[e]||e.split("_")[0]},hn=function(){dn(!1,"Not match any format. Please help to fire a issue about this.")},mn={getNow:function(){return g()},getFixedDate:function(e){return g(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return g().locale(pn(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(pn(e)).weekday(0)},getWeek:function(e,t){return t.locale(pn(e)).week()},getShortWeekDays:function(e){return g().locale(pn(e)).localeData().weekdaysMin()},getShortMonths:function(e){return g().locale(pn(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(pn(e)).format(n)},parse:function(e,t,n){for(var r=pn(e),i=0;i<n.length;i+=1){var a=n[i],l=t;if(a.includes("wo")||a.includes("Wo")){for(var o=l.split("-")[0],s=l.split("-")[1],c=g(o,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var u=c.add(d,"week");if(u.format("Wo")===s)return u}return hn(),null}var p=g(l,a).locale(r);if(p.isValid())return p}return t&&hn(),null}}};const fn=re(mn),gn=ie(mn);function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vn.apply(null,arguments)}const yn=e.forwardRef(((t,n)=>e.createElement(gn,vn({},t,{picker:"time",mode:void 0,ref:n}))));yn.displayName="TimePicker";const bn=e.forwardRef(((t,n)=>e.createElement(gn.RangePicker,vn({},t,{picker:"time",mode:void 0,ref:n}))));bn.displayName="RangePicker",yn.RangePicker=bn;var xn={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",countLimit:"Quantity cannot exceed {count}",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload",remove:"Delete files"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter",nullValue:"Null Value"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",tabPanes:["Search condition","More conditions"],matchCase:"Case matching",matchFullchar:"Full character matching",clear:"Clear condition",queryPrev:"Find previous",queryNext:"Find next"}}}};const En={[xn.name]:{qm:xn,antd:le},[Ut.name]:{qm:Ut,antd:ae}};class Sn extends r{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},Zt(Object.assign({},En,e.global.langPackage)[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:n,size:r}=t.value,{locale:i,size:a,global:l}=e;return i!==n&&Zt(Object.assign({},En,l.langPackage)[i].qm),i!==n||a!==r?{value:Object.assign({},t.value,{locale:i,size:a})}:null}render(){const{global:e}=this.props,{value:n}=this.state,r=Object.assign({},En,e.langPackage);return t.createElement(Bt.Provider,{value:n},t.createElement(w,{locale:r[n.locale].antd,componentSize:n.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}function wn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function Cn(e,t,n,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(l=(a<3?i(l):a>3?i(t,n,l):i(t,n))||l);return a>3&&l&&Object.defineProperty(t,n,l),l}function Tn(e,t,n,r){return new(n||(n=Promise))((function(i,a){function l(e){try{s(r.next(e))}catch(e){a(e)}}function o(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,o)}s((r=r.apply(e,t||[])).next())}))}Sn.propTypes={locale:f.string,size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("ConfigProvider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},theme:f.string,global:f.object},Sn.defaultProps={locale:"zh-cn",size:"middle",global:{}};var Nn="undefined"==typeof window;const In=e=>t.isValidElement(e),Rn=e=>In(e)&&e.type===t.Fragment,On=()=>{},kn=()=>!0,Ln=e=>Tn(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),An=e=>{Promise.resolve().then(e)},Pn=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),_n=e=>!!(!e&&0!==e||oe(e)&&!e.length||se(e)&&!Object.keys(e).length),Hn=(e,t)=>{const n=Object.assign({},e);for(const e of t)delete n[e];return n};const Fn=(e,t=new WeakMap)=>{if(se(e)||oe(e)){const n=Array.isArray(e),r=n?[]:{};if(t.get(e))return e;t.set(e,r);const i=n?void 0:Object.keys(e);return function(e,t){let n=-1;const r=e.length;for(;++n<r;)t(e[n],n)}(i||e,((n,a)=>{i&&(a=n),r[a]=Fn(e[a],t)})),r}return e},Dn=e=>ce(e)?`${e}px`:e.toString();class $n extends r{constructor(){super(...arguments),this.state={isLoading:!1},this.clickHandle=e=>Tn(this,void 0,void 0,(function*(){var t,n;this.setState({isLoading:!0});try{yield null===(n=(t=this.props).click)||void 0===n?void 0:n.call(t,e)}catch(e){en("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:n,authConfig:r,click:i,confirm:a}=this.props,{isLoading:l}=this.state,o=e||this.context.size||"",s=de(i)?{onClick:this.clickHandle}:null,c=Object.assign(Object.assign(Object.assign({},Hn(this.props,["authConfig","click","confirm"])),{size:o,loading:l||n||!1}),s);if(r){const{visible:e=1,disabled:t}=r||{};if(!e)return null;t&&(c.disabled=!0)}return a?t.createElement(T,{title:a.title||Xt("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{var t,n;null===(t=a.onConfirm)||void 0===t||t.call(a),null===(n=c.onClick)||void 0===n||n.call(c,e)},onCancel:e=>{var t;null===(t=a.onCancel)||void 0===t||t.call(a,e)}},t.createElement(C,vn({},c,{onClick:On}),this.props.children)):t.createElement(C,c,this.props.children)}}var Mn;$n.propTypes={click:f.func,confirm:f.shape({title:f.node,onConfirm:f.func,onCancel:f.func})},$n.contextType=Bt,function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(Mn||(Mn={}));class qn extends r{render(){const{size:e}=this.props,n=e||this.context.size||"",r=ce(e)?e:Mn[e||n||"default"],i=Object.assign(Object.assign({},this.props),{size:r});return t.createElement(N,i,this.props.children)}}qn.contextType=Bt;const jn=e=>`qm-${e}`;class Vn extends r{constructor(){super(...arguments),this.clickHandle=()=>{const{collapse:e,onCollapseChange:t=On}=this.props;t(!e)}}render(){const{size:e,label:n,extra:r,collapse:i,bordered:a,disabled:l,id:o,className:s,style:c}=this.props,d=e||this.context.size||"",u=jn("divider"),p={[u]:!0,[`${u}-borderless`]:!a,[`${u}--lg`]:"large"===d,[`${u}--sm`]:"small"===d};return t.createElement("div",{id:o,className:Fe(p,s),style:c},t.createElement("span",{className:Fe(`${u}__title`)},n),t.createElement("div",{className:Fe(`${u}__extra`)},r),void 0!==i&&t.createElement(C,{type:"link",className:Fe(`${u}__collapse`),disabled:l,onClick:this.clickHandle},Xt(i?"qm.divider.collect":"qm.divider.spread"),i?t.createElement(De,null):t.createElement($e,null)))}}Vn.contextType=Bt,Vn.propTypes={label:f.string,size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},extra:f.oneOfType([f.element,f.string]),collapse:f.bool,bordered:f.bool},Vn.defaultProps={bordered:!0};const Kn=()=>({height:0,opacity:0}),zn=(e,t)=>"height"===t.propertyName,Wn={motionName:"rc-collapse-motion",onEnterStart:Kn,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:Kn,onEnterEnd:zn,onLeaveEnd:zn,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"};function Bn(e){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bn(e)}function Un(e){var t=function(e,t){if("object"!==Bn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Bn(t)?t:String(t)}function Gn(e,t,n){return(t=Un(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yn(Object(n),!0).forEach((function(t){Gn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,l,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jn(e){return e instanceof HTMLElement||e instanceof SVGElement}function er(e){var n,r=function(e){return e&&"object"===Bn(e)&&Jn(e.nativeElement)?e.nativeElement:Jn(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=Dt.findDOMNode)||void 0===n?void 0:n.call(Dt,e):null)}var tr,nr={exports:{}},rr={};nr.exports=(tr||(tr=1,function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function f(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var f=e.type;switch(f){case r:case a:case i:case d:case u:return f;default:var g=f&&f.$$typeof;switch(g){case s:case o:case c:case h:case p:case l:return g;default:return m}}case n:return m}}}e=Symbol.for("react.module.reference");var g=o,v=l,y=t,b=c,x=r,E=h,S=p,w=n,C=a,T=i,N=d,I=u,R=!1,O=!1;rr.ContextConsumer=g,rr.ContextProvider=v,rr.Element=y,rr.ForwardRef=b,rr.Fragment=x,rr.Lazy=E,rr.Memo=S,rr.Portal=w,rr.Profiler=C,rr.StrictMode=T,rr.Suspense=N,rr.SuspenseList=I,rr.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},rr.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},rr.isContextConsumer=function(e){return f(e)===o},rr.isContextProvider=function(e){return f(e)===l},rr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},rr.isForwardRef=function(e){return f(e)===c},rr.isFragment=function(e){return f(e)===r},rr.isLazy=function(e){return f(e)===h},rr.isMemo=function(e){return f(e)===p},rr.isPortal=function(e){return f(e)===n},rr.isProfiler=function(e){return f(e)===a},rr.isStrictMode=function(e){return f(e)===i},rr.isSuspense=function(e){return f(e)===d},rr.isSuspenseList=function(e){return f(e)===u},rr.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===i||t===d||t===u||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===p||t.$$typeof===l||t.$$typeof===o||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},rr.typeOf=f}()),rr);var ir=function(e,t){"function"==typeof e?e(t):"object"===Bn(e)&&e&&"current"in e&&(e.current=t)},ar=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(Boolean);return r.length<=1?r[0]:function(e){t.forEach((function(t){ir(t,e)}))}},lr=function(e){var t,n,r=nr.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===nr.exports.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===nr.exports.ForwardRef)};function or(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}Number(i.split(".")[0]);var sr=e.createContext({});function cr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Un(r.key),r)}}function ur(e,t,n){return t&&dr(e.prototype,t),n&&dr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pr(e,t){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pr(e,t)}function hr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pr(e,t)}function mr(e){return mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mr(e)}function fr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=mr(e);if(t){var i=mr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fr(e)}(this,n)}}var vr=function(t){hr(r,e.Component);var n=gr(r);function r(){return cr(this,r),n.apply(this,arguments)}return ur(r,[{key:"render",value:function(){return this.props.children}}]),r}();function yr(t){var n=e.useRef(!1),r=Qn(e.useState(t),2),i=r[0],a=r[1];return e.useEffect((function(){return n.current=!1,function(){n.current=!0}}),[]),[i,function(e,t){t&&n.current||a(e)}]}var br="none",xr="appear",Er="enter",Sr="leave",wr="none",Cr="prepare",Tr="start",Nr="active",Ir="end",Rr="prepared";function Or(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Lr,Ar,Pr,_r=(Lr=Or(),Ar="undefined"!=typeof window?window:{},Pr={animationend:kr("Animation","AnimationEnd"),transitionend:kr("Transition","TransitionEnd")},Lr&&("AnimationEvent"in Ar||delete Pr.animationend.animation,"TransitionEvent"in Ar||delete Pr.transitionend.transition),Pr),Hr={};if(Or()){var Fr=document.createElement("div");Hr=Fr.style}var Dr={};function $r(e){if(Dr[e])return Dr[e];var t=_r[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var a=n[i];if(Object.prototype.hasOwnProperty.call(t,a)&&a in Hr)return Dr[e]=t[a],Dr[e]}return""}var Mr=$r("animationend"),qr=$r("transitionend"),jr=!(!Mr||!qr),Vr=Mr||"animationend",Kr=qr||"transitionend";function zr(e,t){return e?"object"===Bn(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var Wr=function(t){var n=l(),r=l(t);r.current=t;var i=e.useCallback((function(e){r.current(e)}),[]);function a(e){e&&(e.removeEventListener(Kr,i),e.removeEventListener(Vr,i))}return e.useEffect((function(){return function(){a(n.current)}}),[]),[function(e){n.current&&n.current!==e&&a(n.current),e&&e!==n.current&&(e.addEventListener(Kr,i),e.addEventListener(Vr,i),n.current=e)},a]},Br=Or()?o:s,Ur=function(e){return+setTimeout(e,16)},Gr=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Ur=function(e){return window.requestAnimationFrame(e)},Gr=function(e){return window.cancelAnimationFrame(e)});var Yr=0,Xr=new Map;function Zr(e){Xr.delete(e)}var Qr=function(e){var t=Yr+=1;return function n(r){if(0===r)Zr(t),e();else{var i=Ur((function(){n(r-1)}));Xr.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};Qr.cancel=function(e){var t=Xr.get(e);return Zr(e),Gr(t)},Qr.ids=function(){return Xr};var Jr=[Cr,Tr,Nr,Ir],ei=[Cr,Rr],ti=!1,ni=!0;function ri(e){return e===Nr||e===Ir}var ii=function(t,n,r){var i=Qn(yr(wr),2),a=i[0],l=i[1],o=function(){var t=e.useRef(null);function n(){Qr.cancel(t.current)}return e.useEffect((function(){return function(){n()}}),[]),[function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n();var a=Qr((function(){i<=1?r({isCanceled:function(){return a!==t.current}}):e(r,i-1)}));t.current=a},n]}(),s=Qn(o,2),c=s[0],d=s[1];var u=n?ei:Jr;return Br((function(){if(a!==wr&&a!==Ir){var e=u.indexOf(a),t=u[e+1],n=r(a);n===ti?l(t,!0):t&&c((function(e){function r(){e.isCanceled()||l(t,!0)}!0===n?r():Promise.resolve(n).then(r)}))}}),[t,a]),e.useEffect((function(){return function(){d()}}),[]),[function(){l(Cr,!0)},a]};var ai=function(t){var n=t;"object"===Bn(t)&&(n=t.transitionSupport);var r=e.forwardRef((function(t,r){var i=t.visible,a=void 0===i||i,o=t.removeOnLeave,c=void 0===o||o,d=t.forceRender,u=t.children,p=t.motionName,h=t.leavedClassName,m=t.eventProps,f=function(e,t){return!(!e.motionName||!n||!1===t)}(t,e.useContext(sr).motion),g=l(),v=l();var y=function(t,n,r,i){var a=i.motionEnter,o=void 0===a||a,c=i.motionAppear,d=void 0===c||c,u=i.motionLeave,p=void 0===u||u,h=i.motionDeadline,m=i.motionLeaveImmediately,f=i.onAppearPrepare,g=i.onEnterPrepare,v=i.onLeavePrepare,y=i.onAppearStart,b=i.onEnterStart,x=i.onLeaveStart,E=i.onAppearActive,S=i.onEnterActive,w=i.onLeaveActive,C=i.onAppearEnd,T=i.onEnterEnd,N=i.onLeaveEnd,I=i.onVisibleChanged,R=Qn(yr(),2),O=R[0],k=R[1],L=Qn(yr(br),2),A=L[0],P=L[1],_=Qn(yr(null),2),H=_[0],F=_[1],D=l(!1),$=l(null);function M(){return r()}var q=l(!1);function j(){P(br,!0),F(null,!0)}function V(e){var t=M();if(!e||e.deadline||e.target===t){var n,r=q.current;A===xr&&r?n=null==C?void 0:C(t,e):A===Er&&r?n=null==T?void 0:T(t,e):A===Sr&&r&&(n=null==N?void 0:N(t,e)),A!==br&&r&&!1!==n&&j()}}var K=Qn(Wr(V),1)[0],z=function(e){var t,n,r;switch(e){case xr:return Gn(t={},Cr,f),Gn(t,Tr,y),Gn(t,Nr,E),t;case Er:return Gn(n={},Cr,g),Gn(n,Tr,b),Gn(n,Nr,S),n;case Sr:return Gn(r={},Cr,v),Gn(r,Tr,x),Gn(r,Nr,w),r;default:return{}}},W=e.useMemo((function(){return z(A)}),[A]),B=Qn(ii(A,!t,(function(e){if(e===Cr){var t=W[Cr];return t?t(M()):ti}var n;return G in W&&F((null===(n=W[G])||void 0===n?void 0:n.call(W,M(),null))||null),G===Nr&&(K(M()),h>0&&(clearTimeout($.current),$.current=setTimeout((function(){V({deadline:!0})}),h))),G===Rr&&j(),ni})),2),U=B[0],G=B[1],Y=ri(G);q.current=Y,Br((function(){k(n);var e,r=D.current;D.current=!0,!r&&n&&d&&(e=xr),r&&n&&o&&(e=Er),(r&&!n&&p||!r&&m&&!n&&p)&&(e=Sr);var i=z(e);e&&(t||i[Cr])?(P(e),U()):P(br)}),[n]),s((function(){(A===xr&&!d||A===Er&&!o||A===Sr&&!p)&&P(br)}),[d,o,p]),s((function(){return function(){D.current=!1,clearTimeout($.current)}}),[]);var X=e.useRef(!1);s((function(){O&&(X.current=!0),void 0!==O&&A===br&&((X.current||O)&&(null==I||I(O)),X.current=!0)}),[O,A]);var Z=H;return W[Cr]&&G===Tr&&(Z=Xn({transition:"none"},Z)),[A,G,Z,null!=O?O:n]}(f,a,(function(){try{return g.current instanceof HTMLElement?g.current:er(v.current)}catch(e){return null}}),t),b=Qn(y,4),x=b[0],E=b[1],S=b[2],w=b[3],C=e.useRef(w);w&&(C.current=!0);var T,N=e.useCallback((function(e){g.current=e,ir(r,e)}),[r]),I=Xn(Xn({},m),{},{visible:a});if(u)if(x===br)T=w?u(Xn({},I),N):!c&&C.current&&h?u(Xn(Xn({},I),{},{className:h}),N):d||!c&&!h?u(Xn(Xn({},I),{},{style:{display:"none"}}),N):null;else{var R,O;E===Cr?O="prepare":ri(E)?O="active":E===Tr&&(O="start");var k=zr(p,"".concat(x,"-").concat(O));T=u(Xn(Xn({},I),{},{className:Fe(zr(p,x),(R={},Gn(R,k,k&&O),Gn(R,p,"string"==typeof p),R)),style:S}),N)}else T=null;e.isValidElement(T)&&lr(T)&&(T.ref||(T=e.cloneElement(T,{ref:N})));return e.createElement(vr,{ref:v},T)}));return r.displayName="CSSMotion",r}(jr);function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},li.apply(this,arguments)}var oi="add",si="keep",ci="remove",di="removed";function ui(e){var t;return Xn(Xn({},t=e&&"object"===Bn(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function pi(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(ui)}var hi=["component","children","onVisibleChanged","onAllRemoved"],mi=["status"],fi=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ai,r=function(t){hr(i,e.Component);var r=gr(i);function i(){var e;cr(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return Gn(fr(e=r.call.apply(r,[this].concat(n))),"state",{keyEntities:[]}),Gn(fr(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:Xn(Xn({},e),{},{status:di})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==di})).length})),e}return ur(i,[{key:"render",value:function(){var t=this,r=this.state.keyEntities,i=this.props,a=i.component,l=i.children,o=i.onVisibleChanged,s=i.onAllRemoved,c=or(i,hi),d=a||e.Fragment,u={};return fi.forEach((function(e){u[e]=c[e],delete c[e]})),delete c.keys,e.createElement(d,c,r.map((function(r){var i=r.status,a=or(r,mi),c=i===oi||i===si;return e.createElement(n,li({},u,{key:a.key,visible:c,eventProps:a,onVisibleChanged:function(e){(null==o||o(e,{key:a.key}),e)||0===t.removeKey(a.key)&&s&&s()}}),l)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,i=pi(n),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,a=pi(e),l=pi(t);a.forEach((function(e){for(var t=!1,a=r;a<i;a+=1){var o=l[a];if(o.key===e.key){r<a&&(n=n.concat(l.slice(r,a).map((function(e){return Xn(Xn({},e),{},{status:oi})}))),r=a),n.push(Xn(Xn({},o),{},{status:si})),r+=1,t=!0;break}}t||n.push(Xn(Xn({},e),{},{status:ci}))})),r<i&&(n=n.concat(l.slice(r).map((function(e){return Xn(Xn({},e),{},{status:oi})}))));var o={};return n.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==ci}))).forEach((function(t){t.key===e&&(t.status=si)}))})),n}(r,i);return{keyEntities:a.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==di||e.status!==ci}))}}}]),i}();Gn(r,"defaultProps",{component:"div"})}(jr);const gi=t.forwardRef(((e,n)=>{const{forceRender:r,className:i,style:a,boxStyle:l,isActive:o}=e,[s,c]=t.useState(o||r);if(t.useEffect((()=>{(r||o)&&c(!0)}),[r,o]),!s)return null;const d=jn("collapse");return t.createElement("div",{ref:n,className:Fe(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},i),style:a},t.createElement("div",{className:`${d}-content-box`,style:l},e.children))}));gi.displayName="PanelContent";const vi=e=>{const{defaultActive:n,label:r,extra:i,className:a,style:l,containerStyle:o,bordered:s,disabled:c,forceRender:d,destroyOnClose:u=!1,onChange:p}=e,[h,m]=t.useState(!!n),f=jn("collapse"),g=Fe({[`${f}`]:!0,[`${f}-active`]:h,[`${f}-disabled`]:c},a);return t.createElement("div",{className:g,style:l},t.createElement(Vn,{label:r,extra:i,collapse:h,bordered:s,disabled:c,onCollapseChange:e=>{m(e),null==p||p(e)}}),t.createElement(ai,vn({visible:h},Wn,{leavedClassName:`${f}-content-hidden`,forceRender:d,removeOnLeave:u}),(({className:n,style:r},i)=>t.createElement(gi,{ref:i,prefixCls:f,className:n,style:r,boxStyle:o,isActive:h,forceRender:d},e.children))))};vi.displayName="QmCollapse";const yi=t.createContext(void 0);function bi(t,n){((t,n)=>{const r=e.useRef(!0);e.useEffect((()=>t(r.current)),n),e.useEffect((()=>(r.current=!1,()=>{r.current=!0})),[])})((e=>{if(!e)return t()}),n)}const xi=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},Ei=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},Si=e=>e.preventDefault(),wi=(e,t)=>{if(Nn||!e||!t)return null;"float"===(t=Pn(t))&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=window.getComputedStyle(e);return r?r[t]:""}catch(n){return e.style[t]}},Ci=(e,t,n)=>{!Nn&&e&&t&&(se(t)?Object.keys(t).forEach((n=>{Ci(e,n,t[n])})):(t=Pn(t),e.style[t]=n))},Ti=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Ni=(e,t)=>Math.abs(Ti(e)-Ti(t)),Ii=e=>{let t=0,n=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}},Ri=(e,t)=>{var n;let r=e;for(;r;){if(null===(n=r.classList)||void 0===n?void 0:n.contains(t))return r;r=r.parentNode}return null},Oi=(e,t)=>{if(Nn||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},ki=e=>Math.pow(e,3),Li=e=>e<.5?ki(2*e)/2:1-ki(2*(1-e))/2,Ai=e=>{const{minValues:n,onDragChange:r,onDragging:i}=e,{splitRef:a,direction:l}=t.useContext(yi),o=t.useRef(Nn?null:document.onselectstart),s=t.useMemo((()=>"horizontal"===l),[l]),c=t.useMemo((()=>s?"X":"Y"),[s]),d=t.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),u=e=>{d.current=Object.assign({},d.current,e)},p=e=>{if(1!==e.buttons)return h();const t=e[`page${c}`]-d.current[`start${c}`],r=[n[0],d.current[`containerSize${c}`]-n[1]];let a=d.current[`firstElementSize${c}`]+t;a=Math.max(r[0],a),a=Math.min(r[1],a),i(a)},h=()=>{u({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),Ei(document,"mousemove",p),Ei(document,"mouseup",h),m()},m=()=>{document.onselectstart!==o.current&&(document.onselectstart=o.current)},f={[`${jn("split")}__resize-bar`]:!0,vertical:"vertical"===l,horizontal:"horizontal"===l};return t.createElement("div",{className:Fe(f),title:Xt("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];u({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),xi(document,"mousemove",p),xi(document,"mouseup",h),r(!0),o.current=document.onselectstart,document.onselectstart=()=>!1}})};Ai.displayName="ResizeBar";const Pi=t.forwardRef(((e,n)=>{const{offset:r,className:i,style:a}=e,{direction:l,dragging:o}=t.useContext(yi),s="vertical"===l?"height":"width",c={[jn("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===l,vertical:"vertical"===l,[i]:!!i},d=void 0!==r?{[s]:Dn(r)}:{flex:1,[s]:0};return t.createElement("div",{ref:n,className:Fe(c),style:Object.assign(Object.assign({},d),a)},e.children)}));Pi.displayName="QmSplitPane";const _i=e=>{const{direction:n="horizontal",defaultValue:r="50%",uniqueKey:i,className:a,style:l,onDragStart:o,onDrag:s=On,onDragEnd:c}=e,{global:d}=t.useContext(Bt),u=t.useRef(null),p=t.useRef(null),h=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,m=e=>Number.parseInt(e,10),f=e=>{var t;const n=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return n>=0?n:0},g=t.useMemo((()=>i?`split_${i}`:""),[i]),[v,y]=t.useState(!1),[b,x]=t.useState(h(r));bi((()=>{v?null==o||o(m(b)):(null==c||c(m(b)),localStorage.setItem(g,b),w(g,b))}),[v]),t.useEffect((()=>{E()}),[]);const E=()=>{if(!g)return;const e=localStorage.getItem(g);e?x(h(e)):S(g).then((e=>{localStorage.setItem(g,h(e||r)),E()})).catch((()=>{}))},S=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),w=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),C=t.useMemo((()=>({splitRef:u,direction:n,dragging:v})),[n,v]),T=[];t.Children.map(e.children,(e=>{var t;In(e)&&!Rn(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&T.push(e)}));const[N,I]=T,R=t.useMemo((()=>[f(N),f(I)]),[N,I]),O={[jn("split")]:!0,vertical:"vertical"===n};return t.createElement(yi.Provider,{value:C},t.createElement("div",{ref:u,className:Fe(O,a),style:l},t.createElement(Pi,vn({},N.props,{ref:p,offset:b})),t.createElement(Ai,{minValues:R,onDragChange:e=>y(e),onDragging:e=>{x(`${e}px`),s(e)}}),t.createElement(Pi,I.props)))};_i.Pane=Pi,_i.displayName="QmSplit";class Hi extends r{render(){const{size:e,className:n,style:r}=this.props,i=e||this.context.size||"",a=jn("countup"),l={[a]:!0,[`${a}--lg`]:"large"===i,[`${a}--sm`]:"small"===i};return t.createElement(Rt,vn({},this.props,{className:Fe(l,n),style:r}),this.props.children)}}Hi.defaultProps={duration:2},Hi.contextType=Bt;class Fi extends r{render(){const{size:e,className:n}=this.props,r=e||this.context.size||"",i=jn("empty"),a=Object.assign(Object.assign({},this.props),{image:I.PRESENTED_IMAGE_SIMPLE}),l={[i]:!0,[`${i}--lg`]:"large"===r,[`${i}--sm`]:"small"===r};return t.createElement(I,vn({},a,{className:Fe(l,n)}))}}Fi.contextType=Bt,Fi.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Empty","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class Di extends r{render(){const{fullHeight:e,className:n,style:r={}}=this.props,i={[`${jn("spin")}-full-height`]:e},a=Object.assign(Object.assign({wrapperClassName:Fe(i,n)},Hn(this.props,["fullHeight"])),{style:Object.assign(Object.assign({},r),{maxHeight:"none"})});return t.createElement(R,a,this.props.children)}}Di.defaultProps={tip:"Loading...",fullHeight:!1};const $i=t.createContext(void 0),Mi=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},qi=function(e,t){!Nn&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new Ot(Mi),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},ji=function(e,t){var n;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(n=e.__ro__)||void 0===n||n.disconnect())};function Vi(t){const[n,r]=e.useState({width:0,height:0});return e.useLayoutEffect((()=>{const e=t.current,n=e=>{const{width:t,height:n}=e.contentRect;r({width:t,height:n})};return e&&qi(e,n),()=>{e&&ji(e,n)}}),[t]),n}const Ki=(t,n)=>{const r=e.useRef(!0);e.useLayoutEffect((()=>t(r.current)),n),e.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function zi(e,t){Ki((t=>{if(!t)return e()}),t)}function Wi(t,n){const r=e.useRef(null);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{r.current&&clearTimeout(r.current),r.current=setTimeout((()=>t.apply(this,e)),n)}),[t,n])}const Bi=6,Ui={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",reverse:"width",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",reverse:"height",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},Gi=e=>{const{thumb:n,always:r,className:i,barSize:a=Bi,direction:l="vertical",onDrag:o=On}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=t.useContext($i),u=Ui[l],p=t.useRef(n),h=t.useRef(null),m=t.useRef(null),f=t.useRef({}),g=t.useRef(!1),v=t.useRef(!1),y=t.useRef(Nn?null:document.onselectstart),[b,x]=t.useState(!1);t.useLayoutEffect((()=>{p.current=n}),[n]),t.useEffect((()=>{const e=c.current;return xi(e,"mousemove",C),xi(e,"mouseleave",T),()=>{w(),Ei(document,"mouseup",S),Ei(e,"mousemove",C),Ei(e,"mouseleave",T)}}),[]);const E=e=>{if(!h.current||!m.current)return;if(!g.current)return;const t=f.current[u.axis];if(!t)return;const n=100*(-1*(h.current.getBoundingClientRect()[u.direction]-e[u.client])-(m.current[u.offset]-t))/h.current[u.offset];d.current[u.scroll]=n*d.current[u.scrollSize]/100,o(!0)},S=()=>{g.current=!1,f.current={[u.axis]:0},Ei(document,"mousemove",E),Ei(document,"mouseup",S),w(),v.current&&x(!1),o(!1)},w=()=>{document.onselectstart!==y.current&&(document.onselectstart=y.current)},C=()=>{v.current=!1,x(!!p.current.size)},T=()=>{v.current=!0,x(g.current)},N=jn("scrollbar"),I={[`${N}__bar`]:!0,"is-vertical":"vertical"===l,"is-horizontal":"horizontal"===l},R={[u.reverse]:a},O={[u.size]:n.size,transform:`translate${u.axis}(${n.offset}%)`};return t.createElement(Ap,{name:"fade",in:r||s||b,timeout:300},t.createElement("div",{ref:h,className:Fe(I,i),style:R},t.createElement("div",{ref:m,className:`${N}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),xi(document,"mousemove",E),xi(document,"mouseup",S),g.current=!0,y.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(f.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},Yi=20,Xi=t.forwardRef(((e,n)=>{const{wrapClassName:r,wrapStyle:i,barWidth:a,always:l,native:o,showTopScrollbar:s,minSize:c=Yi,onScroll:d}=e,u=t.useRef(null),p=t.useRef(null),h=t.useRef(null),[m,f]=t.useState({size:0,offset:0,ratio:1}),[g,v]=t.useState({size:0,offset:0,ratio:1}),[y,b]=t.useState(!1),x=Vi(u),E=Vi(h);zi((()=>{!o&&S()}),[E.width,E.height,x.width,x.height]);const S=Wi((()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,n=Math.pow(e,2)/p.current.scrollHeight,r=Math.pow(t,2)/p.current.scrollWidth,i=Math.max(n,c),a=Math.max(r,c),l=n/(e-n)/(i/(e-i)),o=r/(t-r)/(a/(t-a)),s=i+4<e?i:0,d=a+4<t?a:0,u=100*p.current.scrollTop/e*l,h=100*p.current.scrollLeft/t*o;f(Object.assign({},m,{size:d,ratio:o,offset:h})),v(Object.assign({},g,{size:s,ratio:l,offset:u}))}),5),w=e=>{b(e)},C=(e,t)=>{ce(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollTop,i=window.requestAnimationFrame,a=()=>{const l=(Date.now()-n)/500;l<1?(e.scrollTop=r+(t-r)*Li(l),i(a)):e.scrollTop=t};i(a)})(p.current,e):p.current.scrollTop=e:en("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},T=(e,t)=>{ce(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollLeft,i=window.requestAnimationFrame,a=()=>{const l=(Date.now()-n)/500;l<1?(e.scrollLeft=r+(t-r)*Li(l),i(a)):e.scrollLeft=t};i(a)})(p.current,e):p.current.scrollLeft=e:en("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};t.useImperativeHandle(n,(()=>{var e,t;return{container:u.current,scrollTop:(null===(e=p.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=p.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:C,SET_SCROLL_LEFT:T}}));const N=t.useMemo((()=>({dragging:y,scrollbarElement:u,wrapElement:p})),[y]),I=jn("scrollbar"),R={[`${I}__wrap`]:!0,[`${I}__wrap--hidden`]:!o};return t.createElement("div",{ref:u,className:Fe(I,e.className),style:e.style},t.createElement("div",{ref:p,className:Fe(R,r),style:i,onScroll:e=>{const{scrollTop:t,scrollLeft:n}=e.target;!o&&(()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,n=100*p.current.scrollTop/e*g.ratio,r=100*p.current.scrollLeft/t*m.ratio;f(Object.assign({},m,{offset:r})),v(Object.assign({},g,{offset:n}))})(),null==d||d({scrollTop:t,scrollLeft:n})}},t.createElement("div",{ref:h,className:`${I}__view`},e.children)),!o&&t.createElement($i.Provider,{value:N},s&&t.createElement(Gi,{className:"top",direction:"horizontal",thumb:m,barSize:a,always:l,onDrag:w}),t.createElement(Gi,{direction:"horizontal",thumb:m,barSize:a,always:l,onDrag:w}),t.createElement(Gi,{direction:"vertical",thumb:g,barSize:a,always:l,onDrag:w})))}));Xi.displayName="QmScrollbar";const Zi=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const n=window.URL.createObjectURL(e);let r=document.createElement("a");r.href=n,r.download=decodeURI(t),r.click(),r=null}},Qi=(e,{fileName:t,headers:n,params:r})=>Tn(void 0,void 0,void 0,(function*(){const i=r?new URLSearchParams(r).toString():"",a=i?e.includes("?")?"&":"?":"",l=yield fetch(e+`${a+i}`,{method:"GET",headers:n});if(!l.ok)throw new Error(Xt("qm.download.error"));const o=yield l.blob(),s=l.headers.get("content-disposition"),c=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Zi(o,c)})),Ji=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e};class ea extends r{constructor(){super(...arguments),this.state={actived:{}},this.uploadRef=t.createRef(),this.setActiveState=(e,t)=>{this.setState((n=>({actived:Object.assign({},n.actived,{[e]:null!=t?t:!n.actived[e]})})))},this.createSortable=()=>{this.props.draggable&&(this.sortableInstance=kt.create(this.getFileListNode(),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:e=>{const{oldIndex:t,newIndex:n}=e,{fileList:r=[],onSortChange:i,onChange:a}=this.props;if(t!==n){const e=[...r],[l]=e.splice(t,1);e.splice(n,0,l),null==i||i(e),null==a||a({fileList:e})}}}))},this.getFileListNode=()=>Ri(this.uploadRef.current,jn("upload-file")).querySelector(".ant-upload-list"),this.beforeUpload=(e,t)=>new Promise(((n,r)=>Tn(this,void 0,void 0,(function*(){const{fileTypes:i=[],fileSize:a,maxCount:l,fileList:o=[],beforeUpload:s}=this.props,c=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),d=!a||e.size/1024/1024<a,u=!(l>1)||o.length<l,p=c&&d&&u;if(c||L.warning(Xt("qm.upload.tooltip",{type:i.join(",")})),d||L.warning(Xt("qm.upload.sizeLimit",{size:a})),u||L.warning(Xt("qm.upload.countLimit",{count:l})),!p)return k.LIST_IGNORE;if(s){const i=s(e,t);if(!0===i)return n(e);if(!1===i)return r("not upload");if(i&&"function"==typeof i.then)try{const e=yield i;n(e)}catch(e){r(e)}}else n(e)})))),this.doDownload=e=>Tn(this,void 0,void 0,(function*(){const{downloadWithHeaders:t,headers:n}=this.props;try{e.url&&(yield Qi(e.url,Object.assign({fileName:e.name},t?{headers:n}:null)))}catch(e){L.error(Xt("qm.download.error"))}})),this.itemRender=(e,n)=>{const{fileList:r=[],draggable:i,editable:a,disabled:l,readOnly:o,iconRender:s,onChange:c,onEditChange:d}=this.props,{actived:u}=this.state,{uid:p,name:h,url:m,status:f="done"}=e,g=l||o,v="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return t.createElement("div",{className:Fe("ant-upload-list-item",`ant-upload-list-item-${f}`,"ant-upload-list-item-list-type-text",{handle:i})},t.createElement("div",{className:"ant-upload-list-item-info"},t.createElement("span",{className:"ant-upload-span"},t.createElement("div",{className:"ant-upload-text-icon"},s?s(e):t.createElement(Me,null)),t.createElement("div",{className:"ant-upload-list-item-name"},u[p]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:Ji(h),onBlur:t=>{const{value:n}=t.target;if(n!==Ji(h)){const t=Object.assign({},e,{name:n}),i=r.map((e=>e.uid!==p?e:t));null==d||d(t,i),null==c||c({file:t,fileList:i})}this.setActiveState(p,!1)}}):t.createElement("a",{target:"_blank",rel:"noreferrer",title:h,href:m,onClick:e=>{e.preventDefault(),a?g||this.setActiveState(p,!0):n.preview()}},h)),t.createElement("span",{className:"ant-upload-list-item-card-actions"},a&&!g&&t.createElement("button",{type:"button",className:v,onClick:()=>this.setActiveState(p)},u[p]?t.createElement(je,null):t.createElement(qe,null)),a&&t.createElement("button",{type:"button",className:v,onClick:()=>n.preview()},t.createElement(Ve,null)),t.createElement("button",{type:"button",className:v,disabled:g,onClick:()=>n.download()},t.createElement(Ke,null)),t.createElement("button",{type:"button",className:v,disabled:g,onClick:()=>n.remove()},t.createElement(ze,null))))))}}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}componentDidMount(){this.createSortable()}componentWillUnmount(){var e;null===(e=this.sortableInstance)||void 0===e||e.destroy()}render(){var e,n;const{fileList:r=[],button:i={},fileDirection:a,disabled:l,readOnly:o,className:s,onPreview:c,onChange:d}=this.props,u=jn("upload-file"),p=l||o,h={[u]:!0,[`${u}--lg`]:"large"===this.$size,[`${u}--sm`]:"small"===this.$size,[`${u}--horizontal`]:"horizontal"===a};return t.createElement(k,vn({className:Fe(h,s)},Hn(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,disabled:p,onChange:d,onPreview:e=>Tn(this,void 0,void 0,(function*(){if("function"==typeof c)return c(e,(t=>this.doDownload(t||e)));l||(yield this.doDownload(e))})),onDownload:e=>Tn(this,void 0,void 0,(function*(){yield this.doDownload(e)})),itemRender:(e,t,n,r)=>this.itemRender(t,r)}),t.createElement("span",{ref:this.uploadRef},this.props.children||o&&r.length?this.props.children:t.createElement(C,{type:null!==(e=i.type)&&void 0!==e?e:"default",icon:null!==(n=i.icon)&&void 0!==n?n:t.createElement(We,null),disabled:p},i.text||Xt("qm.upload.text"))))}}ea.contextType=Bt,ea.defaultProps={name:"file",multiple:!0,fileDirection:"vertical",showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}};class ta extends r{constructor(){super(...arguments),this.state={loading:!1},this.downloadHandle=()=>Tn(this,void 0,void 0,(function*(){var e,t,n,r;this.setState({loading:!0});try{const{action:n,fileName:r,headers:i,params:a,beforeDownload:l=kn}=this.props,o=ue(n)?n:yield this.getActionUrl();if(!o)return en("Download","参数 `action` 有误!");if(!l(o))return;yield Qi(o,{fileName:r,headers:i,params:a}),yield Ln(100),null===(t=(e=this.props).onSuccess)||void 0===t||t.call(e),L.success(Xt("qm.download.success"))}catch(e){null===(r=(n=this.props).onError)||void 0===r||r.call(n,e),L.error(Xt("qm.download.error"))}this.setState({loading:!1})}))}getActionUrl(){return Tn(this,void 0,void 0,(function*(){const e=this.props.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}))}render(){const{size:e}=this.props,{loading:n}=this.state,r=e||this.context.size||"",i=Hn(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t.createElement(C,vn({},i,{size:r,loading:n,onClick:this.downloadHandle}),this.props.children)}}ta.propTypes={action:f.oneOfType([f.string,f.shape({api:f.func.isRequired,params:f.object})]),size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Download","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},fileName:f.string,headers:f.object,withCredentials:f.bool,params:f.object,beforeDownload:f.func,onSuccess:f.func,onError:f.func},ta.defaultProps={icon:t.createElement(Ke,null),children:Xt("qm.download.text"),withCredentials:!1},ta.contextType=Bt;class na extends r{renderLabel(){const{activeKey:e,labels:n,onTabClick:r}=this.props;return n.map(((n,i)=>{const a={item:!0,actived:i===e};return t.createElement("div",{key:i,className:Fe(a),onClick:e=>r(i,e)},t.createElement("span",null,n))}))}render(){return t.createElement(t.Fragment,null,this.renderLabel())}}class ra extends r{render(){const{label:e,showDivider:n,className:r,style:i}=this.props,a={[jn("anchor-item")]:!0};return t.createElement("div",{className:Fe(a,r),style:i},n&&t.createElement(Vn,{label:e,style:{marginBottom:10}}),this.props.children)}}ra.displayName="QmAnchorItem";class ia extends r{get __is_conf(){var e;return!!(null===(e=this.props.labelList)||void 0===e?void 0:e.length)}constructor(e){super(e),this.currentState="ready",this.scrollRef=c(),this.onScrollHandle=e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})},this.onTabClickHandle=e=>{const t=this.getTargetElement(e);t&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),At(t,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))},this.SCROLL_TO_ITEM=e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)},this.state={activeKey:e.defaultActiveIndex||0}}componentDidMount(){this.initialHandle(),this.scrollEvent=Lt(this.scrollRef.current,"scroll",pe(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}initialHandle(){const{activeKey:e}=this.state;e>0&&(this.scrollRef.current.scrollTop=Ni(this.getTargetElement(e),this.scrollRef.current))}createDistances(){var e;const{labelList:t=[]}=this.props;return(this.__is_conf?t.map((e=>document.getElementById(e.id))):Array.from((null===(e=this.scrollRef.current)||void 0===e?void 0:e.children)||[])).map((e=>Ni(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),n=this.createDistances();let r=-1;for(let e=0;e<n.length;e++){const i=n[e],a=n[e+1]||1e4;t>=i-1&&t<a&&(r=e)}return r}getTargetElement(e){const{labelList:t=[]}=this.props;return this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e]}render(){const{activeKey:e}=this.state,{size:n,labelWidth:r,tabPosition:i,labelList:a=[],onTabClick:l,className:o,style:s}=this.props,c=n||this.context.size||"",d=jn("anchor"),u={[d]:!0,[`${d}-left`]:"left"===i,[`${d}-top`]:"top"===i,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c},p=[];t.Children.map(this.props.children,(e=>{var t;In(e)&&!Rn(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&p.push(e)}));const h=this.__is_conf?a.map((e=>e.label)):p.map((e=>e.props.label)),m=this.__is_conf?a.map((e=>e.id)):p.map(((e,t)=>e.props["data-id"]||t.toString()));return this.itemsTotal=h.length,t.createElement("div",{className:Fe(u,o),style:s},t.createElement("div",{className:Fe("anchor-nav"),style:{width:r?Dn(r):""}},t.createElement(na,{activeKey:e,labels:h,onTabClick:(e,t)=>{this.onTabClickHandle(e),null==l||l({label:h[e],id:m[e]},t)}})),t.createElement("div",{ref:this.scrollRef,className:Fe("anchor-container")},this.__is_conf?this.props.children:p))}}ia.Item=ra,ia.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelWidth:(e,t,n)=>{if(!tn(e[t]))return Jt("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelList:f.arrayOf(f.shape({id:f.string,label:f.string}))},ia.defaultProps={tabPosition:"left"},ia.contextType=Bt;class aa extends r{render(){return t.createElement(A.TabPane,this.props,this.props.children)}}aa.displayName="QmTabPane";class la extends r{render(){const{items:e,size:n,tabPosition:r,tabBarGutter:i,className:a,authConfig:l}=this.props,o=n||this.context.size||"",s=jn("tabs"),c={[s]:!0,[`${s}--lg`]:"large"===o,[`${s}--sm`]:"small"===o},d=Object.assign(Object.assign({},Hn(this.props,["items","authConfig"])),{size:o,tabBarGutter:null!=i?i:["top","bottom"].includes(r)?30:0}),u=[];t.Children.map(this.props.children,(e=>{var t;In(e)&&!Rn(e)&&"QmTabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&u.push(e)}));const p=e?[...e]:u.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(l){const{fieldList:e=[]}=l||{};for(let t=0;t<p.length;t++){const n=p[t],r=e.find((e=>e.dataIndex===n.key)),{visible:i=1,disabled:a}=r||{};i?a&&(n.disabled=!0):(p.splice(t,1),t--)}}return t.createElement(A,vn({},d,{items:p,className:Fe(c,a)}))}}la.TabPane=aa,la.contextType=Bt,la.defaultProps={tabPosition:"top"};class oa extends r{constructor(){super(...arguments),this.titleRef=t.createRef(),this.$drawer=null,this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1},this.afterVisibleChange=e=>{var t,n;const{loading:r}=this.props;e?(this.opened=!0,he(r)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(n=(t=this.props).onClosed)||void 0===n||n.call(t),this.setState({fullscreen:!1}))},this.toggleHandle=()=>{this.$drawer=Ri(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){var n;const{visible:r,open:i,loading:a,destroyOnClose:l}=this.props,o=null!=i?i:r,s=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:c}=this.state;o&&o!==s&&(!l&&this.opened||he(a)&&this.setState({spinning:!0})),this.$drawer&&c!==t.fullscreen&&Ci(this.$drawer,c?{width:"100%"}:{width:Dn(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{title:n,showHeader:r,showFullScreen:i}=this.props;return t.createElement(t.Fragment,null,t.createElement("span",{ref:this.titleRef,className:Fe("text")},r&&n),i&&t.createElement("button",{type:"button",className:Fe("full-screen"),onClick:this.toggleHandle},t.createElement(e?Be:Ue)))}render(){var e;const{spinning:n,sloading:r}=this.state,{visible:i,open:a,size:l,className:o,loading:s,showHeader:c,maskClosable:d,onClose:u}=this.props,p=this.context.global,h=l||this.context.size||"",m=jn("drawer"),f={[m]:!0,"no-header":!c,[`${m}--lg`]:"large"===h,[`${m}--sm`]:"small"===h};return t.createElement(P,vn({},Hn(this.props,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=a?a:i,maskClosable:null!==(e=null!=d?d:null==p?void 0:p.maskClosable)&&void 0!==e&&e,className:Fe(f,o),title:this.renderTitle(),footer:null,onClose:u,afterOpenChange:this.afterVisibleChange}),this.props.children,(s||r||n)&&t.createElement(Di,{spinning:!0,className:Fe("spinning")}))}}oa.contextType=Bt,oa.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Drawer","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:f.bool},oa.defaultProps={width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null};const sa="10vh";var ca;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(ca||(ca={}));class da extends r{constructor(){super(...arguments),this.draggleRef=t.createRef(),this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0},this.onStart=(e,t)=>{const{clientWidth:n,clientHeight:r}=window.document.documentElement,i=this.draggleRef.current.getBoundingClientRect();i&&this.setState({bounds:{left:-i.left+t.x,right:n-(i.right-t.x)-1,top:-i.top+t.y,bottom:r-(i.bottom-t.y)-1}})},this.toggleHandle=e=>{const t=Ri(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body"),{width:r,height:i,showHeader:a}=this.props,{fullscreen:l}=this.state;l?(Ci(t,{width:Dn(r||"60%"),height:"auto",top:sa}),Ci(n,{height:i?Dn(i):this.defaultHeight,maxHeight:"auto"===i?this.defaultHeight:""})):(Ci(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Ci(n,{height:`calc(100vh - ${ca[a?this.$size:"none"]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.afterVisibleChange=()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - ${sa} - ${sa} - ${ca[this.props.showHeader?this.$size:"none"]}px)`}componentDidUpdate(e,t){var n;const{visible:r,open:i,loading:a,destroyOnClose:l}=this.props,o=null!=i?i:r,s=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:c}=this.state;if(o&&o!==s){if(!l&&this.opened||he(a)&&this.setState({spinning:!0}),!l&&this.opened)return;setTimeout((()=>{this.opened=!0,he(a)&&this.setState({spinning:!1})}),400)}c!==t.fullscreen&&(c?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:n}=this.state,{title:r,showHeader:i,showFullScreen:a}=this.props;return t.createElement("div",{onMouseOver:()=>{n&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},t.createElement("span",{className:Fe("text")},i&&r),a&&t.createElement("button",{type:"button",className:Fe("full-screen"),onClick:this.toggleHandle},t.createElement(e?Be:Ue)))}render(){var e;const{spinning:n,sloading:r,fullscreen:i,disabled:a,bounds:l,position:o}=this.state,{visible:s,open:c,height:d,className:u,loading:p,draggable:h,showHeader:m,maskClosable:f,bodyStyle:g,onClose:v}=this.props,y=this.context.global,b=jn("modal"),x={height:d?Dn(d):this.defaultHeight,maxHeight:"auto"===d?this.defaultHeight:"",overflow:"auto"},E={[b]:!0,"no-header":!m,[`${b}--lg`]:"large"===this.$size,[`${b}--sm`]:"small"===this.$size};return t.createElement(_,vn({},Hn(this.props,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=c?c:s,maskClosable:null!==(e=null!=f?f:null==y?void 0:y.maskClosable)&&void 0!==e&&e,className:Fe(E,u),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},x,g),onCancel:v,afterClose:this.afterVisibleChange,modalRender:e=>t.createElement(Pt,{nodeRef:this.draggleRef,bounds:l,position:o,disabled:!h||a||i,onStart:(e,t)=>this.onStart(e,t)},t.createElement("div",{ref:this.draggleRef},e))}),this.props.children,(p||r||n)&&t.createElement(Di,{spinning:!0,className:Fe("spinning")}))}}da.contextType=Bt,da.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Modal","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:f.bool},da.defaultProps={width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:sa}};const ua=n(void 0),pa=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ha={operations:function(e){const t=e.split(" "),n=[];let r=0;n[r]=[];for(let e=0;e<t.length;e++)pa.includes(t[e])?(n[r]=n[r].join(" "),r++,n[r]=[]):n[r].push(t[e]);return n[r]=n[r].join(" "),n},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e,t=" "){return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let n=0,r=(e=Array.isArray(e)?e:[e]).length;n<r;n++)t+="number"==typeof e[n]?e[n]:"'"+e[n]+"'",n<r-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,n){return e.split(t).join(n)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),e=this.find_replace(e," NIN "," nin ")}};const ma=["==","<",">","<=",">=","!=","like","likes","in","nin"];var fa=function(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const n=e.charAt(r);"("===n&&t++,")"===n&&t--}return 0===t},ga=function(e,t){let n="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?n+=" "+e[t]+" ":n+=e[t];const r=n.split(" ").filter((e=>""!==e));for(let e=0;e<r.length;e++)ma.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),ma.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return e=r.join(" ")};const va=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,ya=["string","number","boolean","symbol"],ba=e=>ya.includes(typeof e),xa=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Ea=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(va,"\\$1"),"i");window.__query__=(...e)=>((e,t,n)=>{e=null!=e?e:"";let r=!0;switch(t){case"like":r=null!==e.toString().match(Ea(n));break;case"likes":r=n.split(/,|,/).some((t=>null!==e.toString().match(Ea(t))));break;case"in":ba(n)&&(n=[n]),Array.isArray(n)&&(r=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":ba(n)&&(n=[n]),Array.isArray(n)&&(r=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":r=(xa(e)?e.slice(0,10):e)!=n;break;case"<":r=(xa(e)?e.slice(0,10):e)<n;break;case"<=":r=(xa(e)?e.slice(0,10):e)<=n;break;case">":r=(xa(e)?e.slice(0,10):e)>n;break;case">=":r=(xa(e)?e.slice(0,10):e)>=n;break;default:r=(xa(e)?e.slice(0,10):e)==n}return r})(e[0],e[1],e[2]);const Sa=ha.stringify,wa=ha.array_format,Ca=fa,Ta=(e,t,n)=>{let r=[];t=ha.replace_symbols(t);try{if(n){const n=new Function("record",`return ${ga(t,"record")};`);r=rl(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${ga(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)n(e,t)&&r.push(e[t])}}catch(t){en("Table","组件 `initialFilter` 参数有误!"),r=e}return r},Na=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Na(e.children)):t.push(e)})),t},Ia=e=>e.filter((e=>(e.children&&(e.children=Ia(e.children)),!e.hidden&&!e.noAuth))),Ra=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Ra(e.children))})),t},Oa=(e,t)=>e.map((e=>(e.children&&(e.children=Oa(e.children,t)),null==t||t(e),e))),ka=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=ka(n.children,t);if(e)return e}}return null},La=e=>{const t=e.children;return t?t[0].children?La(t[0]):t[0]:e},Aa=e=>{const t=e.children;return t?t[t.length-1].children?Aa(t[t.length-1]):t[t.length-1]:e},Pa=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),_a=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=_a(n.children,t);if(e)return e}}return null},Ha=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Ha(e.children))})),t},Fa=e=>{let t=1;const n=(e,r)=>{var i;if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{e.fixed?r.fixed=e.fixed:delete r.fixed,n(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=null!==(i=e.colSpan)&&void 0!==i?i:1};e.forEach((e=>{e.level=1,n(e,null)}));const r=[];for(let e=0;e<t;e++)r.push([]);return Ra(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},Da=(e,t,n={left:0,top:0})=>{if(e){const r=e.parentNode;if(n.top+=e.offsetTop,n.left+=e.offsetLeft,r&&r!==document.documentElement&&r!==document.body&&(n.top-=r.scrollTop,n.left-=r.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Da(e.offsetParent,t,n)}return n},$a=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Ma=(e,t)=>fe(e,((e,n,r)=>{ge(n,t[r])||(e[r]=se(n)&&se(t[r])?Ma(n,t[r]):n)})),qa=(e,t)=>{var n;return null!==(n=me(e,t))&&void 0!==n?n:""},ja=(e,t,n,r)=>{r>=0&&null!=n&&(n=Number(n).toFixed(r)),ve(e,t,null!=n?n:"")},Va=(e,t)=>{if(!t.includes("|"))return qa(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(qa(e,t))})),n.every((e=>!e))?"":n.join(" | ")},Ka=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),za=e=>{const t=(e=e.toString()).split("."),n="-"===t[0].charAt(0)?"-":"";let r=n?t[0].slice(1):t[0],i="";for(;r.length>3;)i=`,${r.slice(-3)}${i}`,r=r.slice(0,r.length-3);return r&&(i=r+i),`${n}${i}${t[1]?`.${t[1]}`:""}`},Wa=(e,t)=>{const n=e.toString();if(!Ka(n)||0===t)return e;const r=Number.parseFloat(n).toString(),i=r.indexOf(".");if(-1===i)return r+"."+"0".repeat(t);const a=Math.max(0,t-(r.length-i-1));return r+"0".repeat(a)},Ba=(e,t)=>e?g(e,t):null,Ua=(e,t)=>e?g(e).format(t):"",Ga=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Ya=e=>{const n=[];if(t.isValidElement(e)){const{children:r}=e.props;t.Children.forEach(r,(e=>{n.push(...Ya(e))}))}else n.push(e);return n},Xa=e=>Ya(e).join(""),Za=e=>e.filter((e=>!e._group)),Qa=(e,t=!1)=>{let n="";if(Array.isArray(e)){let r=0;for(let i=0,a=e.length;i<a;i++){const a=e[i];if(!a.fieldName)continue;const l=Array.isArray(a.condition)?wa(a.condition):Sa(a.condition,"^");n+=`${a.bracketLeft} ${t?`${a.fieldName}|${a.fieldType}`:a.fieldName} ${a.expression} ${l} ${a.bracketRight} ${a.logic} `,r=a.logic.length}n=n.slice(0,-1*r-2)}else{const r=5;for(const r in e){const[i,a]=r.includes("|")?r.split("|"):[r,""],l=e[r];for(const e in l){n+=`${t?`${i}|${a}`:i} ${e} ${Array.isArray(l[e])?wa(l[e]):Sa(l[e],"^")} and `}}n=n.slice(0,-1*r)}return n.replace(/\s+/g," ").trim()},Ja=(e=[],t=[])=>{const n={};return e.forEach((e=>{const r=JSON.stringify((e=>{const n=[];return t.forEach((t=>n.push(qa(e,t)))),n})(e));n[r]=n[r]||[],n[r].push(e)})),Object.keys(n).map((e=>n[e]))},el=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].dataIndex===t)return[e[n]];if(Array.isArray(e[n].children)){const r=el(e[n].children,t);if(r)return[e[n],r].flat()}}},tl=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].rowKey===t)return[t];if(Array.isArray(e[n].children)){const r=tl(e[n].children,t);if(r)return[e[n].rowKey,r].flat()}}},nl=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=nl(n.children,t);if(e)return e}if(t(n))return n}return null},rl=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&rl(e.children,t),t(e)||e.children&&e.children.length))),il=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),al=80,ll="1",ol="0",sl=400,cl=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],dl={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var ul,pl,hl;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(ul||(ul={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(pl||(pl={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(hl||(hl={}));const ml={items:f.arrayOf(f.shape({type:f.string.isRequired,fieldName:f.string.isRequired})),initialValues:f.object,initialExtras:f.object,layout:f.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:f.number,customClass:f.string,compactMode:f.bool,labelWidth:f.oneOfType([f.number,f.string]),labelAlign:f.oneOf(["left","right"]),labelWrap:f.bool,formType:f.oneOf(["default","search","onlyShow"]),disabled:f.bool,uniqueKey:f.string,defaultRows:f.number,defaultExpand:f.bool,searchButtonCols:f.number,scrollToFirstError:f.bool,authConfig:f.object,isAutoFocus:f.bool,isCollapse:f.bool,isFieldsDefine:f.bool,isSearchBtn:f.bool,isSubmitBtn:f.bool,fieldsChange:f.func,onValuesChange:f.func,onFieldsChange:f.func,onFinish:f.func,onFinishFailed:f.func,onReset:f.func,onCollapse:f.func},fl={layout:"horizontal",labelWidth:al,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:On,onFieldsChange:On,onFinish:On,onFinishFailed:On,onReset:On,onCollapse:On},gl=(e,t)=>{if(!e)return null;if(t===pl.week){const t=e.match(/^(\d{4})-(\d+)/);return t?g().year(Number(t[1])).week(Number(t[2])):null}if(t===pl.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?g().year(Number(t[1])).quarter(Number(t[2])):null}return g(e,t)},vl=(e,t)=>e?g(e).format(t):"",yl=e=>""===e||null==e,bl=(e,t)=>{var n;if(!e)return"";if(!t.includes("|"))return e[t];const r=t.split("|");let i="";for(let t=0,a=r.length;t<a;t++){i+=(null!==(n=e[r[t].trim()])&&void 0!==n?n:"")+(t===a-1?"":" | ")}return i},xl=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),a=n[r].split("|");i.forEach(((t,n)=>e[t]=e[a[n]]))}else e[t[r]]=e[n[r]]},El=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),a=n[r].split("|");i.forEach(((t,n)=>e[t]=e[a[n]]))}else e[t[r]]=e[n[r]]},Sl=(e,t,n)=>e.map((e=>{const r={value:e[t],text:e[n]};return e.disabled&&(r.disabled=!0),he(e.isLeaf)||(r.isLeaf=!!e.isLeaf),he(e.selectable)||(r.selectable=!!e.selectable),Array.isArray(e.children)&&(r.children=Sl(e.children,t,n)),r})),wl=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=wl(n.children,t);if(e)return e}}return null},Cl=(e,t,n=0)=>{const r=[];return e.forEach((e=>{e.value==t.split(",")[n]&&r.push(e),Array.isArray(e.children)&&r.push(...Cl(e.children,t,n+1))})),r},Tl=e=>In(e)||"string"==typeof e,Nl=e=>In(e)?Ya(e).join(""):null!=e?e:"",Il=(e,t,n,r)=>{var i;const a={};return a.filters=(null===(i=e.filters)||void 0===i?void 0:i.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],a.table={columns:e.columns||[],rowKey:e.valueName},a.fieldsDefine={valueKey:e.valueKey||e.valueName},a.fieldAliasMap={[r?"textKey":t]:e.displayName[0],[r?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(a.table.fetch={api:n(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(a.echoRequest={fetchApi:n(e.echoSetting.api),formatter:t=>{var n;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(n=t.key)&&void 0!==n?n:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(a.echoRequest.fieldAliasMap={[r?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(a.tree={fetch:{api:n(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const n={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>n[e.tableField]=e.treeField)),n}}),e.emmediateSetting&&(a.columns=e.emmediateSetting.columns,a.request={fetchApi:n(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),a};var Rl={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{"曾":"ZENG","沈":"SHEN","嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬤":"MO","嬷":"MO","蹒":"PAN","蹊":"XI","丬":"PAN","霰":"XIAN","莘":"XIN","豉":"CHI","饧":"XING","筠":"JUN","长":"CHANG","帧":"ZHEN","峙":"SHI","郍":"NA","芎":"XIONG","谁":"SHUI"}};const Ol="阿",kl="鿿",Ll=1,Al=2,Pl=3;let _l,Hl=null;function Fl(e){return e||null===Hl?("object"==typeof Intl&&Intl.Collator?(_l=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Hl=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Hl=!1,Hl):Hl}function Dl(e){const t=Rl.UNIHANS,n=Rl.PINYINS,r=Rl.EXCEPTIONS,i={source:e};if(e in r)return i.type=Al,i.target=r[e],i;let a,l=-1;if(e.charCodeAt(0)<256)return i.type=Ll,i.target=e,i;if(a=_l.compare(e,Ol),a<0)return i.type=Pl,i.target=e,i;if(0===a)i.type=Al,l=0;else{if(a=_l.compare(e,kl),a>0)return i.type=Pl,i.target=e,i;0===a&&(i.type=Al,l=t.length-1)}if(i.type=Al,l<0){let n=0,r=t.length-1;for(;n<=r;){l=~~((n+r)/2);const i=t[l];if(a=_l.compare(e,i),0===a)break;a>0?n=l+1:r=l-1}}return a<0&&l--,i.target=n[l],i.target||(i.type=Pl,i.target=i.source),i}function $l(e){return"string"==typeof e&&Fl()?e.split("").map((e=>Dl(e))):e}var Ml={isSupported:Fl,parse:$l,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Rl)})))},genToken:Dl,convertToPinyin:(e,t,n)=>$l(e).map((e=>t&&e.type===Al?e.target.toLowerCase():e.target)).join(n||"")};var ql={patcher:function(e){e.EXCEPTIONS={"嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬷":"MO","蹊":"XI","丬":"PAN","霰":"XIAN","豉":"CHI","饧":"XING","帧":"ZHEN","芎":"XIONG","谁":"SHUI","钶":"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&("FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target)}};Ml.isSupported()&&ql.shouldPatch(Ml.genToken)&&Ml.patchDict(ql);const jl=e=>{const{value:n,bordered:r}=e;return t.createElement(O,{value:n,title:n,bordered:r,readOnly:!0})};jl.displayName="FormItemView";const{Option:Vl}=$,Kl=e=>{const{$$form:n}=t.useContext(ua),{value:r,items:i,multiple:a,loading:l,onChange:o,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=Xt("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,readOnly:f,disabled:g,onClear:v}=e.option,{itemList:y=[],filterable:b=!0,listHeight:x=sl,collapseTags:E,maxTagTextLength:S,dropdownStyle:w,openPyt:C=!0}=d,T=_n(y)?i:y,N=e=>{var t;return(null===(t=T.find((t=>t.value===e)))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},I=e=>a?(null==e?void 0:e.map((e=>N(e))).join(","))||"":N(e);return n.isOnlyShow?t.createElement(jl,{value:I(r),bordered:h}):t.createElement($,vn({value:r,mode:a?"multiple":void 0,popupClassName:`form-popper__${c}`,dropdownStyle:w,placeholder:p,style:u,loading:l,bordered:h,allowClear:m,disabled:g,showSearch:b,listHeight:x,maxTagCount:E?"responsive":void 0,maxTagTextLength:S},a?{title:I(r)}:null,{filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"",i=Ml.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,I(e),T)})(e)},onClear:v}),T.map((e=>t.createElement(Vl,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class zl extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:a="value",textKey:l="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[a],text:e[l]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:a,tooltip:l,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:h,validateTrigger:m,rules:f=[],onChange:g=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(a),className:Fe(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Dn(d)},required:e.getFormItemRequired(f)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:o,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(a)}},t.createElement(Kl,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{g(t,n,r),e.setViewValue(o,n)}}))),h&&t.createElement(D,null,e.renderFormItemButton(o,h)),p&&t.createElement(D,{flex:Dn(p.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}zl.contextType=ua;const Wl=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{label:l,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToCheckbox:u,falseValue:p=ol,trueValue:h=ll}=o,m=e=>Xt(e===h?"am.form.trueText":"am.form.falseText");return t.createElement(M,{checked:r===h,style:s,disabled:d||n.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==i||i(e),a(e,m(e))})(t?h:p)}},u?l:null)};class Bl extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option,{labelToCheckbox:m}=o;return t.createElement(H.Item,{label:m?" ":e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Wl,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Bl.contextType=ua;class Ul extends r{constructor(){super(...arguments),this.linkRef=t.createRef(),this.state={visible:!1},this.getFormFieldsConfig=e=>Tn(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.saveFormFieldsConfig=(e,t)=>Tn(this,void 0,void 0,(function*(){const n=this.context.global,r=null==n?void 0:n.saveComponentConfigApi;if(r)try{yield r({[e]:t})}catch(e){}})),this.resetFieldsHandle=e=>{const t=e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName))||Fn(e);return Object.assign(t,{hidden:e.hidden})}));this.changeHandle(t),this.setLocalFields(t)}}get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}componentDidMount(){this.initLocalfields()}getLocalFields(){if(!this.formUniqueKey)return;const e=JSON.parse(localStorage.getItem(this.formUniqueKey));if(e||this.getFormFieldsConfig(this.formUniqueKey).then((e=>{var t;e?(localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()):(null===(t=this.context.global)||void 0===t?void 0:t.getComponentConfigApi)&&this.setLocalFields(this.props.items)})).catch((()=>{})),!e)return;return ye(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:n}=t,r=e.find((e=>e.fieldName===n));return r?(he(r.hidden)||(t.hidden=r.hidden),t):t})):e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return he(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(this.formUniqueKey));ge(t,n)||(localStorage.setItem(this.formUniqueKey,JSON.stringify(t)),this.saveFormFieldsConfig(this.formUniqueKey,t))}initLocalfields(){const e=this.getLocalFields();e&&this.changeHandle(e)}changeHandle(e){const{fieldsChange:t}=this.props;null==t||t([...e])}popupRender(){const{items:e}=this.props;return t.createElement(ua.Consumer,null,(n=>{const r=n.$$form;return t.createElement("div",{className:Fe("ant-dropdown-menu","fields-list")},t.createElement("div",{className:"reset"},t.createElement($n,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(r.getOriginItems())},Xt("qm.table.columnFilter.reset"))),t.createElement(Vt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:e,setList:t=>{const n=t.map((e=>e.fieldName)),i=e.map((e=>e.fieldName));if(ge(n,i))return;r.setExpandHandle(!0);const a=il(t);this.changeHandle(a),this.setLocalFields(a)}},e.map((n=>{var i;return t.createElement("li",{key:n.fieldName,className:"item",style:n.noAuth?{display:"none"}:void 0},t.createElement(M,{disabled:(null===(i=n.rules)||void 0===i?void 0:i.findIndex((e=>e.required)))>-1,checked:!n.hidden,onChange:t=>{const{checked:r}=t.target;n.hidden=!r,this.changeHandle(e),this.setLocalFields(e)}}),t.createElement(Ge,{className:"handle",title:Xt("qm.form.draggable")}),t.createElement("span",{className:"title"},r.getFormItemLabel(n.label)))}))))}))}render(){const{visible:e}=this.state,n=jn("form-fields-filter");return t.createElement(ua.Consumer,null,(r=>{const{$size:i}=r.$$form,a={[n]:!0,[`${n}--lg`]:"large"===i,[`${n}--sm`]:"small"===i};return t.createElement(q,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:Fe(a),placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,onOpenChange:e=>{this.setState({visible:e})}},t.createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},t.createElement(Ye,null)))}))}}Ul.contextType=Bt;const Gl=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(ua),{value:i,onChange:a,onValuesChange:l}=e,{options:o={},style:s={},placeholder:c=Xt("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h,onFocus:m,onBlur:f,onEnter:g,onClear:v}=e.option,{prefix:y,suffix:b,password:x,maxLength:E,pattern:S,toUpper:w,toTrim:C,autoFocus:T,autoComplete:N,secretType:I}=o,R=I&&(p||h),k=t.useRef();t.useEffect((()=>{var e;const t=()=>null==v?void 0:v(),n=null===(e=k.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return u&&n&&n.addEventListener("click",t),()=>{null==n||n.removeEventListener("click",t)}}),[]);const L=e=>{null==a||a(e),l(e)},A=x?O.Password:O,P=R?((e="",t)=>(e=e.toString(),"finance"===t&&(e=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","))(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e))(i,I):i;return r.isOnlyShow?t.createElement(jl,{value:(e=>e&&x?new Array(e.length).fill("*").join(""):e)(P),bordered:d}):t.createElement(A,{ref:e=>{k.current=e,"function"==typeof n&&n(e)},value:P,autoComplete:x?"new-password":N,autoFocus:T,placeholder:c,style:s,title:x?"":P,prefix:y,suffix:b,maxLength:E,bordered:d,allowClear:u,readOnly:p,disabled:h,onFocus:e=>{null==m||m(e.target.value,e)},onBlur:t=>{var n;let r=null!==(n=t.target.value)&&void 0!==n?n:"";if(C){const e=r.trim();r!==e&&(r=e,L(r))}(t=>{const{onBlur:n}=e;null==n||n(t)})(r),null==f||f(r,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==g||g(n,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=k.current)||void 0===t||t.blur())}},onChange:e=>{let t=e.target.value;be(S)&&(t=S.test(t)?t:null!=i?i:""),w&&(t=t.toUpperCase()),L(t)}})}));Gl.displayName="VInput";class Yl extends r{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Gl,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(a,t)}}))),u&&t.createElement(D,null,e.renderFormItemButton(a,u)),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Yl.contextType=ua;const Xl=e=>{const{$$form:n}=t.useContext(ua),{value:r=[],onChange:i,onValuesChange:a}=e,{options:l={},placeholder:o=Xt("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{prefix:p,suffix:h,maxLength:m}=l,f=e=>{const t=e.every((e=>!e))?[]:e;null==i||i(t),a(t,g(t))},g=e=>e.join(" - ");return n.isOnlyShow?t.createElement(jl,{value:g(r),bordered:s}):t.createElement(O.Group,null,t.createElement(O,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:p,suffix:h,maxLength:m,allowClear:c,bordered:s,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;f([t,r[1]])}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),t.createElement(O,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:p,suffix:h,maxLength:m,bordered:s,allowClear:c,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;f([r[0],t])}}))};class Zl extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(s),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(o)},required:e.getFormItemRequired(u)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Xl,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(a,n)}}))),c&&t.createElement(D,{flex:Dn(c.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},c)))))}}Zl.contextType=ua;const Ql=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(ua),{value:i,onChange:a,onValuesChange:l}=e,{options:o={},style:s={},placeholder:c=Xt("qm.form.inputPlaceholder"),bordered:d=!0,readOnly:u,disabled:p,onFocus:h,onBlur:m,onEnter:f}=e.option,{step:g=1,min:v,max:y,precision:b,autoFocus:x,stringMode:E,textAlign:S="left",controls:w=!0,formatter:C,parser:T}=o,N=t.useRef(),I=t.useRef(i),R=e=>{const t=yl(e)?"":ce(e)?e.toFixed(b):new Ft(e).toFixed(b);return"function"==typeof C?C(t):t},O={[S]:!0,controls:w};return r.isOnlyShow?t.createElement(jl,{value:R(i),bordered:d}):t.createElement(j,{ref:e=>{N.current=e,"function"==typeof n&&n(e)},value:i,className:Fe(O),placeholder:c,style:Object.assign({width:"100%"},s),step:g,min:v,max:y,controls:w,precision:b,autoFocus:x,stringMode:E,formatter:C,parser:T,bordered:d,readOnly:u,disabled:p,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{An((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(I.current),null==m||m(I.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==f||f(i,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=N.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!E&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{I.current=e,null==a||a(e),l(e,R(e))})(t)}})}));Ql.displayName="VInputNumber";class Jl extends r{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Ql,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(a,u)),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Jl.contextType=ua;const eo=e=>{const{$$form:n}=t.useContext(ua),{value:r=[],onChange:i,onValuesChange:a}=e,{options:l={},placeholder:o=Xt("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{step:p=1,min:h=0,max:m,textAlign:f="left",controls:g=!0,precision:v,formatter:y,parser:b}=l,x=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),E(e)},E=e=>{const t=e.every((e=>null===e))?[]:[...e];null==i||i(t),a(t,S(t))},S=e=>yl(e)?"":e.map((e=>yl(e)?"":Number(e).toFixed(v))),w={[f]:!0,controls:g};return n.isOnlyShow?t.createElement(jl,{value:S(r),bordered:s}):t.createElement(O.Group,null,t.createElement(j,{value:r[0],className:Fe("site-input-left",w),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:p,min:h,max:m,controls:g,precision:v,formatter:y,parser:b,bordered:s,readOnly:d,disabled:u,onChange:e=>{E([e,r[1]])},onBlur:()=>{x(r)}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),t.createElement(j,{value:r[1],className:Fe("site-input-right",w),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:p,min:h,max:m,controls:g,precision:v,formatter:y,parser:b,bordered:s,readOnly:d,disabled:u,onChange:e=>{E([r[0],e])},onBlur:()=>{x(r)}}))};class to extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(s),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(o)},required:e.getFormItemRequired(u)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(eo,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(a,n)}}))),c&&t.createElement(D,{flex:Dn(c.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},c)))))}}var no;to.contextType=ua,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(no||(no={}));const{Search:ro}=O;class io extends r{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||en("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||en("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&en("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Tn(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:a,triggeredChange:l,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(!t||_n(u))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=me(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&xl(e,this.alias,c),d&&El(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=bl(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==a||a([e])}}}catch(e){}this.setState({loading:!1})})),this.todoOpen=e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)},this.createFilters=e=>{const{fieldName:t}=this.props.option,{filterAliasMap:n}=this.searchHelper,r=""!==e?e:void 0,i=("function"==typeof n?n():n)||[],a={[t]:r};return(Array.isArray(i)?i:[i]).forEach((e=>{if(se(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](r):r;else a[e]=r})),a},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=kn,formatter:i=(e=>e)}=t.fetch;return new Promise(((a,l)=>Tn(this,void 0,void 0,(function*(){var o;const s=xe({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});if(!r(s))return l();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=me(e.data,t.fetch.dataKey))&&void 0!==o?o:[];a(n)}else l()}catch(e){l(e)}finally{An((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=bl(e,this.alias[r]);void 0!==i&&(t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i))}for(const n in this.extras){const r=bl(e,this.extras[n]);void 0!==r&&t.SET_FIELDS_EXTRA({[n]:r})}},this.resetSearchHelperValue=(e=[],t)=>Tn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,r=e.filter((e=>{var r;return null===(r=bl(e,this.alias[n]))||void 0===r?void 0:r.toString().toLowerCase().includes(t.toLowerCase())}));if(1===r.length)return this.closeSearchHelper(r[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:r}=this.searchHelper,i=(null!=r?r:kn)(n.state.formData);(null==i?void 0:i.then)?i.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==i&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias)r!==n&&t.SET_FIELDS_VALUE({[r]:bl(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:bl(e,this.extras[n])});const r=bl(e,this.alias[n]);this.triggerChange(r),this.searchHelperChangeHandle(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.closeButNotSelect=()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:a}=this.props,{type:l,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=Xt("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:Xt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${no[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:Object.assign({},this.deriveParams,c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(jl,{value:a,bordered:p}):t.createElement(t.Fragment,null,t.createElement(ro,{ref:e=>this[`${l}_Ref`]=e,value:a,title:a,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:h,readOnly:m,disabled:f,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:i=!0,table:a}=this.searchHelper;this.triggerBlur(n),this._is_change&&!r&&(n?i?(null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e,n))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(n):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!r&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):An((()=>this.clearSearchHelperValue())))}}),t.createElement(da,b,t.createElement(ip,x)))}}io.contextType=ua;class ao extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:a}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Il(Object.assign({},n.data,a),l,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[]}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(io,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(l,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(l,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}ao.contextType=ua;const lo=e=>{class n extends r{constructor(){super(...arguments),this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var n,r;const i=e.target,a=null==t?void 0:t.target,l=!i||!a,o=(null===(n=this.$el)||void 0===n?void 0:n.contains(i))||(null===(r=this.$el)||void 0===r?void 0:r.contains(a)),s=this.$el===i,c=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),d=c.some((e=>null==e?void 0:e.contains(i)))||c.includes(a);let u;u=!(l||o||s||d),this.setState({clickOutside:u})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=Lt(document,"mousedown",this.mousedownHandler),this.event2=Lt(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:n}=this.props,{clickOutside:r}=this.state;return t.createElement(e,vn({ref:n},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return n.displayName=`OutsideClick(${e.displayName||e.name})`,t.forwardRef(((e,r)=>t.createElement(n,vn({},e,{forwardedRef:r}))))};function oo(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function so(e,t,n,r){var i=Dt.unstable_batchedUpdates?function(e){Dt.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,i,r)}}}var co=d((function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,a=l(),o=l();u(t,(function(){return{}}));var c=l(!1);return!c.current&&Or()&&(o.current=r(),a.current=o.current.parentNode,c.current=!0),s((function(){null==n||n(e)})),s((function(){return null===o.current.parentNode&&null!==a.current&&a.current.appendChild(o.current),function(){var e;null===(e=o.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(o.current)}}),[]),o.current?Dt.createPortal(i,o.current):null}));function uo(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var po;function ho(e){var t=e.prefixCls,n=e.motion,r=e.animation,i=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:i?{motionName:i}:null)}function mo(t){var n=t.prefixCls,r=t.visible,i=t.zIndex,a=t.mask,l=t.maskMotion,o=t.maskAnimation,s=t.maskTransitionName;if(!a)return null;var c={};return(l||s||o)&&(c=Xn({motionAppear:!0},ho({motion:l,prefixCls:n,transitionName:s,animation:o}))),e.createElement(ai,li({},c,{visible:r,removeOnLeave:!0}),(function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:Fe("".concat(n,"-mask"),r)})}))}function fo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function go(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fo(Object(n),!0).forEach((function(t){yo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vo(e){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vo(e)}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bo={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function xo(){if(void 0!==po)return po;po="";var e=document.createElement("p").style;for(var t in bo)t+"Transform"in e&&(po=t);return po}function Eo(){return xo()?"".concat(xo(),"TransitionProperty"):"transitionProperty"}function So(){return xo()?"".concat(xo(),"Transform"):"transform"}function wo(e,t){var n=Eo();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function Co(e,t){var n=So();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var To,No=/matrix\((.*)\)/,Io=/matrix3d\((.*)\)/;function Ro(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Oo(e,t,n){var r=n;if("object"!==vo(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):To(e,t);for(var i in t)t.hasOwnProperty(i)&&Oo(e,i,t[i])}function ko(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}function Lo(e){return ko(e)}function Ao(e){return ko(e,!0)}function Po(e){var t=function(e){var t,n,r,i=e.ownerDocument,a=i.body,l=i&&i.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),r=Math.floor(t.top),{left:n-=l.clientLeft||a.clientLeft||0,top:r-=l.clientTop||a.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=Lo(r),t.top+=Ao(r),t}function _o(e){return null!=e&&e==e.window}function Ho(e){return _o(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Fo=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Do=/^(top|right|bottom|left)$/,$o="currentStyle",Mo="runtimeStyle",qo="left";function jo(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function Vo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Ko(e,t,n){"static"===Oo(e,"position")&&(e.style.position="relative");var r=-999,i=-999,a=jo("left",n),l=jo("top",n),o=Vo(a),s=Vo(l);"left"!==a&&(r=999),"top"!==l&&(i=999);var c,d="",u=Po(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[Eo()]||"",wo(e,"none")),"left"in t&&(e.style[o]="",e.style[a]="".concat(r,"px")),"top"in t&&(e.style[s]="",e.style[l]="".concat(i,"px")),Ro(e);var p=Po(e),h={};for(var m in t)if(t.hasOwnProperty(m)){var f=jo(m,n),g="left"===m?r:i,v=u[m]-p[m];h[f]=f===m?g+v:g-v}Oo(e,h),Ro(e),("left"in t||"top"in t)&&wo(e,d);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=jo(b,n),E=t[b]-u[b];y[x]=b===x?h[x]+E:h[x]-E}Oo(e,y)}function zo(e,t){var n=Po(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(So());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(e),i={x:r.x,y:r.y};"left"in t&&(i.x=r.x+t.left-n.left),"top"in t&&(i.y=r.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue(So());if(r&&"none"!==r){var i,a=r.match(No);a?((i=(a=a[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,Co(e,"matrix(".concat(i.join(","),")"))):((i=r.match(Io)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,Co(e,"matrix3d(".concat(i.join(","),")")))}else Co(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function Wo(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Bo(e){return"border-box"===To(e,"boxSizing")}"undefined"!=typeof window&&(To=window.getComputedStyle?function(e,t,n){var r=n,i="",a=Ho(e);return(r=r||a.defaultView.getComputedStyle(e,null))&&(i=r.getPropertyValue(t)||r[t]),i}:function(e,t){var n=e[$o]&&e[$o][t];if(Fo.test(n)&&!Do.test(t)){var r=e.style,i=r[qo],a=e[Mo][qo];e[Mo][qo]=e[$o][qo],r[qo]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[qo]=i,e[Mo][qo]=a}return""===n?"auto":n});var Uo=["margin","border","padding"],Go=-1,Yo=2,Xo=1;function Zo(e,t,n){var r,i,a,l=0;for(i=0;i<t.length;i++)if(r=t[i])for(a=0;a<n.length;a++){var o=void 0;o="border"===r?"".concat(r).concat(n[a],"Width"):r+n[a],l+=parseFloat(To(e,o))||0}return l}var Qo={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Jo(e,t,n){var r=n;if(_o(e))return"width"===t?Qo.viewportWidth(e):Qo.viewportHeight(e);if(9===e.nodeType)return"width"===t?Qo.docWidth(e):Qo.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],a="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),l=Bo(e),o=0;(null==a||a<=0)&&(a=void 0,(null==(o=To(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===r&&(r=l?Xo:Go);var s=void 0!==a||l,c=a||o;return r===Go?s?c-Zo(e,["border","padding"],i):o:s?r===Xo?c:c+(r===Yo?-Zo(e,["border"],i):Zo(e,["margin"],i)):o+Zo(e,Uo.slice(r),i)}Wo(["Width","Height"],(function(e){Qo["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],Qo["viewport".concat(e)](n))},Qo["viewport".concat(e)]=function(t){var n="client".concat(e),r=t.document,i=r.body,a=r.documentElement[n];return"CSS1Compat"===r.compatMode&&a||i&&i[n]||a}}));var es={position:"absolute",visibility:"hidden",display:"block"};function ts(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0];return 0!==i.offsetWidth?r=Jo.apply(void 0,t):function(e,t,n){var r,i={},a=e.style;for(r in t)t.hasOwnProperty(r)&&(i[r]=a[r],a[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(a[r]=i[r])}(i,es,(function(){r=Jo.apply(void 0,t)})),r}function ns(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Wo(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Qo["outer".concat(t)]=function(t,n){return t&&ts(t,e,n?0:Xo)};var n="width"===e?["Left","Right"]:["Top","Bottom"];Qo[e]=function(t,r){var i=r;return void 0!==i?t?(Bo(t)&&(i+=Zo(t,["padding","border"],n)),Oo(t,e,i)):void 0:t&&ts(t,e,Go)}}));var rs={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Ho,offset:function(e,t,n){if(void 0===t)return Po(e);!function(e,t,n){if(n.ignoreShake){var r=Po(e),i=r.left.toFixed(0),a=r.top.toFixed(0),l=t.left.toFixed(0),o=t.top.toFixed(0);if(i===l&&a===o)return}n.useCssRight||n.useCssBottom?Ko(e,t,n):n.useCssTransform&&So()in document.body.style?zo(e,t):Ko(e,t,n)}(e,t,n||{})},isWindow:_o,each:Wo,css:Oo,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:ns,getWindowScrollLeft:function(e){return Lo(e)},getWindowScrollTop:function(e){return Ao(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)rs.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};ns(rs,Qo);var is=rs.getParent;function as(e){if(rs.isWindow(e)||9===e.nodeType)return null;var t,n=rs.getDocument(e).body,r=rs.css(e,"position");if(!("fixed"===r||"absolute"===r))return"html"===e.nodeName.toLowerCase()?null:is(e);for(t=is(e);t&&t!==n&&9!==t.nodeType;t=is(t))if("static"!==(r=rs.css(t,"position")))return t;return null}var ls=rs.getParent;function os(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=as(e),i=rs.getDocument(e),a=i.defaultView||i.parentWindow,l=i.body,o=i.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===l||r===o||"visible"===rs.css(r,"overflow")){if(r===l||r===o)break}else{var s=rs.offset(r);s.left+=r.clientLeft,s.top+=r.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+r.clientWidth),n.bottom=Math.min(n.bottom,s.top+r.clientHeight),n.left=Math.max(n.left,s.left)}r=as(r)}var c=null;rs.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===rs.css(e,"position")&&(e.style.position="fixed"));var d=rs.getWindowScrollLeft(a),u=rs.getWindowScrollTop(a),p=rs.viewportWidth(a),h=rs.viewportHeight(a),m=o.scrollWidth,f=o.scrollHeight,g=window.getComputedStyle(l);if("hidden"===g.overflowX&&(m=a.innerWidth),"hidden"===g.overflowY&&(f=a.innerHeight),e.style&&(e.style.position=c),t||function(e){if(rs.isWindow(e)||9===e.nodeType)return!1;var t=rs.getDocument(e),n=t.body,r=null;for(r=ls(e);r&&r!==n&&r!==t;r=ls(r))if("fixed"===rs.css(r,"position"))return!0;return!1}(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,u),n.right=Math.min(n.right,d+p),n.bottom=Math.min(n.bottom,u+h);else{var v=Math.max(m,d+p);n.right=Math.min(n.right,v);var y=Math.max(f,u+h);n.bottom=Math.min(n.bottom,y)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function ss(e){var t,n,r;if(rs.isWindow(e)||9===e.nodeType){var i=rs.getWindow(e);t={left:rs.getWindowScrollLeft(i),top:rs.getWindowScrollTop(i)},n=rs.viewportWidth(i),r=rs.viewportHeight(i)}else t=rs.offset(e),n=rs.outerWidth(e),r=rs.outerHeight(e);return t.width=n,t.height=r,t}function cs(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,a=e.height,l=e.left,o=e.top;return"c"===n?o+=a/2:"b"===n&&(o+=a),"c"===r?l+=i/2:"r"===r&&(l+=i),{left:l,top:o}}function ds(e,t,n,r,i){var a=cs(t,n[1]),l=cs(e,n[0]),o=[l.left-a.left,l.top-a.top];return{left:Math.round(e.left-o[0]+r[0]-i[0]),top:Math.round(e.top-o[1]+r[1]-i[1])}}function us(e,t,n){return e.left<n.left||e.left+t.width>n.right}function ps(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function hs(e,t,n){var r=[];return rs.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function ms(e,t){return e[t]=-e[t],e}function fs(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function gs(e,t){e[0]=fs(e[0],t.width),e[1]=fs(e[1],t.height)}function vs(e,t,n,r){var i=n.points,a=n.offset||[0,0],l=n.targetOffset||[0,0],o=n.overflow,s=n.source||e;a=[].concat(a),l=[].concat(l);var c={},d=0,u=os(s,!(!(o=o||{})||!o.alwaysByViewport)),p=ss(s);gs(a,p),gs(l,t);var h=ds(p,t,i,a,l),m=rs.merge(p,h);if(u&&(o.adjustX||o.adjustY)&&r){if(o.adjustX&&us(h,p,u)){var f=hs(i,/[lr]/gi,{l:"r",r:"l"}),g=ms(a,0),v=ms(l,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(ds(p,t,f,g,v),p,u)||(d=1,i=f,a=g,l=v)}if(o.adjustY&&ps(h,p,u)){var y=hs(i,/[tb]/gi,{t:"b",b:"t"}),b=ms(a,1),x=ms(l,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(ds(p,t,y,b,x),p,u)||(d=1,i=y,a=b,l=x)}d&&(h=ds(p,t,i,a,l),rs.mix(m,h));var E=us(h,p,u),S=ps(h,p,u);if(E||S){var w=i;E&&(w=hs(i,/[lr]/gi,{l:"r",r:"l"})),S&&(w=hs(i,/[tb]/gi,{t:"b",b:"t"})),i=w,a=n.offset||[0,0],l=n.targetOffset||[0,0]}c.adjustX=o.adjustX&&E,c.adjustY=o.adjustY&&S,(c.adjustX||c.adjustY)&&(m=function(e,t,n,r){var i=rs.clone(e),a={width:t.width,height:t.height};return r.adjustX&&i.left<n.left&&(i.left=n.left),r.resizeWidth&&i.left>=n.left&&i.left+a.width>n.right&&(a.width-=i.left+a.width-n.right),r.adjustX&&i.left+a.width>n.right&&(i.left=Math.max(n.right-a.width,n.left)),r.adjustY&&i.top<n.top&&(i.top=n.top),r.resizeHeight&&i.top>=n.top&&i.top+a.height>n.bottom&&(a.height-=i.top+a.height-n.bottom),r.adjustY&&i.top+a.height>n.bottom&&(i.top=Math.max(n.bottom-a.height,n.top)),rs.mix(i,a)}(h,p,u,c))}return m.width!==p.width&&rs.css(s,"width",rs.width(s)+m.width-p.width),m.height!==p.height&&rs.css(s,"height",rs.height(s)+m.height-p.height),rs.offset(s,{left:m.left,top:m.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:a,targetOffset:l,overflow:c}}function ys(e,t,n){var r=n.target||t,i=ss(r),a=!function(e,t){var n=os(e,t),r=ss(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return vs(e,i,n,a)}ys.__getOffsetParent=as,ys.__getVisibleRectForElement=os;var bs=Or()?e.useLayoutEffect:e.useEffect,xs=function(t,n){var r=e.useRef(!0);bs((function(){return t(r.current)}),n),bs((function(){return r.current=!1,function(){r.current=!0}}),[])};function Es(e,t){var n=null,r=null;var i=new Ot((function(e){var i=Qn(e,1)[0].target;if(document.documentElement.contains(i)){var a=i.getBoundingClientRect(),l=a.width,o=a.height,s=Math.floor(l),c=Math.floor(o);n===s&&r===c||Promise.resolve().then((function(){t({width:s,height:c})})),n=s,r=c}}));return e&&i.observe(e),function(){i.disconnect()}}function Ss(e){return"function"!=typeof e?null:e()}function ws(e){return"object"===Bn(e)&&e?e:null}var Cs=function(e,n){var r=e.children,i=e.disabled,a=e.target,l=e.align,o=e.onAlign,s=e.monitorWindowResize,c=e.monitorBufferTime,d=void 0===c?0:c,u=t.useRef({}),p=t.useRef(),h=t.Children.only(r),m=t.useRef({});m.current.disabled=i,m.current.target=a,m.current.align=l,m.current.onAlign=o;var f=function(e,n){var r=t.useRef(!1),i=t.useRef(null);function a(){window.clearTimeout(i.current)}return[function t(l){if(a(),r.current&&!0!==l)i.current=window.setTimeout((function(){r.current=!1,t()}),n);else{if(!1===e(l))return;r.current=!0,i.current=window.setTimeout((function(){r.current=!1}),n)}},function(){r.current=!1,a()}]}((function(){var e=m.current,t=e.disabled,n=e.target,r=e.align,i=e.onAlign,a=p.current;if(!t&&n&&a){var l,o=Ss(n),s=ws(n);u.current.element=o,u.current.point=s,u.current.align=r;var c=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),a=i.width,l=i.height;if(a||l)return!0}}return!1}(o)?l=ys(a,o,r):s&&(l=function(e,t,n){var r,i,a=rs.getDocument(e),l=a.defaultView||a.parentWindow,o=rs.getWindowScrollLeft(l),s=rs.getWindowScrollTop(l),c=rs.viewportWidth(l),d=rs.viewportHeight(l),u={left:r="pageX"in t?t.pageX:o+t.clientX,top:i="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=o+c&&i>=0&&i<=s+d,h=[n.points[0],"cc"];return vs(e,u,go(go({},n),{},{points:h}),p)}(a,s,r)),function(e,t){e!==document.activeElement&&oo(t,e)&&"function"==typeof e.focus&&e.focus()}(c,a),i&&l&&i(a,l),!0}return!1}),d),g=Qn(f,2),v=g[0],y=g[1],b=Qn(t.useState(),2),x=b[0],E=b[1],S=Qn(t.useState(),2),w=S[0],C=S[1];return xs((function(){E(Ss(a)),C(ws(a))})),t.useEffect((function(){var e,t;u.current.element===x&&((e=u.current.point)===(t=w)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=r.has(t);if(cn(!l,"Warning: There may be circular references"),l)return!1;if(t===i)return!0;if(n&&a>1)return!1;r.add(t);var o=a+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],i[s],o))return!1;return!0}if(t&&i&&"object"===Bn(t)&&"object"===Bn(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every((function(n){return e(t[n],i[n],o)}))}return!1}(e,t)}(u.current.align,l)||v()})),t.useEffect((function(){return Es(p.current,v)}),[p.current]),t.useEffect((function(){return Es(x,v)}),[x]),t.useEffect((function(){i?y():v()}),[i]),t.useEffect((function(){if(s)return so(window,"resize",v).remove}),[s]),t.useEffect((function(){return function(){y()}}),[]),t.useImperativeHandle(n,(function(){return{forceAlign:function(){return v(!0)}}})),t.isValidElement(h)&&(h=t.cloneElement(h,{ref:ar(h.ref,p)})),h},Ts=t.forwardRef(Cs);function Ns(){Ns=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var a=t&&t.prototype instanceof p?t:p,l=Object.create(a.prototype),o=new T(i||[]);return r(l,"_invoke",{value:E(e,n,o)}),l}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function h(){}function m(){}var f={};s(f,a,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(N([])));v&&v!==t&&n.call(v,a)&&(f=v);var y=m.prototype=p.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,a,l,o){var s=d(e[r],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Bn(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,l,o)}),(function(e){i("throw",e,l,o)})):t.resolve(u).then((function(e){c.value=e,l(c)}),(function(e){return i("throw",e,l,o)}))}o(s.arg)}var a;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var o=S(l,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=d(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function N(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=m,r(y,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:h,configurable:!0}),h.displayName=s(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,l,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var l=new x(c(t,n,r,i),a);return e.isGeneratorFunction(n)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},b(y),s(y,o,"Generator"),s(y,a,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=N,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return l.type="throw",l.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(o&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Is(e,t,n,r,i,a,l){try{var o=e[a](l),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,i)}function Rs(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){Is(a,r,i,l,o,"next",e)}function o(e){Is(a,r,i,l,o,"throw",e)}l(void 0)}))}}Ts.displayName="Align";var Os=["measure","alignPre","align",null,"motion"],ks=e.forwardRef((function(t,n){var r=t.visible,i=t.prefixCls,a=t.className,o=t.style,c=t.children,d=t.zIndex,u=t.stretch,h=t.destroyPopupOnHide,m=t.forceRender,f=t.align,g=t.point,v=t.getRootDomNode,y=t.getClassNameFromAlign,b=t.onAlign,x=t.onMouseEnter,E=t.onMouseLeave,S=t.onMouseDown,w=t.onTouchStart,C=t.onClick,T=l(),N=l(),I=Qn(p(),2),R=I[0],O=I[1],k=function(t){var n=Qn(e.useState({width:0,height:0}),2),r=n[0],i=n[1];return[e.useMemo((function(){var e={};if(t){var n=r.width,i=r.height;-1!==t.indexOf("height")&&i?e.height=i:-1!==t.indexOf("minHeight")&&i&&(e.minHeight=i),-1!==t.indexOf("width")&&n?e.width=n:-1!==t.indexOf("minWidth")&&n&&(e.minWidth=n)}return e}),[t,r]),function(e){var t=e.offsetWidth,n=e.offsetHeight,r=e.getBoundingClientRect(),a=r.width,l=r.height;Math.abs(t-a)<1&&Math.abs(n-l)<1&&(t=a,n=l),i({width:t,height:n})}]}(u),L=Qn(k,2),A=L[0],P=L[1];var _=function(e,t){var n=Qn(yr(null),2),r=n[0],i=n[1],a=l();function o(e){i(e,!0)}function c(){Qr.cancel(a.current)}return s((function(){o("measure")}),[e]),s((function(){"measure"===r&&t(),r&&(a.current=Qr(Rs(Ns().mark((function e(){var t,n;return Ns().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Os.indexOf(r),(n=Os[t+1])&&-1!==t&&o(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),s((function(){return function(){c()}}),[]),[r,function(e){c(),a.current=Qr((function(){o((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r,(function(){u&&P(v())})),H=Qn(_,2),F=H[0],D=H[1],$=Qn(p(0),2),M=$[0],q=$[1],j=l();function V(){var e;null===(e=T.current)||void 0===e||e.forceAlign()}function K(e,t){var n=y(t);R!==n&&O(n),q((function(e){return e+1})),"align"===F&&(null==b||b(e,t))}xs((function(){"alignPre"===F&&q(0)}),[F]),xs((function(){"align"===F&&(M<3?V():D((function(){var e;null===(e=j.current)||void 0===e||e.call(j)})))}),[M]);var z=Xn({},ho(t));function W(){return new Promise((function(e){j.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=z[e];z[e]=function(e,n){return D(),null==t?void 0:t(e,n)}})),e.useEffect((function(){z.motionName||"motion"!==F||D()}),[z.motionName,F]),e.useImperativeHandle(n,(function(){return{forceAlign:V,getElement:function(){return N.current}}}));var B=Xn(Xn({},A),{},{zIndex:d,opacity:"motion"!==F&&"stable"!==F&&r?0:void 0,pointerEvents:r||"stable"===F?void 0:"none"},o),U=!0;null==f||!f.points||"align"!==F&&"stable"!==F||(U=!1);var G=c;return e.Children.count(c)>1&&(G=e.createElement("div",{className:"".concat(i,"-content")},c)),e.createElement(ai,li({visible:r,ref:N,leavedClassName:"".concat(i,"-hidden")},z,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:h,forceRender:m}),(function(t,n){var r=t.className,l=t.style,o=Fe(i,a,R,r);return e.createElement(Ts,{target:g||v,key:"popup",ref:T,monitorWindowResize:!0,disabled:U,align:f,onAlign:K},e.createElement("div",{ref:n,className:o,onMouseEnter:x,onMouseLeave:E,onMouseDownCapture:S,onTouchStartCapture:w,onClick:C,style:Xn(Xn({},l),B)},G))}))}));ks.displayName="PopupInner";var Ls=e.forwardRef((function(t,n){var r=t.prefixCls,i=t.visible,a=t.zIndex,l=t.children,o=t.mobile,s=(o=void 0===o?{}:o).popupClassName,c=o.popupStyle,d=o.popupMotion,u=void 0===d?{}:d,p=o.popupRender,h=t.onClick,m=e.useRef();e.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return m.current}}}));var f=Xn({zIndex:a},c),g=l;return e.Children.count(l)>1&&(g=e.createElement("div",{className:"".concat(r,"-content")},l)),p&&(g=p(g)),e.createElement(ai,li({visible:i,ref:m,removeOnLeave:!0},u),(function(t,n){var i=t.className,a=t.style,l=Fe(r,s,i);return e.createElement("div",{ref:n,className:l,onClick:h,style:Xn(Xn({},a),f)},g)}))}));Ls.displayName="MobilePopupInner";var As=["visible","mobile"],Ps=e.forwardRef((function(t,n){var r=t.visible,i=t.mobile,a=or(t,As),l=Qn(p(r),2),o=l[0],c=l[1],d=Qn(p(!1),2),u=d[0],h=d[1],m=Xn(Xn({},a),{},{visible:o});s((function(){c(r),r&&i&&h(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[r,i]);var f=u?e.createElement(Ls,li({},m,{mobile:i,ref:n})):e.createElement(ks,li({},m,{ref:n}));return e.createElement("div",null,e.createElement(mo,m),f)}));Ps.displayName="Popup";var _s=e.createContext(null);function Hs(){}function Fs(){return""}function Ds(e){return e?e.ownerDocument:window.document}var $s=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var Ms=function(t){var n=function(n){hr(i,e.Component);var r=gr(i);function i(t){var n,a;return cr(this,i),Gn(fr(n=r.call(this,t)),"popupRef",e.createRef()),Gn(fr(n),"triggerRef",e.createRef()),Gn(fr(n),"portalContainer",void 0),Gn(fr(n),"attachId",void 0),Gn(fr(n),"clickOutsideHandler",void 0),Gn(fr(n),"touchOutsideHandler",void 0),Gn(fr(n),"contextMenuOutsideHandler1",void 0),Gn(fr(n),"contextMenuOutsideHandler2",void 0),Gn(fr(n),"mouseDownTimeout",void 0),Gn(fr(n),"focusTime",void 0),Gn(fr(n),"preClickTime",void 0),Gn(fr(n),"preTouchTime",void 0),Gn(fr(n),"delayTimer",void 0),Gn(fr(n),"hasPopupMouseDown",void 0),Gn(fr(n),"onMouseEnter",(function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)})),Gn(fr(n),"onMouseMove",(function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)})),Gn(fr(n),"onMouseLeave",(function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Gn(fr(n),"onPopupMouseEnter",(function(){n.clearDelayTimer()})),Gn(fr(n),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&oo(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Gn(fr(n),"onFocus",(function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))})),Gn(fr(n),"onMouseDown",(function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()})),Gn(fr(n),"onTouchStart",(function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()})),Gn(fr(n),"onBlur",(function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)})),Gn(fr(n),"onContextMenu",(function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)})),Gn(fr(n),"onContextMenuClose",(function(){n.isContextMenuToShow()&&n.close()})),Gn(fr(n),"onClick",(function(e){if(n.fireEvents("onClick",e),n.focusTime){var t;if(n.preClickTime&&n.preTouchTime?t=Math.min(n.preClickTime,n.preTouchTime):n.preClickTime?t=n.preClickTime:n.preTouchTime&&(t=n.preTouchTime),Math.abs(t-n.focusTime)<20)return;n.focusTime=0}n.preClickTime=0,n.preTouchTime=0,n.isClickToShow()&&(n.isClickToHide()||n.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!n.state.popupVisible;(n.isClickToHide()&&!r||r&&n.isClickToShow())&&n.setPopupVisible(!n.state.popupVisible,e)})),Gn(fr(n),"onPopupMouseDown",(function(){var e;(n.hasPopupMouseDown=!0,clearTimeout(n.mouseDownTimeout),n.mouseDownTimeout=window.setTimeout((function(){n.hasPopupMouseDown=!1}),0),n.context)&&(e=n.context).onPopupMouseDown.apply(e,arguments)})),Gn(fr(n),"onDocumentClick",(function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),i=n.getPopupDomNode();oo(r,t)&&!n.isContextMenuOnly()||oo(i,t)||n.hasPopupMouseDown||n.close()}})),Gn(fr(n),"getRootDomNode",(function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=er(n.triggerRef.current);if(t)return t}catch(e){}return Dt.findDOMNode(fr(n))})),Gn(fr(n),"getPopupClassNameFromAlign",(function(e){var t=[],r=n.props,i=r.popupPlacement,a=r.builtinPlacements,l=r.prefixCls,o=r.alignPoint,s=r.getPopupClassNameFromAlign;return i&&a&&t.push(function(e,t,n,r){for(var i=n.points,a=Object.keys(e),l=0;l<a.length;l+=1){var o=a[l];if(uo(e[o].points,i,r))return"".concat(t,"-placement-").concat(o)}return""}(a,l,e,o)),s&&t.push(s(e)),t.join(" ")})),Gn(fr(n),"getComponent",(function(){var t=n.props,r=t.prefixCls,i=t.destroyPopupOnHide,a=t.popupClassName,l=t.onPopupAlign,o=t.popupMotion,s=t.popupAnimation,c=t.popupTransitionName,d=t.popupStyle,u=t.mask,p=t.maskAnimation,h=t.maskTransitionName,m=t.maskMotion,f=t.zIndex,g=t.popup,v=t.stretch,y=t.alignPoint,b=t.mobile,x=t.forceRender,E=t.onPopupClick,S=n.state,w=S.popupVisible,C=S.point,T=n.getPopupAlign(),N={};return n.isMouseEnterToShow()&&(N.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(N.onMouseLeave=n.onPopupMouseLeave),N.onMouseDown=n.onPopupMouseDown,N.onTouchStart=n.onPopupMouseDown,e.createElement(Ps,li({prefixCls:r,destroyPopupOnHide:i,visible:w,point:y&&C,className:a,align:T,onAlign:l,animation:s,getClassNameFromAlign:n.getPopupClassNameFromAlign},N,{stretch:v,getRootDomNode:n.getRootDomNode,style:d,mask:u,zIndex:f,transitionName:c,maskAnimation:p,maskTransitionName:h,maskMotion:m,ref:n.popupRef,motion:o,mobile:b,forceRender:x,onClick:E}),"function"==typeof g?g():g)})),Gn(fr(n),"attachParent",(function(e){Qr.cancel(n.attachId);var t,r=n.props,i=r.getPopupContainer,a=r.getDocument,l=n.getRootDomNode();i?(l||0===i.length)&&(t=i(l)):t=a(n.getRootDomNode()).body,t?t.appendChild(e):n.attachId=Qr((function(){n.attachParent(e)}))})),Gn(fr(n),"getContainer",(function(){if(!n.portalContainer){var e=(0,n.props.getDocument)(n.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",n.portalContainer=e}return n.attachParent(n.portalContainer),n.portalContainer})),Gn(fr(n),"setPoint",(function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Gn(fr(n),"handlePortalUpdate",(function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)})),Gn(fr(n),"triggerContextValue",{onPopupMouseDown:n.onPopupMouseDown}),a="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,n.state={prevPopupVisible:a,popupVisible:a},$s.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),n}return ur(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=so(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=so(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=so(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=so(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Qr.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?function(e,t,n){return Xn(Xn({},e[t]||{}),n)}(r,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:r}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var r=this,i=1e3*t;if(this.clearDelayTimer(),i){var a=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(e,a),r.clearDelayTimer()}),i)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var n=this.state.popupVisible,r=this.props,i=r.children,a=r.forceRender,l=r.alignPoint,o=r.className,s=r.autoDestroy,c=e.Children.only(i),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,l&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=Fe(c&&c.props&&c.props.className,o);u&&(d.className=u);var p=Xn({},d);lr(c)&&(p.ref=ar(this.triggerRef,c.ref));var h,m=e.cloneElement(c,p);return(n||this.popupRef.current||a)&&(h=e.createElement(t,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!n&&s&&(h=null),e.createElement(_s.Provider,{value:this.triggerContextValue},m,h)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,r={};return void 0!==n&&t.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=t.popupVisible),r}}]),i}();return Gn(n,"contextType",_s),Gn(n,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Fs,getDocument:Ds,onPopupVisibleChange:Hs,afterPopupVisibleChange:Hs,onPopupAlign:Hs,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),n}(co);let qs=class extends r{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||en("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||en("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(Ee([...this._records.filter((e=>t.includes(e[n]))),...e],n));const r=this.recordsToDict();this.setItemList(r),this.triggerChange(r.map((e=>e.value)));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;ge(n,r)||ge(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:a={},formatter:l=(e=>e),dataKey:o,callback:s,fieldAliasMap:c}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof c?c():c||{},{value:u}=this.props;if(i){if(_n(u))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(l(Object.assign(Object.assign({},a),{keys:u})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=me(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==r&&(e[r]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==n&&(e[n]=e[d.textKey])})),i=i.filter((e=>u.includes(e[r])));const a=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(a),this.setViewValue(u),null==s||s(i)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:a,visible2:l,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:h={},placeholder:m=Xt("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,E={visible:a,title:Xt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${no[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:xe({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),w=s.filter((e=>null==c?void 0:c.includes(e.value))),T=t.createElement("ul",{className:"ant-dropdown-menu"},w.length?w.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Xt("qm.table.config.emptyText"))),N=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=jn("form-multiple-search-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(jl,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(Ms,{popupVisible:!y&&l,popup:T,popupClassName:Fe(O),popupStyle:{minWidth:N},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:dl,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement($,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:m,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},h),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Xe,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(da,E,t.createElement(ip,S)))}};qs.contextType=ua,qs=Cn([lo],qs);class js extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:a}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Il(Object.assign({},n.data,a),l,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(qs,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(l,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(l,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}js.contextType=ua;const{Search:Vs}=O;class Ks extends r{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||en("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||en("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&en("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Tn(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:a,triggeredChange:l,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(!t||_n(u))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=me(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&xl(e,this.alias,c),d&&El(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=bl(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==a||a([e])}}}catch(e){}this.setState({loading:!1})})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=bl(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:bl(e,this.extras[n])})},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias)r!==n&&t.SET_FIELDS_VALUE({[r]:bl(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:bl(e,this.extras[n])});const r=bl(e,this.alias[n]);this.triggerChange(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:a=""}=this.props,{type:l,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=Xt("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:Xt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${no[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:xe({},c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return n.isOnlyShow?t.createElement(jl,{value:a,bordered:p}):t.createElement(t.Fragment,null,t.createElement(Vs,{ref:e=>this[`${l}_Ref`]=e,value:a,title:a,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:h,readOnly:m,disabled:f,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),t.createElement(da,b,t.createElement(sp,x)))}}Ks.contextType=ua;class zs extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:a}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Il(Object.assign({},n.data,a),l,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Ks,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n)=>{f(t,n),e.setViewValue(l,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(l,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}zs.contextType=ua;let Ws=class extends r{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||en("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||en("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(Ee([...this._records.filter((e=>t.includes(e[n]))),...e],n));const r=this.recordsToDict();this.setItemList(r),this.triggerChange(r.map((e=>e.value)));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;ge(n,r)||ge(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:a={},formatter:l=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof s?s():s||{},{value:d}=this.props;if(i){if(_n(d))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(l(Object.assign(Object.assign({},a),{keys:d})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=me(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==c?void 0:c.valueKey)&&c.valueKey!==r&&(e[r]=e[c.valueKey]),(null==c?void 0:c.textKey)&&c.textKey!==n&&(e[n]=e[c.textKey])})),i=i.filter((e=>d.includes(e[r])));const a=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(a),this.setViewValue(d)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:a,visible2:l,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:h={},placeholder:m=Xt("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,E={visible:a,title:Xt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${no[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:xe({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),w=s.filter((e=>null==c?void 0:c.includes(e.value))),T=t.createElement("ul",{className:"ant-dropdown-menu"},w.length?w.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Xt("qm.table.config.emptyText"))),N=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=jn("form-multiple-tree-table-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(jl,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(Ms,{popupVisible:!y&&l,popup:T,popupClassName:Fe(O),popupStyle:{minWidth:N},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:dl,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement($,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:m,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},h),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Xe,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(da,E,t.createElement(sp,S)))}};Ws.contextType=ua,Ws=Cn([lo],Ws);class Bs extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:a}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Il(Object.assign({},n.data,a),l,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Ws,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(l,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(l,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Bs.contextType=ua;const Us=new Array(2).fill("");class Gs extends r{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Us},this.getSearchHelper=_t((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||en("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||en("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;this._is_change=!1,null==t||t(e),n(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(Us),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:n}=this.alias,r=e.map((e=>({value:e[t],text:e[n]})));this.setRecords(e),this.setItemList(r),this.setTextValue(r.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.openSearchHelper=e=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:kn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:_n(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=kn,formatter:i=(e=>e)}=t.fetch;return new Promise(((a,l)=>Tn(this,void 0,void 0,(function*(){var o;const s=xe({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!r(s))return l();this.setState({loading:!0});const e=yield t.fetch.api(s);if(An((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=me(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return a(n)}}catch(e){this.setState({loading:!1})}l()}))))},this.resetSearchHelperValue=(e=[])=>Tn(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:n}=this.alias,r=e.filter((e=>{var r;const i=null===(r=e[n])||void 0===r?void 0:r.toString().toLowerCase();return t.some((e=>null==i?void 0:i.includes(e.toLowerCase())))}));if(2===r.length)return this.closeSearchHelper(r);this.openSearchHelper()})),this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;ge(t,n)||ge(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:i}=this.props.option;if(!ge(r[i],this._ceho_data)&&(this._ceho_data=r[i],this.setItemList(r[i]),n.length)){const e=Us.map(((e,t)=>{var a,l;return null!==(l=null===(a=r[i].find((e=>e.value===n[t])))||void 0===a?void 0:a.text)&&void 0!==l?l:""}));this.setTextValue(e)}}getItemList(){var e;return Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:n}=this.alias,{fetchApi:r,params:i={},formatter:a=(e=>e),dataKey:l,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(r){if(_n(c))return this.setRecords([]);this.setState({loading:!0});try{const o=yield r(a(Object.assign(Object.assign({},i),{keys:c})));if(200===o.code){let r=Array.isArray(o.data)?o.data:null!==(e=me(o.data,l))&&void 0!==e?e:[];r.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==n&&(e[n]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),r=r.filter((e=>c.includes(e[n]))).slice(0,2);const i=r.map((e=>({value:e[n],text:e[t]})));this.setRecords(r),this.setItemList(i),this.setTextValue(i.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}))}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){var e;const{$$form:n}=this.context;this.props;const{visible:r,loading:i,textValue:a}=this.state,{fieldName:l,options:o={},searchHelper:s={},placeholder:c=Xt("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||s,m=a.every((e=>yl(e)))?"":a.join(" - "),f={visible:r,title:Xt("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${no[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},g=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:xe({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(jl,{value:m,bordered:d}):t.createElement(t.Fragment,null,t.createElement(O.Group,null,t.createElement(O,{value:a[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:c[0],allowClear:!1,bordered:d,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?a.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(a).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):a.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;h||(this._is_change=!0,this.setTextValue([t,a[1]]))}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:p,readOnly:!0}),t.createElement(O.Search,{value:a[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:c[1],loading:i,bordered:d,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?a.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(a).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):a.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:h||(this._is_change=!0,this.setTextValue([a[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),t.createElement(da,f,t.createElement(pp,g)))}}Gs.contextType=ua;class Ys extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:a}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Il(Object.assign({},n.data,a),l,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(c),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Gs,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{m(t,r),e.setViewValue(l,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Ys.contextType=ua;const Xs=e=>{const{$$form:n}=t.useContext(ua),{value:r,items:i,onChange:a,onValuesChange:l}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,h=_n(p)?i:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return n.isOnlyShow?t.createElement(jl,{value:m(r),bordered:c}):t.createElement(M.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u,onChange:e=>{(e=>{null==a||a(e),l(e,m(e))})(e)}},h.map((e=>t.createElement(M,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Zs extends r{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}getItemList(){var e;return Tn(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:a="value",textKey:l="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[a],text:e[l]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Xs,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Zs.contextType=ua;const Qs=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},style:o={},allowClear:s=!0,readOnly:c,disabled:d=n.isFormDisabled}=e.option,{allowHalf:u,count:p=5,tooltips:h}=l,m=e=>h?h[Math.ceil(e)-1]:e.toString();return t.createElement(V,{value:r,count:p,style:o,allowHalf:u,allowClear:s,tooltips:h,disabled:d||n.isOnlyShow,onChange:e=>{(e=>{null==i||i(e),a(e,m(e))})(e)}})};class Js extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Qs,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Js.contextType=ua;const ec=e=>{const{$$form:n}=t.useContext(ua),{value:r,items:i,onChange:a,onValuesChange:l}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u=n.isFormDisabled}=e.option,{itemList:p=[]}=o,h=_n(p)?i:p,m=e=>{var t,n;return null!==(n=null===(t=h.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==n?n:""};return n.isOnlyShow?t.createElement(jl,{value:m(r),bordered:c}):t.createElement(K.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u||n.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),l(e,m(e))})(t)}},h.map((e=>t.createElement(K,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class tc extends r{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:a="value",textKey:l="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[a],text:e[l]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(h)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(ec,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}tc.contextType=ua;const nc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{label:l,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToSwitch:u,falseValue:p=ol,trueValue:h=ll}=o;return t.createElement(t.Fragment,null,t.createElement(z,{checked:r===h,style:s,disabled:d||n.isOnlyShow,checkedChildren:t.createElement(je,null),unCheckedChildren:t.createElement(Ze,null),onChange:e=>{(e=>{null==i||i(e),a(e,Xt(e===h?"am.form.trueText":"am.form.falseText"))})(e?h:p)}}),u?t.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},l):null)};class rc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option,{labelToSwitch:m}=o;return t.createElement(H.Item,{label:m?" ":e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(nc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}rc.contextType=ua;const ic=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},style:o={},placeholder:s=Xt("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p,onBlur:h,onEnter:m}=e.option,{showCount:f,maxLength:g,autoSize:v}=l,y=Object.assign({},{minRows:1,maxRows:3},v);return t.createElement(O.TextArea,{value:r,placeholder:s,style:o,maxLength:g,showCount:f,autoSize:y,bordered:c,allowClear:d,readOnly:u||n.isOnlyShow,disabled:p,onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),null==h||h(n,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==m||m(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==i||i(e),a(e)})(t)}})};class ac extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ic,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ac.contextType=ua;const lc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{fieldName:l,options:o={},style:s={},placeholder:c=Xt("qm.form.datePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{dateType:m="date",format:f,disabledDate:v,minDateTime:y,maxDateTime:b,shortCuts:x=!0}=o,E=t.createRef(),S=e=>{e&&"date"===m&&(e=e.slice(0,10)+" 00:00:00"),null==i||i(e),a(e,w(e))},w=e=>yl(e)?"":["date","exactdate"].includes(m)?e.slice(0,10):e,C=e=>{let t=vl(g().subtract(e,"day"),pl[m]);"date"===m&&(t=t.slice(0,10)),S(t),E.current.blur(),E.current.focus()};return n.isOnlyShow?t.createElement(jl,{value:w(r),bordered:d}):t.createElement(gn,{ref:E,style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${l}`,picker:ul[m],format:f,bordered:d,showToday:!1,showTime:"datetime"===m&&{defaultValue:g("00:00:00","HH:mm:ss")},allowClear:u,disabled:h,inputReadOnly:p,disabledDate:null!=v?v:e=>((e,[t,n])=>t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day"))(e,[y,b]),renderExtraFooter:x&&m.includes("date")?()=>"function"==typeof x?x():t.createElement(t.Fragment,null,t.createElement(W,{color:"processing",onClick:()=>C(0)},Xt("qm.form.datePickers")[0]),t.createElement(W,{color:"processing",onClick:()=>C(1)},Xt("qm.form.datePickers")[1]),t.createElement(W,{color:"processing",onClick:()=>C(7)},Xt("qm.form.datePickers")[2]),t.createElement(W,{color:"processing",onClick:()=>C(30)},Xt("qm.form.datePickers")[3])):void 0,value:gl(r,pl[m]),onChange:(e,t)=>{S(vl(e,pl[m]))}})};class oc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(lc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}oc.contextType=ua;const sc=e=>[g().subtract(e,"day"),g()],cc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{fieldName:l,options:o={},style:s={},placeholder:c=Xt("qm.form.daterangePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h=n.isFormDisabled}=e.option,{dateType:m="date",format:f,disableds:v=[!1,!1],allowEmpty:y,disabledDate:b,minDateTime:x,maxDateTime:E,shortCuts:S=!0}=o,w={[Xt("qm.form.dateRangePickers")[0]]:sc(7),[Xt("qm.form.dateRangePickers")[1]]:sc(30),[Xt("qm.form.dateRangePickers")[2]]:sc(90),[Xt("qm.form.dateRangePickers")[3]]:sc(180)},C=e=>yl(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return n.isOnlyShow?t.createElement(jl,{value:C(r),bordered:d}):t.createElement(gn.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${l}`,picker:ul[m],format:f,bordered:d,showTime:"datetime"===m&&{defaultValue:[g("00:00:00","HH:mm:ss"),g("23:59:59","HH:mm:ss")]},allowClear:u,allowEmpty:y,disabled:h?[!0,!0]:v,inputReadOnly:p,disabledDate:null!=b?b:e=>((e,[t,n])=>t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day"))(e,[x,E]),ranges:S&&m.includes("date")?w:void 0,value:_n(r)?null:[gl(null==r?void 0:r[0],pl[m]),gl(null==r?void 0:r[1],pl[m])],onChange:(e,t)=>{(e=>{"date"===m&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==i||i(e),a(e,C(e))})([vl(null==e?void 0:e[0],pl[m]),vl(null==e?void 0:e[1],pl[m])])}})};class dc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(cc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}dc.contextType=ua;const uc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{fieldName:l,options:o={},style:s={},placeholder:c=Xt("qm.form.timePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",hourStep:f=1,minuteStep:g=1,secondStep:v=1}=o;return n.isOnlyShow?t.createElement(jl,{value:r,bordered:d}):t.createElement(yn,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${l}`,bordered:d,showNow:!0,hourStep:f,minuteStep:g,secondStep:v,allowClear:u,disabled:h,inputReadOnly:p,format:hl[m],value:gl(r,hl[m]),onChange:(e,t)=>{(e=>{const t=vl(e,hl[m]);null==i||i(t),a(t)})(e)}})};class pc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(uc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}pc.contextType=ua;const hc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{fieldName:l,options:o={},style:s={},placeholder:c=Xt("qm.form.timerangePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h=n.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:f=[!1,!1],allowEmpty:g,hourStep:v=1,minuteStep:y=1,secondStep:b=1}=o,x=e=>yl(e)?"":e.join(" - ");return n.isOnlyShow?t.createElement(jl,{value:x(r),bordered:d}):t.createElement(yn.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${l}`,bordered:d,showNow:!1,hourStep:v,minuteStep:y,secondStep:b,allowClear:u,allowEmpty:g,disabled:h?[!0,!0]:f,inputReadOnly:p,format:hl[m],value:_n(r)?null:[gl(null==r?void 0:r[0],hl[m]),gl(null==r?void 0:r[1],hl[m])],onChange:(e,t)=>{(e=>{const t=[vl(null==e?void 0:e[0],hl[m]),vl(null==e?void 0:e[1],hl[m])];null==i||i(t),a(t,x(t))})(e)}})};class mc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(hc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}mc.contextType=ua;class fc extends r{constructor(e){super(e),this.searchRef=t.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=_t(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.initialHandle=()=>Tn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:n}=this.props.option,{fieldAliasMap:r,fieldsDefine:i,echoRequest:a}=this.searchHelper;if(r||en("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(e)||en("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),a&&!this.valueKey&&en("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&en("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getItemText=()=>Tn(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:a,triggeredChange:l,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t){if(_n(u))return this._prevValue=void 0;try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=me(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&xl(e,this.alias,c),d&&El(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=bl(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==a||a([e])}}}catch(e){}}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias){const i=bl(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:bl(e,this.extras[n])})},this.fetchHandle=Se(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:n}=this.context,{fieldName:r}=this.props.option;for(const t in this.alias)t!==r&&n.SET_FIELDS_VALUE({[t]:bl(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:bl(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=bl(e,this.alias[r]);this.triggerChange(i),this.setState({inputText:void 0}),t&&t()},this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(e){var t,n,r,i,a,l,o;const s=(null===(n=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===n?void 0:n.params)||(null===(r=e.option.request)||void 0===r?void 0:r.params),c=(null===(a=null===(i=this.props.option.searchHelper)||void 0===i?void 0:i.request)||void 0===a?void 0:a.params)||(null===(l=this.props.option.request)||void 0===l?void 0:l.params);if(ge(s,c)||this.getItemList(),null===this._prevValue)return;const d=this.getItemValue();this._prevValue!==d&&d!==(null===(o=this._record)||void 0===o?void 0:o[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=d}getItemList(e){var t;return Tn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:r,params:i={},formatter:a=(e=>e),dataKey:l}=this.searchHelper.request||this.props.option.request||{};if(r){this.setState({loading:!0});try{const o=yield r(a(Object.assign(Object.assign({},i),{[n]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=me(o.data,l))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:n,loading:r,itemList:i,inputText:a}=this.state,{value:l}=this.props,{fieldName:o,options:s={},style:c={},placeholder:d=Xt("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{listHeight:f=sl}=s,{hideHeader:g,onlySelect:v=!0}=this.searchHelper||s,y=this.searchHelper.columns||[],b=jn("form-immediate"),x=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,E=t.createElement(R,{spinning:r},i.length?t.createElement("table",{cellSpacing:0,cellPadding:0,className:Fe("table")},!g&&t.createElement("thead",null,t.createElement("tr",null,y.filter((e=>!e.hidden)).map((e=>t.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),t.createElement("tbody",null,i.map(((e,n)=>t.createElement("tr",{key:n,className:this.state.activeIndex===n?"active":"",onMouseEnter:()=>{this.setState({activeIndex:n})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},y.filter((e=>!e.hidden)).map((n=>t.createElement("td",{key:n.dataIndex},me(e,n.dataIndex))))))))):t.createElement(Fi,null));return t.createElement(Bt.Consumer,null,(r=>{const s={[b]:!0,[`${b}--lg`]:"large"===(null==r?void 0:r.size),[`${b}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(jl,{value:l,bordered:u}):t.createElement(Ms,{action:m?[]:["click"],popupVisible:!m&&n,popup:E,popupClassName:Fe(s,`form-popper__${o}`),popupStyle:{minWidth:x,maxHeight:f},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:dl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:d,allowClear:p,bordered:u,readOnly:h,disabled:m,style:Object.assign({width:"100%"},c),value:null!=a?a:l,title:l,onFocus:()=>{!i.length&&this.fetchHandle(l)},onBlur:e=>{v&&!this._clicking&&a!==l&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(i[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const n=40===e.keyCode?++t%i.length:(--t+i.length)%i.length;this.setState({activeIndex:n})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),v?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}fc.contextType=ua;class gc extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Tn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Jt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:a}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return en("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Il(Object.assign({},n.data,a),l,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:a,fieldName:l,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:Fe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Dn(c)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(fc,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="",n)=>{f(t,n),e.setViewValue(l,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(l,p)),u&&t.createElement(D,{flex:Dn(u.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}gc.contextType=ua;class vc extends r{render(){var e;const{$$form:n}=this.context,{type:r,label:i,fieldName:a,className:l,style:o={},collapse:s={}}=this.props.option,{expand:c}=n.state,{showLimit:d,remarkItems:u=[],onCollapse:p=On}=s,h=[];if(u.length){const t=null!==(e=n.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],r=null!=d?d:t.length-1;t.slice(r+1).forEach((e=>{var t;const r=u.find((t=>t.fieldName===e.fieldName));if(!r)return;const i=r.showLabel?`${e.label}:`:"",a=null!==(t=n.getViewValue(e.fieldName))&&void 0!==t?t:"";""!==a&&h.push(Object.assign(Object.assign({},e),{text:`${i}${a}`}))}))}return t.createElement(H.Item,{labelCol:{span:0},wrapperCol:{span:24}},t.createElement(Vn,{id:a,label:i,className:l,extra:h.map((e=>e.text)).join(" | "),style:Object.assign({},o),collapse:c[a],onCollapseChange:e=>{n.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),p(e)}}))}}vc.contextType=ua;const yc=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:yc(e.children,t,n,r)}):e)),bc=e=>{const{$$form:n}=t.useContext(ua),{value:r,items:i,multiple:a,loading:l,onChange:o,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=Xt("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,asyncLoad:f,readOnly:g,disabled:v}=e.option,{itemList:y,filterable:b=!0,listHeight:x=sl,checkStrictly:E,checkStrategy:S="SHOW_CHILD",collapseTags:w,defaultExpandAll:C=!f,defaultExpandedKeys:T,dropdownStyle:N,openPyt:I=!0}=d,[R,O]=t.useState(_n(y)?i:y),k=t.useRef(R);bi((()=>{const e=_n(y)?i:y;f?ge(e,k.current)||(O(e),k.current=e):O(e)}),[y,i]);const L=e=>{var t;return(null===(t=wl(R,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},A=e=>a?(null==e?void 0:e.map((e=>L(e))).join(","))||"":L(e);return n.isOnlyShow?t.createElement(jl,{value:A(r),bordered:h}):t.createElement(B,vn({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:a,treeCheckable:a,treeCheckStrictly:E,showCheckedStrategy:B[S],popupClassName:`form-popper__${c}`,dropdownStyle:N,placeholder:p,listHeight:x,style:u,loading:l,bordered:h,allowClear:m,disabled:v,treeDefaultExpandAll:C,treeDefaultExpandedKeys:T,showSearch:b,maxTagCount:w?"responsive":void 0,loadData:f?({key:e,children:t})=>Tn(void 0,void 0,void 0,(function*(){var n;if(!f||t)return;const{fetchApi:r,params:i,dataKey:a,textKey:l="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=f;if(r)try{const t=yield r(c(Object.assign(Object.assign({},i),{[o]:e})));if(200===t.code){const r=Array.isArray(t.data)?t.data:null!==(n=me(t.data,a))&&void 0!==n?n:[],i=yc(R,e,o,Sl(r,o,l));O(i),null==s||s(r)}}catch(e){}})):void 0,treeData:R},a?{title:A(r)}:null,{filterTreeNode:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=Ml.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(I?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,A(e),R)})(e)}}))};class xc extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:a="value",textKey:l="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=Sl(n,a,l);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:a,tooltip:l,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(a),className:Fe(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Dn(d)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(a)}},t.createElement(bc,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Dn(p.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}xc.contextType=ua;const Ec=e=>{const{$$form:n}=t.useContext(ua),{value:r,multiple:i,items:a}=e,{fieldName:l,options:o={},style:s={},placeholder:c=Xt("qm.form.selectPlaceholder"),bordered:d=!0,allowClear:u=!0,asyncLoad:p,readOnly:h,disabled:m}=e.option,{itemList:f,changeOnSelect:g,checkStrictly:v,checkStrategy:y="SHOW_PARENT",filterable:b=!0,dropdownStyle:x,openPyt:E=!0}=o,[S,w]=t.useState(_n(f)?a:f),C=t.useRef(S);bi((()=>{const e=_n(f)?a:f;p?ge(e,C.current)||(w(e),C.current=e):w(e)}),[f,a]);const T=e=>Cl(S,null!=e?e:"").map((e=>e.text)).join("/"),N=e=>i?(null==e?void 0:e.map((e=>T(e))).join(","))||"":T(e);return n.isOnlyShow?t.createElement(jl,{value:N(r),bordered:d}):t.createElement(U,vn({value:(e=>_n(e)?[]:i?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:S,multiple:i,maxTagCount:"responsive",changeOnSelect:g||v,showCheckedStrategy:U[y],popupClassName:`form-popper__${l}`,dropdownStyle:x,placeholder:c,style:s,bordered:d,allowClear:u,disabled:m,showSearch:b&&!p&&{filter:(e,t)=>t.some((t=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=Ml.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(E?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:p?e=>Tn(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!p||n.children)return;const{fetchApi:r,params:i,dataKey:a,textKey:l="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=p;if(r)try{const e=yield r(c(Object.assign(Object.assign({},i),{[o]:n.value})));if(200===e.code){const r=Array.isArray(e.data)?e.data:null!==(t=me(e.data,a))&&void 0!==t?t:[],i=yc(S,n.value,o,Sl(r,o,l));w(i),null==s||s(r)}}catch(e){}})):void 0},i?{title:N(r)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:r}=e;null==n||n(t),r(t,N(t),S)})(((e=[])=>i?e.map((e=>e.join(","))):e.join(","))(t))}}))};class Sc extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Tn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:a="value",textKey:l="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[],r=Sl(n,a,l);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;ge(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:n}=this.props,{itemList:r}=this.state,{type:i,label:a,tooltip:l,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(a),className:Fe(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Dn(d)},required:e.getFormItemRequired(m)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(a)}},t.createElement(Ec,{option:this.props.option,multiple:n,items:r,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Dn(p.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Sc.contextType=ua;const wc=["110000","120000","310000","500000"],Cc=["810000","820000"],Tc=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Nc=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Ic=e=>Ml.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Rc=(e,t,n=1)=>{if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...wc,...Cc].includes(e))):Object.keys(e[t])).map((r=>({l:Ic(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Rc(e,r,n+1)})))},Oc=(e,t)=>t.map((t=>({l:Ic(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class kc extends r{constructor(e){super(e),this.searchRef=t.createRef(),this.scrollRef=t.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),At(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Oc(Wt,wc)},{l:"Z2",n:"港澳",c:"",p:"",children:Oc(Wt,Cc)}]}createProvince(){var e;return(null!==(e=Rc(Wt,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Nc.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...wc,...Cc].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t.createElement(K.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},t.createElement(K.Button,{value:"0"},Xt("qm.form.citySelectType.0")),t.createElement(K.Button,{value:"1"},Xt("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:n}=this.state;return("0"===n?Tc:Nc).map((n=>t.createElement("li",{key:n.value,className:Fe({tag:!0,actived:n.value===e}),onClick:()=>this.scrollHandle(n.value.toString())},n.text)))}renderSelect(){const{value:e}=this.props;return t.createElement($,{size:"small",placeholder:Xt("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var n;return((null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t.createElement($.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:n}=this.state;return("0"===n?this.provinces:this.letterCities).map(((n,r)=>{var i;return t.createElement("div",{key:r},t.createElement("dt",{ref:e=>this[`${n.l}Ref`]=e},n.n,":"),t.createElement("dd",null,null===(i=n.children)||void 0===i?void 0:i.map((n=>t.createElement("li",{key:n.c,className:Fe({actived:n.c===e}),onClick:()=>this.clickHadnle(n.c)},n.n)))))}))}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:a={},style:l={},placeholder:o=Xt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=jn("form-city-select"),h=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=this.createTextValue(r),f=t.createElement("div",{className:"container",style:Object.assign({},l)},t.createElement("div",{className:"city-drop"},t.createElement("div",{className:"city-drop-toper"},t.createElement("div",{className:"city-drop-toper__type"},this.renderType()),t.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),t.createElement("div",{className:"city-drop-letter"},this.renderLetter()),t.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},t.createElement("dl",null,this.renderCity(r)))));return t.createElement(Bt.Consumer,null,(r=>{const a={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(jl,{value:m,bordered:s}):t.createElement(Ms,{action:u?[]:["click"],popupVisible:!u&&n,popup:f,popupClassName:Fe(a,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:dl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,readOnly:d,disabled:u,style:Object.assign({width:"100%"},l),value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}kc.contextType=ua;class Lc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(kc,{option:this.props.option,onValuesChange:(t,n)=>{h(t,n),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Lc.contextType=ua;const Ac=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:Ac(e,n)})))};class Pc extends r{constructor(e){super(e),this.searchRef=t.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const n=Ac(Wt,"86")||[];this.state={results:n,visible:!1,values:[],tabs:[n.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:n}=this.props;t!==n&&this.state.values.join(",")!==(null!=n?n:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var n,r;return null===(r=null===(n=this.state.tabs[t])||void 0===n?void 0:n.find((t=>t.value===e)))||void 0===r?void 0:r.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const n=this.state.tabs.slice(0,1);for(let r=0;r<t.length;r++){const i=wl(e,t[r]);if(i&&_n(i.children)){this.isFetch&&this.getStreetList(t[r]);break}Array.isArray(null==i?void 0:i.children)&&(n[r+1]=null==i?void 0:i.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:n})}getStreetList(e){var t;return Tn(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:r,formatter:i=(e=>e),dataKey:a,valueKey:l="value",textKey:o="text"}=n;if(r)try{const n=yield r(i({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=me(n.data,a))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[l]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,n=this.state.tabs.map(((n,r)=>{var i;const a=(null===(i=n.find((t=>t.value===e[r])))||void 0===i?void 0:i.text)||`${Xt("qm.form.selectPlaceholder").replace("...","")}(${Xt("qm.form.regionSelectLabel")[r]})`;return t.createElement(la.TabPane,{key:r.toString(),tab:a},t.createElement("div",{className:"region-box"},n.map((n=>t.createElement("span",{key:n.value,className:Fe({"region-box__item":!0,actived:e.includes(n.value.toString())}),title:n.text,onClick:()=>{let{values:e}=this.state;e[r]=n.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},n.text)))))}));return n.length?t.createElement(la,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},n):t.createElement(Fi,null)}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:a={},style:l={},placeholder:o=Xt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=jn("form-region-select"),h=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=t.createElement("div",{className:"container"},this.renderTabs());let f=this.prevText;if(!n){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(f=e,this.prevText=f)}return t.createElement(Bt.Consumer,null,(r=>{const a={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(jl,{value:f,bordered:s}):t.createElement(Ms,{action:u?[]:["click"],popupVisible:!u&&n,popup:m,popupClassName:Fe(a,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:dl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,style:Object.assign({width:"100%"},l),readOnly:d,disabled:u,value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&An((()=>this.initial()))}})))}))}}Pc.contextType=ua;class _c extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Pc,{option:this.props.option,onValuesChange:(t,n)=>{h(t,n),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}_c.contextType=ua;const Hc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fileTypes:h,fileSize:m,draggable:f,editable:g,fileDirection:v,onPreview:y,onRemove:b,onSortChange:x,onEditChange:E}=l,{action:S,headers:w,params:C,withCredentials:T=!1,dataKey:N="",downloadWithHeaders:I,fieldAliasMap:R,beforeUpload:O,button:k}=o,A="function"==typeof R?R():R||{};return t.createElement(ea,{name:"file",action:S,multiple:u,headers:w,data:C,withCredentials:T,downloadWithHeaders:I,beforeUpload:O,maxCount:p,fileTypes:h,fileSize:m,draggable:f,editable:g,fileDirection:v,disabled:c,readOnly:n.isOnlyShow||d,button:k,showUploadList:{showDownloadIcon:!0,downloadIcon:t.createElement(Ke,null)},fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in A)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[A[i]])||"";return e.response&&200!==n.code&&L.error(n.message||Xt("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(N?me(n.data,N):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onPreview:y,onRemove:b,onSortChange:x,onEditChange:E})};class Fc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Hc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,"")}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Fc.contextType=ua;const Dc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fixedSize:h,quality:m,openCropper:f,fileTypes:g,fileSize:v,draggable:y,onRemove:b,onSortChange:x}=l,{action:E,headers:S,params:w,withCredentials:C=!1,dataKey:T="",popupClassName:N,fieldAliasMap:I,beforeUpload:R}=o,O="function"==typeof I?I():I||{};return t.createElement(od,{name:"file",action:E,multiple:u,headers:S,data:w,withCredentials:C,popupClassName:N,beforeUpload:R,maxCount:p,fixedSize:h,quality:m,openCropper:f,fileTypes:g,fileSize:v,draggable:y,disabled:c,readOnly:n.isOnlyShow||d,fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in O)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[O[i]])||"";return e.response&&200!==n.code&&L.error(n.message||Xt("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(T?me(n.data,T):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onRemove:b,onSortChange:x})};class $c extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Dc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,"")}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}$c.contextType=ua;const Mc=e=>{const{$$form:n}=t.useContext(ua),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o,style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{tinymce:u,thresholdSize:p,onResizeEditor:h}=l;return t.createElement(id,{value:r,tinymce:u,upload:o,thresholdSize:p,style:Object.assign({width:"100%"},s),disabled:d||c||n.isOnlyShow,onResizeEditor:h,onChange:e=>{(e=>{null==i||i(e),a(e)})(e)}})};class qc extends r{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:a,invisible:l,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=On}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:Fe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Dn(s)},required:e.getFormItemRequired(p)},t.createElement(F,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(H.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Mc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(D,{flex:Dn(d.labelWidth||al)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}qc.contextType=ua;class jc extends r{constructor(e){var n;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=t.createRef(),this.formRef=t.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(n=this.props.cols)&&void 0!==n?n:4,collapse:!!this.props.defaultExpand},this.resizeObserveHandler=()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let n=Math.floor(t/300);n=24%n==0?n:n-1,n=n<1?1:n,n=n>8?8:n,n!==this.state.flexCols&&this.setState({flexCols:n})},this.resizeListenerHandle=Se(this.resizeObserveHandler,10),this.getFormItems=_t((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=_t((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{se(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onValuesChange)||void 0===r||r.call(n,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onFieldsChange)||void 0===r||r.call(n,e,t)},this.finishHandle=e=>{var t,n;null===(n=(t=this.props).onFinish)||void 0===n||n.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var n,r;null===(r=(n=this.props).onFinishFailed)||void 0===r||r.call(n,t)},this.openValidateInfo=e=>{const n=t.createElement("ul",null,e.map((e=>{const{label:n}=this.formItems.find((t=>t.fieldName===e.name[0]));return t.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof n?`${n}: `:"")+e.errors.join(","),"]")})));G.error({message:Xt("qm.form.validatePrompt"),description:n,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&At(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})},this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){var e,t;return null!==(t=null!==(e=this.props.size)&&void 0!==e?e:this.context.size)&&void 0!==t?t:""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isFormDisabled(){return this.props.disabled}get isCompactMode(){var e;const t=this.context.global;return null!==(e=this.props.compactMode)&&void 0!==e?e:"small"===this.$size&&!!(null==t?void 0:t.compactModeInSmallSize)}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){qi(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){ji(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&en("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return Object.assign({},n)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>se(e.extra))).forEach((n=>{var r;t[n.fieldName]=null!==(r=e[n.fieldName])&&void 0!==r?r:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>se(e.collapse))).forEach((t=>{var n;e[t.fieldName]=null!==(n=t.collapse.defaultExpand)&&void 0!==n&&n})),Object.assign({},e)}getInitialValue(e,t){var n;const{type:r,options:i}=e;return t=null!=t?t:void 0,cl.includes(r)&&(t=null!=t?t:[]),"CHECKBOX"!==r&&"SWITCH"!==r||(t=null!==(n=null!=t?t:null==i?void 0:i.falseValue)&&void 0!==n?n:ol),t}createFormValue(e){const t={};return this.flattenItems.forEach((n=>{t[n.fieldName]=this.getInitialValue(n,e[n.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=Fn(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((n=>({viewData:Object.assign({},n.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){var t,n;e!==this.state.collapse&&(this.setState({collapse:e}),null===(n=(t=this.props).onCollapse)||void 0===n||n.call(t,e),An((()=>{var t,n;return null===(n=(t=this.props).onCollapse)||void 0===n?void 0:n.call(t,e)})))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:n}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!n||setTimeout((()=>this.CREATE_FOCUS(n)))}getFormItemLabel(e){var t,n,r,i,a;if(Tl(e))return Nl(e);if(se(e)){const{fieldName:l,label:o,options:s={}}=e;if(Tl(o))return Nl(o);const{itemList:c=[]}=s,d=null!==(r=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([l])[l])&&void 0!==n?n:this._initialValues[l])&&void 0!==r?r:null===(i=c[0])||void 0===i?void 0:i.value;return(null===(a=c.find((e=>e.value===d)))||void 0===a?void 0:a.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,n=this.dividers.length;t<n;t++){const n=this.formItems.findIndex((e=>e===this.dividers[t]));let r=this.formItems.findIndex((e=>e===this.dividers[t+1]));r=r>-1?r:void 0,e.push(this.formItems.slice(n,r).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var n,r;if("DIVIDER"===e)return!0;const i=this.getBlockDerivedItems();for(let e=0,a=i.length;e<a;e++){const a=i[e],l=this.dividers.find((e=>e.fieldName===a[0].fieldName)),o=null!==(r=null===(n=null==l?void 0:l.collapse)||void 0===n?void 0:n.showLimit)&&void 0!==r?r:a.length-1;for(let e=1;e<a.length;e++){if(a[e].fieldName===t&&e>o)return this.state.expand[a[0].fieldName]}}return!0}formatFormValue(e){var t,n;for(const r in e){const i=e[r];if(yl(i)&&(e[r]=""),Array.isArray(i)&&i.forEach(((t,n)=>{yl(t)&&(e[r][n]="")})),r.includes("|")&&Array.isArray(i)){const[a,l]=r.split("|");e[a]=null!==(t=i[0])&&void 0!==t?t:"",e[l]=null!==(n=i[1])&&void 0!==n?n:""}}if(this.isFilterType)for(const t in e)_n(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Tn(this,void 0,void 0,(function*(){const{authConfig:r}=this.props;if(!r)return;let i=Hn(r,["fetch"]);if(r.fetch){const{api:t,params:n,dataKey:a}=r.fetch;try{const r=yield t(n);200===r.code&&(i=null!==(e=a?me(r.data,a):r.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(i.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,n=i.fieldList.find((e=>e.dataIndex===t));if(n){const r=this.originItems.find((e=>e.fieldName===t)),{visible:i=1,disabled:a,secretName:l}=n;i||(e.noAuth=!0,r.noAuth=!0),a&&(e.disabled=!0,r.disabled=!0),l&&(e.options?e.options.secretType=l:e.options={secretType:l},r.options=Object.assign({},r.options,{secretType:l})),this.setFieldAuth(t,{visible:i,disabled:a,secretName:l})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return t.createElement(Yl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t.createElement(Zl,{option:e})}INPUT_NUMBER(e){return t.createElement(Jl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t.createElement(to,{option:e})}SEARCH_HELPER(e){return t.createElement(ao,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t.createElement(js,{option:e})}TREE_TABLE_HELPER(e){return t.createElement(zs,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t.createElement(Bs,{option:e})}RANGE_SEARCH_HELPER(e){return t.createElement(Ys,{option:e})}CHECKBOX(e){return t.createElement(Bl,{option:e})}MULTIPLE_CHECKBOX(e){return t.createElement(Zs,{option:e})}RATE(e){return t.createElement(Js,{option:e})}RADIO(e){return t.createElement(tc,{option:e})}SWITCH(e){return t.createElement(rc,{option:e})}TEXT_AREA(e){return t.createElement(ac,{option:e})}DATE(e){return t.createElement(oc,{option:e})}RANGE_DATE(e){return t.createElement(dc,{option:e})}TIME(e){return t.createElement(pc,{option:e})}RANGE_TIME(e){return t.createElement(mc,{option:e})}SELECT(e){return t.createElement(zl,{option:e})}MULTIPLE_SELECT(e){return t.createElement(zl,{option:e,multiple:!0})}IMMEDIATE(e){return t.createElement(gc,{option:e})}DIVIDER(e){return t.createElement(vc,{option:e})}TREE_SELECT(e){return t.createElement(xc,{option:e})}MULTIPLE_TREE_SELECT(e){return t.createElement(xc,{option:e,multiple:!0})}CASCADER(e){return t.createElement(Sc,{option:e})}MULTIPLE_CASCADER(e){return t.createElement(Sc,{option:e,multiple:!0})}CITY_SELECT(e){return t.createElement(Lc,{option:e})}REGION_SELECT(e){return t.createElement(_c,{option:e})}UPLOAD_FILE(e){return t.createElement(Fc,{option:e})}UPLOAD_IMG(e){return t.createElement($c,{option:e})}TINYMCE(e){return t.createElement(qc,{option:e})}renderFormLabel(e){if(Tl(e)||!se(e))return e;const{type:n,fieldName:r,label:i,options:a={},onChange:l=On}=e,{itemList:o=[]}=a;return"SELECT"===n?t.createElement(H.Item,{name:r,noStyle:!0},t.createElement(Kl,{option:e,items:o,loading:!1,onValuesChange:(e,t)=>l(e,t)})):"CHECKBOX"===n?t.createElement(t.Fragment,null,t.createElement("span",{style:{paddingRight:5}},i),t.createElement(H.Item,{name:r,noStyle:!0},t.createElement(Wl,{option:e,onValuesChange:e=>l(e)}))):null}renderFormItemExtra(e){const{fieldName:n,isTooltip:r,style:i={},render:a}=e,{extra:l}=this.state;if(r)return t.createElement(Y,{className:"extra-tooltip",title:l[n]},t.createElement(Qe,{style:{marginLeft:4}}));const o=this.formItems.find((e=>e.fieldName===n));return t.createElement("div",{className:"extra-text",title:a?"":l[n],style:i},t.createElement("span",{className:"extra-overflow-cut"},a?a(o,this):l[n]))}renderFormItemButton(e,t){const n=this.formItems.find((t=>t.fieldName===e)),r="function"==typeof t?t(n):t;return this.isOnlyShow?null:r}renderFormItem(e){const{label:n,fieldName:r,invisible:i,tooltip:a,className:l,labelWidth:o=this.props.labelWidth,validateTrigger:s,rules:c=[],style:d={},render:u}=e;return _n(this.state.formData)?null:t.createElement(H.Item,{label:this.renderFormLabel(n),name:r,rules:c,tooltip:a,hidden:i,className:Fe(l),style:Object.assign({width:"100%"},d),labelCol:{flex:this.verticalLayout?"initial":Dn(o)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(n)}},null==u?void 0:u(e,this))}createFormItem(e){return de(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(en("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:n,defaultRows:r,isFieldsDefine:i}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:n=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<n;e++)a.push({})}));const l=24/e,o=[],s=a.reduce(((e,t)=>{const{selfCol:n=1}=t,r=e+n;return o.push(r),r}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=a.map(((n,r)=>{let{selfCol:i=1}=n;const{type:a,fieldName:s}=n;i=i>=24||"DIVIDER"===a||"TINYMCE"===a?e:i;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(n);return u&&d.push(o[r]),t.createElement(D,{key:null!=s?s:r,className:s,span:i*l,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},a?this.createFormItem(Fn(n)):null)}));return i&&"default"===n&&u.push(t.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(e=0){const{flexCols:n,collapse:r}=this.state,{searchButtonCols:i,isSearchBtn:a,isFieldsDefine:l=!0}=this.props;if(!this.isFilterType)return null;const o=24/n,s=i||1,c=n-e%n-s;return a?t.createElement(D,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t.createElement(N,{style:{marginBottom:12}},t.createElement($n,{type:"primary",size:this.$size,icon:t.createElement(Xe,null),onClick:()=>this.SUBMIT_FORM()},Xt("qm.form.search")),t.createElement($n,{size:this.$size,icon:t.createElement(Je,null),onClick:()=>this.RESET_FORM()},Xt("qm.form.reset")),l?this.createFieldsDefine():null,this.showFilterCollapse&&t.createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t.createElement(De,null):t.createElement($e,null)," ",Xt(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:n,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const i=24/e;return r&&"default"===n?t.createElement(F,{gutter:0},t.createElement(D,{key:"-",span:i},t.createElement(H.Item,null,t.createElement(N,{style:{marginBottom:12}},t.createElement($n,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Xt("qm.form.save")),t.createElement($n,{size:this.$size,onClick:()=>this.RESET_FORM()},Xt("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:n,fieldsChange:r}=this.props;return t.createElement(Ul,{uniqueKey:e,items:n,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise(((e,t)=>Tn(this,void 0,void 0,(function*(){const[n,r]=yield this.VALIDATE_FIELDS(),i=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[Xt("qm.form.searchHelperTips")],warnings:[]})));n||i.length?t((n||[]).concat(i)):e(r)}))))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}GET_FORM_DATA(){return Tn(this,void 0,void 0,(function*(){try{const e=yield this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}))}VALIDATE_FIELDS(e){return Tn(this,void 0,void 0,(function*(){try{return[null,yield this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}))}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}SUBMIT_FORM(){return Tn(this,void 0,void 0,(function*(){try{yield this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}))}RESET_FORM(){var e,t;const n=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),r=this.flattenItems.map((e=>e.fieldName)).filter((e=>!n.includes(e)));r.length&&this.formRef.current.resetFields(r),this.setState((e=>{const t=Object.keys(e.other),n=Object.keys(this._initialOthers),r=t.filter((e=>!n.includes(e))),i={};return r.forEach((e=>i[e]=void 0)),{other:Object.assign({},this._initialOthers,i)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(t=(e=this.props).onReset)||void 0===t||t.call(e)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){en("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:r,fieldsChange:i}=this.props,a=r.find((t=>t.fieldName===e));if(!a)return en("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!se(t))return en("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(a.noAuth)return en("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||ve(a,n,t[n]));n&&(i?i([...r]):en("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:n,layout:r,disabled:i,labelWidth:a,labelAlign:l,labelWrap:o,customClass:s}=this.props,c=jn("form"),d={required:"${label}"+Xt("qm.form.requiredTips")},u={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return t.createElement("div",{ref:this.wrapperRef,className:Fe(u,e),style:n},t.createElement(H,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:l,labelWrap:o,colon:!1,disabled:i,labelCol:{flex:this.verticalLayout?"initial":Dn(a)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t.createElement(ua.Provider,{value:this.provide},t.createElement(F,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}jc.contextType=Bt,jc.propTypes=ml,jc.defaultProps=fl;const Vc={onActivate:m.func,onAddUndo:m.func,onBeforeAddUndo:m.func,onBeforeExecCommand:m.func,onBeforeGetContent:m.func,onBeforeRenderUI:m.func,onBeforeSetContent:m.func,onBeforePaste:m.func,onBlur:m.func,onChange:m.func,onClearUndos:m.func,onClick:m.func,onContextMenu:m.func,onCommentChange:m.func,onCopy:m.func,onCut:m.func,onDblclick:m.func,onDeactivate:m.func,onDirty:m.func,onDrag:m.func,onDragDrop:m.func,onDragEnd:m.func,onDragGesture:m.func,onDragOver:m.func,onDrop:m.func,onExecCommand:m.func,onFocus:m.func,onFocusIn:m.func,onFocusOut:m.func,onGetContent:m.func,onHide:m.func,onInit:m.func,onKeyDown:m.func,onKeyPress:m.func,onKeyUp:m.func,onLoadContent:m.func,onMouseDown:m.func,onMouseEnter:m.func,onMouseLeave:m.func,onMouseMove:m.func,onMouseOut:m.func,onMouseOver:m.func,onMouseUp:m.func,onNodeChange:m.func,onObjectResizeStart:m.func,onObjectResized:m.func,onObjectSelected:m.func,onPaste:m.func,onPostProcess:m.func,onPostRender:m.func,onPreProcess:m.func,onProgressState:m.func,onRedo:m.func,onRemove:m.func,onReset:m.func,onSaveContent:m.func,onSelectionChange:m.func,onSetAttrib:m.func,onSetContent:m.func,onShow:m.func,onSubmit:m.func,onUndo:m.func,onVisualAid:m.func,onSkinLoadError:m.func,onThemeLoadError:m.func,onModelLoadError:m.func,onPluginLoadError:m.func,onIconsLoadError:m.func,onLanguageLoadError:m.func},Kc=Object.assign({apiKey:m.string,id:m.string,inline:m.bool,init:m.object,initialValue:m.string,onEditorChange:m.func,value:m.string,tagName:m.string,cloudChannel:m.string,plugins:m.oneOfType([m.string,m.array]),toolbar:m.oneOfType([m.string,m.array]),disabled:m.bool,textareaName:m.string,tinymceScriptSrc:m.string,rollback:m.oneOfType([m.number,m.oneOf([!1])]),scriptLoading:m.shape({async:m.bool,defer:m.bool,delay:m.number})},Vc),zc=e=>"function"==typeof e,Wc=e=>e in Vc,Bc=e=>e.substr(2),Uc=(e,t,n,r,i)=>((e,t,n,r,i,a,l)=>{const o=Object.keys(i).filter(Wc),s=Object.keys(a).filter(Wc),c=o.filter((e=>void 0===a[e])),d=s.filter((e=>void 0===i[e]));c.forEach((e=>{const t=Bc(e),r=l[t];n(t,r),delete l[t]})),d.forEach((n=>{const i=r(e,n),a=Bc(n);l[a]=i,t(a,i)}))})(i,e.on.bind(e),e.off.bind(e),((t,n)=>r=>{var i;return null===(i=t(n))||void 0===i?void 0:i(r,e)}),t,n,r);let Gc=0;const Yc=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return Gc++,e+"_"+n+Gc+String(t)},Xc=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Zc=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),Qc=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Jc=()=>({listeners:[],scriptId:Yc("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),ed=(()=>{let e=Jc();return{load:(t,n,r,i,a,l)=>{const o=()=>((e,t,n,r,i,a)=>{const l=t.createElement("script");l.referrerPolicy="origin",l.type="application/javascript",l.id=e,l.src=n,l.async=r,l.defer=i;const o=()=>{l.removeEventListener("load",o),a()};l.addEventListener("load",o),t.head&&t.head.appendChild(l)})(e.scriptId,t,n,r,i,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?l():(e.listeners.push(l),e.scriptLoading||(e.scriptLoading=!0,a>0?setTimeout(o,a):o()))},reinitialize:()=>{e=Jc()}}})(),td=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class nd extends e.Component{constructor(t){var n,r,i;super(t),this.rollbackTimer=void 0,this.valueCursor=void 0,this.rollbackChange=()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0},this.handleBeforeInput=e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}},this.handleBeforeInputSpecial=e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)},this.handleEditorChange=e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}},this.handleEditorChangeSpecial=e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)},this.initialise=(e=0)=>{var t,n,r;const i=this.elementRef.current;if(!i)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,n=e.parentNode;for(;null!=n;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected})(i)){if(0===e)setTimeout((()=>this.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>this.initialise(e+1)),100)}return}const a=td(this.view);if(!a)throw new Error("tinymce should have been loaded into global scope");const l=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:i,readonly:this.props.disabled,inline:this.inline,plugins:(o=null===(t=this.props.init)||void 0===t?void 0:t.plugins,s=this.props.plugins,Zc(o).concat(Zc(s))),toolbar:null!==(n=this.props.toolbar)&&void 0!==n?n:null===(r=this.props.init)||void 0===r?void 0:r.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!Xc(i)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&zc(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,n;const r=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==r&&(this.currentContent=r,e.setContent(r),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const i=null!==(n=this.props.disabled)&&void 0!==n&&n;Qc(this.editor,i?"readonly":"design"),this.props.init&&zc(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(i.style.visibility=""),Xc(i)&&(i.value=this.getInitialValue()),a.init(l)},this.id=this.props.id||Yc("tiny-react"),this.elementRef=e.createRef(),this.inline=null!==(i=null!==(n=this.props.inline)&&void 0!==n?n:null===(r=this.props.init)||void 0===r?void 0:r.inline)&&void 0!==i&&i,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,n;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const n=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const r of[t,n])if(r)try{e.selection.moveToBookmark(r),this.valueCursor=r;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(n=this.props.disabled)&&void 0!==n&&n;Qc(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,r,i,a;null!==td(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&ed.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),null!==(t=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)&&void 0!==t&&t,null!==(r=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.defer)&&void 0!==r&&r,null!==(a=null===(i=this.props.scriptLoading)||void 0===i?void 0:i.delay)&&void 0!==a?a:0,this.initialise)}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,n;return(null===(n=null===(t=null===(e=td(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:t="div"}=this.props;return e.createElement(t,{ref:this.elementRef,id:this.id})}renderIframe(){return e.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){Uc(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,n=t(e),r=t(this.props);!n&&r?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):n&&!r&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}var rd;nd.propTypes=Kc,nd.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(rd||(rd={}));class id extends r{constructor(){super(...arguments),this.defaultOption={height:400,plugins:"preview importcss searchreplace autolink save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",menubar:"file edit view insert format tools table help",toolbar:"undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl"}}render(){var e;const{size:n,className:r,style:i,tinymce:a={},upload:l={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:d,onResizeEditor:u,onChange:p}=this.props,h=this.context.global,m=this.context.locale,f=n||this.context.size||"",g=jn("tinymce"),v={[g]:!0,[`${g}--lg`]:"large"===f,[`${g}--sm`]:"small"===f},y={init:Object.assign(Object.assign({height:a.height||this.defaultOption.height,plugins:a.plugins||this.defaultOption.plugins,toolbar:a.toolbar||this.defaultOption.toolbar,menubar:a.menubar||this.defaultOption.menubar,font_family_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",font_size_formats:"10px 12px 14px 16px 18px 20px 24px 36px 48px 56px 72px",language:rd[m],skin:"tinymce-5"},Hn(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>Tn(this,void 0,void 0,(function*(){const{action:n,headers:r,dataKey:i}=l,a=`data:image/jpeg;base64,${e.base64()}`,s=new FormData;s.append("file",e.blob(),e.filename());const c=e.blob().size;if(n&&c/1024/1024>o)try{const e=yield fetch(n,{method:"POST",body:s,headers:r});if(!e.ok)throw new Error(Xt("qm.upload.uploadError"));const a=yield e.json();if(200===a.code){const e=i?me(a.data,i):a.data;t(e)}}catch(e){L.error(Xt("qm.uploadCropper.uploadError"))}else t(a)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:n,offsetHeight:r}=e.editorContainer;null==u||u({width:n,height:r},t)}))}}),value:d,disabled:c,tinymceScriptSrc:s||(null===(e=null==h?void 0:h.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return t.createElement("div",{className:Fe(v,r),style:i},t.createElement(nd,y))}}id.contextType=Bt,id.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Tinymce","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class ad extends r{constructor(){super(...arguments),this.imgRef=t.createRef()}componentDidMount(){const e=wn(this.props,["className","style","src","alt","imgStyle"]),t={};for(const n in e)void 0!==this.props[n]&&(t[n]=this.props[n]);this.cropper=new Ht(this.imgRef.current,t)}componentWillUnmount(){this.destroy(),this.cropper=null}reset(){return this.cropper.reset()}clear(){return this.cropper.clear()}initCrop(){return this.cropper.crop()}replace(e,t=!1){return this.cropper.replace(e,t)}enable(){return this.cropper.enable()}disable(){return this.cropper.disable()}destroy(){return this.cropper.destroy()}move(e,t){return this.cropper.move(e,t)}moveTo(e,t=e){return this.cropper.moveTo(e,t)}relativeZoom(e,t){return this.cropper.zoom(e,t)}zoomTo(e,t){return this.cropper.zoomTo(e,t)}rotate(e){return this.cropper.rotate(e)}rotateTo(e){return this.cropper.rotateTo(e)}scaleX(e){return this.cropper.scaleX(e)}scaleY(e){return this.cropper.scaleY(e)}scale(e,t=e){return this.cropper.scale(e,t)}getData(e=!1){return this.cropper.getData(e)}setData(e){return this.cropper.setData(e)}getContainerData(){return this.cropper.getContainerData()}getImageData(){return this.cropper.getImageData()}getCanvasData(){return this.cropper.getCanvasData()}setCanvasData(e){return this.cropper.setCanvasData(e)}getCropBoxData(){return this.cropper.getCropBoxData()}setCropBoxData(e){return this.cropper.setCropBoxData(e)}getCroppedCanvas(e={}){return this.cropper.getCroppedCanvas(e)}setAspectRatio(e){return this.cropper.setAspectRatio(e)}setDragMode(e){return this.cropper.setDragMode(e)}render(){const{className:e,style:n,src:r,alt:i,imgStyle:a}=this.props,l={[jn("cropper")]:!0};return t.createElement("div",{className:Fe(l,e),style:n},t.createElement("img",{ref:this.imgRef,src:r,alt:i,style:Object.assign({maxWidth:"100%"},a)}))}}ad.defaultProps={src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0};class ld extends r{constructor(){super(...arguments),this.cropperRef=t.createRef(),this.state={src:""},this.confirmHandle=()=>Tn(this,void 0,void 0,(function*(){const{quality:e}=this.props,{type:t,name:n,uid:r}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((e=>Tn(this,void 0,void 0,(function*(){let i=new File([e],n,{type:t});Object.assign(i,{uid:r});const{fileTypes:a=[],fileSize:l}=this.props;if(!(!a.length||a.includes(i.name.slice(i.name.lastIndexOf(".")+1).toLowerCase())))return L.warning(Xt("qm.upload.tooltip",{type:a.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(i);const o=this.beforeUploadRef(i,[i]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(i);if(!1===o)return this.rejectRef("not upload");if(o&&"function"==typeof o.then)try{const e=yield o,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(i=e),this.resolveRef(i)}catch(e){this.rejectRef(e)}}else en("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),t,e),yield Ln(100),this.onClose()})),this.onOk=()=>{this.confirmHandle()},this.onClose=()=>{this.setSrc("")}}get previewSize(){const{fixedSize:e}=this.props;return{width:"380px",height:e?`calc(380px * ${e[1]/e[0]})`:"auto"}}setSrc(e){this.setState({src:e})}renderUpload(){const{children:e,beforeCrop:n}=this.props,r=Array.isArray(e)?e[0]:e;if(!r)return null;const i=r.props,{beforeUpload:a}=i,l=wn(i,["beforeUpload"]);return this.beforeUploadRef=a,t.createElement(r.type,Object.assign(Object.assign({},l),{beforeUpload:(e,t)=>new Promise(((r,i)=>Tn(this,void 0,void 0,(function*(){const i=()=>r(k.LIST_IGNORE);if(n&&!(yield n(e,t)))return void i();this.fileRef=e,this.resolveRef=r,this.rejectRef=i;const a=new FileReader;a.onload=()=>{this.setSrc(a.result),a.onload=null},a.readAsDataURL(e)}))))}))}scaleHandle(e){this.cropperRef.current.relativeZoom(e,void 0)}rotateHandle(e){this.cropperRef.current.rotate(e)}renderCropper(){const{fixedSize:e}=this.props;return t.createElement("div",{className:"cropper-preview"},t.createElement("div",{className:"cropper-area"},t.createElement("div",{className:"img-cropper"},t.createElement(ad,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),t.createElement("div",{className:"actions"},t.createElement(N,{size:"small"},t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(et,null),onClick:()=>this.scaleHandle(.2)},Xt("qm.uploadCropper.zoomIn")),t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(tt,null),onClick:()=>this.scaleHandle(-.2)},Xt("qm.uploadCropper.zoomOut")),t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(nt,null),onClick:()=>this.rotateHandle(90)},Xt("qm.uploadCropper.rotatePlus")),t.createElement(C,{type:"primary",size:"middle",icon:t.createElement(rt,null),onClick:()=>this.rotateHandle(-90)},Xt("qm.uploadCropper.rotateSubtract"))))),t.createElement("div",{className:"preview-area"},t.createElement("div",{className:"preview",style:this.previewSize})))}render(){const{className:e}=this.props,{src:n}=this.state,r=jn("cropper-preview");return t.createElement(t.Fragment,null,this.renderUpload(),n&&t.createElement(_,{open:!0,wrapClassName:Fe(r,e),title:Xt("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}ld.contextType=Bt;class od extends r{constructor(){super(...arguments),this.state={previewVisible:!1,currentIndex:0},this.uploadRef=t.createRef(),this.isFocused=!1,this.createSortable=()=>{this.props.draggable&&(this.sortableInstance=kt.create(this.getFileListNode(),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:e=>{const{oldIndex:t,newIndex:n}=e,{fileList:r=[],onSortChange:i,onChange:a}=this.props;if(t!==n){const e=[...r],[l]=e.splice(t,1);e.splice(n,0,l),null==i||i(e),null==a||a({fileList:e})}}}))},this.getFileListNode=()=>Ri(this.uploadRef.current,jn("upload-img")).querySelector(".ant-upload-list"),this.beforeUpload=(e,t)=>new Promise(((n,r)=>Tn(this,void 0,void 0,(function*(){const{fileTypes:i=[],fileSize:a,beforeUpload:l}=this.props,o=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!a||e.size/1024/1024<a,c=o&&s;if(o||L.warning(Xt("qm.upload.tooltip",{type:i.join(",")})),s||L.warning(Xt("qm.upload.sizeLimit",{size:a})),!c)return k.LIST_IGNORE;if(l){const i=l(e,t);if(!0===i)return n(e);if(!1===i)return r("not upload");if(i&&"function"==typeof i.then)try{const e=yield i;n(e)}catch(e){r(e)}}else n(e)})))),this.handlePreview=e=>{var t;this.setState({currentIndex:(null===(t=this.props.fileList)||void 0===t?void 0:t.findIndex((t=>t.url===e.url)))||0,previewVisible:!0})},this.handlePaste=e=>Tn(this,void 0,void 0,(function*(){const{fileList:t=[],action:n,data:r,headers:i,onChange:a}=this.props;if(this.isFocused&&this.showUploadButton&&n)for(const l of e.clipboardData.items)if("file"===l.kind&&l.type.startsWith("image/")){const e=l.getAsFile(),o=Date.now(),s=new File([e],`screenshot-${o}.png`,{type:e.type});Object.assign(s,{uid:`rc-upload-${o}`});try{yield this.beforeUpload(s,[...t,s]);const e=new FormData;if(e.append("file",s),r)for(const t in r)e.append(t,r[t]);const l="string"==typeof n?n:yield n(s),o=yield fetch(l,{method:"POST",body:e,headers:i});if(!o.ok)throw new Error(Xt("qm.upload.uploadError"));const c=yield o.json();null==a||a({file:s,fileList:[...t,{uid:s.uid,lastModified:s.lastModified,lastModifiedDate:s.lastModifiedDate,name:s.name,type:s.type,size:s.size,response:c,status:"done",percent:100,originFileObj:s}]})}catch(e){}}}))}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}get showUploadButton(){var e,t;const n=null!==(t=null===(e=this.props.fileList)||void 0===e?void 0:e.length)&&void 0!==t?t:0;return!this.props.maxCount||n<this.props.maxCount}componentDidMount(){this.createSortable(),document.addEventListener("paste",this.handlePaste)}componentDidUpdate(e){const{fileList:t}=e,{fileList:n}=this.props;t===n||this.showUploadButton||(this.isFocused=!1)}componentWillUnmount(){var e;null===(e=this.sortableInstance)||void 0===e||e.destroy(),document.removeEventListener("paste",this.handlePaste)}render(){const{previewVisible:e,currentIndex:n}=this.state,{fileList:r=[],fixedSize:i,quality:a,fileTypes:l,fileSize:o,draggable:s,disabled:c,readOnly:d,className:u,popupClassName:p,openCropper:h,beforeCrop:m}=this.props,f=jn("upload-img"),g={[f]:!0,[`${f}--lg`]:"large"===this.$size,[`${f}--sm`]:"small"===this.$size},v=c||d,y=t.createElement(k,vn({className:Fe(g,u)},Hn(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,disabled:v,onPreview:this.handlePreview,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,n,r,i)=>t.createElement("div",{className:Fe("upload-item",{handle:s})},e,!v&&t.createElement(Ze,{title:Xt("qm.upload.remove"),className:"icon",onClick:()=>i.remove()}))}),t.createElement("span",{ref:this.uploadRef},!this.showUploadButton||d&&r.length?null:t.createElement(t.Fragment,null,t.createElement("p",{className:"ant-upload-drag-icon"},t.createElement(it,null)),t.createElement("p",{className:"ant-upload-text"},Xt("qm.uploadCropper.dragableText")),t.createElement("button",{className:Fe("ant-upload-button",{disabled:v}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{this.isFocused=!0},onBlur:()=>{this.isFocused=!1}},Xt("qm.uploadCropper.pasteText")))));return t.createElement(t.Fragment,null,h?t.createElement(ld,{className:p,fixedSize:i,quality:a,fileTypes:l,fileSize:o,beforeCrop:m},y):y,t.createElement("div",{style:{display:"none"}},t.createElement(X.PreviewGroup,{preview:{visible:e,current:n,rootClassName:p,onVisibleChange:e=>{this.setState({previewVisible:e})}}},r.map(((e,n)=>{var r;return t.createElement(X,{key:null!==(r=e.uid)&&void 0!==r?r:n,src:e.url,alt:""})})))))}}od.contextType=Bt,od.defaultProps={name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0};const sd=(e,t,n)=>{let r;for(let i=0;i<e.length;i++){const a=e[i];if(a.children)if(a.children.some((e=>e[n]===t)))r=a[n];else{const e=sd(a.children,t,n);e&&(r=e)}}return r},cd=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&cd(e.children,t),t(e)||e.children&&e.children.length))),dd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...dd(e.children,t)),t(e)&&n.push(e)})),n},ud=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=ud(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},pd=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:pd(e.children,t,n,r)}):e)),hd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...hd(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},md=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][n]===t)return[t];if(Array.isArray(e[r].children)){const i=md(e[r].children,t,n);if(i)return[e[r][n],i].flat()}}},fd=(e,t)=>{var n;const r=(null===(n=e.children)||void 0===n?void 0:n.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...fd(e,t)))),r},gd=t.forwardRef(((e,n)=>{const{className:r,style:i,filterable:a=!0,multiple:l,draggable:o,dataSource:s,fetch:c,asyncLoad:d,checkStrictly:u,checkStrategy:p="SHOW_CHILD",placeholder:h=Xt("qm.form.inputPlaceholder"),fieldsDefine:m,value:f,height:g,defaultSelectedKeys:v=[],defaultExpandAll:y=!0,showSearchBar:b=!0,showCollapse:x=!0,onSelectChange:E,onCheckChange:S,onDragStart:w,onDragChange:C,onExpand:T}=e,{size:N}=t.useContext(Bt),I=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:N)&&void 0!==n?n:""}),[e.size,N]),R=(null==m?void 0:m.valueKey)||"value",k=(null==m?void 0:m.textKey)||"text";null==m||m.children;const L=t.useRef(null),A=Vi(L),[P,_]=t.useState(g),[H,F]=t.useState(!1),D=Wi((()=>{_(L.current.offsetHeight-X.current.offsetHeight-10)}),5);zi((()=>{g||D()}),[A.height]);const[$,M]=t.useState([]),[q,j]=t.useState({}),[V,K]=t.useState([]),[z,W]=t.useState([]),[B,U]=t.useState(""),[G,Y]=t.useState(y),X=t.useRef(null),Q=t.useRef([]),J=t.useRef([]);t.useEffect((()=>{Array.isArray(s)&&(ee(s),K(te(s)),j({}))}),[s]),t.useEffect((()=>{ie()}),[]),bi((()=>{ie()}),[null==c?void 0:c.params]),bi((()=>{W(re())}),[q]),t.useImperativeHandle(n,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],r=ud($,(t=>e===t[R]));r&&(Array.isArray(r.children)?r.children.push(...n):r.children=[...n],ee([...$]))},REMOVE_RECORD:e=>{var t;const n=sd($,e,R);if(void 0===n&&$.find((t=>t[R]===e)))ee($.filter((t=>t[R]!==e)));else{const r=ud($,(e=>n===e[R]));if(!r)return;const i=null===(t=r.children)||void 0===t?void 0:t.findIndex((t=>e===t[R]));i>=0&&(r.children.splice(i,1),ee([...$]))}},UPDATE_RECORD:(e,t)=>{const n=ud($,(t=>e===t[R]));n&&(xe(n,t),ee([...$]))}})));const ee=e=>{M(e),Q.current=e,J.current=hd(e,R)},te=e=>{if(l)return v;const t=dd(e,(e=>v.includes(e[k])));return 1===t.length?[t[0][R]]:[]},ne=e=>{var t;return(null===(t=md($,e,R))||void 0===t?void 0:t.slice(0,-1))||[]},re=()=>{if(y)return J.current;const e=[];return V.forEach((t=>{if(l){if("SHOW_ALL"===p&&!J.current.includes(t)&&e.push(...ne(t)),"SHOW_CHILD"===p&&e.push(...ne(t)),"SHOW_PARENT"===p){const n=wl($,t);if(n){const r=ne(t),i=fd(n,R);e.push(...r,...[t,...i].filter((e=>J.current.includes(e))))}}}else e.push(...ne(t))})),[...new Set(e)]},ie=()=>Tn(void 0,void 0,void 0,(function*(){var e;if(!c)return;const{api:t,params:n,dataKey:r,afterFetch:i,callback:a}=c;try{F(!0);const l=yield t(n);if(200===l.code){let t=Array.isArray(l.data)?l.data:null!==(e=me(l.data,r))&&void 0!==e?e:[];t="function"==typeof i?yield i(t):t,ee(t),K(te(t)),j({}),null==a||a(t)}}catch(e){}F(!1)})),ae=e=>`${e}|${Ml.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,le=jn("search-tree"),oe={[le]:!0,[`${le}--lg`]:"large"===I,[`${le}--sm`]:"small"===I};return t.createElement("div",{ref:L,className:Fe(oe,r),style:i},t.createElement("div",{ref:X,className:"topper"},b&&t.createElement(O.Search,{value:B,size:I,placeholder:h,allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=cd(Q.current,(t=>{if(!e)return!0;const n=t[k]||"";return-1!==ae(n).indexOf(e)}));U(e),M(t),y||e?W(hd(t,R)):j({})})(e.target.value)}),x&&t.createElement("a",{className:"trigger",onClick:()=>{Y(!G),W(G?[]:J.current)}},G?t.createElement(De,null):t.createElement($e,null)," ",Xt(G?"qm.form.collect":"qm.form.spread"))),t.createElement(Di,{spinning:H},t.createElement(Z,{fieldNames:{title:k,key:R,children:"children"},multiple:l,draggable:o,blockNode:o,checkable:l,selectable:!l,height:P,disabled:e.disabled,checkStrictly:u,selectedKeys:null!=f?f:V,checkedKeys:null!=f?f:V,expandedKeys:z,treeData:$,loadData:d?({key:e,children:t})=>Tn(void 0,void 0,void 0,(function*(){var n;if(!c||t)return;const{api:r,params:i,dataKey:a,formatter:l=(e=>e),afterFetch:o}=c;try{const t=yield r(l(Object.assign(Object.assign({},i),{[R]:e})));if(200===t.code){let r=Array.isArray(t.data)?t.data:null!==(n=me(t.data,a))&&void 0!==n?n:[];r="function"==typeof o?yield o(r):r;const i=pd(Q.current,e,R,r);ee(i)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!B)return!1;const t=e[k]||"";return-1!==ae(t).indexOf(B)},onDragStart:w,onDragEnter:e=>{W(e.expandedKeys)},onDrop:e=>{const t=e.node.key,n=e.dragNode.key,r=e.node.pos.split("-"),i=e.dropPosition-Number(r[r.length-1]),a=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][R]===t)return n(e[r],r,e);e[r].children&&a(e[r].children,t,n)}},l=[...$];let o;if(a(l,n,((e,t,n)=>{n.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===i)a(l,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,n=[];a(l,t,((t,r,i)=>{n=i,e=r})),-1===i?n.splice(e,0,o):n.splice(e+1,0,o)}else a(l,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));ee(l)},onDragEnd:e=>{null==C||C(e,$)},onExpand:(e,t)=>{_n(e)&&Y(!1),J.current.every((t=>e.includes(t)))&&Y(!0),W(e),null==T||T(e,t)},onSelect:e=>{K(e);const t=dd(Q.current,(t=>e.includes(me(t,R))));null==E||E(l?t:t[0])},onCheck:e=>{u&&(e=e.checked),K(e),"SHOW_CHILD"===p&&(e=e.filter((e=>!J.current.includes(e)))),"SHOW_PARENT"===p&&(e=e.filter(((e,t,n)=>!n.includes(sd($,e,R)))));const t=dd(Q.current,(t=>e.includes(me(t,R))));null==S||S(l?t:t[0])}})))}));gd.displayName="QmSearchTree";const vd=n(void 0),yd={dataIndex:f.string.isRequired,title:f.string.isRequired,description:f.string,colSpan:f.number,width:f.number,minWidth:f.number,fixed:f.oneOf(["left","right"]),align:f.oneOf(["left","center","right"]),theadAlign:f.oneOf(["left","center","right"]),printFixed:f.bool,hidden:f.bool,noAuth:f.bool,noFixed:f.bool,ellipsis:f.bool,className:f.string,theadClassName:f.string,children:f.array,sorter:f.oneOfType([f.bool,f.func]),filter:f.shape({type:f.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:f.arrayOf(f.shape({text:f.string,value:f.oneOfType([f.string,f.number])})),style:f.object}),precision:f.number,displayPrecision:f.number,formatType:f.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:f.bool,canCopy:f.bool,editRender:f.func,dictItems:f.arrayOf(f.shape({text:f.string,value:f.oneOfType([f.string,f.number])})),summation:f.shape({sumBySelection:f.bool,displayWhenNotSelect:f.bool,dataKey:f.string,unit:f.string,render:f.func}),groupSummary:f.shape({dataKey:f.string,unit:f.string,render:f.func}),shouldCellUpdate:f.func,headRender:f.func,render:f.func};f.arrayOf(f.shape(yd)).isRequired,f.func,f.array,f.oneOfType([f.string,f.func]).isRequired,f.number,f.bool,f.bool,f.shape({api:f.func.isRequired,params:f.object.isRequired,formatter:f.func,beforeFetch:f.func,afterFetch:f.func,stopToFirst:f.bool,dataKey:f.string,callback:f.func}),f.bool,f.bool,f.string,f.string,f.bool,f.bool,f.bool,f.bool,f.oneOfType([f.object,f.func]),f.oneOfType([f.object,f.func]),f.array,f.func,f.bool,f.object,f.object,f.shape({type:f.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:f.array,selectedRowKeys:f.array,hideSelectAll:f.bool,checkStrictly:f.bool,filterable:f.bool,selectByClickRow:f.bool,selectFirstRowOnChange:f.bool,clearableAfterFetched:f.bool,selectAllOnCurrentPage:f.bool,fetchSelectedRows:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),fetchAllRowKeys:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),disabled:f.func,onChange:f.func,onSelect:f.func,onSelectAll:f.func}),f.shape({currentRowKey:f.oneOfType([f.number,f.string]),disabled:f.func,onChange:f.func}),f.shape({virtual:f.bool,doubleXScrollbar:f.bool}),f.shape({virtual:f.bool,expandIconColumn:f.string}),f.shape({defaultExpandAllRows:f.bool,defaultExpandedRowKeys:f.array,expandedRowKeys:f.array,hideExpandAll:f.bool,rowExpandable:f.func,expandedRowClassName:f.string,expandedRowRender:f.func,onExpand:f.func,onChange:f.func}),f.shape({cellMerge:f.bool,onCellMerge:f.func,onSelectChange:f.func}),f.shape({groupItems:f.arrayOf(f.shape({dataIndex:f.string.isRequired,titleIndex:f.string,color:f.string,backgroundColor:f.string})),fetch:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),onChange:f.func}),f.func,f.bool,f.bool,f.bool,f.bool,f.shape({current:f.number,pageSize:f.number,pageSizeOptions:f.array,showSizeChanger:f.bool,showQuickJumper:f.bool}),f.shape({fileName:f.string,fetch:f.shape({api:f.func.isRequired,params:f.object}),beforeExport:f.func,cellStyle:f.bool,hideIcon:f.bool}),f.shape({showLogo:f.bool}),f.shape({fetch:f.shape({api:f.func.isRequired,params:f.object,dataKey:f.string}),fieldList:f.arrayOf(f.object)}),f.shape({position:f.oneOf(["top","bottom"]),hideAlert:f.bool,hideClearButton:f.bool}),f.oneOf(["left","right"]),f.func,f.func,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.bool,f.func,f.func,f.func,f.func,f.func,f.func,f.func,f.func,f.func;const bd={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},xd=10,Ed="1",Sd="0",wd="YYYY-MM-DD",Cd="YYYY-MM-DD HH:mm:ss",Td="YYYYMMDDHHmmss",Nd={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var Id;function Rd(t){const n=e.useRef();n.current=t;return e.useCallback(((...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])}!function(e){e.left="flex-start",e.right="flex-end"}(Id||(Id={}));const Od=Object.assign({},e).useId;let kd=0;var Ld=Od?function(e){const t=Od();return e||t}:function(t){const[n]=e.useState(`qm_unique_${kd}`);return e.useEffect((()=>{kd+=1}),[]),t||n};let Ad=[];const Pd={getFocusInstance:function(){var e;return null!==(e=Ad[0])&&void 0!==e?e:null},getInstance:function(e){var t;return null!==(t=Ad.find((t=>t.id===e)))&&void 0!==t?t:null},focus:function(e){const t=this.getInstance(e);t&&0!==Ad.findIndex((e=>e===t))&&(this.deregister(e),Ad=[t,...Ad])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),Ad=[{id:e,vm:t},...Ad])},deregister:function(e){e&&(Ad=Ad.filter((t=>t.id!==e)))}};class _d{constructor(){this.state={required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]},this.addToRequired=e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)},this.removeFromRequired=e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)},this.addToValidate=e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)},this.removeFromValidate=e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)},this.addToEdited=e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)},this.removeFromEdited=e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)},this.addToInserted=e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)},this.removeFromInserted=e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)},this.addToUpdated=e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)},this.removeFromUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)},this.addToRemoved=e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)},this.removeFromRemoved=e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)},this.clearAllLog=()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]}}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}const Hd={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollX:50,virtualScrollY:150,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored"};function Fd(e){return void 0!==e}function Dd(t,n){const{defaultValue:r,value:i,onChange:a,postState:l}=n||{},[o,s]=e.useState((()=>Fd(i)?i:Fd(r)?"function"==typeof r?r():r:"function"==typeof t?t():t)),c=Fd(i)?i:o,d=l?l(c):c,u=Rd(a),[p,h]=e.useState([c]);zi((()=>{const e=p[0];o!==e&&u(o,e)}),[p]),zi((()=>{Fd(i)||s(i)}),[i]);return[d,Rd((e=>{s(e),h([c])}))]}let $d;const Md=()=>{var e;if(Nn)return 0;if(void 0!==$d)return $d;const t=document.createElement("div");t.className="qm-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),$d=n-i,$d},qd=e=>e.map((e=>{const t=Object.assign({},e);return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=qd(t.children)),t})),jd=(e,n)=>{const{fetch:r,columns:i,height:a,minHeight:l,maxHeight:o,border:s=!0,rowSelection:c,summation:d,expandable:u,treeConfig:p,webPagination:h,scrollPagination:m,showSuperSearch:f,showFastSearch:g,showGroupSummary:v,showTableImport:y,showClipboard:b,showSelectCollection:x,footRender:E}=e,{tableRef:S,getRowKey:w,tableFullData:C,tableData:T,selectionKeys:N,sorter:I,filters:R,superFilters:O,pagination:k,mergedTdCells:L}=n,{selectionRows:A,summaries:P}=S.current,{expandIconColumn:_=""}=p||{},H=e=>{const t=(e=>{const t=[],n=[],r=[];for(let i=0;i<e.length;i++){const a=e[i];"left"===a.fixed?t.push(a):"right"===a.fixed?n.push(a):r.push(a)}return[...t,...r,...n]})(qd(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Hd.selectionColumn,title:"radio"===t?Xt("qm.table.config.selectionText"):"",width:Hd.selectionColumnWidth,fixed:"left",type:t}})(c),r=(null==(i=u)?void 0:i.expandedRowRender)?{dataIndex:Hd.expandableColumn,title:"",width:Hd.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return n&&t.unshift(n),r&&t.unshift(r),Ia(t)},F=t.useMemo((()=>!!(null==r?void 0:r.api)),[null==r?void 0:r.api]),D=t.useMemo((()=>!F&&!!h),[F,h]),$=t.useMemo((()=>F&&!!m),[F,m]),M=t.useMemo((()=>(F||D)&&!$),[F,D,$]),q=t.useMemo((()=>!!(a||l||o)),[a,l,o]),j=t.useMemo((()=>H(i)),[i]),V=t.useMemo((()=>Na(j)),[j]),K=t.useMemo((()=>V.filter((e=>"function"==typeof e.editRender))),[V]),z=t.useMemo((()=>V.filter((e=>!!e.summation))),[V]),W=t.useMemo((()=>V.filter((e=>"left"===e.fixed))),[V]),B=t.useMemo((()=>V.filter((e=>"right"===e.fixed))),[V]),U=t.useMemo((()=>(e=>{const t=[];return e.forEach((e=>{const n=C.find((t=>w(t,t.index)===e.rowKey)),r=V.findIndex((t=>t.dataIndex===e.dataIndex));if(!n||r<0)return;const i={row:n.index,col:r,rowSpan:e.rowSpan,colSpan:e.colSpan};t.push(i);for(let n=1;n<e.colSpan;n++)for(let r=0;r<e.rowSpan;r++)t.push({row:i.row+r,col:i.col+n,rowSpan:0,colSpan:0});for(let n=1;n<e.rowSpan;n++)for(let r=0;r<e.colSpan;r++)t.push({row:i.row+n,col:i.col+r,rowSpan:0,colSpan:0})})),t})(L)),[L,V,C]),G=t.useMemo((()=>{var e,t;const n=V.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(e.dataIndex)));return _&&n.some((e=>e.dataIndex===_))?_:null!==(t=null===(e=n[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[V,_]),Y=t.useMemo((()=>z.length>0),[z]),X=t.useMemo((()=>!!E||Y),[E,Y]),Z=t.useMemo((()=>Fa(j).length>1),[j]),Q=t.useMemo((()=>s||Z),[s,Z]),J=t.useMemo((()=>V.some((e=>e.sorter))),[V]),ee=t.useMemo((()=>V.some((e=>e.filter))),[V]),te=t.useMemo((()=>z.some((e=>!!e.summation.dataKey))),[z]),ne=t.useMemo((()=>!F&&!!y),[F,y]),re=t.useMemo((()=>!!b&&K.length>0),[b,K]),ie=t.useMemo((()=>!!x&&"checkbox"===(null==c?void 0:c.type)),[x,c]),ae=t.useMemo((()=>!!f&&ee),[f,ee]),le=t.useMemo((()=>!F&&!!g&&ee),[F,g,ee]),oe=t.useMemo((()=>!!v&&V.some((e=>!!e.groupSummary))),[V]),se=t.useMemo((()=>{var e;return!!(null===(e=null==d?void 0:d.groupItems)||void 0===e?void 0:e.length)}),[d]),ce=t.useMemo((()=>C.some((e=>Array.isArray(e.children)))),[C]),de=t.useMemo((()=>!T.length),[T]),ue=t.useMemo((()=>(()=>{const e={};return z.forEach((t=>{const{dataIndex:n,precision:r,displayPrecision:i,summation:a}=t,{sumBySelection:l,displayWhenNotSelect:o,unit:s}=a,c=se?Za(S.current.tableFullData):S.current.tableFullData,d=!A.length&&!!o;let u=(!l||d?c:A).reduce(((e,t)=>{if(null==t?void 0:t[Hd.summaryIgnore])return e;const r=qa(t,n);return Ka(r)?e.plus(r):e}),new Ft(0));!Object.keys(P).includes(n)||l&&!d||(u=new Ft(qa(P,n))),ja(e,n,u.toNumber());let p=r>=0?u.toFixed(r):u.toString();i>=0&&""!==p&&(p=Wa(p,i)),p=za(p),ja(e,`${n}_text`,s?`${p} ${s}`:p)})),[e]})()),[T,N,P]),pe=t.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(z)),[z]),he=t.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((n=>{null!==e[n]&&t.push(`${n}|${e[n]}`)})),t.join(",")})(I),n=((e,t)=>{const n=[];if(Object.keys(e).length)for(const t in e){const[r,i]=t.split("|"),a=e[t];Object.keys(a).forEach((e=>{n.push({type:i,bracketLeft:"",fieldName:r,expression:e,value:a[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{n.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),n.length&&(n[n.length-1].logic=""),n})(R,O),i=t?{[Hd.sorterFieldName]:t}:null,a=n.length?{[Hd.filterFieldName]:n}:null,l=pe?{[Hd.groupSummary.summaryFieldName]:pe,usedJH:1}:null,o=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:null,s={[Hd.currentPageName]:k.current,[Hd.pageSizeName]:k.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),a),l),o),s)}),[null==r?void 0:r.params,k.current,k.pageSize,I,R,O,pe]);return{isFetch:F,isWebPagination:D,isScrollPagination:$,showPagination:M,shouldUpdateHeight:q,tableColumns:j,flattenColumns:V,editableColumns:K,summationColumns:z,leftFixedColumns:W,rightFixedColumns:B,derivedMergeCells:U,treeExpandIndex:G,showSummary:Y,showFooter:X,isHeadGroup:Z,bordered:Q,isHeadSorter:J,isHeadFilter:ee,isServiceSummation:te,isSelectCollection:ie,isTableImport:ne,isTableClipboard:re,isSuperSearch:ae,isFastSearch:le,isGroupSummary:oe,isGroupSubtotal:se,isTreeTable:ce,isTableEmpty:de,summationRows:ue,fetchParams:he}};function Vd(){const{locale:t}=e.useContext(Bt);return{t:Xt,$locale:t}}const Kd=(e,n)=>{const{rowKey:r,height:i,dataSource:a,summation:l,fetch:o,initialSorter:s,initialFilter:c,rowSelection:d,expandable:u,tableConfig:p,treeConfig:h,authConfig:m,ignorePageIndex:f,columnsChange:g,onChange:v,onDataChange:y,onDataLoad:b,onScrollEnd:x,onFetchError:E}=e,{getRowKey:S,tableRef:w,tableElementRef:C,tableBodyRef:T,$size:N,tableColumns:I,flattenColumns:R,editableColumns:O,tableFullData:k,pagination:L,layout:A,filters:P,sorter:_,superFilters:H,fetchParams:F,selectionKeys:D,rowExpandedKeys:$,highlightKey:M,summationColumns:q,shouldUpdateHeight:j,isFetch:V,isTreeTable:K,isWebPagination:z,isScrollPagination:W,isServiceSummation:B,isGroupSubtotal:U,doLayout:G,setTableData:Y,setTableFlatColumns:X,setTableFullData:Z,setTableOriginData:Q,setTableFlatData:J,setAllTableData:ee,setDeriveRowKeys:te,setPagination:ne,setSpinning:re,setSorter:ie,setFilters:ae,setSuperFilters:le,setSelectionKeys:oe,setRowExpandedKeys:se,setHighlightKey:ce,setSelectionRows:de,setScrollXLoad:ue,setScrollYLoad:pe,setScrollXStore:he,setScrollYStore:fe,computeVirtualX:ge,computeVirtualY:ve,setFieldAuth:ye,setResizeState:be,setSummaries:xe,setPermission:Ee,setRecordsMap:Se,resetTableScroll:Ce,clearElementStore:Te,clearRecordsMap:Ne}=n,{t:Ie}=Vd(),{store:Re,scrollBarRef:Oe}=w.current,ke=Number.parseInt(t.version)>=18?Dt.flushSync:null,Le=t.useRef(Object.assign({},F)),Ae=t.useRef(new Map),Pe=t.useRef(!1),_e=Vi(C);zi((()=>{qe(),w.current.scrollXLoad?Ve(Oe.current.scrollLeft):Ke(),G()}),[I]),zi((()=>{He()}),[_e,N,i,A.tableAutoHeight]),bi((()=>{It(),Rt(),Ot(),V||(z&>(),dt(a)),s&&ie(s),c&&ae(c)}),[a,null==o?void 0:o.params]),bi((()=>{const e=at(F,Le.current);e||V&&(null==d?void 0:d.clearableAfterFetched)&&kt(),!e&&F[Hd.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?gt():V&&st(),Le.current=F}),[F]),bi((()=>{z&&wt(),W||Ce(),nt()}),[L.current,L.pageSize]),bi((()=>{w.current.scrollYLoad&&Be(Oe.current.scrollTop),V||De(k.length),G()}),[k]),bi((()=>{K&&w.current.scrollYLoad&&(vt(),wt())}),[$]);const He=()=>{const{scrollXLoad:e,scrollYLoad:t,resizeState:n}=w.current,{width:r,height:i}=n,{width:a,height:l}=_e,o=a!==r,s=l!==i;G(),o&&e&&Ke(),s&&j&&t&&Ue(),be(Object.assign({},n,{width:a,height:l}))},Fe=()=>{M&&T.current.setClickedValues([M,""]),"radio"===(null==d?void 0:d.type)&&D.length&&T.current.setClickedValues([D[0],""])},De=e=>{e!==L.total&&ne((t=>Object.assign({},t,{total:e})))},$e=e=>{Pe.current=e},Me=Wi((e=>{ht(),null==x||x(e)})),qe=()=>{ue(R.length>Hd.virtualScrollX)},je=(e=[])=>{let t=e.length>Hd.virtualScrollY;(null==p?void 0:p.virtual)&&(t=!0),(null==h?void 0:h.virtual)&&(t=!0),pe(t)},Ve=(e=0)=>{const{scrollXStore:t}=w.current,{startIndex:n,endIndex:r,offsetSize:i}=t,{toVisibleIndex:a,visibleSize:l}=ge(e,A.tableWidth),o=Math.max(0,a-1-i),s=a+l+i;(a<=n||a>=r-l-1)&&(n===o&&r===s||(he(Object.assign({},t,{startIndex:o,endIndex:s})),Ke()))},Ke=()=>{ze(),We()},ze=()=>{const{scrollXLoad:e,scrollXStore:t}=w.current;if(!e)return;const n=[],r=[],i=[];for(let e=0;e<R.length;e++){const a=R[e];a.fixed?"left"===a.fixed?n.push(a):i.push(a):e>=t.startIndex&&e<t.endIndex&&r.push(a)}ke?queueMicrotask((()=>ke((()=>X([...n,...r,...i]))))):X([...n,...r,...i])},We=()=>{const{elementStore:e,scrollXStore:t,scrollXLoad:n}=w.current,{tableBodyWidth:r,gutterWidth:i}=A;let a="",l="";if(n){a=`${R.slice(0,t.startIndex).filter((e=>!e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)}px`,l=`${scrollY?r-i:r}px`}e.$tableBody.style.marginLeft=a,e.$tableXspace.style.width=l},Be=(e=0)=>{const{scrollYStore:t}=w.current,{startIndex:n,endIndex:r,offsetSize:i,visibleSize:a,rowHeight:l}=t,{toVisibleIndex:o}=ve(e,l),s=Math.max(0,o-1-i),c=o+a+i;(o<=n||o>=r-a-1)&&(n===s&&r===c||(fe(Object.assign({},t,{startIndex:s,endIndex:c})),Ue()))},Ue=()=>{const{tableFlatData:e}=w.current;Et(e),(e=>{const{elementStore:t,scrollYStore:n,scrollYLoad:r}=w.current,{startIndex:i,rowHeight:a}=n;let l="",o="";r&&(l=`${Math.max(0,i*a)}px`,o=e.length*a+"px"),t.$tableBody.style.marginTop=l,t.$tableYspace.style.height=o})(e)},Ge=e=>U?Ye(Xe(e,0)):e,Ye=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Ye(e.children)),delete e.children,t.push(e)})),t},Xe=(e,t)=>{var n;const i=null===(n=l.groupItems)||void 0===n?void 0:n[t];if(!i)return e.forEach(((t,n)=>{t._rowSpan=0===n?e.length:0,t._colSpan=1})),e;return Ja(e,[i.dataIndex]).map((e=>{const n={children:Xe(e,t+1),_group:i.dataIndex};return"function"!=typeof r&&ja(n,r.toString(),Ga()),i.titleIndex&&ja(n,i.titleIndex,qa(e[0],i.titleIndex)),ja(n,i.dataIndex,qa(e[0],i.dataIndex)),q.forEach((e=>{var t;const{dataIndex:r}=e,i=null===(t=n.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Hd.summaryIgnore])return e;const n=Number(qa(t,r));return Number.isNaN(n)?e:e+n}),0);ja(n,r,i)})),n}))},Ze=e=>{oe(e),de((e=>{const{selectionRows:t,recordsMap:n}=w.current,r=new Map;t.forEach((e=>r.set(S(e,e.index),e)));const i=[];for(let t=0,a=e.length;t<a;t++){const a=r.get(e[t])||n.get(e[t]);a&&i.push(a)}return i})(e))},Qe=e=>{const{type:t,checkStrictly:n=!0}=d||{},r=Array.isArray(e)?e:D;let i=[];return w.current.treeTable&&!n&&r.forEach((e=>{i.push(...((e,t)=>{var n;const{disabled:r}=d||{},{deriveRowKeys:i,recordsMap:a}=w.current,l=_a(i,e);let o=[];if(!l)return o;let s=et((null==l?void 0:l.children)||[]);return r&&(s=s.filter((e=>!a.has(e)||!r(a.get(e))))),o=[...new Set([...t,...s])],((null===(n=tl(i,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=_a(i,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=r?[...o,e]:o.filter((t=>t!==e))})),o})(e,r))})),i="radio"===t?r.slice(0,1):[...new Set([...r,...i])],i},Je=e=>{const{allRowKeys:t,flattenRowKeys:n,deriveRowKeys:r}=w.current,{defaultExpandAllRows:i,expandedRowRender:a}=u||{},l=Array.isArray(e)?e:$;if(w.current.treeTable){a&&en("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];M&&e.unshift(M);let o=[];return e.forEach((e=>{const t=tl(r,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=i?t:[...new Set([...l,...o])],o.filter((e=>!n.includes(e)))}return u?i?t.slice(0):[...l]:[]},et=e=>{const t=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&t.push(...et(e[n].children)),t.push(e[n].rowKey);return t},tt=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...tt(e.children,t)),e.rowKey===t&&e.parentRowKey&&n.push(e.parentRowKey)})),n.length&&n.push(...tt(e,n[n.length-1])),n},nt=Wi((()=>{null==v||v(L,it(P),rt(_),H,{currentDataSource:xt()})})),rt=e=>{const t={};for(const n in e)null!==e[n]&&(t[n]=e[n]);return t},it=e=>{const t={};for(const n in e){if(!n.includes("|"))continue;const[r,i]=n.split("|");t[`${r}|${i}`]=e[n]}return t},at=(e,t)=>{const n=Object.keys(Ma(e,t));return 1===n.length&&(n.includes(Hd.currentPageName)||n.includes(Hd.pageSizeName))},lt=()=>Tn(void 0,void 0,void 0,(function*(){var t;if(!m)return;let n=Hn(m,["fetch"]);if(m.fetch){const{api:e,params:r,dataKey:i}=m.fetch;try{const a=yield e(r);200===a.code&&(n=null!==(t=i?me(a.data,i):a.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:r=1}=n;Ee((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!r})))}if(Array.isArray(n.fieldList)){const{originColumns:t}=w.current,r=Oa(e.columns,(e=>{const{dataIndex:r}=e,i=n.fieldList.find((e=>e.dataIndex===r));if(i){const{visible:n=1,disabled:a,secretName:l}=i,o=ka(t,r);ye(r,{visible:n,disabled:a,secretName:l}),n||(e.noAuth=!0,o.noAuth=!0),l&&(e.formatType=`secret-${l}`,o.formatType=`secret-${l}`)}}));null==g||g(r)}})),ot=()=>Tn(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:r=(e=>e),beforeFetch:i=kn,afterFetch:a,callback:s}=o;if(!i(F))return;const c=!!(null===(e=null==l?void 0:l.fetch)||void 0===e?void 0:e.api);re(!0);try{const[e,i]=c?yield Promise.all([o.api(r(F)),l.fetch.api(r(F))]):[yield o.api(r(F))];if(w.current.unMounted)return;if(c?200===e.code&&200===i.code:200===e.code){const r=null!==(t=o.dataKey)&&void 0!==t?t:Hd.dataKey;let l=null!==(n=me(e.data,r))&&void 0!==n?n:[];l="function"==typeof a?yield a(l):l;const c=me(e.data,r.replace(/[^.]+$/,Hd.totalKey))||l.length||0,d=Math.max(Math.ceil(c/L.pageSize),1);if(F[Hd.currentPageName]>d)return mt(Object.assign(Object.assign({},L),{current:d}));dt(Pe.current?w.current.tableFullData.concat(l):l),De(c),ut((null==i?void 0:i.data)||e.data),null==s||s(e.data,e)}}catch(e){null==E||E(e)}var d,u;d=o,u="stopToFirst",Object.prototype.hasOwnProperty.call(d,u)&&(o.stopToFirst=!1),re(!1),$e(!1)})),st=Wi(ot),ct=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=ct(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:n}=L;return!V||W?e:(t-1)*n+e})(t)),e))),dt=e=>{const t=Ge(ct(e));Ct(t),Tt(t),Ze(Qe()),se(Je()),pt(),null==b||b(t)},ut=e=>{var t,n,r;if(!B)return;const i=null!==(n=null===(t=null==l?void 0:l.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:Hd.summationKey,a=null!==(r=i?me(e,i):e)&&void 0!==r?r:{},o={};q.filter((e=>!!e.summation.dataKey)).forEach((e=>{ja(o,e.dataIndex,Number(qa(a,e.summation.dataKey)))})),xe(o)},pt=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=xt();if(e.length){const t=S(e[0],e[0].index);Ze([t])}else Ze([])}},ht=()=>{if(!W)return;const e=ft();Pe.current||L.current>=e||($e(!0),mt(Object.assign(Object.assign({},L),{current:L.current+1})))},mt=({current:e,pageSize:t})=>{ne((n=>Object.assign({},n,{current:e,pageSize:t})))},ft=()=>{const{pageSize:e,total:t}=L;return Math.ceil(t/e)||1},gt=()=>{mt(Object.assign({},L,{current:1}))},vt=()=>{const{scrollYLoad:e,deriveRowKeys:t}=w.current;if(!w.current.treeTable||!e)return;const n=yt(t,(()=>{const{allTableData:e,allRowKeys:t}=w.current,{rowExpandable:n}=u||{},r=[];return"function"==typeof n&&e.forEach(((e,i)=>!n(e)&&r.push(t[i]))),r.length?$.filter((e=>!r.includes(e))):$})());Ae.current.clear(),n.forEach(((e,t)=>Ae.current.set(e,t)))},yt=(e,t)=>{const n=[];return e.forEach((e=>{if(e.children&&n.push(...yt(e.children,t)),void 0===e.parentRowKey)n.push(e.rowKey);else if(t.includes(e.parentRowKey)){e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1))&&n.push(e.rowKey)}})),n},bt=()=>{const{current:e,pageSize:t}=L;return w.current.tableFullData.slice((e-1)*t,e*t)},xt=()=>z?bt():w.current.tableFullData,Et=e=>{const{scrollYLoad:t,scrollYStore:n}=w.current;if(!t)return Y(e);const{startIndex:r,endIndex:i}=n;ke?queueMicrotask((()=>ke((()=>Y(e.slice(r,i)))))):Y(e.slice(r,i))},St=()=>{let e=xt();w.current.treeTable&&(null==h?void 0:h.virtual)&&(e=(e=>{const{recordsMap:t,allRowKeys:n}=w.current,r=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];Ae.current.has(i)&&r.push(t.get(i))}return r})()),je(e),J(e)},wt=()=>{St(),Ue()},Ct=e=>{Z(e),ee(e),te(e),Nt(),vt(),wt()},Tt=e=>{Q(e)},Nt=()=>{Ne(),w.current.allTableData.forEach((e=>Se(S(e,e.index),e)))},It=()=>{ie({})},Rt=()=>{ae({})},Ot=()=>{le([])},kt=()=>{Ze([])};return{initialTable:()=>{lt(),Fe(),qe(),je(),V?ot():dt(a)},checkDataIndex:()=>{const e=R.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&en("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:Ct,getTableData:ot,handleTableData:Et,createWebPageData:bt,createTableData:dt,createGroupData:Ge,createSelectionKeys:Qe,createRowExpandedKeys:Je,setSelectionKeysEffect:Ze,findParentRowKeys:tt,getAllChildRowKeys:et,doFieldValidate:(e,t,n,r)=>{if(!Array.isArray(e))return en("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Re.removeFromRequired({x:n,y:r}),Re.removeFromValidate({x:n,y:r}),e.forEach((e=>{var i;e.required&&_n(t)&&Re.addToRequired({x:n,y:r,text:e.message||O.find((({dataIndex:e})=>e===r)).title+Ie("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(i=e.validator)||void 0===i?void 0:i.call(e,t))||Re.addToValidate({x:n,y:r,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:r,removed:i}=Re.state,a=we(n,i),l=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:l(e),validate:l(t),inserted:n.filter((e=>!a.includes(e))),updated:r.filter((e=>![...we(r,n),...we(r,i)].includes(e))),removed:i.filter((e=>!a.includes(e)))}},dataChange:()=>{null==y||y(w.current.tableFullData)},tableChange:nt,toLastPage:()=>{const e=ft();L.current!==e&&mt(Object.assign({},L,{current:e}))},toFirstPage:gt,getPageCount:ft,pagerChangeHandle:mt,triggerScrollXEvent:e=>{Ve(e)},triggerScrollYEvent:e=>{Be(e)},scrollBottomDebouncer:Me,clearTableSorter:It,clearTableFilter:Rt,clearSuperFilters:Ot,clearRowSelection:kt,clearRowHighlight:()=>{ce("")},clearTableLog:()=>{Re.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=w.current;Te(),Re.destroy(),e.deregister(t)}}},zd=(e,n)=>{const{height:r,minHeight:i,maxHeight:a,ellipsis:l,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,topElementRef:u,tableElementRef:p,$size:h,tableColumns:m,flattenColumns:f,leftFixedColumns:g,derivedMergeCells:v,layout:y,scrollX:b,scrollY:x,showFooter:E,showPagination:S,isFullScreen:w,setLayout:C,setScrollX:T,setScrollY:N,setElementStore:I,setScrollXStore:R,setScrollYStore:O,setShouldToTop:k}=n,L=t.useRef(x),A=t.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=y,n={};return i&&Object.assign(n,{minHeight:`${$a(i)}px`}),a&&Object.assign(n,{maxHeight:`${$a(a)}px`}),w?Object.assign(Object.assign({},n),{maxHeight:"",minHeight:"",height:`${e}px`}):r?Object.assign(Object.assign({},n),{height:"auto"!==r?`${$a(r)}px`:`${t}px`}):n}),[r,a,i,w,y]),P=()=>{const{elementStore:e,scrollYLoad:t,resizeState:n}=d.current;if(!e.$table.offsetParent)return;const r=e.$table.offsetHeight,i=o?e.$header.offsetHeight:y.headerHeight,a=E?e.$footer.offsetHeight:y.footerHeight,l=r-i-a,s=e.$tableBody.offsetHeight,c=t||s>l;let u=0;if(w){const t=e.$toper?e.$toper.offsetHeight+xd:0,r=e.$pager?e.$pager.offsetHeight+xd:0;u=n.winHeight-t-r-20}(t||l!==y.viewportHeight)&&F(l),L.current=c,N(c),C((e=>Object.assign({},e,{headerHeight:i,footerHeight:a,viewportHeight:l,tableBodyHeight:s,tableFullHeight:u})))},_=e=>{const{scrollXStore:t,isIE:n,scrollBarRef:r}=d.current,i=r.current.scrollLeft,{toVisibleIndex:a,visibleSize:l}=H(i,e),o=n?5:0,s=Math.max(0,a-1-o),c=Math.max(a+l+o,t.endIndex);R(Object.assign({},t,{visibleSize:l,offsetSize:o,startIndex:s,endIndex:c}))},H=(e,t)=>{const n=e+t;let r=-1,i=0,a=0;for(let t=0,l=f.length;t<l;t++){const l=f[t];if(i+=l.width||l.renderWidth,-1===r&&e<i&&(r=t),r>=0&&(a++,i>n))break}return{toVisibleIndex:Math.max(0,r),visibleSize:Math.max(8,a)}},F=e=>{const{scrollBarRef:t,scrollYStore:n,isIE:r}=d.current,i=t.current.scrollTop,{rowHeight:a}=n,{toVisibleIndex:l}=D(i,a),o=Math.max(8,Math.ceil(e/a)+2),s=r?5:0,c=Math.max(0,l-1-s),u=Math.max(l+o+s,n.endIndex);O(Object.assign({},n,{visibleSize:o,offsetSize:s,startIndex:c,endIndex:u}))},D=(e,t)=>{const n=Math.floor(e/t);return{toVisibleIndex:Math.max(0,n)}},$=(e,t)=>{const{scrollBarRef:n,elementStore:r,scrollYStore:i,scrollYLoad:a,tableFlatData:l}=d.current;if(void 0!==t&&t>=0)n.current.SET_SCROLL_TOP(t*i.rowHeight);else if(a){const t=l.findIndex((t=>e===c(t,t.index)));t>=0&&n.current.SET_SCROLL_TOP(t*i.rowHeight)}else{const t=r.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);t&&n.current.SET_SCROLL_TOP(t.offsetTop)}};return{createElementStore:()=>{I("$toper",u.current),I("$table",p.current)},tableStyles:A,getSpan:(e,t,n,r,i)=>{let a=1,l=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:n,columnIndex:r,tableData:i});Array.isArray(o)?(a=o[0],l=o[1]):se(o)&&(a=o.rowSpan,l=o.colSpan)}if(v.length>0){const e=v.find((e=>e.row===n&&e.col===r));e&&(a=e.rowSpan,l=e.colSpan)}return{rowSpan:a,colSpan:l}},getStickyLeft:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=La(ka(m,e)).dataIndex);let t=0;for(let n=0;n<f.length;n++){const r=f[n];if(r.dataIndex===e)break;t+=r.width||r.renderWidth||0}return t},getStickyRight:(e,t)=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Aa(ka(m,e)).dataIndex);const n="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let n=[];return e.forEach((e=>{e.colSpan>0&&n.length>0&&(t.push(n),n=[]),n.push(e)})),n.length>0&&t.push(n),t.map((e=>{const[t,n]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...n,...t.reverse()]})).flat()})(f):f;let r=0;for(let t=n.length-1;t>=0;t--){const i=n[t];if(i.dataIndex===e)break;r+=i.width||i.renderWidth||0}return r},scrollXToColumn:(e,t)=>{const{scrollBarRef:n}=d.current,r=void 0===t?f.findIndex((t=>t.dataIndex===e)):t;if(r<0)return;const i=g.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),a=f.slice(0,r).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);n.current.SET_SCROLL_LEFT(a-i)},scrollYToRecord:$,rowInViewport:e=>{const{scrollBarRef:t,scrollYStore:n}=d.current,{viewportHeight:r,gutterWidth:i}=y,a=e*n.rowHeight;return!(a<t.current.scrollTop||a+n.rowHeight>t.current.scrollTop+(b?r-i:r))},calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current,n=t.winHeight-e.$table.getBoundingClientRect().top-(S?no["small"!==h?"middle":h]+xd:0)-xd;C((e=>Object.assign({},e,{tableAutoHeight:n})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&$("",0),k(!0)},computeVirtualX:H,computeVirtualY:D,doLayout:()=>{l?P():An((()=>P())),(()=>{const{elementStore:e,scrollXLoad:t}=d.current,n=e.$table.clientWidth,r=L.current?y.gutterWidth:0,{defaultColumnWidth:i}=Hd,a=[];let l=0;if(f.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,l+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=f.reduce(((e,t)=>e+(t.width||t.minWidth||i)),0);if(e<=n-r){T(!1);const t=n-r-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||i)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||i)),0);let n=0;a.forEach(((t,r)=>{if(0===r)return;const a=Math.floor((t.minWidth||i)*e);n+=a,t.renderWidth=(t.minWidth||i)+a})),a[0].renderWidth=(a[0].minWidth||i)+t-n}}else T(!0),a.forEach((e=>{e.renderWidth=e.minWidth||i}));C((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,n)})))}else l=f.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||i)),0),T(l>n),C((e=>Object.assign(Object.assign({},e),{tableBodyWidth:l})));C((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&_(n)})()}}};function Wd({handler:t,delay:n=0}){const r=function(t,n){const r=e.useRef(null),i=e.useRef(0);return e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]),e.useCallback(((...e)=>{const r=Date.now();(!i.current||r-i.current>n)&&(t.apply(this,e),i.current=r)}),[t,n])}(t,n),i=Rd(n>0?r:t);e.useEffect((()=>(window.addEventListener("resize",i),()=>window.removeEventListener("resize",i))),[i])}const Bd=e=>{const{total:n}=e,{tableRef:r,selectionKeys:i,isHeadSorter:a,isHeadFilter:l,isTreeTable:o,clearTableSorter:s,clearTableFilter:c,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:p}=t.useContext(vd),{infoBarConfig:h,rowSelection:m,rowHighlight:f}=r.current.props,{allTableData:g,invalidRowKeys:v}=r.current,{hideAlert:y,hideClearButton:b}=h||{},x=t.useMemo((()=>!y),[y]),E=t.useMemo((()=>!b&&!!(a||l||m||f)),[b,a,l,m,f]),S={[`${jn("table")}__alert`]:!0};return x?t.createElement("div",{className:Fe(S)},t.createElement("i",{className:"svgicon icon"},t.createElement(at,null)),t.createElement("span",null,Xt("qm.table.alert.total",{total:o?g.length:n}),m?`,${Xt("qm.table.alert.selected",{total:Math.max(i.length-v.length,0)})}`:""),E&&t.createElement("em",{onClick:()=>{c(),d(),u(),p(),An((()=>s()))}},Xt("qm.table.alert.clear"))):null},Ud=t.forwardRef(((e,n)=>{const{isFullScreen:r,open:i=!0}=e,{setFullScreen:a}=t.useContext(vd),l=()=>{a(!r)};t.useImperativeHandle(n,(()=>({clickHandle:l})));const o=jn("table");return i?t.createElement("span",{className:`${o}-full-screen`,title:Xt(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>l()},t.createElement("i",{className:"svgicon icon"},r?t.createElement(Be,null):t.createElement(Ue,null))):null}));Ud.displayName="FullScreen";const Gd=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{getTableData:i}=t.useContext(vd),a=()=>{i()};t.useImperativeHandle(n,(()=>({clickHandle:a})));const l=jn("table");return r?t.createElement("span",{className:`${l}-reload`,title:Xt("qm.table.refresh.text"),onClick:()=>a()},t.createElement("i",{className:"svgicon icon"},t.createElement(Je,null))):null}));Gd.displayName="Reload";const Yd=()=>{const e={dateFormat:e=>{const t=e?g(e).format(wd):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?g(e).format(Cd):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?g(e).format(Cd.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Ka(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>za(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,n,r)=>{var i,a,l,o;const{dictItems:s,precision:c,displayPrecision:d,formatType:u,editRender:p}=n,h=s||(null===(i=null==p?void 0:p(r,n))||void 0===i?void 0:i.items)||[];let m=null!==(o=null!==(l=null===(a=h.find((e=>e.value==t)))||void 0===a?void 0:a.text)&&void 0!==l?l:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(m=t.map((e=>{var t,n;return null!==(n=null===(t=h.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==n?n:e})).join(",")),c>=0&&""!==m&&(m=Ka(m)?new Ft(m).toFixed(c):m),d>=0&&""!==m&&(m=Wa(m,d)),u){const t=e[`${Pn(u)}Format`];t?m=t(m):en("Table","字段的格式化类型 `formatType` 配置不正确")}return m},n=e=>In(e)?Ya(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,r,i,a)=>{const l=qa(e,r.dataIndex),o=r.render?r.render(l,e,r,i,a):t(l,r,e);return n(o)}}},Xd=t.forwardRef(((e,n)=>{var r,i,a,l;const{tableColumns:o,open:s=!0}=e,{global:c}=t.useContext(Bt),{tableRef:d,flattenColumns:u,summationRows:p,showSummary:h,getSpan:m}=t.useContext(vd),{tablePrint:f,showHeader:g}=d.current.props,{getTitleFromCellValue:v}=Yd(),y=null!==(i=null===(r=null==c?void 0:c.print)||void 0===r?void 0:r.leftLogo)&&void 0!==i?i:"",b=null!==(l=null===(a=null==c?void 0:c.print)||void 0===a?void 0:a.rightLogo)&&void 0!==l?l:"",x=!(!y&&!b),E=t.useMemo((()=>Fn(Pa(o,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn]))),[o]),S=t.useMemo((()=>Fn(Pa(u,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn]))),[u]),w=t.useMemo((()=>Fn(o.filter((e=>e.printFixed)))),[o]),C=e=>{const t=Object.assign({},el(E,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?C(t):t},T=(e,t)=>Ce(Te(Ne(e),t),Ie(((...e)=>Re(...e,((e,n)=>{if(Array.isArray(e))return T(e.concat(n),t)}))))),N=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(C(e))})),n=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const n=e.filter((e=>e.dataIndex===t));return n.length<=1?n[0]:T(n,"dataIndex")[0]})))(n),t.push(Fa(n))})),t},I=()=>{const{tableFullData:e}=d.current,t=(e=>{const t=[];let n=[],r=0,i=0;for(;i<e.length;){const a=e[i];r+=a.width||a.renderWidth||a.minWidth||Hd.defaultColumnWidth,r<=Hd.printWidth?(n.push(a),i===e.length-1&&t.push(n),i++):i>0?(e.splice(0,i),w.length&&e.unshift(...w),t.push(n),n=[],r=0,i=0):(a.width=Hd.printWidth,n.push(a),t.push(n),i++)}return t})([...S]),n=N(t);let r=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let i=0;i<t.length;i++)r+=R(n[i],t[i],e),r+='<div class="page-break"></div>';return r+"</body></html>"},R=(e,t,n)=>{const{showLogo:r=!0}=f;let i='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${t.map((({width:e,minWidth:t,renderWidth:n})=>`<col style="width:${e||n||t||Hd.defaultColumnWidth}px">`)).join("")}</colgroup>`,g&&(i+=["<thead>",r&&x?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',y?`<img src="${y}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',b?`<img src="${b}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Xa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(i+=`<tbody>${Ha(n).map((e=>`<tr>${t.map(((t,r)=>{const{rowSpan:i,colSpan:a}=m(e,t,e.index,r,n);if(!i||!a)return null;return`<td rowspan="${i}" colspan="${a}">${r<=0?`<span style="padding-left:${e._level*Hd.treeTable.textIndent}px"></span>`:""}${v(e,t,e.index,r)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),h&&p.length&&(i+=["<tfoot>",p.map((e=>`<tr>${t.map(((t,r)=>{const{dataIndex:i,summation:a}=t,l=(null==a?void 0:a.render)?a.render(n):qa(e,`${i}_text`);return`<td>${0===r&&""===l?Xt("qm.table.config.summaryText"):In(l)?Ya(l).join(""):l}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},O=()=>{var e;null===(e=((e,t)=>{const{filename:n,type:r,isDownload:i}=e,a=`${n}.${r}`;if(window.Blob){const e=new Blob([t],{type:`text/${r}`});if(!i)return Promise.resolve({type:r,content:t,blob:e});Zi(e,a)}})({filename:"print",type:"html",isDownload:!1},I()))||void 0===e||e.then((({content:e,blob:t})=>{let n=document.createElement("iframe");n.setAttribute("frameborder","0"),n.setAttribute("width","100%"),n.setAttribute("height","0"),n.style.display="none",document.body.appendChild(n),d.current.isIE?(n.contentDocument.write(e),n.contentDocument.execCommand("print"),n.parentNode.removeChild(n),n=null):(n.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{n.parentNode.removeChild(n),n=null}))},n.src=URL.createObjectURL(t))}))};t.useImperativeHandle(n,(()=>({clickHandle:O})));const k=jn("table");return s?t.createElement("span",{className:`${k}-print`,title:Xt("qm.table.print.text"),onClick:()=>O()},t.createElement("i",{className:"svgicon icon"},t.createElement(lt,null))):null}));Xd.displayName="TablePrint";const Zd="606060",Qd="thin",Jd="d4d4d4",eu=(e,t)=>{t&&(e.height=Math.floor(.75*t))},tu=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},nu=()=>({top:{style:Qd,color:{argb:Jd}},left:{style:Qd,color:{argb:Jd}},bottom:{style:Qd,color:{argb:Jd}},right:{style:Qd,color:{argb:Jd}}}),ru=e=>{const{children:t}=e;return t&&t.length?ru(t[0]):e},iu=e=>{const{precision:t,formatType:n}=e,r=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:r?`0${r}%`:"0%"}:"finance"===n?{numFmt:r?`#,##0${r}`:"#,##0"}:r?{numFmt:`0${r}`}:null},au=()=>{const{tableRef:e,getSpan:n,showSummary:r,isHeadGroup:i}=t.useContext(vd),{spanMethod:a,showHeader:l}=e.current.props,o=(e,t)=>{var n,r,i;return null!==(i=null!==(r=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==r?r:t)&&void 0!==i?i:""};return{exportXLSX:(t,o,s,c)=>Tn(void 0,void 0,void 0,(function*(){const{columns:d,footSummation:u}=t,{scrollYStore:{rowHeight:p}}=e.current,h=Na(d),m=Fa(d),f=[],g=[],v=[],y=[];let b=0;const x={};h.forEach((e=>{const{dataIndex:t,width:n,minWidth:r,renderWidth:i}=e;x[t]=Xa(e.title),v.push({key:t,width:(n||i||r||Hd.defaultColumnWidth)/8})})),l&&(i?m.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:r,rowSpan:i}=e,a=ru(e),l=h.findIndex((({dataIndex:e})=>e===a.dataIndex));n[a.dataIndex]=Xa(e.title),0!==r&&(r>1||i>1)&&y.push({s:{r:t,c:l},e:{r:t+i-1,c:l+r-1}})})),f.push(n)})):(h.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;(n>1||r>1)&&y.push({s:{r:b,c:t},e:{r:b+r-1,c:t+n-1}})})),f.push(x)),b+=f.length);const E=Ha(o).map(((e,t)=>{const r={};return h.forEach(((i,l)=>{if("function"==typeof a){const{rowSpan:r,colSpan:a}=n(e,i,t,l,o);(a>1||r>1)&&y.push({s:{r:t+b,c:l},e:{r:t+b+r-1,c:l+a-1}})}const s=["percent","finance"].includes(i.formatType);r[i.dataIndex]=s?qa(e,i.dataIndex):c(e,t,i,l)})),r._level=e._level,r}));b+=E.length,r&&u&&s(h,o).forEach(((e,t)=>{const n={};h.forEach(((t,r)=>{const{dataIndex:i,summation:a}=t,l=(null==a?void 0:a.render)?a.render(o):qa(e,i);n[i]=0===r&&""===l?Xt("qm.table.config.summaryText"):In(l)?Ya(l).join(""):l})),g.push(n)}));const{sheetName:S,useStyle:w}=t,C=new zt.Workbook,T=C.addWorksheet(S);T.columns=v,l&&T.addRows(f).forEach((e=>{w&&eu(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),n=ka(d,t.key),{align:r,theadAlign:i}=n;tu(e,i||r),w&&Object.assign(e,{font:{bold:!0,color:{argb:Zd}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:nu()})}))})),T.addRows(E).forEach(((e,t)=>{const{_level:n}=E[t];w&&eu(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),r=ka(d,t.key),{align:i}=r;tu(e,i),Object.assign(e,iu(r)),w&&Object.assign(e,{font:{color:{argb:Zd}},border:nu()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),r&&u&&T.addRows(g).forEach((e=>{w&&eu(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),n=ka(d,t.key),{align:r}=n;tu(e,r),Object.assign(e,iu(n)),w&&Object.assign(e,{font:{color:{argb:Zd}},border:nu()})}))})),y.forEach((({s:e,e:t})=>{T.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const N=yield C.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const n=e=>{let t=e;const n=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),r=-1!==e.indexOf('"');return r&&(t=t.replace(/"/g,'""')),(n||r)&&(t='"'+t+'"'),t},r="\ufeff"+(e=>{let t,r,i,a,l="";for(t=0;t<e.rows.length;t+=1){for(i=e.rows[t],r=0;r<i.cells.length;r+=1)a=i.cells[r],l=l+(r?",":"")+n(a.textContent.trim());l+="\r\n"}return l})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var i;return((e,t,n)=>{t=t||"",n=n||512;const r=window.atob(e),i=[];let a;for(a=0;a<r.length;a+=n){const e=r.slice(a,a+n),t=new Array(e.length);let l;for(l=0;l<e.length;l+=1)t[l]=e.charCodeAt(l);const o=new window.Uint8Array(t);i.push(o)}return new window.Blob(i,{type:t})})((i=r,window.btoa(unescape(encodeURIComponent(i)))),"application/csv")},importXLSX:(e,t)=>{const{columns:n,file:r}=e,i=Na(n),a=new FileReader;a.onerror=()=>{L.error(Xt("qm.table.import.error"))},a.onload=e=>{const n=i.map((e=>Xa(e.title))),r=new zt.Workbook,a=e.target;a?r.xlsx.load(a.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),a=e.findIndex((e=>e&&e.length>0)),l=e[a],s=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,l);if(s){const r=e.slice(a+1).map((e=>{const t={};e.forEach(((e,n)=>{var r;let i=e;Array.isArray(null==i?void 0:i.richText)&&(i=i.richText.map((e=>e.text)).join("")),se(i)&&"text"in i&&(i=i.text),Oe(i)&&(i=Ua(i,Cd)),(null==i?void 0:i.formula)&&(i=null!==(r=i.result)&&void 0!==r?r:i.value),t[l[n]]=i}));const r={};return n.forEach(((e,n)=>{var a;const{dataIndex:l,dictItems:s}=i[n];Array.isArray(s)&&((null===(a=t[e])||void 0===a?void 0:a.toString().includes(","))?t[e]=t[e].split(",").map((e=>o(s,e))).filter((e=>""!==e)):t[e]=o(s,t[e])),ja(r,l,t[e])})),r}));null==t||t(r)}else L.error(Xt("qm.table.import.error"))}else L.error(Xt("qm.table.import.error"))})):L.error(Xt("qm.table.import.error"))},a.readAsArrayBuffer(r)}}},lu=e=>{const{fileType:n,onChange:r}=e;let i,a;const l=jn("table"),o=e=>{const t=e.name,n=t.lastIndexOf("."),r=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:r}},s=()=>Tn(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return i||(i=document.createElement("form"),a=document.createElement("input"),i.className=`${l}--file-form`,a.name="file",a.type="file",i.appendChild(a),document.body.appendChild(i)),new Promise(((e,n)=>{const r=!t.type;a.multiple=!!t.multiple,a.accept=r?"":`.${t.type}`,a.onchange=l=>{const{files:s}=l.target,c=s[0];let d="";if(!r)for(let e=0;e<s.length;e++){const{type:n}=o(s[e]);if(t.type!==n){d=n;break}}d?(L.warning(Xt("qm.upload.notType",{type:d})),n()):e(c),document.body.removeChild(i),i=null,a=null},i.reset(),a.click()}))})({type:n});null==r||r(e.name,e)}catch(e){}}));return t.createElement($n,{onClick:()=>s()},Xt("qm.upload.text"))},ou=e=>{const{columns:n,onClose:r}=e,{tableRef:i,createTableData:a,dataChange:l}=t.useContext(vd),{beforeTableImport:o}=i.current.props,{importXLSX:s}=au(),c=t.useRef(null),[d,u]=t.useState(!1),[p,h]=t.useState(!0),m=e=>e.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))),f={posIndex:"条"},[g,v]=t.useState([{type:"INPUT",label:Xt("qm.table.export.fileName"),fieldName:"fileName",render:(e,n)=>{const{fileName:r}=n.GET_FIELDS_VALUE(["fileName"]);return t.createElement(t.Fragment,null,r?t.createElement("span",null,r):t.createElement(lu,{fileType:n.state.formData.fileType,onChange:(e,t)=>{n.SET_FIELDS_VALUE({fileName:e,file:t}),t&&h(!1)}}))}},{type:"SELECT",label:Xt("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:Xt("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:Xt("qm.table.import.fillText"),value:"fill"},{text:Xt("qm.table.import.addText"),value:"add"},{text:Xt("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{g.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&c.current.SET_FIELDS_EXTRA(f),v([...g])}},{type:"INPUT_NUMBER",label:Xt("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:i.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),y=jn("table");return t.createElement("div",{className:`${y}-import__setting`},t.createElement(jc,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:f,items:g,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r(),style:{marginRight:8}},Xt("qm.table.export.closeButton")),t.createElement($n,{type:"primary",loading:d,disabled:p,onClick:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();e||(u(!0),s({columns:m(n),file:t.file},(e=>Tn(void 0,void 0,void 0,(function*(){const{tableFullData:n,store:s}=i.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof o)try{e=yield o(e)}catch(e){}if("fill"===t.importType&&a(e),"add"===t.importType&&a([...n,...e]),"insert"===t.importType){const r=t.posIndex,i=n.slice(0,r).concat(e).concat(n.slice(r));a(i)}e.forEach((e=>{s.addToInserted(e)})),l(),L.success(Xt("qm.table.import.success",{total:e.length})),u(!1),r()})))))}))},Xt("qm.table.import.text"))))},su=t.forwardRef(((e,n)=>{const{tableColumns:r,open:i=!0}=e,[a,l]=t.useState(!1),o=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s={[`${jn("table")}-import`]:!0},c={visible:a,title:Xt("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:Fe(s),title:Xt("qm.table.import.textNoSpace"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(ot,null))),t.createElement(da,c,t.createElement(ou,{columns:r,onClose:()=>l(!1)})))}));su.displayName="TableImport";const cu=e=>{const{columns:n,onChange:r}=e,{$size:i}=t.useContext(vd),a=t.useRef([]),[l,o]=t.useState(!1),[s,c]=t.useState(n);bi((()=>{u()}),[s]),t.useEffect((()=>{d()}),[n]);const d=()=>{const e=[];n.forEach(((t,r)=>{const i=t.colSpan;i>1&&n.slice(r+1,r+i).every((({colSpan:e})=>0===e))&&e.push(n.slice(r,r+i))})),a.current=e},u=()=>{const e=[];s.forEach((t=>{const{colSpan:n,dataIndex:r}=t;if(0===n)return;if(1===n)return e.push(t);const i=a.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===i)return e.push(t);e.push(...a.current[i].map((({dataIndex:e},n)=>{const r=s.find((t=>t.dataIndex===e));return n>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==r||r(e)},p=jn("table"),h={[`${p}__popper`]:!0,"column-filter__popper":!0,[`${p}--lg`]:"large"===i,[`${p}--sm`]:"small"===i},m=[`${p}-column-filter`,{selected:l}];return t.createElement(Ms,{action:["click"],popupVisible:l,popup:t.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"main"},t.createElement(Vt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),n=s.map((e=>e.dataIndex));ge(t,n)||c(il(e))}},s.map((e=>((e,n)=>{const{colSpan:r}=e;if(0===r)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=["svgicon","handle",`${n}-handle`];return t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(M,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,c([...s])}}),t.createElement("i",{className:Fe(i),title:Xt("qm.table.columnFilter.draggable")},t.createElement(Ge,null)),t.createElement("span",{className:"text"},Xa(e.title)))})(e,"main")))))),popupClassName:Fe(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{o(e)},builtinPlacements:Nd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Fe(m),title:Xt("qm.table.columnFilter.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(st,null)),t.createElement("span",null,Xt("qm.table.columnFilter.text"))))},du=e=>{const{defaultValue:n,onClose:r,onOk:i}=e,{tableRef:a,selectionKeys:l,pagination:o,showSummary:s}=t.useContext(vd),{rowSelection:c}=a.current.props,d=t.useRef(null),[u,p]=t.useState(!1),h=t.useMemo((()=>Object.assign({},{fileName:`${g().format(Td)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:l.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},n,{columns:Fn(n.columns||[])})),[]),[m,f]=t.useState([{type:"INPUT",label:Xt("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:Xt("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:Xt("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:Xt("qm.table.export.all"),value:"all"},{text:Xt("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==c?void 0:c.type)},{text:Xt("qm.table.export.custom"),value:"custom"}]},onChange:e=>{m.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,f([...m])}},options:{min:1},disabled:!0},{type:"INPUT",label:Xt("qm.table.columnFilter.text"),fieldName:"columns",render:(e,n)=>t.createElement(cu,{columns:n.state.formData.columns,onChange:e=>{n.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:Xt("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:Xt("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),v=jn("table");return t.createElement("div",{className:`${v}-export__setting`},t.createElement(jc,{ref:d,initialValues:h,items:m,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r(),style:{marginRight:8}},Xt("qm.table.export.closeButton")),t.createElement($n,{type:"primary",loading:u,onClick:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield d.current.GET_FORM_DATA();if(!e){p(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);i(t),yield Ln(1e3),p(!1),r()}}))},Xt("qm.table.export.text"))))},uu=t.forwardRef(((e,n)=>{var r;const{tableColumns:i,open:a=!0}=e,{global:l}=t.useContext(Bt),{tableRef:o,flattenColumns:s,pagination:c,fetchParams:d,isFetch:u,isGroupSubtotal:p,showSummary:h,getSpan:m}=t.useContext(vd),{exportExcel:f,fetch:v,showHeader:y}=o.current.props,{getTitleFromCellValue:b}=Yd(),[x,E]=t.useState(!1),[S,w]=t.useState(!1),C=t.useMemo((()=>{var e;return!!(null===(e=null==f?void 0:f.fetch)||void 0===e?void 0:e.api)}),[f]),T=t.useMemo((()=>!c.total||S),[c.total,S]),N=t.useMemo((()=>Pa(i,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn])),[i]),I=t.useMemo((()=>Pa(s,[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn])),[s]),R=(e,t="",n=0)=>e.map(((e,r)=>{const i=Object.assign(Object.assign({},e),{index:r,pageIndex:r}),a=t?`${t}.${i.index+1}`:`${i.index+1}`;return i.indexPath=a,i._level=n,Array.isArray(e.children)&&(i.children=R(e.children,a,n+1)),I.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&ja(i,t,qa(i,t))})),i})),O=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,i=(p?Za(t):t).reduce(((e,t)=>{if(null==t?void 0:t[Hd.summaryIgnore])return e;const n=Number(qa(t,r));return Number.isNaN(n)?e:e+n}),0);ja(n,r,i)})),[n]},k=(e,t,n,r)=>{const{precision:i,formatType:a}=n;let l=b(e,n,t,r);return i>=0&&!a&&""!==l&&(l=Number(l)),l},{exportXLSX:A,exportCSV:P}=au(),_=e=>Tn(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:r=(e=>e),afterFetch:i,dataKey:a}=v;let l=[];try{w(!0);const o=yield n(Object.assign(Object.assign({},r(d)),{[Hd.currentPageName]:1,[Hd.pageSizeName]:null!=e?e:c.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=me(o.data,a))&&void 0!==t?t:[];e="function"==typeof i?yield i(e):e,l=R(e)}}catch(e){}return w(!1),l})),H=e=>{var t;const n=null===(t=null==l?void 0:l.table)||void 0===t?void 0:t.recordExportLog;try{null==n||n({fileName:e})}catch(e){}},F=(e,t)=>{const{columns:n,footSummation:r}=e,i=Fa(n),a=Na(n);let l='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return l+=`<colgroup>${a.map((({width:e,minWidth:t,renderWidth:n})=>`<col style="width:${e||n||t||Hd.defaultColumnWidth}px">`)).join("")}</colgroup>`,y&&(l+=["<thead>",i.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Xa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(l+=`<tbody>${Ha(t).map((e=>`<tr>${a.map(((n,r)=>{const{rowSpan:i,colSpan:a}=m(e,n,e.index,r,t);return i&&a?`<td rowspan="${i}" colspan="${a}">${k(e,e.index,n,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),h&&r&&(l+=["<tfoot>",O(a,t).map((e=>`<tr>${a.map(((n,r)=>{const{dataIndex:i,summation:a}=n,l=(null==a?void 0:a.render)?a.render(t):qa(e,i);return`<td>${0===r&&""===l?Xt("qm.table.config.summaryText"):In(l)?Ya(l).join(""):l}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),l+="</table>",l},D=null!==(r=null==f?void 0:f.fileName)&&void 0!==r?r:`${g().format(Td)}.xlsx`,$=D.slice(D.lastIndexOf(".")+1).toLowerCase(),M=()=>{if(T)return L.warning(Xt("qm.table.export.warnText"));var e;C?(e=D,Tn(void 0,void 0,void 0,(function*(){w(!0);try{const{api:t,params:n}=f.fetch,r=yield t(Object.assign(Object.assign(Object.assign({columns:I.map((e=>{const{title:t,dataIndex:n,hidden:r}=e,{type:i}=e.filter||{};return{title:t,dataIndex:n,type:i,hidden:r}}))},d),n),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Hd.currentPageName]:void 0,[Hd.pageSizeName]:void 0}));r.data&&(Zi(r.data,e),H(e))}catch(e){}w(!1)}))):E(!0)};t.useImperativeHandle(n,(()=>({clickHandle:M})));const q={[`${jn("table")}-export`]:!0},j={visible:x,title:Xt("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>E(!1)},V={fileName:D.slice(0,D.lastIndexOf(".")),fileType:$,columns:N,useStyle:(null==f?void 0:f.cellStyle)?1:0};return t.createElement(t.Fragment,null,a&&t.createElement("span",{className:Fe(q),title:Xt("qm.table.export.textNoSpace"),onClick:()=>M()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ke,null))),t.createElement(da,j,t.createElement(du,{defaultValue:V,onClose:()=>E(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:Ia(e.columns)}),Tn(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:n,exportType:r,startIndex:i=1,endIndex:a}=t,{tableFullData:l,selectionRows:s}=o.current;let c=[];if(u?("all"===r&&(c=yield _()),"custom"===r&&(c=yield _(a),c=c.slice(i-1))):("all"===r&&(c=l.slice(0)),"custom"===r&&(c=l.slice(i-1,a||void 0))),"selected"===r&&(c=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==f?void 0:f.beforeExport))try{c=null==f?void 0:f.beforeExport(c)}catch(e){}if("xlsx"===n){const n=yield A(t,c,O,k);Zi(n,`${e}.xlsx`),H(`${e}.xlsx`)}if("csv"===n){const n=P(t,F(t,c));Zi(n,`${e}.csv`),H(`${e}.csv`)}}))}})))}));uu.displayName="TableExport";const pu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,tableBodyRef:a,dataChange:l}=t.useContext(vd),{beforeClipboard:o}=i.current.props,s=t.useRef(null),[c,d]=t.useState([{type:"INPUT_NUMBER",label:Xt("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:Xt("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:n.map(((e,t)=>({value:t,text:Xa(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:Xt("qm.table.clipboard.content"),fieldName:"content",placeholder:Xt("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[u,p]=t.useState(!1),h=jn("table");return t.createElement("div",{className:`${h}-clipboard__setting`},t.createElement("h3",{className:"info"},Xt("qm.table.clipboard.supportText")),t.createElement(jc,{ref:s,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r(),style:{marginRight:8}},Xt("qm.table.export.closeButton")),t.createElement($n,{type:"primary",loading:u,onClick:()=>Tn(void 0,void 0,void 0,(function*(){var e;const[t,c]=yield s.current.GET_FORM_DATA();if(t)return;const{tableFullData:d,store:u}=i.current;p(!0);const h=c.content.trim().replace(/(\r|\n)$/,"");let m=h.replace(/"[^"]+"/g,"^");((null===(e=h.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{m=m.replace(/\^/,e)}));let f=m.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{f=yield o(f,f[0].map(((e,t)=>n[c.colIndex+t].dataIndex)))}catch(t){}f.forEach(((e,t)=>{e.forEach(((e,r)=>{var a,l;const o=d[c.rowIndex-1+t],s=n[c.colIndex+r];if(o&&s){let t=!1;if(s.editRender){const e=s.editRender(o,s);t=!(e.disabled||(null===(a=e.extra)||void 0===a?void 0:a.disabled)||(null===(l=i.current.fieldAuth[s.dataIndex])||void 0===l?void 0:l.disabled))}t&&s.dictItems&&(t=s.dictItems.some((t=>t.value==e))),t&&(ja(o,s.dataIndex,e),u.addToUpdated(o))}}))})),a.current.forceUpdate(),l(),L.success(Xt("qm.table.clipboard.success",{total:f.length})),p(!1),r()}))},Xt("qm.table.clipboard.text"))))},hu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{flattenColumns:i}=t.useContext(vd),[a,l]=t.useState(!1),o=t.useMemo((()=>(e=>e.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))))(i)),[i]),s=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={[`${jn("table")}-clipboard`]:!0},d={visible:a,title:Xt("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:Fe(c),title:Xt("qm.table.clipboard.textNoSpace"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(ct,null))),t.createElement(da,d,t.createElement(pu,{columns:o,onClose:()=>l(!1)})))}));hu.displayName="TableClipboard";const mu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,$size:a,selectionKeys:l,setSelectionKeysEffect:o}=t.useContext(vd),{rowKey:s,rowSelection:c}=i.current.props,d=t.useRef(null),u=Vi(d),p=e=>e.map((e=>{var t;const n={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(n.children=p(e.children)),n})),[h,m]=t.useState([{title:Xt("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...p(n.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))))]),[f]=t.useState((()=>{const{disabled:e}=c||{},t=i.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[g,v]=t.useState(300),y=Wi((()=>{const e=d.current;v(e.offsetHeight-2*no[a]-30)}),5);return zi((()=>{y()}),[u.width]),t.createElement("div",{ref:d,style:{height:"100%"}},t.createElement(rp,{size:a,columns:h,dataSource:f,rowKey:s,height:g,rowSelection:{type:"checkbox",selectedRowKeys:l,onChange:e=>o(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),t.createElement("div",{style:{height:10}}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>r()},Xt("qm.table.selectCollection.closeButton"))))},fu=t.forwardRef(((e,n)=>{const{columns:r,open:i=!0}=e,{tableRef:a,getRowKey:l,selectionKeys:o,isFetch:s,isTableEmpty:c,setSelectionKeysEffect:d,setSelectionRows:u}=t.useContext(vd),{rowSelection:p}=a.current.props,[h,m]=t.useState(!1),f=t.useRef(!1);bi((()=>{!f.current&&g()}),[c]);const g=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=p;if(s&&t)try{const r=yield t.api(Object.assign({},{selectedKeys:o},t.params));if(200===r.code){let i=Array.isArray(r.data)?r.data:null!==(e=me(r.data,t.dataKey))&&void 0!==e?e:[];i=i.filter((e=>!n(e))),d(i.map(((e,t)=>l(e,t)))),u(i),f.current=!0}}catch(e){}})),v=()=>{m(!0)};t.useImperativeHandle(n,(()=>({clickHandle:v})));const y=jn("table"),b={visible:h,title:Xt("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>m(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:`${y}-select-collection`,title:Xt("qm.table.selectCollection.text"),onClick:()=>v()},t.createElement("i",{className:"svgicon icon"},t.createElement(dt,null))),t.createElement(da,b,t.createElement(mu,{columns:r,onClose:()=>m(!1)})))}));fu.displayName="SelectCollection";const gu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Bt),{tableRef:i,getRowKey:a,$size:l,flattenColumns:o,pagination:s,createWebPageData:c,setPagination:d,scrollYToRecord:u,setHighlightKey:p,setShouldToTop:h,isTreeTable:m,isWebPagination:f}=t.useContext(vd),{uniqueKey:g}=i.current.props,v=t.useRef(null),y=t.useRef(null),b=t.useRef([]),x=t.useRef(""),E=t.useRef(-1),S=t.useRef("stop");bi((()=>{const e=Ha(c()).findIndex((e=>a(e,e.index)===x.current));u("",e)}),[s.current]);const w=e=>{let t;switch(e){case"text":case"textarea":default:t="INPUT";break;case"number":t="INPUT_NUMBER";break;case"date":t="DATE";break;case"checkbox":case"radio":t="SELECT"}return t},C=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>{var t;return{type:w(e.filter.type),fieldName:e.dataIndex,label:Xa(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:null!==(t=e.dictItems)&&void 0!==t?t:[]},onChange:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA(),[n,r]=yield y.current.GET_FORM_DATA(),i=ke(Object.assign({},t,r),_n);R(i)}))}})),T={case:0,fullchar:0},N=t.useMemo((()=>o.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[o]),[I,R]=t.useState({}),[k,L]=t.useState(T),[A]=t.useState(C([N[0]])),[P]=t.useState(C(N.slice(1))),[H,F]=t.useState(0),D=t.useMemo((()=>!Object.keys(I).length),[I]);bi((()=>{S.current="ready"}),[I,k]);const $=e=>{L(Object.assign({},k,e))},q=(e,t,n)=>new Promise(((r,i)=>{_.confirm({title:Xt("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{n(),r()}})})),j=e=>Tn(void 0,void 0,void 0,(function*(){if(!Object.keys(I).length)return _.warning({title:Xt("qm.button.confirmPrompt"),content:Xt("qm.table.fastSearch.queryCondition")});if("ready"===S.current&&(S.current="stop",b.current=(e=>{const{allTableData:t}=i.current,n=[];for(let i=0,a=t.length;i<a;i++){const a=t[i];let l=!0;for(const t in e){const{type:n}=N.find((e=>e.dataIndex===t)).filter;let i=qa(a,t),o=!0;if("text"===n||"textarea"===n?o=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(i):(i="string"==typeof(r=i)&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(r)?i.slice(0,10):i,o=i==e[t]),!o){l=!1;break}}l&&n.push(a)}var r;return n})(I),F(b.current.length)),!b.current.length)return p(""),_.warning({title:Xt("qm.button.confirmPrompt"),content:Xt("qm.table.fastSearch.notMatch")});"next"===e&&(E.current=E.current<0?0:E.current+1,E.current>b.current.length-1&&(yield q(Xt("qm.table.fastSearch.toTheEnd"),(()=>E.current=0),(()=>E.current=b.current.length-1)))),"prev"===e&&(E.current=E.current<0?b.current.length-1:E.current-1,E.current<0&&(yield q(Xt("qm.table.fastSearch.toStart"),(()=>E.current=b.current.length-1),(()=>E.current=0))));const t=b.current[E.current],n=a(t,t.index);let r=t.index;if(m&&f){const e=tl(i.current.deriveRowKeys,n)[0];r=i.current.tableFullData.findIndex((t=>a(t,t.index)===e))}((e,t)=>{if(x.current=e,f){const{pageSize:e}=s,n=Math.ceil((t+1)/e);h(!1),d(Object.assign({},s,{current:n}))}else u(e)})(n,r),p(n)})),V=()=>{v.current.RESET_FORM(),y.current.RESET_FORM()},K=t.useMemo((()=>g?`fastSearch_${g}`:""),[g]),[z,W]=t.useState([]),[B,U]=t.useState(""),[G,Y]=t.useState("");bi((()=>{if(G){const{filters:e,config:t}=z.find((e=>e.value===G)).list;v.current.SET_FIELDS_VALUE(Hn(e,P.map((e=>e.fieldName)))),y.current.SET_FIELDS_VALUE(Hn(e,A.map((e=>e.fieldName)))),R(e),L(t)}else V(),R({}),L(T)}),[G]),t.useEffect((()=>{X()}),[]);const X=()=>Tn(void 0,void 0,void 0,(function*(){if(!K)return;let e=yield Kt.getItem(K);e||(e=yield Z(K),Array.isArray(e)&&(yield Kt.setItem(K,e))),Array.isArray(e)&&e.length&&(W(e),Y(e[0].value))})),Z=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),Q=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),J=jn("table");return t.createElement("div",{className:`${J}-fast-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"top"},t.createElement("div",{className:"container"},t.createElement(la,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t.createElement("span",null,Xt("qm.table.alert.total",{total:H}))},t.createElement(la.TabPane,{tab:Xt("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t.createElement(jc,{ref:v,items:A,cols:1,labelWidth:110})),t.createElement(la.TabPane,{tab:Xt("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t.createElement(jc,{ref:y,items:P,cols:1,labelWidth:110})))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:l,value:B,placeholder:Xt("qm.table.highSearch.configText"),disabled:D,onChange:e=>{const{value:t}=e.target;U(t)}}),t.createElement($n,{type:"primary",disabled:!B||D,style:{marginLeft:"10px"},onClick:()=>Tn(void 0,void 0,void 0,(function*(){if(!K)return en("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ga(),t=[...z,{text:B,value:e,list:{filters:I,config:k}}];W(t),Y(e),U(""),yield Kt.setItem(K,t),yield Q(K,t)}))},Xt("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Hd.rowHeightMaps[l]}px`}},t.createElement("span",null,Xt("qm.table.fastSearch.savedSetting"))),t.createElement("ul",null,z.map((e=>t.createElement("li",{key:e.value,className:Fe({selected:e.value===G}),title:e.text,onClick:()=>{return t=e.value,void Y(t!==G?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:Xt("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Tn(void 0,void 0,void 0,(function*(){if(!n)return;const e=z.filter((e=>e.value!==n));W(e),n===G&&Y(""),yield Kt.setItem(K,e),yield Q(K,e)}))}},t.createElement(ut,null))))),!z.length&&t.createElement("div",{style:{padding:xd}},t.createElement(Fi,null)))))),t.createElement("div",{className:"bottom"},t.createElement("div",null,t.createElement(M,{checked:!!k.case,onChange:e=>$({case:e.target.checked})},Xt("qm.table.fastSearch.matchCase")),t.createElement(M,{checked:!!k.fullchar,onChange:e=>$({fullchar:e.target.checked})},Xt("qm.table.fastSearch.matchFullchar"))),t.createElement("div",null,t.createElement($n,{onClick:()=>V()},Xt("qm.table.fastSearch.clear"))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${no[l]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>n(),style:{marginRight:8}},Xt("qm.table.fastSearch.closeButton")),t.createElement($n,{type:"primary",style:{marginRight:8},onClick:()=>j("prev")},Xt("qm.table.fastSearch.queryPrev")),t.createElement($n,{type:"primary",onClick:()=>j("next")},Xt("qm.table.fastSearch.queryNext"))))},vu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{$size:i}=t.useContext(vd),[a,l]=t.useState(!1),o=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=jn("table"),c={visible:a,title:Xt("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${no[i]+20}px`},onClose:()=>l(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${s}-super-search`,title:Xt("qm.table.fastSearch.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(pt,null))),t.createElement(da,c,t.createElement(gu,{onClose:()=>l(!1)})))}));vu.displayName="FastSearch";const yu=e=>{const{columns:n,group:r,summary:i}=e,{tableRef:a,$size:l,pagination:o,fetchParams:s,isFetch:c}=t.useContext(vd),{fetch:d}=a.current.props,u=e=>{var t;const r=n.find((t=>t.dataIndex===e));return{title:r.title,precision:r.precision,dictItems:null!==(t=r.dictItems)&&void 0!==t?t:[]}},p=r.map((e=>Object.assign({dataIndex:e.group},u(e.group)))),h=i.map((e=>e.summary===Hd.groupSummary.total.value?{dataIndex:e.summary,title:Hd.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},u(e.summary)),{formula:e.formula}))),m=t.useMemo((()=>Object.assign({},s,{[Hd.sorterFieldName]:void 0,[Hd.groupSummary.summaryFieldName]:i.map((e=>`${e.formula}|${e.summary}`)).join(","),[Hd.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[Hd.currentPageName]:1})),[s,r,i]),[f,v]=t.useState(((e,t)=>[{title:Xt("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...t.map((e=>{var t;const r=null===(t=n.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let i=r?{summation:r}:null;return e.dataIndex===Hd.groupSummary.total.value&&(i={dataIndex:Hd.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?i:null)}))])(p,h)),[y]=t.useState(c?[]:(e=>{const t=Ja(e,r.map((e=>e.group))),n=[];return t.forEach((e=>{const t={};f.forEach((n=>{const{dataIndex:r}=n;"index"!==r&&ja(t,r,qa(e[0],r))})),i.forEach((n=>{const r=n.summary!==Hd.groupSummary.total.value?n.summary:Hd.groupSummary.recordTotalIndex,i=n.formula;"count"===i&&ja(t,r,e.length),"sum"===i&&ja(t,r,Le(e,r)),"max"===i&&ja(t,r,Ae(e,r)[r]),"min"===i&&ja(t,r,Pe(e,r)[r]),"avg"===i&&ja(t,r,(Le(e,r)/e.length).toFixed(2))})),n.push(t)})),n})(a.current.tableFullData)),b=Object.assign(Object.assign({size:l,height:400},c?{fetch:{api:d.api,params:m,dataKey:null==d?void 0:d.dataKey}}:{dataSource:y}),{columns:f,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${g().format(Td)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)});return t.createElement(rp,b)},bu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Bt),{tableRef:i,$size:a,flattenColumns:l}=t.useContext(vd),{uniqueKey:o}=i.current.props,s=t.useRef(null),c=t.useRef(null),[d,u]=t.useState(!1),[p,h]=t.useState([]),[m,f]=t.useState(""),[g,v]=t.useState("");bi((()=>{if(g){const{group:e,summary:t}=p.find((e=>e.value===g)).list;C(e),R(t)}else{const e=_();C((null==e?void 0:e.group)||[]),R((null==e?void 0:e.summary)||[])}}),[g]),t.useEffect((()=>{H()}),[]);const y=t.useMemo((()=>o?`summary_${o}`:""),[o]),b=t.useMemo((()=>l.filter((e=>![Hd.expandableColumn,Hd.selectionColumn,"index","pageIndex",Hd.operationColumn].includes(e.dataIndex)))),[l]),x=b.filter((e=>!e.groupSummary)).map((e=>({text:Xa(e.title),value:e.dataIndex}))),E=[Hd.groupSummary.total,...b.filter((e=>!!e.groupSummary)).map((e=>({text:Xa(e.title),value:e.dataIndex})))],S=[{text:Xt("qm.table.groupSummary.sumText"),value:"sum"},{text:Xt("qm.table.groupSummary.maxText"),value:"max"},{text:Xt("qm.table.groupSummary.minText"),value:"min"},{text:Xt("qm.table.groupSummary.avgText"),value:"avg"},{text:Xt("qm.table.groupSummary.countText"),value:"count"}],[w,C]=t.useState([]),[T,N]=t.useState([{title:Xt("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement($n,{type:"text",onClick:()=>{s.current.REMOVE_RECORDS(n)}},Xt("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:Xt("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:x.map((e=>Object.assign(Object.assign({},e),{disabled:w.findIndex((t=>t.group===e.value))>-1})))})}]),[I,R]=t.useState([]),[k,L]=t.useState([{title:Xt("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement($n,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(n)}},Xt("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:Xt("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:E.map((e=>Object.assign(Object.assign({},e),{disabled:I.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:Xt("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Hd.groupSummary.total.value?S.slice(S.length-1):S})}]),A=t.useMemo((()=>{const e=w.length&&w.every((e=>Object.values(e).every((e=>""!==e)))),t=I.length&&I.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[w,I]),P=()=>{y&&sessionStorage.setItem(y,JSON.stringify({group:w.filter((e=>!!e.group)),summary:I.filter((e=>!!e.summary))}))},_=()=>{if(!y)return;const e=sessionStorage.getItem(y);return e?JSON.parse(e):null},H=()=>Tn(void 0,void 0,void 0,(function*(){if(!y)return;const e=_();if(e){const{group:t,summary:n}=e;C(t),R(n)}let t=yield Kt.getItem(y);t||(t=yield F(y),Array.isArray(t)&&(yield Kt.setItem(y,t))),Array.isArray(t)&&t.length&&(h(t),!e&&v(t[0].value))})),F=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),$=jn("table"),M={visible:d,title:Xt("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>u(!1)};return t.createElement("div",{className:`${$}-group-summary__setting`},t.createElement("div",{className:"main"},t.createElement("div",{style:{width:"30%"}},t.createElement(rp,{ref:s,size:a,columns:T,dataSource:w,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>N(e),onDataChange:e=>{C(e)}},t.createElement($n,{type:"primary",icon:t.createElement(ht,null),onClick:()=>{s.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"container line"},t.createElement(rp,{ref:c,size:a,columns:k,dataSource:I,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>L(e),onDataChange:e=>{R(e)}},t.createElement($n,{type:"primary",icon:t.createElement(ht,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:m,placeholder:Xt("qm.table.groupSummary.configText"),disabled:A,onChange:e=>{const{value:t}=e.target;f(t)}}),t.createElement($n,{type:"primary",disabled:!m||A,style:{marginLeft:"10px"},onClick:()=>Tn(void 0,void 0,void 0,(function*(){if(!y)return en("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ga(),t=[...p,{text:m,value:e,list:{group:w.filter((e=>!!e.group)),summary:I.filter((e=>!!e.summary))}}];h(t),v(e),f(""),yield Kt.setItem(y,t),yield D(y,t)}))},Xt("qm.table.groupSummary.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Hd.rowHeightMaps[a]}px`}},t.createElement("span",null,Xt("qm.table.groupSummary.savedSetting"))),t.createElement("ul",null,p.map((e=>t.createElement("li",{key:e.value,className:Fe({selected:e.value===g}),title:e.text,onClick:()=>{return t=e.value,void v(t!==g?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:Xt("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Tn(void 0,void 0,void 0,(function*(){if(!n)return;const e=p.filter((e=>e.value!==n));h(e),n===g&&v(""),yield Kt.setItem(y,e),yield D(y,e)}))}},t.createElement(ut,null))))),!p.length&&t.createElement("div",{style:{padding:xd}},t.createElement(Fi,null)))))),t.createElement(da,M,t.createElement(yu,{columns:b,group:w,summary:I})),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>n(),style:{marginRight:8}},Xt("qm.table.groupSummary.closeButton")),t.createElement($n,{type:"primary",disabled:A,onClick:()=>(P(),void u(!0))},Xt("qm.table.groupSummary.confirmButton"))))},xu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,[i,a]=t.useState(!1),l=()=>{a(!0)};t.useImperativeHandle(n,(()=>({clickHandle:l})));const o=jn("table"),s={visible:i,title:Xt("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${o}-group-summary`,title:Xt("qm.table.groupSummary.text"),onClick:()=>l()},t.createElement("i",{className:"svgicon icon"},t.createElement(mt,null))),t.createElement(da,s,t.createElement(bu,{onClose:()=>a(!1)})))}));xu.displayName="GroupSummary";const Eu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Bt),{tableRef:i,$size:a,flattenColumns:l,setSuperFilters:o,clearTableFilter:s}=t.useContext(vd),{uniqueKey:c}=i.current.props,d=t.useRef(null),[u,p]=t.useState([]),[h,m]=t.useState([]),[f,g]=t.useState(""),[v,y]=t.useState("");bi((()=>{p(v?h.find((e=>e.value===v)).list:_()||[])}),[v]),t.useEffect((()=>{H()}),[]);const b=t.useMemo((()=>c?`superSearch_${c}`:""),[c]),x=t.useMemo((()=>l.filter((e=>!!e.filter))),[l]),E=Qa(u),S=t.useMemo((()=>!(E&&Ca(E))),[E]),w=t.useMemo((()=>!!u.length&&S),[u,S]),C=[{value:"and",text:Xt("qm.table.highSearch.andText")},{value:"or",text:Xt("qm.table.highSearch.orText")}],T=l.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:Xa(e.title)}))),N=e=>["in","nin"].includes(e),I=(e,t)=>{let n;switch(e){case"number":n="number";break;case"date":n="date";break;case"checkbox":case"radio":n=t?"select-multiple":"select";break;default:n="text"}return n},R=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:Xt("qm.table.highSearch.gtText")},{value:"<",text:Xt("qm.table.highSearch.ltText")},{value:">=",text:Xt("qm.table.highSearch.gteText")},{value:"<=",text:Xt("qm.table.highSearch.lteText")},{value:"==",text:Xt("qm.table.highSearch.eqText")},{value:"!=",text:Xt("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:Xt("qm.table.highSearch.inText")},{value:"nin",text:Xt("qm.table.highSearch.ninText")},{value:"==",text:Xt("qm.table.highSearch.eqText")},{value:"!=",text:Xt("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:Xt("qm.table.highSearch.likeText")},{value:"==",text:Xt("qm.table.highSearch.eqText")},{value:"!=",text:Xt("qm.table.highSearch.neqText")}]}return t},[k,L]=t.useState([{title:Xt("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement($n,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(n)}},Xt("qm.table.highSearch.removeText")))},{title:Xt("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:Xt("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:T,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:Xt("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,r;const i=Object.values(t)[0],a=null===(n=x.find((e=>e.dataIndex===i)))||void 0===n?void 0:n.filter.type,l=R(a);e.fieldType=a,e.expression=i?null===(r=l[0])||void 0===r?void 0:r.value:"",e.condition=N(e.expression)?[]:"",i||(e.bracketLeft=e.bracketRight="")}})},{title:Xt("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:Xt("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=x.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:R(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=N(e.expression)?[]:""}}}},{title:Xt("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,r;const i=x.find((t=>t.dataIndex===e.fieldName)),a=null==i?void 0:i.filter.type,l=null!==(r=null!==(n=null===(t=null==i?void 0:i.filter)||void 0===t?void 0:t.items)&&void 0!==n?n:null==i?void 0:i.dictItems)&&void 0!==r?r:[];return{type:I(a,N(e.expression)),editable:!0,items:l,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:Xt("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:Xt("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:C,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),A=()=>{s(),o(u.map((e=>Hn(e,["index","pageIndex"])))),P(),n()},P=()=>{b&&sessionStorage.setItem(b,JSON.stringify(u.filter((e=>!!e.fieldName))))},_=()=>{if(!b)return;const e=sessionStorage.getItem(b);return e?JSON.parse(e):null},H=()=>Tn(void 0,void 0,void 0,(function*(){if(!b)return;const e=_();e&&p(e);let t=yield Kt.getItem(b);t||(t=yield F(b),Array.isArray(t)&&(yield Kt.setItem(b,t))),Array.isArray(t)&&t.length&&(m(t),!e&&y(t[0].value))})),F=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),$=jn("table");return t.createElement("div",{className:`${$}-super-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement(rp,{ref:d,size:a,columns:k,dataSource:u,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>L(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(n)&&("bracketLeft"===n&&(e[n]=e[n]?"":"("),"bracketRight"===n&&(e[n]=e[n]?"":")"),p([...u]))},onDataChange:e=>{p(e)}},t.createElement($n,{type:"primary",icon:t.createElement(ht,null),onClick:()=>{d.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Hd.highSearch.showSQL&&E&&t.createElement("code",{className:"lang-js"},E)),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:f,placeholder:Xt("qm.table.highSearch.configText"),disabled:S,onChange:e=>{const{value:t}=e.target;g(t)}}),t.createElement($n,{type:"primary",disabled:!f||S,style:{marginLeft:"10px"},onClick:()=>Tn(void 0,void 0,void 0,(function*(){if(!b)return en("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ga(),t=[...h,{text:f,value:e,list:u.filter((e=>!!e.fieldName))}];m(t),y(e),g(""),yield Kt.setItem(b,t),yield D(b,t)}))},Xt("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Hd.rowHeightMaps[a]}px`}},t.createElement("span",null,Xt("qm.table.highSearch.savedSetting"))),t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.value,className:Fe({selected:e.value===v}),title:e.text,onClick:()=>{return t=e.value,void y(t!==v?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:Xt("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Tn(void 0,void 0,void 0,(function*(){if(!n)return;const e=h.filter((e=>e.value!==n));m(e),n===v&&y(""),yield Kt.setItem(b,e),yield D(b,e)}))}},t.createElement(ut,null))))),!h.length&&t.createElement("div",{style:{padding:xd}},t.createElement(Fi,null)))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>n(),style:{marginRight:8}},Xt("qm.table.highSearch.closeButton")),t.createElement($n,{type:"primary",disabled:w,onClick:()=>A()},Xt("qm.table.highSearch.searchButton"))))},Su=t.forwardRef(((e,n)=>{const{open:r=!0}=e,[i,a]=t.useState(!1),l=()=>{a(!0)};t.useImperativeHandle(n,(()=>({clickHandle:l})));const o=jn("table"),s={visible:i,title:Xt("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${o}-super-search`,title:Xt("qm.table.highSearch.text"),onClick:()=>l()},t.createElement("i",{className:"svgicon icon"},t.createElement(ft,null))),t.createElement(da,s,t.createElement(Eu,{onClose:()=>a(!1)})))}));Su.displayName="SuperSearch";const wu=t.forwardRef(((e,n)=>{const{tableColumns:r,showFullScreen:i,showReload:a,showPrint:l,showImport:o,showExport:s,showClipboard:c,showCollection:d,showFastSearch:u,showSuperSearch:p,showGroupSummary:h,showToolBox:m}=e,{global:f}=t.useContext(Bt),{tableRef:g,isFullScreen:v,$size:y}=t.useContext(vd),{uniqueKey:b,exportExcel:x}=g.current.props,E=t.useRef(null),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),T=t.useRef(null),N=t.useRef(null),I=t.useRef(null),R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),L=t.useRef(!1),A=t.useMemo((()=>b?`toolBox_${b}`:""),[b]),[P,_]=t.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),H={fullScreen:i,reload:a,print:l,import:o,export:s&&!(null==x?void 0:x.hideIcon),clipboard:c,collection:d,fastSearch:u,superSearch:p,groupSummary:h},[F,D]=t.useState(!1);bi((()=>{L.current&&(j(),L.current=!1)}),[P]),t.useEffect((()=>{$()}),[]),t.useImperativeHandle(n,(()=>({exportHandle:()=>{if(!T.current)return en("Table","执行导出需要配置 `exportExcel` 参数");T.current.clickHandle()}})));const $=()=>{if(!A||!m)return;const e=JSON.parse(localStorage.getItem(A));e||V(A).then((e=>{e&&(_(Object.assign({},P,e)),localStorage.setItem(A,JSON.stringify(e)))})).catch((()=>{})),e&&_(Object.assign({},P,e))},j=()=>{if(!A||!m)return;const e={};for(const t in P)P[t]&&(e[t]=P[t]);localStorage.setItem(A,JSON.stringify(e)),K(A,e)},V=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==f?void 0:f.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),K=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==f?void 0:f.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),z=e=>Tn(void 0,void 0,void 0,(function*(){D(!1),yield Ln(100),e.current.clickHandle()})),W=(e,t)=>{L.current=!0,_(Object.assign({},P,{[t]:e}))},B=jn("table"),U={"top-toolbox__popper":!0,[`${B}--lg`]:"large"===y,[`${B}--sm`]:"small"===y};return t.createElement(t.Fragment,null,i&&t.createElement(Ud,{ref:E,isFullScreen:v,open:!m||P.fullScreen}),a&&t.createElement(Gd,{ref:S,open:!m||P.reload}),l&&t.createElement(Xd,{ref:w,tableColumns:r,open:!m||P.print}),o&&t.createElement(su,{ref:C,tableColumns:r,open:!m||P.import}),s&&t.createElement(uu,{ref:T,tableColumns:r,open:(!m||P.export)&&!(null==x?void 0:x.hideIcon)}),c&&t.createElement(hu,{ref:N,open:!m||P.clipboard}),d&&t.createElement(fu,{ref:I,columns:r,open:!m||P.collection}),u&&t.createElement(vu,{ref:R,open:!m||P.fastSearch}),h&&t.createElement(xu,{ref:O,open:!m||P.groupSummary}),p&&t.createElement(Su,{ref:k,open:!m||P.superSearch}),m&&t.createElement(q,{open:F,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.fullScreen,style:{marginRight:6},onChange:e=>W(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.screen.full"))),onClick:()=>z(E)},{key:"reload",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.reload,style:{marginRight:6},onChange:e=>W(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.refresh.text"))),onClick:()=>z(S)},{key:"print",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.print,style:{marginRight:6},onChange:e=>W(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.print.text"))),onClick:()=>z(w)},{key:"import",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.import,style:{marginRight:6},onChange:e=>W(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.import.textNoSpace"))),onClick:()=>z(C)},{key:"export",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.export,style:{marginRight:6},onChange:e=>W(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.export.textNoSpace"))),onClick:()=>z(T)},{key:"clipboard",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.clipboard,style:{marginRight:6},onChange:e=>W(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.clipboard.textNoSpace"))),onClick:()=>z(N)},{key:"collection",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.collection,style:{marginRight:6},onChange:e=>W(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.selectCollection.text"))),onClick:()=>z(I)},{key:"fastSearch",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.fastSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.fastSearch.text"))),onClick:()=>z(R)},{key:"groupSummary",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.groupSummary,style:{marginRight:6},onChange:e=>W(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.groupSummary.text"))),onClick:()=>z(O)},{key:"superSearch",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:P.superSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,Xt("qm.table.highSearch.text"))),onClick:()=>z(k)}];return t.createElement(Q,{items:e.filter((e=>H[e.key]))})})(),overlayClassName:Fe(U),overlayStyle:{minWidth:120},onOpenChange:e=>{D(e)}},t.createElement("span",{className:`${B}-toolbox`,title:Xt("qm.table.toolbox.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(gt,null)))))}));wu.displayName="ToolBox";const Cu=(e,t)=>e.map((e=>(e.children&&(e.children=Cu(e.children,t)),t(e)))),Tu=t.forwardRef(((e,n)=>{const{columns:r}=e,{global:i}=t.useContext(Bt),{tableRef:a,$size:l}=t.useContext(vd),{showColumnDefine:o,uniqueKey:s,onlyShowIcon:c,columnsChange:d}=a.current.props,u=t.useRef([]),[p,h]=t.useState(!1),m=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),f=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),g=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),v=t.useMemo((()=>s?`table_${s}`:""),[s]);bi((()=>{x(r)}),[r]),t.useLayoutEffect((()=>{E()}),[]),t.useImperativeHandle(n,(()=>({initialHandler:E})));const y=()=>{if(!v)return;const e=JSON.parse(localStorage.getItem(v));var t;if(e||(t=v,Tn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(v,JSON.stringify(e)),E()):(null==i?void 0:i.getComponentConfigApi)&&x(r)})).catch((()=>{})),!e)return;return ye(Ra(e).map((e=>e.dataIndex)),Ra(r).map((e=>e.dataIndex))).length>0?Cu(r,(t=>{const n=ka(e,t.dataIndex);return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Cu(e,(e=>{const t=ka(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},b=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=b(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),x=e=>{if(!v)return;const t=b(e),n=JSON.parse(localStorage.getItem(v));var r,l;a.current.columnsDefined&&!ge(t,n)&&(localStorage.setItem(v,JSON.stringify(t)),r=v,l=t,Tn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.saveComponentConfigApi;if(e)try{yield e({[r]:l})}catch(e){}})))},E=()=>{const e=y();var t;e&&(t=S(e),u.current=t,null==d||d(e))},S=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((n,r)=>{const i=n.colSpan;i>1&&e.slice(r+1,r+i).every((({colSpan:e})=>0===e))&&t.push(e.slice(r,r+i))})),t},w=()=>{const e=t=>t.map((t=>{const n=ka(r,t.dataIndex)||Fn(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==d||d(e(a.current.originColumns))},C=e=>{const t=[];e.forEach((n=>{const{colSpan:r,dataIndex:i}=n;if(0===r)return;if(1===r)return t.push(n);const a=u.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===a)return t.push(n);t.push(...u.current[a].map((({dataIndex:t},r)=>{const i=e.find((e=>e.dataIndex===t));return r>0&&(void 0!==n.hidden&&(i.hidden=n.hidden),void 0!==n.fixed?i.fixed=n.fixed:i.fixed&&delete i.fixed),i})))})),r.forEach(((e,n)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(n,0,e)})),null==d||d(t)},T=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,C(r))},N=(e,n)=>{var i;const{colSpan:a,noFixed:l}=e;if(0===a)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const o=Xa(e.title),s=["svgicon","handle",`${n}-handle`],c=t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(M,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,C(r)}}),t.createElement("i",{className:Fe(s),title:Xt("qm.table.columnFilter.draggable")},t.createElement(Ge,null)),t.createElement("span",{className:"text",title:o},o),"main"===n?t.createElement("span",{className:Fe("fixed",l?"disabled":"")},t.createElement("i",{className:"svgicon",title:Xt("qm.table.columnFilter.fixedLeft"),onClick:()=>T(e,"left")},t.createElement(vt,null)),t.createElement("i",{className:"svgicon",title:Xt("qm.table.columnFilter.fixedRight"),onClick:()=>T(e,"right")},t.createElement(yt,null))):"sub"!==n?t.createElement("span",{className:Fe("fixed",l?"disabled":"")},t.createElement("i",{className:"svgicon",title:Xt("qm.table.columnFilter.cancelFixed"),onClick:()=>T(e)},t.createElement(ut,null))):null);return!e.hidden&&(null===(i=e.children)||void 0===i?void 0:i.length)?t.createElement(J,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:I(e.children,e.dataIndex)},c):c},I=(e,n)=>t.createElement("div",{className:"column-filter--wrap"},t.createElement(Vt,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:t=>{const i=t.map((e=>e.dataIndex)),a=e.map((e=>e.dataIndex));ge(i,a)||((e,t)=>{ka(r,t).children=e,null==d||d([...r])})(il(t),n)}},e.map((e=>N(e,"sub"))))),R=jn("table"),O={[`${R}__popper`]:!0,"column-filter__popper":!0,[`${R}--lg`]:"large"===l,[`${R}--sm`]:"small"===l},k=[`${R}-column-filter`,{selected:p}];return o?t.createElement(Ms,{action:["click"],popupVisible:p,popup:t.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"reset"},t.createElement($n,{type:"text",size:"small",onClick:w},Xt("qm.table.columnFilter.reset"))),t.createElement("div",{className:"left"},t.createElement(Vt,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:m,setList:e=>{const t=e.map((e=>e.dataIndex)),n=m.map((e=>e.dataIndex));ge(t,n)||C([...il(e),...g,...f])}},m.map((e=>N(e,"left"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"main"},t.createElement(Vt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),n=g.map((e=>e.dataIndex));ge(t,n)||C([...m,...il(e),...f])}},g.map((e=>N(e,"main"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"right"},t.createElement(Vt,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:f,setList:e=>{const t=e.map((e=>e.dataIndex)),n=f.map((e=>e.dataIndex));ge(t,n)||C([...m,...g,...il(e)])}},f.map((e=>N(e,"right")))))),popupClassName:Fe(O),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{h(e)},builtinPlacements:Nd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Fe(k),title:c?Xt("qm.table.columnFilter.text"):void 0},t.createElement("i",{className:"svgicon icon"},t.createElement(st,null)),!c&&t.createElement("span",null,Xt("qm.table.columnFilter.text")))):null}));Tu.displayName="ColumnFilter";const Nu=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"})),Iu=e=>{const{column:n,filters:r}=e,{$size:i,setFilters:a,clearSuperFilters:l}=t.useContext(vd),o=t.useRef(null),s=t.useRef(null),c=t.useRef(null),[d,u]=t.useState(!1),[p,h]=t.useState(!1),[m,f]=t.useState({}),g=t.useMemo((()=>{const{dataIndex:e,filter:t}=n;return`${e}|${t.type}`}),[n]),v=t.useMemo((()=>{let e=!1;for(const t in r[g])if(!_n(r[g][t])||p){e=!0;break}return e}),[g,r,p]);t.useLayoutEffect((()=>{d&&setTimeout((()=>y()),20)}),[d]),t.useEffect((()=>{var e;ge(m[g],r[g])||f({[g]:r[g]||{}}),h(""===(null===(e=r[g])||void 0===e?void 0:e["=="]))}),[r]);const y=()=>{switch(n.filter.type){case"text":o.current.focus();break;case"number":s.current.focus();break;case"textarea":c.current.focus()}},b=e=>{e&&f(e),l(),a((e=>{for(const t in e){for(const n in e[t])if(_n(e[t][n])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][n])continue;delete e[t][n]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},r),m),e))),u(!1)},x={text:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O,{ref:o,size:i,placeholder:Xt("qm.table.filter.searchText",{text:Xa(e.title)}),style:{width:"180px"},value:null!==(r=null===(n=m[g])||void 0===n?void 0:n.like)&&void 0!==r?r:"",disabled:p,onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&b()}}),t.createElement("div",{style:{marginTop:8}},t.createElement(M,{checked:p,onChange:e=>{const{checked:t}=e.target,n=t?"":null;f((e=>Object.assign({},e,{[g]:{"==":n,like:null}}))),h(t)}},Xt("qm.table.filter.nullValue"))))},textarea:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O.TextArea,{ref:c,size:i,placeholder:Xt("qm.table.filter.searchAreaText",{text:Xa(e.title)}),style:{width:"220px"},value:null!==(r=null===(n=m[g])||void 0===n?void 0:n.likes)&&void 0!==r?r:"",disabled:p,onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),b())}}),t.createElement("div",{style:{marginTop:8}},t.createElement(M,{checked:p,onChange:e=>{const{checked:t}=e.target,n=t?"":null;f((e=>Object.assign({},e,{[g]:{"==":n,like:null}}))),h(t)}},Xt("qm.table.filter.nullValue"))))},number:e=>{const n=e=>{var t,n;return{value:null!==(n=null===(t=m[g])||void 0===t?void 0:t[e])&&void 0!==n?n:"",size:i,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||f((n=>Object.assign({},n,{[g]:Object.assign({},n[g],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&b()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(j,vn({ref:s},n(">"),{placeholder:Xt("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(j,vn({},n("<"),{placeholder:Xt("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(j,vn({},n("=="),{placeholder:Xt("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(j,vn({},n("!="),{placeholder:Xt("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const n=e=>{var t;return{value:Ba(null===(t=m[g])||void 0===t?void 0:t[e],wd),format:wd,size:i,onChange:t=>{f((n=>Object.assign({},n,{[g]:Object.assign({},n[g],{[e]:Ua(t,wd)})})))},onKeyDown:e=>{13===e.keyCode&&b()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(gn,vn({},n(">"),{placeholder:Xt("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(gn,vn({},n("<"),{placeholder:Xt("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(gn,vn({},n("=="),{placeholder:Xt("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(gn,vn({},n("!="),{placeholder:Xt("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var n;const{filter:r,dictItems:i=[]}=e,a=r.items||i;return t.createElement("ul",null,t.createElement(K.Group,{style:{width:"100%"},value:null===(n=m[g])||void 0===n?void 0:n["=="],onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{"==":t}})))}},a.map((e=>t.createElement("li",{key:e.value},t.createElement(K,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var n;const{filter:r,dictItems:i=[]}=e,a=r.items||i;return t.createElement("ul",null,t.createElement(M.Group,{style:{width:"100%"},value:null===(n=m[g])||void 0===n?void 0:n.in,onChange:e=>{f((t=>Object.assign({},t,{[g]:{in:e}})))}},a.map((e=>t.createElement("li",{key:e.value},t.createElement(M,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var n;const{filter:r,dictItems:i=[]}=e,a=r.items||i;return t.createElement("div",{style:Object.assign({height:200},r.style)},t.createElement(gd,{multiple:!0,value:(null===(n=m[g])||void 0===n?void 0:n.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));f((e=>Object.assign({},e,{[g]:{in:t}})))}}))}},E=()=>t.createElement(N,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t.createElement($n,{size:i,onClick:()=>(b({[g]:{}}),void h(!1))},Xt("qm.table.filter.reset")),t.createElement($n,{type:"primary",size:i,onClick:()=>b()},Xt("qm.table.filter.search"))),S=jn("table"),w={"head-filter__popper":!0,[`${S}--lg`]:"large"===i,[`${S}--sm`]:"small"===i},C=["cell--filter",{selected:d,actived:v}];return t.createElement(Ms,{action:["click"],popupVisible:d,popup:(()=>{const e=n.filter.type,r=x[e];return r?t.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t.createElement("div",null,r(n)),E()):(en("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:Fe(w),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{u(e)},builtinPlacements:Nd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("div",{className:Fe(C),title:Xt("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t.createElement("span",{className:"svgicon icon"},t.createElement(Nu,null))))},Ru=e=>{const{column:n}=e,{tableRef:r,bordered:i}=t.useContext(vd),{columns:a,resizable:l,columnsChange:o=On}=r.current.props,s=t.useMemo((()=>Aa(n)),[n]),c={resizable:!0,"is--line":l&&!i};return t.createElement("div",{className:Fe(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n}=r.current,i=n.$resizableBar,l=t.offsetWidth/2,c=e.clientX,d=Da(t,n.$table).left-n.$tableBody.parentNode.parentNode.scrollLeft+l;n.$table.classList.add("c--resize"),i.style.left=`${d}px`,i.style.display="block";const u=s.width||s.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,n=u+t;n<(s.minWidth||Hd.defaultColumnWidth)||(p=Math.floor(n),i.style.left=`${t+d}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),i.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(ka(a,s.dataIndex).width=p,o([...a]))},!1}})},Ou=e=>{const{selectionKeys:n}=e,{tableRef:r,getRowKey:i,fetchParams:a,createWebPageData:l,setSelectionKeysEffect:o,setInvalidRowKeys:s,setSpinning:c,isFetch:d,isWebPagination:u}=t.useContext(vd),{rowSelection:p}=r.current.props,{fetchAllRowKeys:h,selectAllOnCurrentPage:m,filterable:f,onSelectAll:g}=p,v=t.useRef([]),y=t.useMemo((()=>d&&!!h),[d,h]),b=t.useMemo((()=>!y&&!!m),[y,m]),x=t.useMemo((()=>(null==f||f)&&!b),[f,b]),E=()=>u?l():r.current.tableFullData,S=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>i(e,e.index)))},w=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:n}=p;if(y)return v.current.length?v.current:_e(t,S());if(!b)return n?t.filter((t=>!n(e.get(t)))):t;const a=n?E().filter((e=>!n(e))).map((e=>i(e,e.index))):E().map((e=>i(e,e.index)));return _e(a,S())})(),C=n.filter((e=>!w.includes(e))),T=n.length-C.length,N=T>0&&T<w.length,I=!!T&&T===w.length;s(C);const R=()=>Tn(void 0,void 0,void 0,(function*(){var e;const t=h;let n=[];c(!0);try{const r=yield t.api(a);if(200===r.code){n=Array.isArray(r.data)?r.data:null!==(e=me(r.data,t.dataKey))&&void 0!==e?e:[];const{disabled:a}=p;a&&(n=ye(n,E().filter((e=>a(e))).map((e=>i(e,e.index))))),v.current=n}}catch(e){}return c(!1),n})),O=e=>Tn(void 0,void 0,void 0,(function*(){let t=[];t=y?e?yield R():[]:e?w.slice(0):[],t=[...new Set([...t,...C])],o(t),null==g||g(e,t)})),k=()=>{const e=[{key:1,label:Xt("qm.table.selection.all"),onClick:()=>{O(!0)}},{key:2,label:Xt("qm.table.selection.invert"),onClick:()=>Tn(void 0,void 0,void 0,(function*(){let e=[];e=ye(n,y?yield R():w),e=[...new Set([...e,...C])],o(e)}))},{key:3,label:Xt("qm.table.selection.clear"),onClick:()=>{O(!1)}}];return t.createElement(Q,{items:e})};return t.createElement("div",{className:"cell--selection"},t.createElement(M,{checked:I,indeterminate:N,disabled:!w.length,onChange:e=>O(e.target.checked)}),x&&t.createElement(q,{overlayClassName:"all-selection__popper",dropdownRender:()=>k()},t.createElement($e,{className:"svgicon icon"})),b&&t.createElement(Y,{placement:"top",title:Xt("qm.table.selection.currentPage")},t.createElement(bt,{className:"info"})))},ku=e=>{const{style:n}=e,{tableRef:r,isTreeTable:i,setRowExpandedKeys:a}=t.useContext(vd),{expandable:l}=r.current.props,[o,s]=t.useState((null==l?void 0:l.defaultExpandAllRows)||!1);bi((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;a(o?e.filter((e=>!(i&&t.includes(e)))):[])}),[o]);const c={[`${jn("expand")}--icon`]:!0,expanded:o,collapsed:!o};return t.createElement("span",{className:Fe(c),title:"",onClick:e=>{e.stopPropagation(),s(!o)},style:n})},Lu=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),Au=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),Pu=e=>{const{tableColumns:n,sorter:r,filters:i}=e,{tableRef:a,layout:l,scrollY:o,flattenColumns:s,superFilters:c,selectionKeys:d,rightFixedColumns:u,treeExpandIndex:p,isFetch:h,isTreeTable:m,isGroupSubtotal:f,tableChange:g,setSorter:v,setElementStore:y,resetTableScroll:b,getStickyLeft:x,getStickyRight:E,createGroupData:S,createTableFullData:w}=t.useContext(vd),{ellipsis:C,resizable:T,multipleSort:N,rowSelection:I,expandable:R}=a.current.props,[O,k]=Hd.sortDirections,{tableOriginData:L}=a.current,A=t.useRef(null),P=t.useMemo((()=>L.some((e=>Array.isArray(e.children)))),[L]),_=t.useMemo((()=>!h),[h]),H=t.useMemo((()=>!h),[h]),F=t.useMemo((()=>!(null==R?void 0:R.hideExpandAll)),[R]),D=t.useMemo((()=>!!I&&(h?!(!I.selectAllOnCurrentPage&&!I.fetchAllRowKeys):!I.hideSelectAll)),[h,I]);bi((()=>{z(),g(),b()}),[r]),bi((()=>{U(),g(),b()}),[i]),bi((()=>{U(),g(),b()}),[c]),t.useEffect((()=>{!_n(r)&&An((()=>z())),!_n(i)&&An((()=>U()))}),[]),t.useLayoutEffect((()=>{$()}),[]);const $=()=>{y("$header",A.current)},M=(e,n,i)=>{var s,c,d;const{isIE:u}=a.current,{gutterWidth:p}=l,{dataIndex:h,colSpan:m,rowSpan:f,fixed:g,align:v,theadAlign:y,theadClassName:b="",sorter:S,filter:w,required:N,headRender:I}=e;if(0===m)return null;const R=y||v,O=["header--column",{"col--ellipsis":null!==(s=e.ellipsis)&&void 0!==s?s:C,"col--center":"center"===R,"col--right":"right"===R,"column--required":!!N,"column-has-sorter":S,"column-has-filter":w,"column--sort":!!r[h],"cell-fix-left":!u&&"left"===g,"cell-fix-right":!u&&"right"===g,"cell-fix-left-last":!u&&"left"===g&&!(null===(c=i[n+(null!=m?m:1)])||void 0===c?void 0:c.fixed),"cell-fix-right-first":!u&&"right"===g&&!(null===(d=i[n-1])||void 0===d?void 0:d.fixed),[b]:!!b}],k=u?null:{left:"left"===g?`${x(h)}px`:"",right:"right"===g?`${E(h,"thead")+(o?p:0)}px`:""},L=T&&![Hd.expandableColumn,Hd.selectionColumn].includes(h);return t.createElement("th",{key:h,className:Fe(O),colSpan:m,rowSpan:f,style:Object.assign({},k),onClick:t=>K(t,e)},t.createElement("div",{className:"cell--wrapper"},I?t.createElement("div",{className:"cell--text cell"},I(e,a.current.tableFullData)):t.createElement(t.Fragment,null,t.createElement("div",{className:"cell--text"},q(e)),w?V(e):null)),L&&t.createElement(Ru,{column:e}))},q=e=>{const{dataIndex:n,type:i,sorter:a,title:l,description:o}=e;if(n===Hd.selectionColumn&&"checkbox"===i){if("checkbox"===i)return t.createElement("div",{className:"cell"},D?t.createElement(Ou,{selectionKeys:d}):Xt("qm.table.config.selectionText"));if("radio"===i)return t.createElement("div",{className:"cell"},l)}const s=[];return s.push(t.createElement("div",{key:0,className:"cell",title:Xa(l)},m&&n===p&&F?t.createElement(ku,null):null,n===Hd.expandableColumn&&F?t.createElement(ku,null):l)),o&&s.push(t.createElement(Y,{key:1,placement:"top",title:o},t.createElement(bt,{className:"tip"}))),a&&s.push(j(r[n])),s},j=e=>{const n=["svgicon cell--sorter__asc",{actived:e===O}],r=["svgicon cell--sorter__desc",{actived:e===k}];return t.createElement("div",{key:2,className:"cell--sorter",title:Xt("qm.table.sorter.text")},t.createElement("span",{className:Fe(n)},t.createElement(Lu,null)),t.createElement("span",{className:Fe(r)},t.createElement(Au,null)))},V=e=>t.createElement(Iu,{column:e,filters:i}),K=(e,t)=>{const{sorter:n,dataIndex:i}=t;if(n){const e=r[i],t=e?e===k?null:k:O;N?(delete r[i],v(Object.assign({},r,{[i]:t}))):v(Object.assign({},{[i]:t}))}},z=()=>{_&&W()},W=e=>{const t=He(r,(e=>null!==e));for(const e in t){const n=s.find((t=>t.dataIndex===e));n?B(n,t[e]):delete t[e]}e||Object.keys(t).length||B({dataIndex:"index"},O)},B=(e,t)=>{const{tableFullData:n}=a.current,{dataIndex:r,sorter:i}=e,l=(e,n)=>{const i=qa(e,r),a=qa(n,r);return Number.isNaN(i-a)?t===O?i.toString().localeCompare(a.toString()):a.toString().localeCompare(i.toString()):t===O?i-a:a-i},o=f?S(Za(n).sort("function"==typeof i?i:l)):n.sort("function"==typeof i?i:l).slice(0);w(o)},U=()=>{H&&G()},G=()=>{const e=c.length?Qa(c):Qa(i),t=""!==e?f?S(Ta(Za(L),e,P)):Ta(L,e,P):L;w(t),W(!0)},X=Fa(n),Z=jn("table"),{tableBodyWidth:Q}=l;return t.createElement("div",{ref:A,className:`${Z}--header-wrapper`},t.createElement("table",{className:`${Z}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},(()=>{const{gutterWidth:e}=l;return t.createElement("colgroup",null,s.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})})),o&&t.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t.createElement("thead",null,(e=>{const{isIE:n}=a.current,r=["gutter",{"cell-fix-right":!!u.length}],i=n?null:{right:u.length?0:""};return e.map(((e,n)=>t.createElement("tr",{key:n,className:"header--row"},e.map(((t,n)=>M(t,n,e))),o&&t.createElement("th",{className:Fe(r),style:Object.assign({},i)}))))})(X))))},_u=t.createContext([]),Hu=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Fu=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),Du=(e,t)=>{var n;const r=e.target;return!("button"in e&&e.button>0)&&(!(r&&!Hu(r).contains(r))&&!(null===(n=t.current)||void 0===n?void 0:n.contains(r)))};function $u({ref:t,handler:n,enabled:r=!0,omitClassNames:i=[]}){const a=Rd(n),l=e.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});e.useEffect((()=>{if(!r)return;const e=e=>{Du(e,t)&&(l.current.isPointerDown=!0)},o=e=>{l.current.ignoreEmulatedMouseEvents?l.current.ignoreEmulatedMouseEvents=!1:n&&l.current.isPointerDown&&Du(e,t)&&Fu(e,i)&&(l.current.isPointerDown=!1,a(e))},s=e=>{l.current.ignoreEmulatedMouseEvents=!0,n&&l.current.isPointerDown&&Du(e,t)&&Fu(e,i)&&(l.current.isPointerDown=!1,a(e))},c=Hu(t.current);return c.addEventListener("mousedown",e,!0),c.addEventListener("mouseup",o,!0),c.addEventListener("touchstart",e,!0),c.addEventListener("touchend",s,!0),()=>{c.removeEventListener("mousedown",e,!0),c.removeEventListener("mouseup",o,!0),c.removeEventListener("touchstart",e,!0),c.removeEventListener("touchend",s,!0)}}),[n,t,a,l,r])}function Mu(){const[,t]=e.useReducer((e=>e+1),0);return t}const qu=e=>{const{selectionKeys:n,column:r,record:i,rowKey:a}=e,{tableRef:l,isTreeTable:o,getAllChildRowKeys:s}=t.useContext(vd),{rowSelection:c}=l.current.props,d=t.useMemo((()=>r.type||""),[r.type]),u=e=>{var t,r;const i=null===(t=c.checkStrictly)||void 0===t||t;if(!o||i)return!1;const a=_a(l.current.deriveRowKeys,e);return((e,t)=>{const n=new Set(t);let r=!1,i=!1;for(const t of e)if(n.has(t)?r=!0:i=!0,r&&i)break;return r&&i})(s(null!==(r=null==a?void 0:a.children)&&void 0!==r?r:[]),n)};return"radio"===d?(()=>{const e=c.disabled,r=null==e?void 0:e(i),l=!r&&n[0]===a;return t.createElement(K,{checked:l,disabled:r})})():(()=>{const e=c.disabled,r=null==e?void 0:e(i),l=!!n.includes(a);return t.createElement(M,{checked:l,indeterminate:u(a),disabled:r})})()},ju=e=>{const{record:n,rowKey:r,style:i}=e,{tableRef:a,rowExpandedKeys:l,setRowExpandedKeys:o}=t.useContext(vd),{expandable:s={}}=a.current.props,[c]=t.useState("function"==typeof s.rowExpandable&&!s.rowExpandable(n)),d=t.useMemo((()=>l.includes(r)),[l,r]);bi((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,n)}),[d]);const u={[`${jn("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t.createElement("span",{className:Fe(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?l.filter((e=>e!==r)):[...l,r];o(t)},style:i})},Vu=t.forwardRef(((e,n)=>{const{size:r,defaultValue:i,value:a,min:l,max:o,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,stringMode:h,allowClear:m,readOnly:f,disabled:g,formatter:v=(e=>e.toString()),parser:y=(e=>e),onFocus:b}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>o&&(t=o.toString()),t&&Number(t)<l&&(t=l.toString()),p>=0&&""!==t&&(t=new Ft(t).toFixed(p)),t},E=void 0!==a,[S,w]=t.useState(null!=i?i:""),C=v(E?a:S),T=y(C);bi((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,T)}),[S]);return t.createElement(O,{ref:n,size:r,value:C,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:m,readOnly:f,disabled:g,onChange:t=>{const n=y(t.target.value);let r=/^-?\d*(\.\d*)?$/.test(n)||""===n||"-"===n;if(0===p&&n.includes(".")&&(r=!1),l>=0&&n.startsWith("-")&&(r=!1),r){if(!h&&(Number(n)>Number.MAX_SAFE_INTEGER||Number(n)<Number.MIN_SAFE_INTEGER))return;(t=>{var n;E?null===(n=e.onChange)||void 0===n||n.call(e,t):w(t)})(n)}},onFocus:b,onBlur:()=>{var t;const n=x(T);null===(t=e.onBlur)||void 0===t||t.call(e,n,T)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(T),T))}})}));Vu.displayName="InputNumber";const{Search:Ku}=O,zu=t.forwardRef(((e,n)=>{var r,i,a,l,o,s;const{column:c,record:d,rowKey:u,columnKey:p}=e,{tableRef:h,tableBodyRef:m,$size:f,flattenColumns:g,updateTableData:v,doFieldValidate:y,dataChange:b}=t.useContext(vd),x=t.useContext(_u),E="table-editable__popper",S=Mu(),{store:w,fieldAuth:T}=h.current,N=(null===(r=c.editRender)||void 0===r?void 0:r.call(c,d,c))||{},I=t.useRef(null),R=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(!1),_=t.useRef({}),H=t.useRef({}),F=t.useRef([]),[D,q]=t.useState(!1),[j,V]=t.useState(!1),[K,W]=t.useState(!1),[B,U]=t.useState(N.items||[]),[G,Y]=t.useState(),X=(N.editable||ge(x,[u,p]))&&!N.disabled&&!(null===(i=T[p])||void 0===i?void 0:i.disabled),Z=`${u}|${p}`,Q=2===x.length?`${x[0]}|${x[1]}`:"",J=![...w.state.required,...w.state.validate].some((({x:e,y:t})=>e===u&&t===p)),ee=(null===(a=w.state.required.find((({x:e,y:t})=>e===u&&t===p)))||void 0===a?void 0:a.text)||"",te=(null===(l=w.state.validate.find((({x:e,y:t})=>e===u&&t===p)))||void 0===l?void 0:l.text)||"",ne=w.state.edited.some((({x:e,y:t})=>e===u&&t===p)),re=X||!J||D||K||j,ie=!!(null===(o=N.helper)||void 0===o?void 0:o.combinedDataIndex)&&("search-helper"===N.type||"tree-helper"===N.type),ae=null===(s=N.type)||void 0===s?void 0:s.endsWith("multiple");t.useLayoutEffect((()=>{re&&Q===Z&&de()}),[x]),t.useLayoutEffect((()=>{const{items:e}=N;ae&&e&&ce(e.map((e=>({[H.current.valueKey]:e.value,[H.current.textKey]:e.text}))))}),[]);const le=()=>{v(),b()},oe=(e,t)=>{q(e),null==t||t()},ce=e=>{F.current=e},de=()=>{var e,t,n,r;const{type:i}=N;switch(i){case"text":null===(e=R.current)||void 0===e||e.focus();break;case"number":null===(t=k.current)||void 0===t||t.select();break;case"search-helper":null===(n=L.current)||void 0===n||n.focus();break;case"tree-helper":null===(r=A.current)||void 0===r||r.focus()}};t.useImperativeHandle(n,(()=>({focus:de})));const ue=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},pe=(e,t,n)=>{const{cornerSign:r=!0}=N.extra||{};w.addToUpdated(e),r&&w.addToEdited({x:t,y:n})},he=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",fe={text:(e,n,r)=>{const{dataIndex:i}=n,{type:a,extra:l={},rules:o=[],onInput:s,onChange:c,onEnter:d,onBlur:h}=N,m=qa(e,i),g=Object.assign({},{minRows:1,maxRows:4},l.autoSize),v=r?{rows:g.minRows,autoSize:g}:null,b=l.password?O.Password:r?O.TextArea:O;return t.createElement(b,vn({ref:R,size:f,value:m,maxLength:l.maxLength,showCount:l.showCount},v,{autoComplete:l.password?"new-password":"off",placeholder:l.placeholder||Xt("qm.table.editable.inputPlaceholder"),allowClear:l.allowClear,readOnly:l.readOnly,disabled:l.disabled,suffix:l.suffix,onChange:t=>{var n;const r=null!==(n=t.target.value)&&void 0!==n?n:"";ja(e,i,r),y(o,r,u,p),S(),null==s||s({[Z]:r}),P.current=!0},onFocus:()=>V(!0),onBlur:t=>{var n;V(!1);const r=null!==(n=t.target.value)&&void 0!==n?n:"";P.current&&(P.current=!1,pe(e,u,p),null==c||c({[Z]:r},e),null==h||h({[Z]:r},e),le())},onKeyUp:t=>{var n;if(13===t.keyCode&&!t.shiftKey){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==d||d({[Z]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&d&&e.preventDefault()}}))},textarea:(e,t)=>fe.text(e,t,!0),number:(e,n)=>{var r;const{dataIndex:i,precision:a,formatType:l}=n,{type:o,extra:s={},rules:c=[],onInput:d,onChange:h,onEnter:m,onBlur:g}=N,v=qa(e,i);let b,x;return"finance"===l&&(b=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},x=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===l&&(b=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new Ft(e).times(100).toNumber()}`,x=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new Ft(e).times(.01).toString()),t.createElement(Vu,{ref:k,size:f,value:v,min:s.min,max:s.max,precision:a,stringMode:s.stringMode,prefix:s.prefix,suffix:null!==(r=s.suffix)&&void 0!==r?r:"percent"===l?"%":void 0,placeholder:s.placeholder||Xt("qm.table.editable.inputPlaceholder"),maxLength:s.maxLength,allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,formatter:b,parser:x,onChange:t=>{ja(e,i,t),y(c,t,u,p),S(),null==d||d({[Z]:t}),P.current=!0},onFocus:()=>V(!0),onBlur:(t,n)=>{if(V(!1),!P.current)return;P.current=!1;let r=s.stringMode?t:he(t);"percent"===l&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),ja(e,i,r),pe(e,u,p),null==h||h({[Z]:r},e),null==g||g({[Z]:r},e),le()},onEnter:(t,n)=>{let r=s.stringMode?t:he(t);"percent"===l&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),null==m||m({[Z]:r},e)}})},select:(e,n,r)=>{var i;const{dataIndex:a,dictItems:l=[]}=n,{type:o,extra:s={},rules:c=[],items:d,onChange:h,onEnter:m}=N,g=d||l,v=qa(e,a);let b=v;return t.createElement($,{mode:r?"multiple":void 0,size:f,popupClassName:E,value:v||void 0,placeholder:s.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,listHeight:s.listHeight,maxTagCount:s.collapseTags?"responsive":void 0,maxTagTextLength:s.maxTagTextLength,disabled:s.disabled,style:{width:"100%"},showSearch:null===(i=s.filterable)||void 0===i||i,filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"";return`${r}|${Ml.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{ja(e,a,t),y(c,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e),le()},onSelect:e=>{b=e},onInputKeyDown:t=>{13===t.keyCode&&An((()=>null==m?void 0:m({[Z]:b},e)))}},g.map((e=>t.createElement($.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>fe.select(e,t,!0),date:(e,n,r)=>{var i;const{dataIndex:a}=n,{type:l,extra:o={},rules:s=[],onChange:c}=N,d=r||"exactdate",h=qa(e,a);return t.createElement(gn,{size:f,popupClassName:E,value:null!==(i=Ba(h,pl[d]))&&void 0!==i?i:void 0,picker:ul[d],format:o.format,showTime:"datetime"===d,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:n}=o;return t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day")})(e),placeholder:o.placeholder,allowClear:o.allowClear,disabled:o.disabled,style:{width:"100%"},onChange:t=>{const n=Ua(t,pl[d]);ja(e,a,n),y(s,n,u,p),pe(e,u,p),null==c||c({[Z]:n},e),le()}})},datetime:(e,t)=>fe.date(e,t,"datetime"),month:(e,t)=>fe.date(e,t,"month"),year:(e,t)=>fe.date(e,t,"year"),time:(e,n)=>{var r;const{dataIndex:i}=n,{type:a,extra:l={},rules:o=[],onChange:s}=N,c="HH:mm:ss",d=qa(e,i);return t.createElement(yn,{size:f,popupClassName:E,value:null!==(r=Ba(d,c))&&void 0!==r?r:void 0,format:l.format||c,placeholder:l.placeholder,allowClear:l.allowClear,disabled:l.disabled,style:{width:"100%"},onChange:t=>{const n=Ua(t,c);ja(e,i,n),y(o,n,u,p),pe(e,u,p),null==s||s({[Z]:n},e),le()}})},checkbox:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],onChange:o}=N,{trueValue:s=Ed,falseValue:c=Sd,disabled:d}=a,h=qa(e,r);return t.createElement(M,{checked:h===s,disabled:d,onChange:t=>{const n=t.target.checked?s:c;ja(e,r,n),y(l,n,u,p),pe(e,u,p),null==o||o({[Z]:n},e),le()}})},switch:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],onChange:o}=N,{trueValue:s=Ed,falseValue:c=Sd,disabled:d}=a,h=qa(e,r);return t.createElement(z,{checked:h===s,disabled:d,onChange:t=>{const n=t?s:c;ja(e,r,n),y(l,n,u,p),pe(e,u,p),null==o||o({[Z]:n},e),le()}})},"search-helper":(e,n)=>{var r;const{dataIndex:i,precision:a}=n,{type:l,extra:o={},rules:s=[],helper:c={},onInput:d,onChange:h,onEnter:m}=N,v=Va(e,ie?c.combinedDataIndex:i),b=c.fieldAliasMap;b||en("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(i)||en("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ie&&(c.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||en("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[i].includes("|")&&en("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const S=e=>{const{filterAliasMap:t}=c,n=""!==e?e:void 0,r=("function"==typeof t?t():t)||[],a={[i]:n};return(Array.isArray(r)?r:[r]).forEach((e=>{if(se(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a},w=e=>{const{autoQueryAssign:t=!0}=c;t&&(_.current=S(e)),q(!0)},C=(t,r)=>{const{beforeOpen:i}=c,a=(null!=i?i:kn)({[Z]:v},e,n);(null==a?void 0:a.then)?a.then((()=>{w(t),null==r||r()})).catch((()=>{})):!1!==a&&(w(t),null==r||r())},T=e=>{const t={};for(const n in x){const r=x[n];n!==i&&(t[n]=Va(e,r))}const n=x[i]?Va(e,x[i]):"";O(n,t);const{closed:r}=c;oe(!1,(()=>ue(I.current))),de(),null==r||r(e)},R=()=>{const{onlySelect:e=!0}=c;P.current&&O(e?"":v),oe(!1,(()=>ue(I.current)))},O=(t="",n)=>{var r;if(se(n)&&Object.keys(n).length)for(const t in n){const i=n[t],a=g.find((e=>e.dataIndex===t));if(a){ja(e,t,i,a.precision);const n=null===(r=a.editRender)||void 0===r?void 0:r.call(a,e,a);n&&Array.isArray(n.rules)&&y(n.rules,i,u,t)}else ja(e,t,i)}ie&&!t&&((e,t,n,r)=>{if(!t.includes("|"))return ja(e,t,n,r);const i=n.split("|")||[];t.split("|").forEach(((t,n)=>{var r;t&&ja(e,t,null===(r=i[n])||void 0===r?void 0:r.trim())}))})(e,c.combinedDataIndex,""),ja(e,i,t,a),y(s,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e),le(),_.current={},P.current=!1,Y(void 0)},k={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{R()}},A=Object.assign(Object.assign({},c),{size:f,initialValue:Object.assign({},_.current,c.initialValue),onClose:e=>{e?T(e):R()}});return t.createElement(t.Fragment,null,t.createElement(Ku,{ref:L,value:null!=G?G:v,placeholder:o.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:r=!0,table:a}=c;if(P.current&&!D)return n&&r&&(null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=c,{beforeFetch:r=kn}=t.fetch;return new Promise(((i,a)=>Tn(void 0,void 0,void 0,(function*(){var l;const o=xe({},t.fetch.params,Object.assign(Object.assign({},n),S(e)),{currentPage:1,pageSize:500});if(!r(o))return a();W(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(l=me(e.data,t.fetch.dataKey))&&void 0!==l?l:[];i(n)}else a()}catch(e){a(e)}finally{An((()=>W(!1)))}}))))})(n).then((e=>((e=[],t)=>{const n=e.filter((e=>Va(e,x[i]).toString().includes(t)));if(1===n.length)return T(n[0]);C(t)})(e,n))).catch((()=>O(""))):void O(n)},onChange:e=>{const{value:t}=e.target;null==d||d({[Z]:t}),P.current=!0,Y(t)},onKeyUp:t=>{var n;if(13===t.keyCode){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==m||m({[Z]:r},e)}},onDoubleClick:e=>{const{value:t}=e.target;C(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&C(e)}}),t.createElement(da,k,t.createElement(ip,A)))},"search-helper-multiple":(e,n)=>{var r;const{dataIndex:i}=n,{type:a,items:l=[],extra:o={},rules:s=[],helper:c={},onInput:d,onChange:h,onEnter:m}=N,g=qa(e,i),v=c.fieldAliasMap;v||en("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||en("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:kn)({[Z]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{oe(!1,(()=>ue(I.current)))},w=t=>{ja(e,i,t),y(s,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e,F.current),le()},T={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:xe({},c.initialValue),defaultSelectedKeys:g,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:r}=b;ce(Ee([...F.current.filter((e=>t.includes(e[r]))),...e],r));const i=F.current.map((e=>({text:e[n],value:e[r]}))),a=Ee([...i,...l],"value").filter((e=>t.includes(e.value)));U(a),w(a.map((e=>e.value)));const{closed:o}=c;oe(!1,(()=>ue(I.current))),null==o||o(F.current)})(e,t):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement($,{mode:"multiple",open:!1,value:g,placeholder:o.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==m||m({[Z]:g},e))},onDoubleClick:()=>{o.disabled||x()},onChange:e=>{const{valueKey:t}=b;ce(F.current.filter((n=>e.includes(n[t])))),w(e)}},B.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:o.disabled,icon:t.createElement(Xe,null),onClick:()=>{x()}})))),t.createElement(da,T,t.createElement(ip,R)))},"tree-helper":(e,n)=>{var r,i;const{dataIndex:a,precision:l}=n,{type:o,extra:s={},rules:c=[],helper:d={},onChange:h,onEnter:m}=N,v=Va(e,ie?d.combinedDataIndex:a),b=d.fieldAliasMap;b||en("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(a)||en("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ie&&(d.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||en("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[a].includes("|")&&en("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const S=t=>{const{beforeOpen:r}=d,i=(null!=r?r:kn)({[Z]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},w=()=>{oe(!1,(()=>ue(I.current)))},C=(t="",n)=>{var r;if(se(n)&&Object.keys(n).length)for(const t in n){const i=n[t],a=g.find((e=>e.dataIndex===t));if(a){ja(e,t,i,a.precision);const n=null===(r=a.editRender)||void 0===r?void 0:r.call(a,e,a);n&&Array.isArray(n.rules)&&y(n.rules,i,u,t)}else ja(e,t,i)}ja(e,a,t,l),y(c,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e),le()},T={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"30%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{w()}},R=Object.assign(Object.assign({},d),{defaultSelectedKeys:[v],size:f,onClose:e=>{e?(e=>{const t={};for(const n in x){const r=x[n];n!==a&&(t[n]=Va(e,r))}const n=x[a]?Va(e,x[a]):"";C(n,t);const{closed:r}=d;oe(!1,(()=>ue(I.current))),de(),null==r||r(e)})(e):w()}});return t.createElement(t.Fragment,null,t.createElement(Ku,{ref:A,value:v,allowClear:null===(i=s.allowClear)||void 0===i||i,readOnly:s.readOnly,disabled:s.disabled,placeholder:s.placeholder||Xt("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyUp:t=>{var n;if(13===t.keyCode){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==m||m({[Z]:r},e)}},onDoubleClick:()=>{S()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?S():C(""))}}),t.createElement(da,T,t.createElement(cp,R)))},"tree-helper-multiple":(e,n)=>{var r;const{dataIndex:i}=n,{type:a,extra:l={},items:o=[],rules:s=[],helper:c={},onInput:d,onChange:h,onEnter:m}=N,g=qa(e,i),v=c.fieldAliasMap;v||en("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||en("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:kn)({[Z]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{oe(!1,(()=>ue(I.current)))},w=t=>{ja(e,i,t),y(s,t,u,p),pe(e,u,p),null==h||h({[Z]:t},e,F.current),le()},T={visible:D,title:Xt("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${no[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:xe({},c.initialValue),defaultSelectedKeys:g,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=b;ce(e);const r=F.current.map((e=>({text:e[t],value:e[n]})));U(r),w(r.map((e=>e.value)));const{closed:i}=c;oe(!1,(()=>ue(I.current))),null==i||i(F.current)})(e):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement($,{mode:"multiple",open:!1,value:g,placeholder:l.placeholder||Xt("qm.table.editable.selectPlaceholder"),allowClear:l.allowClear,maxTagCount:l.collapseTags?"responsive":void 0,maxTagTextLength:l.maxTagTextLength,disabled:l.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==m||m({[Z]:g},e))},onDoubleClick:()=>{l.disabled||x()},onChange:e=>{const{valueKey:t}=b;ce(F.current.filter((n=>e.includes(n[t])))),w(e)}},B.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(C,{className:"ant-input-search-button",disabled:l.disabled,icon:t.createElement(Xe,null),onClick:()=>{x()}})))),t.createElement(da,T,t.createElement(cp,R)))},custom:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],render:o,onChange:s}=N;if(!o)return en("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const c=qa(e,r),d=t=>{ja(e,r,t),y(l,t,u,p),pe(e,u,p),null==s||s({[Z]:t},e),le()},h=o(e,n,d);return t.isValidElement(h)?t.cloneElement(h,{value:c,disabled:a.disabled,readOnly:a.readOnly,popupClassName:E,onChange:d}):null}};return t.createElement(t.Fragment,null,re?(()=>{const{type:e}=N,n=fe[e];if(!n)return en("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!J}];return t.createElement("div",{ref:I,className:Fe(r)},n(d,c),!J&&t.createElement("div",{className:"cell-error"},ee||te))})():(()=>{const{disabled:n,extra:r={}}=N,{disabledColor:i,disabledBgColor:a}=r,l=["cell--show",{"is-cell-bg":n&&a}];return t.createElement(t.Fragment,null,t.createElement("span",{className:Fe(l),style:{color:n?i:""}},e.children),n&&a&&t.createElement("i",{className:"cell--bg",style:{background:a}}))})(),ne&&t.createElement("i",{className:"cell--sign"}))}));zu.displayName="CellEdit";const Wu=(e,...n)=>t.isValidElement(e)?t.cloneElement(e,...n):null,Bu=e=>{const{text:n,options:r,showMessage:i=!0,onCopy:a}=e;return Wu(e.children,{onClick:l=>{const o=t.Children.only(e.children),s=$t(n,r);null==a||a(n,s),s&&i&&L.success(Xt("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(l)}})};Bu.displayName="QmCopyToClipboard";const Uu=t.forwardRef(((n,r)=>{const{column:i,row:a,rowIndex:l,columnIndex:o,rowKey:s,showTitle:c}=n,{selectionKeys:d,treeExpandIndex:u,updateMark:p,isTreeTable:h}=t.useContext(vd),{dataIndex:m,canCopy:f,render:g,editRender:v,shouldCellUpdate:y}=i,{t:b}=Vd(),{renderText:x,getTitleFromCellNode:E}=Yd(),S=t.useRef(null),w=qa(a,m),[C,T]=function(t,n,r){const i=e.useRef({});return"value"in i.current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value}((()=>{const e=g?g(w,a,i,l,o):x(w,i,a);return[e,v?t.createElement(zu,{ref:r,column:i,record:a,rowKey:s,columnKey:m},e):null]}),[p,a,w,g,v],((e,t)=>{if(y){const[,n]=e,[,r]=t;return y(r,n,a)}return!((e,t,n=!1)=>{const r=new Set;return function e(t,i,a=1){if(r.has(t))return!1;if(t===i)return!0;if(n&&a>1)return!1;r.add(t);const l=a+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],i[n],l))return!1;return!0}if(t&&i&&"object"==typeof t&&"object"==typeof i){const n=Object.keys(t);return n.length===Object.keys(i).length&&n.every((n=>e(t[n],i[n],l)))}return!1}(e,t)})(e,t,!0)}));t.useEffect((()=>{if([Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(m))return;const e=S.current.parentNode;c?e.title=E(C):e.removeAttribute("title")}),[c,C]);const N=e=>Array.isArray(e.children);return t.createElement("div",{ref:S,className:"cell"},(()=>{if(m===Hd.expandableColumn)return t.createElement(ju,{record:a,rowKey:s});if(m===Hd.selectionColumn)return t.createElement(qu,{selectionKeys:d,column:i,record:a,rowKey:s});if(T)return T;if(h&&m===u)return t.createElement(t.Fragment,null,(e=a._level)?t.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*Hd.treeTable.textIndent+"px"}}):null,t.createElement(ju,{key:"expand",record:a,rowKey:s,style:N(a)?{}:{visibility:"hidden"}}),C);var e;if(f){const e=E(C);return t.createElement("div",{className:"cell--copy"},t.createElement("span",{className:"text"},C),e&&t.createElement(Bu,{text:e},t.createElement(ct,{className:"icon",title:b("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return C})())}));Uu.displayName="Cell";const Gu={startX:0,startY:0,startOffsetX:0,startOffsetY:0,containerSizeX:0,containerSizeY:0},Yu={open:!1,offsetX:0,offsetY:0},Xu=t.forwardRef(((e,n)=>{const{tableRef:r,getRowKey:i,flattenColumns:a,mergedTdCells:l,setMergedCells:o}=t.useContext(vd),{areaSelection:s={}}=r.current.props,{elementStore:c,tableFlatData:d}=r.current,{t:u}=Vd(),p=t.useRef(document.onselectstart),h=t.useRef(null),m=t.useRef(null),[f,g]=t.useState(null),[v,y]=t.useState(null),[b,x]=t.useState(null);$u({ref:h,handler:()=>D()});const E=t.useRef(Gu),S=e=>{E.current=Object.assign({},E.current,e)};t.useEffect((()=>{const e=Lt(c.$tableBody,"mousedown",L),t=Lt(c.$tableBody,"contextmenu",O),n=Lt(document,"keydown",k);return()=>{e.remove(),t.remove(),n.remove()}}),[]);const w=()=>{g(null),y(null),x(null)};t.useImperativeHandle(n,(()=>({blur:w})));const C=()=>c.$tableBody.parentNode,T=e=>{const{offsetLeft:t,offsetTop:n,offsetWidth:r,offsetHeight:i}=e;return{rowKey:e.parentNode.getAttribute("data-row-key"),colIndex:Number(e.getAttribute("data-col-index")),l:t,t:n,w:r,h:i}},N=Wi(((e,t)=>{let n=null;const r=c.$tableBody.querySelectorAll("tbody > tr");for(let i=0;i<r.length;i++){if(r[i].offsetTop>t||r[i].offsetTop+r[i].offsetHeight<t)continue;const a=r[i].querySelectorAll("td");for(let t=0;t<a.length;t++)if(!(a[t].offsetLeft>e||a[t].offsetLeft+a[t].offsetWidth<e)){n=a[t];break}break}n&&y(T(n))}),5),I=Rd((()=>{const e=[];if(!f||!v)return e;const[t,n]=[f.colIndex,v.colIndex],[r,l]=[f.rowKey,v.rowKey];let[o,s]=[0,0];for(let e=0;e<d.length;e++){const t=i(d[e],d[e].index);if(t==r&&(o=e),t==l){s=e;break}}const c=a.slice(Math.min(t,n),Math.max(t,n)+1);return d.slice(o,s+1).forEach((t=>{for(let n=0;n<c.length;n++){const{dataIndex:r}=c[n];e.push({rowKey:i(t,t.index),dataIndex:r,cellValue:qa(t,r)})}})),e})),R=e=>{var t;o(e),null===(t=s.onCellMerge)||void 0===t||t.call(s,e),An((()=>w()))},O=Rd((e=>{s.cellMerge&&f&&H(e.clientX,e.clientY)?(e.preventDefault(),F(e)):(null==b?void 0:b.open)&&D()})),k=e=>{27===e.keyCode&&w()},L=Rd((e=>{e.stopPropagation();const t=(e=>{let t=e;for(;t;){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null})(e.target);if(1!==e.buttons||!t)return;D(),setTimeout((()=>{g(T(t)),y(T(t))}));const[n,r]=[c.$tableBody.getBoundingClientRect().top,C().getBoundingClientRect().left],{offsetWidth:i,offsetHeight:a}=C();S({startX:e.clientX,startY:e.clientY,startOffsetX:e.clientX-r,startOffsetY:e.clientY-n,containerSizeX:i,containerSizeY:a}),document.addEventListener("mousemove",A),document.addEventListener("mouseup",P),p.current=document.onselectstart,document.onselectstart=()=>!1})),A=e=>{const t=e.clientX-E.current.startX,n=e.clientY-E.current.startY,r=E.current.startOffsetX+t,i=E.current.startOffsetY+n;N(Math.min(r,E.current.containerSizeX),Math.min(i,E.current.containerSizeY))},P=()=>{var e;S(Gu),null===(e=s.onSelectChange)||void 0===e||e.call(s,I()),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",P),_()},_=()=>{document.onselectstart!==p.current&&(document.onselectstart=p.current)},H=(e,t)=>{const{top:n,left:r}=C().getBoundingClientRect(),[i,a]=[e-r,t-n],{el:l,et:o,ew:s,eh:c}=q();return!(i<l||i>l+s||a<o||a>o+c)},F=e=>{const{top:t,left:n,height:r}=m.current.getBoundingClientRect();x({open:!0,offsetX:e.clientX-n,offsetY:-1*(r-(e.clientY-t))})},D=()=>{x((e=>Object.assign(Object.assign({},e),{open:!1})))},$=()=>{if(!f||!v||(t=v,(e=f).rowKey===t.rowKey&&e.colIndex===t.colIndex))return w();var e,t;const[n,r]=f.t<=v.t?[f.rowKey,v.rowKey]:[v.rowKey,f.rowKey],[o,s]=f.l<=v.l?[f.colIndex,v.colIndex]:[v.colIndex,f.colIndex];let[c,u]=[0,0],p=n;for(let e=0;e<d.length;e++){const t=d[e],a=i(t,t.index);if(a==n&&(p=a,c=e),a==r){u=e;break}}const h={rowKey:p,dataIndex:a[Math.min(o,s)].dataIndex,rowSpan:u-c+1,colSpan:Math.abs(s-o+1)};R([...l.filter((e=>!(e.rowKey===h.rowKey&&e.dataIndex===h.dataIndex))),h])},M=()=>{let e=f.rowKey;const t=f.colIndex;for(let t=0;t<d.length;t++){const n=d[t],r=i(n,n.index);if(r==e){e=r;break}}const n=e,r=a[t].dataIndex;R(l.filter((e=>!(e.rowKey===n&&e.dataIndex===r))))},q=()=>{const{w:e,h:t,l:n,t:r}=f;let{w:i,h:a,l:l,t:o}=v;return i=l-n>0?l-n+i:Math.abs(l-n)+e,a=o-r>0?o-r+a:Math.abs(o-r)+t,l=l>n?n:l,o=o>r?r:o,{sl:n,st:r,sw:e,sh:t,el:l,et:o,ew:i,eh:a}},j=jn("table");return t.createElement("div",{className:`${j}--area-select`},(()=>{if(!f||!v)return null;const{sl:e,st:n,sw:r,sh:i,el:a,et:l,ew:o,eh:s}=q(),{open:c,offsetX:d,offsetY:p}=b||Yu,g=t.createElement("ul",{ref:h,className:"ant-dropdown-menu"},t.createElement("li",{className:"ant-dropdown-menu-item",onClick:$},u("qm.table.areaSelect.mergeCell")),t.createElement("li",{className:"ant-dropdown-menu-item",onClick:M},u("qm.table.areaSelect.cancelMerge")));return t.createElement(t.Fragment,null,t.createElement("div",{className:"active-area",style:{left:e,top:n,width:r,height:i}}),t.createElement(Ms,{popupVisible:c,popup:g,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:"table-editable__popper",builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,p+4],overflow:{adjustX:1,adjustY:1}}}},t.createElement("div",{ref:m,className:"checked-area",style:{left:a,top:l,width:o,height:s}})))})())}));Xu.displayName="AreaSelect";const Zu=t.forwardRef(((e,n)=>{const{tableFlatColumns:r,tableData:i}=e,{getRowKey:a,tableRef:l,flattenColumns:o,editableColumns:s,leftFixedColumns:c,rightFixedColumns:d,derivedMergeCells:u,sorter:p,layout:h,showFooter:m,scrollX:f,scrollY:g,selectionKeys:v,rowExpandedKeys:y,highlightKey:b,isPingLeft:x,isPingRight:E,isTableEmpty:S,isTreeTable:w,isGroupSubtotal:C,isWebPagination:T,setElementStore:N,createTableFullData:I,setSelectionKeysEffect:R,setHighlightKey:O,getStickyLeft:k,getStickyRight:L,scrollXToColumn:A,scrollYToRecord:P,rowInViewport:_,dataChange:H,setPingLeft:F,setPingRight:D,setFullScreen:$,findParentRowKeys:M,getAllChildRowKeys:q,triggerScrollXEvent:j,triggerScrollYEvent:V,scrollBottomDebouncer:K}=t.useContext(vd),{height:z,minHeight:W,maxHeight:B,rowHeight:U,rowSelection:G,rowHighlight:Y,expandable:X,stripe:Z,summation:Q,rowStyle:J,cellStyle:ee,spanMethod:te,tableConfig:ne,areaSelection:re,nativeScrollBar:ie,ellipsis:ae,showHeader:le,rowDraggable:oe,onRowClick:ce,onRowDblclick:de,onRowContextmenu:ue,onRowEnter:pe}=l.current.props,he=t.useRef(null),me=t.useRef({}),fe=t.useRef(null),ve=t.useRef(null),ye=t.useRef(null),be=t.useRef({prevST:0,prevSL:0}),xe=l.current.scrollXLoad?r:o,Ee=t.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:n,tableFullHeight:r,tableAutoHeight:i}=h,a={};return S&&Object.assign(a,{minHeight:"100px"}),W&&Object.assign(a,{minHeight:$a(W)-e-n+"px"}),B&&Object.assign(a,{maxHeight:$a(B)-e-n+"px"}),z||r||i?Object.assign(Object.assign({},a),{maxHeight:"",minHeight:"",height:`${t}px`}):a}),[z,B,W,S,h]),Se=t.useMemo((()=>{const{scrollYStore:e}=l.current,{viewportHeight:t,gutterWidth:n}=h;return Math.floor((f?t-n:t)/e.rowHeight)}),[h,f]),[we,Ce]=t.useState([]),Te=Mu();$u({ref:he,omitClassNames:[".table-editable__popper"],handler:()=>{var e;ke([]),null===(e=ye.current)||void 0===e||e.blur()}}),t.useImperativeHandle(n,(()=>({setClickedValues:ke,createFocus:Re,forceUpdate:Te}))),bi((()=>{we.length&&l.current.tableManager.focus(l.current.uid)}),[we]),t.useLayoutEffect((()=>{Ie();const e=Lt(document,"keydown",Ne);return()=>e.remove()}),[]);const Ne=Rd((e=>{var t,n,r,o,c,d,u;const{keyCode:p}=e;if(l.current.uid===(null===(t=l.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id)&&(27===p&&(ke([]),O(""),$(!1)),we.length&&(Oi(document.activeElement,he.current)||"INPUT"!==(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)))){if(13===p&&("radio"===(null==G?void 0:G.type)||Y)){const t=null!==(o=null!==(r=v[0])&&void 0!==r?r:b)&&void 0!==o?o:null,n=null!==(c=i.find((e=>a(e,e.index)===t)))&&void 0!==c?c:null;n&&(null==pe||pe(n,e))}if(38===p||40===p){Si(e);const{allTableData:t}=l.current,n=T?Ha(i):t,r=n.length;let o=n.findIndex((e=>a(e,e.index)===we[0]));const s=38===p?(--o+r)%r:++o%r,c=n[s],h=a(c,c.index);"radio"!==(null==G?void 0:G.type)||(null===(d=G.disabled)||void 0===d?void 0:d.call(G,c))||R([h]),Y&&!(null===(u=Y.disabled)||void 0===u?void 0:u.call(Y,c))&&O(h),_(s)||(38===p&&P(h,s),40===p&&P(h,Se>s+1?0:s+1-Se)),ke([h,we[1]])}if(9===p){if(Si(e),!s.length)return ke([]);const t=s.length;let n=s.findIndex((e=>e.dataIndex===we[1]));const r=++n%t,i=s[r].dataIndex;ke([we[0],i]),A(i)}}})),Ie=()=>{N("$tableBody",he.current),N("$tableXspace",fe.current),N("$tableYspace",ve.current)},Re=(e,t)=>{var n;null===(n=me.current[`${e}-${t}`])||void 0===n||n.focus()},Oe=(e,t,n)=>{var r,i;const{dataIndex:l}=n;if([Hd.expandableColumn,Hd.operationColumn].includes(l))return;const o=a(t,t.index);ke([o,l]);const s=null===(r=n.editRender)||void 0===r?void 0:r.call(n,t,n),c=s&&!s.disabled,{type:d,selectByClickRow:u=!0,disabled:p=On}=G||{};!d||p(t)||c||(u||l===Hd.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:r=!0,onSelect:i}=G||{};if("radio"===n&&R([e]),"checkbox"===n){const n=!v.includes(e),a=w&&!r?Ae(e,v,n):Le(e,v,n);R(a),null==i||i(n,t,a)}})(o,t),[Hd.selectionColumn].includes(l)||(!Y||(null===(i=Y.disabled)||void 0===i?void 0:i.call(Y,t))||c||O(o),null==ce||ce(t,n,e))},ke=e=>{ge(e,we)||Ce(e)},Le=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),Ae=(e,t,n)=>{var r;const{disabled:i}=G||{},{deriveRowKeys:a,recordsMap:o}=l.current,s=_a(a,e);let c=[],d=q((null==s?void 0:s.children)||[]);i&&(d=d.filter((e=>!o.has(e)||!i(o.get(e))))),c=n?[...new Set([...t,e,...d])]:t.filter((t=>![e,...d].includes(t)));return((null===(r=tl(a,e))||void 0===r?void 0:r.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=_a(a,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>c.includes(e.rowKey)));c=r?[...c,e]:c.filter((t=>t!==e))})),c},Pe=(e,n=0)=>{const r=[];return e.forEach((e=>{const i=e.index,o=a(e,e.index);if(r.push(_e(e,i,o,n)),null==X?void 0:X.expandedRowRender){const{expandedRowClassName:n,rowExpandable:a=kn}=X;y.includes(o)&&a(e)&&r.push(t.createElement("tr",{key:`expand_${o}`,className:"body--row-expanded"},t.createElement("td",{colSpan:xe.length,className:"body--column",style:{paddingLeft:G?2*Hd.selectionColumnWidth:Hd.selectionColumnWidth}},t.createElement("div",{className:Fe("cell",n)},X.expandedRowRender(e,i)))))}if(!l.current.scrollYLoad&&(e=>Array.isArray(e.children))(e)){const t="function"!=typeof(null==X?void 0:X.rowExpandable)||X.rowExpandable(e);y.includes(o)&&t&&r.push(...Pe(e.children,n+1))}})),r},_e=(e,n,r,i=0)=>{const{disabled:a}=G||{},l=["body--row",Object.assign({"body--row-striped":Z&&n%2!=0,"body--row-selected":v.includes(r)&&!(null==a?void 0:a(e)),"body--row-current":b===r},C?Me(e._group):null)];return t.createElement("tr",{key:r,"data-row-key":r,className:Fe(l)},xe.map(((t,a)=>He(t,a,e,n,r,i))))},He=(e,n,r,i,a,s)=>{var u,h,m;const{isIE:f}=l.current,{dataIndex:g,fixed:v,align:y,className:b=""}=e;l.current.scrollXLoad&&(n=o.findIndex((e=>e.dataIndex===g)));const{rowSpan:x,colSpan:E}=De(r,e,i,n);if(!x||!E)return null;const S=null!==(u=e.ellipsis)&&void 0!==u?u:ae,w=!f&&"left"===v,T=!f&&"right"===v,N=["body--column",{"col--ellipsis":S,"col--center":"center"===y,"col--right":"right"===y,"column--sort":!!p[g],"cell-fix-left":w,"cell-fix-right":T,"cell-fix-left-last":w&&(null===(h=c[c.length-E])||void 0===h?void 0:h.dataIndex)===g,"cell-fix-right-first":T&&(null===(m=d[0])||void 0===m?void 0:m.dataIndex)===g,[b]:!!b}],I=T&&E>1?o.slice(n+1,n+E).reduce(((e,t)=>e+(t.width||t.renderWidth||0)),0):0,R=f?null:{left:w?`${k(g)}px`:"",right:T?L(g)-I+"px":""},O=J?"function"==typeof J?J(r,i):J:null,A=ee?"function"==typeof ee?ee(r,e,i,n):ee:null,P=C?$e(r._group):null,_=Object.assign({},R,U?{height:U}:null,P,O,A);return t.createElement("td",{key:g,"data-col-index":n,rowSpan:x>1?x:void 0,colSpan:E>1?E:void 0,className:Fe(N),style:_,onClick:t=>Oe(t,r,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:r}=n;[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(r)||null==de||de(t,n,e)})(t,r,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:r}=n;[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(r)||null==ue||ue(t,n,e)})(t,r,e)},t.createElement(Uu,{ref:e=>me.current[`${a}-${g}`]=e,row:r,column:e,rowIndex:i,columnIndex:n,rowKey:a,depth:s,showTitle:S}))},De=(e,t,n,r)=>{let a=1,l=1;if("function"==typeof te){const o=te({row:e,column:t,rowIndex:n,columnIndex:r,tableData:i});if(Array.isArray(o)?(a=o[0],l=o[1]):se(o)&&(a=o.rowSpan,l=o.colSpan),e===i[0]&&0===a){a=1;for(let e=1;e<i.length;e++){const{rowSpan:n}=De(i[e],t,i[e].index,r);if(n>0)break;a++}}}if(u.length>0){const e=u.find((e=>e.row===n&&e.col===r));e&&(a=e.rowSpan,l=e.colSpan)}return{rowSpan:a,colSpan:l}},$e=e=>{var t;const{backgroundColor:n,color:r}=null!==(t=Q.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:r}},Me=e=>{const t=Q.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},qe=jn("table");return t.createElement(t.Fragment,null,t.createElement(Xi,{ref:l.current.scrollBarRef,wrapClassName:`${qe}--body-wrapper`,wrapStyle:Ee,native:ie,showTopScrollbar:null==ne?void 0:ne.doubleXScrollbar,onScroll:e=>{const{elementStore:t,scrollXLoad:n,scrollYLoad:r}=l.current,{prevST:i,prevSL:a}=be.current,o=g?h.gutterWidth:0,{scrollTop:s,scrollLeft:c}=e;if(c!==a){le&&(t.$header.scrollLeft=c),m&&(t.$footer.scrollLeft=c);const e=c>0,n=Math.ceil(c)+h.tableWidth<h.tableBodyWidth+o;x!==e&&F(e),E!==n&&D(n)}if(r&&s!==i&&V(s),n&&c!==a&&j(c),g&&s!==i){const n=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(s)+h.viewportHeight-o>=n&&K({type:"scroll",target:e,preventDefault:On,stopPropagation:On})}be.current.prevST=s,be.current.prevSL=c}},t.createElement("div",{ref:ve,className:"body--y-space"}),t.createElement("div",{ref:fe,className:"body--x-space",style:{width:g?h.tableBodyWidth-h.gutterWidth:h.tableBodyWidth}}),t.createElement(_u.Provider,{value:we},t.createElement("table",{ref:he,className:`${qe}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0",style:{width:0}},t.createElement("colgroup",null,xe.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})}))),oe?t.createElement(Vt,{itemKey:e=>a(e,e.index),tag:"tbody",animation:200,list:i,setList:e=>{const t=e.map((e=>a(e,e.index))),n=i.map((e=>a(e,e.index)));if(ge(t,n))return;const r=il(e),o=[];l.current.tableFullData.forEach((e=>{i.includes(e)?o.push(r.shift()):o.push(e)})),I(o),H()}},i.map((e=>_e(e,e.index,a(e,e.index))))):t.createElement("tbody",null,Pe(i)))),!!re&&t.createElement(Xu,{ref:ye})))}));Zu.displayName="TableBody";const Qu=e=>{const{summationRows:n}=e,{tableRef:r,sorter:i,layout:a,scrollY:l,flattenColumns:o,leftFixedColumns:s,rightFixedColumns:c,setElementStore:d,getStickyLeft:u,getStickyRight:p}=t.useContext(vd),{footRender:h}=r.current.props,m=t.useRef(null);t.useLayoutEffect((()=>{f()}),[]);const f=()=>{d("$footer",m.current)},g=(e,n,o)=>{var d,h;const{isIE:m}=r.current,{gutterWidth:f}=a,{dataIndex:g,fixed:v,align:y,summation:b}=e,x=["footer--column","col--ellipsis",{"col--center":"center"===y,"col--right":"right"===y,"column--sort":!!i[g],"cell-fix-left":!m&&"left"===v,"cell-fix-right":!m&&"right"===v,"cell-fix-left-last":!m&&"left"===v&&(null===(d=s[s.length-1])||void 0===d?void 0:d.dataIndex)===g,"cell-fix-right-first":!m&&"right"===v&&(null===(h=c[0])||void 0===h?void 0:h.dataIndex)===g}],E=m?null:{left:"left"===v?`${u(g)}px`:"",right:"right"===v?`${p(g)+(l?f:0)}px`:""},S=(null==b?void 0:b.render)?b.render(r.current.tableFullData):qa(n,`${g}_text`),w=0===o&&""===S?Xt("qm.table.config.summaryText"):S;return t.createElement("td",{key:g,title:w,className:Fe(x),style:Object.assign({},E)},t.createElement("div",{className:"cell"},w))},v=jn("table"),{tableBodyWidth:y}=a;return t.createElement("div",{ref:m,className:`${v}--footer-wrapper`},h?h(o,r.current.tableFullData):t.createElement("table",{className:`${v}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:y?`${y}px`:""}},(()=>{const{gutterWidth:e}=a;return t.createElement("colgroup",null,o.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})})),l&&t.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t.createElement("tfoot",null,(()=>{const{isIE:e}=r.current,i=["gutter",{"cell-fix-right":!!c.length}],a=e?null:{right:c.length?0:""};return n.map(((e,n)=>t.createElement("tr",{key:n,className:"footer--row"},o.map(((t,n)=>g(t,e,n))),l&&t.createElement("td",{className:Fe(i),style:Object.assign({},a)}))))})())))};var Ju;!function(e){e.small="small",e.middle="default",e.large="default"}(Ju||(Ju={}));const ep=e=>{var n,r,i,a;const{current:l,pageSize:o,total:s,onChange:c}=e,{global:d}=t.useContext(Bt),{tableRef:u,$size:p,setElementStore:h}=t.useContext(vd),{uniqueKey:m,paginationConfig:f,infoBarConfig:g}=u.current.props,v=t.useRef(null),y=t.useMemo((()=>m?`tablePager_${m}`:""),[m]);t.useLayoutEffect((()=>{b(),w()}),[]);const b=()=>{h("$pager",v.current)},x=null!==(n=null==f?void 0:f.showSizeChanger)&&void 0!==n?n:Hd.pagination.showSizeChanger,E=null!==(r=null==f?void 0:f.showQuickJumper)&&void 0!==r?r:Hd.pagination.showQuickJumper,S=(null==f?void 0:f.pageSizeOptions)||(null===(a=null===(i=null==d?void 0:d.table)||void 0===i?void 0:i.pagination)||void 0===a?void 0:a.pageSizeOptions)||Hd.pagination.pageSizeOptions,w=()=>Tn(void 0,void 0,void 0,(function*(){if(!y)return;const e=yield C(y);e&&e!==o&&(c(l,e),localStorage.setItem(y,e.toString()))})),C=e=>Tn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t&&!localStorage.getItem(y))try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),T=(e,t)=>Tn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),N={[`${jn("table")}-pager`]:!0};return t.createElement("div",{ref:v,className:Fe(N)},t.createElement("div",{className:"pager-alert"},"bottom"===(null==g?void 0:g.position)&&t.createElement(Bd,{total:s})),t.createElement(ee,{size:Ju[p],showSizeChanger:x,showQuickJumper:E,pageSizeOptions:S,current:l,pageSize:o,total:s,onChange:(e,t)=>{c(e,t)},onShowSizeChange:(e,t)=>{y&&(T(y,t),localStorage.setItem(y,`${t}`))}}))},tp=()=>{const{layout:e}=t.useContext(vd),n=t.useMemo((()=>{const{headerHeight:t,viewportHeight:n}=e;return{top:`${t}px`,height:`${n}px`}}),[e]),r=jn("table");return t.createElement("div",{className:`${r}--empty`,style:n},t.createElement(Fi,null))},np=()=>{const{setElementStore:e}=t.useContext(vd),n=t.useRef(null);t.useLayoutEffect((()=>{r()}),[]);const r=()=>{e("$resizableBar",n.current)},i=jn("table");return t.createElement("div",{ref:n,className:`${i}--resizable-bar`})},rp=t.forwardRef(((e,n)=>{const r=((e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((n,r)=>(n[r]=void 0!==t[r]?t[r]:e[r],n)),{})))(bd,e),{rowKey:i,columns:a,loading:l,resizable:o,customClass:s,areaSelection:c,tablePrint:d,exportExcel:u,infoBarConfig:p,topSpaceAlign:h,showTableInfo:m,showFullScreen:f,showRefresh:g,showToolBox:v,showHeader:y}=r,{size:b}=t.useContext(Bt),x=t.useMemo((()=>{var e,t;return null!==(t=null!==(e=r.size)&&void 0!==e?e:b)&&void 0!==t?t:""}),[r.size,b]),E=t.useRef(null),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),T=t.useRef(null),N=Rd(((e,t)=>{const n="function"==typeof i?i(e,t):null==e?void 0:e[i];return void 0===n?(en("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),{tableRef:I,tableFullData:R,setElementStore:O,setOriginColumns:k,setTableFullData:L,setTableOriginData:A,setTableFlatData:P,setAllTableData:_,setDeriveRowKeys:H,setInvalidRowKeys:F,setFieldAuth:D,setColumnsDefined:$,setScrollXStore:M,setScrollYStore:q,setScrollXLoad:j,setScrollYLoad:V,setResizeState:K,setHandleState:z,setSummaries:W,setSelectionRows:B,setShouldToTop:U,setRecordsMap:G,setUnMounted:Y,clearElementStore:X,clearRecordsMap:Z}=((e,{getRowKey:n,$size:r})=>{const{rowHeight:i,dynamicThead:a}=e,l=t.useRef({props:e,uid:Ld(),tableManager:Pd,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],tableFlatData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!a,scrollBarRef:t.createRef(),scrollXStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0},scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:i||Hd.rowHeightMaps[r]},store:new _d,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},treeTable:!1,scrollXLoad:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],recordsMap:new Map,unMounted:!1,isIE:!Nn&&/MSIE|Trident/.test(navigator.userAgent)});var o;o=e,l.current.props=o;const s=(e,t,r="",i="",a=0)=>e.map((e=>{const l=n(e,e.index),o=r?`${r}#${l}`:`${l}`,c=i?`${i}.${e.index+1}`:`${e.index+1}`,d={level:a,rowKey:l,rowKeyPath:o,indexPath:c};return e.indexPath=c,e._level=a,Array.isArray(e.children)&&(d.children=s(e.children,l,o,c,a+1)),t?Object.assign({},d,{parentRowKey:t}):d})),c=e=>{const t=[];return e.forEach((e=>{Array.isArray(e.children)?t.push(...c(e.children)):t.push(e.rowKey)})),t};return Object.assign(Object.assign({tableRef:l},l.current),{setElementStore:(e,t)=>{l.current.elementStore[e]=t},setOriginColumns:e=>{l.current.originColumns=e},setTableFullData:e=>{l.current.tableFullData=e},setTableFlatData:e=>{l.current.tableFlatData=e},setTableOriginData:e=>{l.current.tableOriginData=e},setAllTableData:e=>{const t=Ha(e);l.current.allTableData=t,l.current.allRowKeys=t.map((e=>n(e,e.index)))},setDeriveRowKeys:e=>{const t=l.current.tableFullData.some((e=>Array.isArray(e.children)));l.current.treeTable=t,l.current.deriveRowKeys=t?s(e,""):[],l.current.flattenRowKeys=t?c(l.current.deriveRowKeys):[]},setInvalidRowKeys:e=>{l.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{l.current.fieldAuth[e]=t},setColumnsDefined:e=>{l.current.columnsDefined=e},setScrollXStore:e=>{l.current.scrollXStore=e},setScrollYStore:e=>{l.current.scrollYStore=e},setResizeState:e=>{l.current.resizeState=e},setHandleState:e=>{l.current.handleState=e},setSummaries:e=>{l.current.summaries=e},setScrollXLoad:e=>{l.current.scrollXLoad=e},setScrollYLoad:e=>{l.current.scrollYLoad=e},setShouldToTop:e=>{l.current.shouldToTop=e},setSelectionRows:e=>{l.current.selectionRows=e},setRecordsMap:(e,t)=>{l.current.recordsMap.set(e,t)},setUnMounted:e=>{l.current.unMounted=e},clearElementStore:()=>{for(const e in l.current.elementStore)l.current.elementStore[e]=null},clearRecordsMap:()=>{l.current.recordsMap.clear()}})})(r,{getRowKey:N,$size:x}),{tableData:Q,setTableData:J,tableFlatColumns:ee,setTableFlatColumns:te,filters:ne,setFilters:re,sorter:ie,setSorter:ae,superFilters:le,setSuperFilters:oe,pagination:ce,setPagination:de,selectionKeys:ue,setSelectionKeys:pe,rowExpandedKeys:he,setRowExpandedKeys:me,highlightKey:fe,setHighlightKey:ye,updateMark:be,forceUpdate:xe,mergedTdCells:Ee,setMergedCells:Se,layout:we,setLayout:Ce,permission:Te,setPermission:Ne,spinning:Ie,setSpinning:Re,scrollX:Oe,setScrollX:ke,scrollY:Le,setScrollY:Ae,isPingLeft:Pe,setPingLeft:_e,isPingRight:He,setPingRight:De,isFullScreen:$e,setFullScreen:Me,updateTableData:qe}=(e=>{var n,r,i,a,l,o,s,c,d,u,p;const{uniqueKey:h,nativeScrollBar:m,initialSorter:f={},initialFilter:g={},paginationConfig:v,rowSelection:y,expandable:b,rowHighlight:x,mergedCells:E}=e,{global:S}=t.useContext(Bt),w={current:null!==(n=null==v?void 0:v.current)&&void 0!==n?n:Hd.pagination.current,pageSize:null!==(o=null!==(i=null!==(r=(()=>{if(h)return Number(localStorage.getItem(`tablePager_${h}`))||void 0})())&&void 0!==r?r:null==v?void 0:v.pageSize)&&void 0!==i?i:null===(l=null===(a=null==S?void 0:S.table)||void 0===a?void 0:a.pagination)||void 0===l?void 0:l.pageSize)&&void 0!==o?o:Hd.pagination.pageSize,total:0},C=null!==(c=null!==(s=null==y?void 0:y.selectedRowKeys)&&void 0!==s?s:null==y?void 0:y.defaultSelectedRowKeys)&&void 0!==c?c:[],T=null!==(u=null!==(d=null==b?void 0:b.expandedRowKeys)&&void 0!==d?d:null==b?void 0:b.defaultExpandedRowKeys)&&void 0!==u?u:[],[N,I]=t.useState([]),[R,O]=t.useState([]),[k,L]=t.useReducer(((e,t)=>ge(e,t)?e:t),g),[A,P]=t.useReducer(((e,t)=>ge(e,t)?e:t),f),[_,H]=t.useReducer(((e,t)=>ge(e,t)?e:t),[]),[F,D]=t.useState(w),[$,M]=t.useReducer(((e,t)=>ge(e,t)?e:t),C),[q,j]=t.useReducer(((e,t)=>ge(e,t)?e:t),T),[V,K]=t.useState(null!==(p=null==x?void 0:x.currentRowKey)&&void 0!==p?p:""),[z,W]=t.useReducer((e=>e+1),0),[B,U]=Dd([],{value:E}),[G,Y]=t.useState({gutterWidth:m?Md():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[X,Z]=t.useState({export:!0,import:!0,print:!0}),[Q,J]=t.useState(!1),[ee,te]=t.useState(!1),[ne,re]=t.useState(!1),[ie,ae]=t.useState(!1),[le,oe]=t.useState(!1),[se,ce]=t.useState(!1);return{tableData:N,setTableData:I,tableFlatColumns:R,setTableFlatColumns:O,filters:k,setFilters:L,sorter:A,setSorter:P,superFilters:_,setSuperFilters:H,pagination:F,setPagination:D,selectionKeys:$,setSelectionKeys:M,rowExpandedKeys:q,setRowExpandedKeys:j,highlightKey:V,setHighlightKey:K,updateMark:z,forceUpdate:W,mergedTdCells:B,setMergedCells:U,layout:G,permission:X,setPermission:Z,setLayout:Y,spinning:Q,setSpinning:J,scrollX:ee,setScrollX:te,scrollY:ne,setScrollY:re,isPingLeft:ie,setPingLeft:ae,isPingRight:le,setPingRight:oe,isFullScreen:se,setFullScreen:ce,updateTableData:()=>I([...N])}})(r),{isFetch:je,isWebPagination:Ve,isScrollPagination:Ke,showPagination:ze,shouldUpdateHeight:We,tableColumns:Be,flattenColumns:Ue,editableColumns:Ge,summationColumns:Ye,leftFixedColumns:Xe,rightFixedColumns:Ze,derivedMergeCells:Qe,treeExpandIndex:Je,showSummary:et,showFooter:tt,isHeadGroup:nt,bordered:rt,isHeadSorter:it,isHeadFilter:at,isServiceSummation:lt,isSelectCollection:ot,isTableImport:st,isTableClipboard:ct,isSuperSearch:dt,isFastSearch:ut,isGroupSummary:pt,isGroupSubtotal:ht,isTreeTable:mt,isTableEmpty:ft,summationRows:gt,fetchParams:vt}=jd(r,{getRowKey:N,tableRef:I,tableFullData:R,tableData:Q,sorter:ie,filters:ne,superFilters:le,selectionKeys:ue,pagination:ce,mergedTdCells:Ee}),{createElementStore:yt,tableStyles:bt,getSpan:xt,getStickyLeft:Et,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Ct,rowInViewport:Tt,calcTableHeight:Nt,resetTableScroll:It,computeVirtualX:Rt,computeVirtualY:Ot,doLayout:kt}=zd(r,{getRowKey:N,tableRef:I,topElementRef:E,tableElementRef:S,$size:x,tableColumns:Be,flattenColumns:Ue,leftFixedColumns:Xe,derivedMergeCells:Qe,layout:we,scrollX:Oe,scrollY:Le,showFooter:tt,showPagination:ze,isFullScreen:$e,setLayout:Ce,setScrollX:ke,setScrollY:Ae,setElementStore:O,setScrollXStore:M,setScrollYStore:q,setShouldToTop:U}),{initialTable:Lt,checkDataIndex:At,createTableFullData:Pt,getTableData:_t,handleTableData:Ht,createWebPageData:Ft,createTableData:Dt,createGroupData:$t,createSelectionKeys:Mt,createRowExpandedKeys:qt,setSelectionKeysEffect:jt,findParentRowKeys:Vt,getAllChildRowKeys:Kt,doFieldValidate:zt,getTableLog:Wt,dataChange:Ut,tableChange:Gt,toLastPage:Yt,toFirstPage:Xt,getPageCount:Zt,pagerChangeHandle:Qt,triggerScrollXEvent:Jt,triggerScrollYEvent:tn,scrollBottomDebouncer:nn,clearTableSorter:rn,clearTableFilter:an,clearSuperFilters:ln,clearRowSelection:on,clearRowHighlight:sn,clearTableLog:cn,destroy:dn}=Kd(r,{getRowKey:N,tableRef:I,tableElementRef:S,tableBodyRef:w,$size:x,tableColumns:Be,flattenColumns:Ue,editableColumns:Ge,tableFullData:R,pagination:ce,layout:we,filters:ne,sorter:ie,superFilters:le,fetchParams:vt,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,summationColumns:Ye,shouldUpdateHeight:We,isFetch:je,isTreeTable:mt,isWebPagination:Ve,isScrollPagination:Ke,isServiceSummation:lt,isGroupSubtotal:ht,doLayout:kt,setTableData:J,setTableFlatColumns:te,setTableFullData:L,setTableOriginData:A,setTableFlatData:P,setAllTableData:_,setDeriveRowKeys:H,setPagination:de,setSpinning:Re,setSorter:ae,setFilters:re,setSuperFilters:oe,setSelectionKeys:pe,setRowExpandedKeys:me,setHighlightKey:ye,setSelectionRows:B,setScrollXLoad:j,setScrollYLoad:V,setScrollXStore:M,setScrollYStore:q,computeVirtualX:Rt,computeVirtualY:Ot,setFieldAuth:D,setResizeState:K,setSummaries:W,setPermission:Ne,setRecordsMap:G,resetTableScroll:It,clearElementStore:X,clearRecordsMap:Z});((e,n)=>{const{columns:r,summation:i,rowSelection:a,expandable:l,rowHighlight:o}=e,{tableRef:s,tableBodyRef:c,$size:d,scrollX:u,pagination:p,selectionKeys:h,rowExpandedKeys:m,highlightKey:f,summationRows:g,showSummary:v,isWebPagination:y,isScrollPagination:b,isTreeTable:x,checkDataIndex:E,toLastPage:S,toFirstPage:w,getPageCount:C,setHandleState:T,scrollYToRecord:N,setSelectionKeysEffect:I,setOriginColumns:R,setRowExpandedKeys:O,setHighlightKey:k,setResizeState:L,setPingRight:A,setUnMounted:P,calcTableHeight:_,createSelectionKeys:H,createRowExpandedKeys:F,initialTable:D,destroy:$}=n,M=t.useRef(g);bi((()=>{if(!a)return;const{onChange:e}=a;"radio"===a.type&&c.current.setClickedValues(h.length?[h[0],""]:[]),h.__prevent__||null==e||e(h,s.current.selectionRows),delete h.__prevent__}),[h]),bi((()=>{if(!l)return;const{onChange:e}=l;m.__prevent__||null==e||e(m,m.map((e=>s.current.recordsMap.get(e)))),delete m.__prevent__}),[m]),bi((()=>{var e,t;x&&O(F()),o&&(c.current.setClickedValues(f?[f,""]:[]),null===(e=o.onChange)||void 0===e||e.call(o,f,null!==(t=s.current.recordsMap.get(f))&&void 0!==t?t:null))}),[f]),bi((()=>{var e;ge(g,M.current)||(M.current=g,v&&i&&(null===(e=i.onChange)||void 0===e||e.call(i,g)))}),[g]),bi((()=>{const e=H(a.selectedRowKeys);ge(e,h)||(e.__prevent__=!0,I(e),x&&O(F()))}),[null==a?void 0:a.selectedRowKeys]),bi((()=>{const e=F(l.expandedRowKeys);ge(e,m)||(e.__prevent__=!0,O(e))}),[null==l?void 0:l.expandedRowKeys]),bi((()=>{const{currentRowKey:e}=o;e!==f&&k(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),bi((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(y&&("after"===e?S():w()),N("","after"===e?1e5:0)),t&&p.current>C()&&S(),(e||t)&&T({insert:null,remove:!1})}),[p.total]),bi((()=>{A(u)}),[u]),bi((()=>{_()}),[d]),bi((()=>{s.current.scrollYLoad&&(e.height||e.maxHeight||en("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||en("Table","必须设置组件参数 `ellipsis`")),b&&(e.height||e.maxHeight||en("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,b]),Wd({handler:()=>{const{resizeState:e}=s.current,{winHeight:t}=e,n=window.innerHeight;n!==t&&(L(Object.assign({},e,{winHeight:n})),_())},delay:16}),t.useEffect((()=>(R(Fn(r)),D(),E(),An((()=>_())),()=>{$(),P(!0)})),[])})(r,{tableRef:I,tableBodyRef:w,$size:x,scrollX:Oe,pagination:ce,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,showSummary:et,summationRows:gt,isWebPagination:Ve,isScrollPagination:Ke,isTreeTable:mt,checkDataIndex:At,toLastPage:Yt,toFirstPage:Xt,getPageCount:Zt,setHandleState:z,scrollYToRecord:Ct,setOriginColumns:k,setSelectionKeysEffect:jt,setRowExpandedKeys:me,setHighlightKey:ye,setResizeState:K,setPingRight:De,setUnMounted:Y,calcTableHeight:Nt,createSelectionKeys:Mt,createRowExpandedKeys:qt,initialTable:Lt,destroy:dn});const un=t.useMemo((()=>({getRowKey:N,tableRef:I,tableBodyRef:w,$size:x,flattenColumns:Ue,editableColumns:Ge,leftFixedColumns:Xe,rightFixedColumns:Ze,treeExpandIndex:Je,sorter:ie,filters:ne,superFilters:le,layout:we,bordered:rt,showFooter:tt,showSummary:et,summationRows:gt,scrollX:Oe,scrollY:Le,pagination:ce,fetchParams:vt,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,mergedTdCells:Ee,derivedMergeCells:Qe,updateMark:be,isFetch:je,isPingLeft:Pe,isPingRight:He,isHeadSorter:it,isHeadFilter:at,isFullScreen:$e,isTableEmpty:ft,isHeadGroup:nt,isTreeTable:mt,isGroupSubtotal:ht,isWebPagination:Ve,dataChange:Ut,tableChange:Gt,getTableData:_t,setElementStore:O,createWebPageData:Ft,createTableFullData:Pt,updateTableData:qe,setSorter:ae,setFilters:re,setSuperFilters:oe,setHighlightKey:ye,setRowExpandedKeys:me,setSelectionRows:B,setSelectionKeysEffect:jt,setInvalidRowKeys:F,setMergedCells:Se,getSpan:xt,getStickyLeft:Et,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Ct,rowInViewport:Tt,setPagination:de,setPingLeft:_e,setPingRight:De,setSpinning:Re,setFullScreen:Me,setShouldToTop:U,doFieldValidate:zt,createTableData:Dt,createGroupData:$t,findParentRowKeys:Vt,getAllChildRowKeys:Kt,triggerScrollXEvent:Jt,triggerScrollYEvent:tn,scrollBottomDebouncer:nn,resetTableScroll:It,clearTableSorter:rn,clearTableFilter:an,clearSuperFilters:ln,clearRowSelection:on,clearRowHighlight:sn})),[x,Ue,Ge,Xe,Ze,Je,ie,ne,le,we,rt,tt,et,gt,Oe,Le,ce,vt,ue,he,fe,Qe,be,je,Pe,He,it,at,$e,ft,nt,mt,ht,Ve]);((e,n)=>{const{getRowKey:r,tableRef:i,toolBoxRef:a,tableBodyRef:l,columnFilterRef:o,flattenColumns:s,editableColumns:c,pagination:d,fetchParams:u,selectionKeys:p,rowExpandedKeys:h,highlightKey:m,isFetch:f,dataChange:g,getTableData:v,handleTableData:y,createTableData:b,createTableFullData:x,calcTableHeight:E,scrollXToColumn:S,scrollYToRecord:w,doFieldValidate:C,setTableOriginData:T,setHandleState:N,setColumnsDefined:I,setSelectionKeysEffect:R,setRowExpandedKeys:O,setHighlightKey:k,setSelectionRows:L,setOriginColumns:A,forceUpdate:P,getTableLog:_,clearRowSelection:H,clearRowHighlight:F,clearTableSorter:D,clearTableFilter:$,clearSuperFilters:M,clearTableLog:q}=n,{columns:j,columnsChange:V}=i.current.props,K=(e,t,n)=>e.filter((e=>{const i=r(e,e.index);e.children&&(e.children=K(e.children,t,n));const a=t.includes(i);return a&&(null==n||n(e,i)),!a}));t.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{E()},DO_REFRESH:e=>Tn(void 0,void 0,void 0,(function*(){f&&(yield v(),null==e||e())})),GET_LOG:()=>_(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{f||(H(),F(),D(),$(),M(),q(),b([]))},CLEAR_LOG:()=>{q()},CREATE_FOCUS:(e,t)=>{l.current.createFocus(e,t)},FORCE_UPDATE:()=>{P()},DO_EXPORT:()=>{a.current.exportHandle()},SCROLL_TO_RECORD:e=>{w(e)},SCROLL_TO_COLUMN:e=>{S(e)},SET_SELECTION:(e,t)=>{const n=[...e];t&&(n.__prevent__=!0),R(n)},SET_EXPANDABLE:(e,t)=>{const n=[...e];t&&(n.__prevent__=!0),O(n)},SET_HIGHLIGHT:e=>{k(e)},SET_SELECTION_ROWS:e=>{L(e)},SET_TABLE_DATA:e=>{y(e)},DEFINE_INITIAL_COLUMNS:e=>{A(e),I(!0),o.current.initialHandler()},SET_TABLE_COLUMN:(e,t,n)=>{const r=ka(j,e);if(!r)return en("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!se(t))return en("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(r.noAuth)return en("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&ve(r,e,t[e]);n&&(V?V([...j]):en("Table","需要设置 `columnsChange` 参数"),P())},INSERT_RECORDS:(e,t)=>{const{store:n,tableFullData:a}=i.current,l=(Array.isArray(e)?e:[e]).filter((e=>se(e)));if(!l.length)return;l.forEach((e=>{s.forEach((t=>{const{dataIndex:n}=t;[Hd.expandableColumn,Hd.selectionColumn,Hd.operationColumn].includes(n)||ja(e,n,qa(e,n))})),n.addToInserted(e)}));const o="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey),d=a;if(c)o?d.unshift(...l):d.push(...l);else{const e=nl(a,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?o?e.children.unshift(...l):e.children.push(...l):e.children=l)}c&&N(Object.assign({},i.current.handleState,{insert:o?"before":"after"})),b(d),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:n}=i.current,a=(Array.isArray(e)?e:[e]).map((e=>se(e)?r(e,e.index):e));if(!a.length)return;let l=!1;const o=K(n,a,((e,n)=>{t.addToRemoved(e),c.forEach((r=>{const{dataIndex:i,editRender:a}=r,l=null==a?void 0:a(e,r);if(!l)return;const{rules:o=[],disabled:s}=l;!s&&o.length&&(t.removeFromRequired({x:n,y:i}),t.removeFromValidate({x:n,y:i}),t.removeFromEdited({x:n,y:i}))})),l=!0}));l&&(N(Object.assign({},i.current.handleState,{remove:!0})),x(o),R(p.filter((e=>!a.includes(e)))),a.includes(m)&&F(),O(h.filter((e=>!a.includes(e)))),g(),An((()=>{T(K(i.current.tableOriginData,a))})))},VALIDATE_FIELDS:(e,t)=>{i.current.allTableData.forEach((n=>{c.forEach((i=>{const{dataIndex:a,editRender:l}=i,o=null==l?void 0:l(n,i);if(!o)return;const s=r(n,n.index);if(e&&!e.includes(s))return;if(t&&!t.includes(a))return;const{rules:c=[],disabled:d}=o;d||C(c,qa(n,a),s,a)}))}));const{required:n,validate:a}=_(),l=[...n,...a];return l.length&&w(l[0].rowKey),P(),{required:n,validate:a}}})))})(n,{getRowKey:N,tableRef:I,toolBoxRef:C,tableBodyRef:w,columnFilterRef:T,flattenColumns:Ue,editableColumns:Ge,pagination:ce,fetchParams:vt,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,isFetch:je,dataChange:Ut,getTableData:_t,handleTableData:Ht,createTableData:Dt,createTableFullData:Pt,calcTableHeight:Nt,scrollXToColumn:wt,scrollYToRecord:Ct,doFieldValidate:zt,setTableOriginData:A,setHandleState:z,setColumnsDefined:$,setSelectionKeysEffect:jt,setRowExpandedKeys:me,setHighlightKey:ye,setSelectionRows:B,setOriginColumns:k,forceUpdate:xe,getTableLog:Wt,clearRowSelection:on,clearRowHighlight:sn,clearTableSorter:rn,clearTableFilter:an,clearSuperFilters:ln,clearTableLog:cn}),t.useLayoutEffect((()=>{yt(),I.current.tableManager.register(I.current.uid,null!=n?n:{current:null})}),[]);const pn=jn("table"),hn={[`${pn}--wrapper`]:!0,[`${pn}--lg`]:"large"===x,[`${pn}--sm`]:"small"===x,[`${pn}--maximize`]:$e,[s]:!!s},mn={[pn]:!0,"is--border":rt,"is--fixed":Xe.length||Ze.length,"is--sortable":it,"is--filterable":at,"is--head-group":nt,"is--area-select":!!c,"is--ping-left":Pe,"is--ping-right":He};return t.createElement(vd.Provider,{value:un},t.createElement("div",{className:Fe(hn)},m&&t.createElement("div",{ref:E,className:`${pn}-top`},t.createElement("div",{className:`${pn}-top__space`},"bottom"!==(null==p?void 0:p.position)&&t.createElement(Bd,{total:ce.total}),t.createElement("div",{className:`${pn}-top__space-slot`,style:{justifyContent:Id[h]}},r.children)),t.createElement("div",{className:`${pn}-top__actions`},t.createElement(wu,{ref:C,showFullScreen:f,showReload:g&&je,showPrint:Te.print&&!!d,showImport:Te.import&&st,showExport:Te.export&&!!u,showClipboard:ct,showCollection:ot,showFastSearch:ut,showSuperSearch:dt,showGroupSummary:pt,showToolBox:v,tableColumns:Be}),t.createElement(Tu,{ref:T,columns:a}))),t.createElement(Di,{spinning:null!=l?l:Ie},t.createElement("div",{ref:S,className:Fe(mn),style:bt},t.createElement("div",{className:`${pn}--main-wrapper`},y&&t.createElement(Pu,{tableColumns:Be,sorter:ie,filters:ne}),t.createElement(Zu,{ref:w,tableFlatColumns:ee,tableData:Q}),tt&&t.createElement(Qu,{summationRows:gt})),rt&&t.createElement("div",{className:`${pn}--border-line`}),ft&&t.createElement(tp,null),o&&t.createElement(np,null))),ze&&t.createElement(ep,vn({},ce,{onChange:(e,t)=>Qt({current:e,pageSize:t})}))))}));rp.displayName="QmTable";const ip=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:a,selectionRows:l,defaultSelectedKeys:o=[],filters:s=[],table:c={},className:d,style:u,onClose:p}=e,{size:h}=t.useContext(Bt),m=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:h)&&void 0!==n?n:""}),[e.size,h]),f=t.useRef(null),g=t.useRef(null),v=t.useRef(null),y=Vi(f),[b,x]=t.useState(c),[E,S]=t.useState(),[w,C]=t.useState(o),[T,N]=t.useState(!1),[I,R]=t.useState(300),[O,k]=t.useState(s),[L,A]=t.useState((e=>[{title:Xt("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[P,_]=t.useState(xe({},null===(n=c.fetch)||void 0===n?void 0:n.params,a)),[H,F]=t.useState([]),D=()=>{const e=f.current,t=e.querySelector(".form-wrap");R(e.offsetHeight-t.offsetHeight-2*no[m]-30)},$=Wi(D,5);zi((()=>{$()}),[y.width]),bi((()=>{ge(s,O)||k(s)}),[s]),t.useEffect((()=>{M()}),[P]),t.useEffect((()=>{l&&v.current.SET_SELECTION_ROWS(l)}),[l]),t.useEffect((()=>{var e;a&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(a))}),[]);const M=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=b;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:a,beforeFetch:l=kn}=n;if(l(P)){N(!0);try{const t=yield r(P);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,a))&&void 0!==e?e:[];i||(C([]),yield Ln(0)),F(n)}}catch(e){}N(!1)}})),q=e=>{i||(S(e),p(e))},j=e=>{_(Object.assign({},P,e))},V={[`${jn("search-helper")}--wrapper`]:!0},K=b.webPagination?{dataSource:H,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:P})};return t.createElement("div",{ref:f,className:Fe(V,d),style:u},t.createElement("div",{className:"form-wrap"},O.length?t.createElement(jc,{ref:g,items:O,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>D(),onFinish:e=>j(e),onReset:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||j(t)}))}):null),t.createElement("div",null,t.createElement(rp,vn({ref:v,uniqueKey:r,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},K,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:w,onChange:(e,t)=>{C(e),S(i?t:t[0])}},paginationConfig:b.paginationConfig,columnsChange:e=>A(e),onRowDblclick:q,onRowEnter:q}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>p(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!E,onClick:()=>p(E,i?w:void 0)},Xt("qm.dialog.confirm"))))};ip.displayName="SearchHelper";const ap=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...ap(e.children)),e.children&&t.push(e.value)})),t},lp=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=lp(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},op=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&op(e.children,t),t(e)||e.children&&e.children.length))),sp=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:a,selectionRows:l,defaultSelectedKeys:o=[],filters:s=[],table:c={},tree:d={},className:u,style:p,onClose:h}=e,{size:m}=t.useContext(Bt),f=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:m)&&void 0!==n?n:""}),[e.size,m]),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=Vi(g),[x,E]=t.useState(c),[S,w]=t.useState(),[C,T]=t.useState(o),[N,I]=t.useState(!1),[R,k]=t.useState(300),[L,A]=t.useState(300),[P,_]=t.useState(s),[H,F]=t.useState((e=>[{title:Xt("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[D,$]=t.useState(xe({},null===(n=c.fetch)||void 0===n?void 0:n.params,a)),[M,q]=t.useState([]),j=()=>{const e=g.current,t=e.querySelector(".form-wrap"),n=e.querySelector(".input-wrap");k(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*no[f]-30)},V=Wi(j,5);zi((()=>{V()}),[b.width]),bi((()=>{ge(s,P)||_(s)}),[s]),t.useEffect((()=>{K()}),[D]),t.useEffect((()=>{l&&y.current.SET_SELECTION_ROWS(l)}),[l]),t.useEffect((()=>{var e;a&&(null===(e=v.current)||void 0===e||e.SET_FIELDS_VALUE(a)),te()}),[]);const K=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=x;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:a,beforeFetch:l=kn}=n;if(l(D)){I(!0);try{const t=yield r(D);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,a))&&void 0!==e?e:[];i||(T([]),yield Ln(0)),q(n)}}catch(e){}I(!1)}})),z=e=>{i||(w(e),h(e))},W=e=>{$(Object.assign({},D,e))},[B,U]=t.useState([]),[G,Y]=t.useState([]),[X,Q]=t.useState(""),J=t.useRef(B),ee=t.useRef([]);bi((()=>{Y(ap(B))}),[B]);const te=()=>Tn(void 0,void 0,void 0,(function*(){var e;if(!d.fetch)return;const{api:t,params:n,dataKey:r,valueKey:i="value",textKey:a="text"}=d.fetch;try{const l=yield t(n);if(200===l.code){const t=Array.isArray(l.data)?l.data:null!==(e=me(l.data,r))&&void 0!==e?e:[],n=Sl(t,i,a);U(n),J.current=n,ee.current=t}}catch(e){}})),ne=e=>`${e}|${Ml.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${jn("tree-table-helper")}--wrapper`]:!0},ie=x.webPagination?{dataSource:M,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},x.fetch),{params:D})};return t.createElement("div",{ref:g,className:Fe(re,u),style:p},t.createElement(_i,{defaultValue:200,style:{height:"100%"}},t.createElement(_i.Pane,{min:100,style:{overflowY:"auto"}},t.createElement(O.Search,{className:"input-wrap",value:X,style:{marginBottom:8},placeholder:Xt("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=op(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==ne(n).indexOf(e)}));Q(e),U(t)})(e.target.value)}),t.createElement(Z,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:G,treeData:B,filterTreeNode:e=>{if(!X)return!1;const t=e.text||"";return-1!==ne(t).indexOf(X)},onExpand:e=>{Y(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return en("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const r in t)n[r]=me(e,t[r]);W(n)})(lp(ee.current,(n=>me(n,t)===e[0]))||{})}})),t.createElement(_i.Pane,{className:"split-pane"},t.createElement("div",{className:"form-wrap"},P.length?t.createElement(jc,{ref:v,items:P,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>j(),onFinish:e=>W(e),onReset:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA();e||W(t)}))}):null),t.createElement("div",null,t.createElement(rp,vn({ref:y,uniqueKey:r,height:L,columns:H,rowKey:x.rowKey||"pageIndex"},ie,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{T(e),w(i?t:t[0])}},paginationConfig:x.paginationConfig,columnsChange:e=>F(e),onRowDblclick:z,onRowEnter:z}))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[f]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>h(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!S,onClick:()=>h(S,i?C:void 0)},Xt("qm.dialog.confirm"))))};sp.displayName="TreeTableHelper";const cp=e=>{var n,r,i;const{multiple:a,tree:l={},defaultSelectedKeys:o,className:s,style:c,onClose:d}=e,{size:u}=t.useContext(Bt),p=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:u)&&void 0!==n?n:""}),[e.size,u]),[h,m]=t.useState(),[f]=t.useState(null===(n=l.fetch)||void 0===n?void 0:n.params),g={[`${jn("tree-helper")}--wrapper`]:!0},v=l.fetch?Object.assign(Object.assign({},Hn(l.fetch,["params","valueKey","textKey"])),{params:f}):void 0;return t.createElement("div",{className:Fe(g,s),style:c},t.createElement(gd,{multiple:a,fetch:v,fieldsDefine:{valueKey:null===(r=l.fetch)||void 0===r?void 0:r.valueKey,textKey:null===(i=l.fetch)||void 0===i?void 0:i.textKey},asyncLoad:l.asyncLoad,checkStrictly:l.checkStrictly,checkStrategy:l.checkStrategy,defaultSelectedKeys:o,defaultExpandAll:l.defaultExpandAll,onSelectChange:e=>m(e),onCheckChange:e=>m(e)}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>d(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!h,onClick:()=>d(h)},Xt("qm.dialog.confirm"))))};cp.displayName="TreeHelper";const dp="_startSign",up="_endSign",pp=e=>{var n;const{uniqueKey:r,initialValue:i,filters:a=[],table:l={},onClose:o}=e,{size:s}=t.useContext(Bt),c=t.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:s)&&void 0!==n?n:""}),[e.size,s]),d=t.useRef(null),u=t.useRef(null),p=t.useRef(null),h=Vi(d),[m,f]=t.useState(l),[g,v]=t.useState(!1),[y,b]=t.useState([]),[x,E]=t.useState(300),[S,w]=t.useState(a),[C,T]=t.useState((e=>[{title:Xt("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},{title:Xt("qm.form.rangeSearchHelper")[0],dataIndex:dp,width:80,align:"right",render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)},...e||(l.columns||[]),{title:Xt("qm.form.rangeSearchHelper")[1],dataIndex:up,fixed:"right",width:80,render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)}])()),[N,I]=t.useState(xe({},null===(n=l.fetch)||void 0===n?void 0:n.params,i)),[R,O]=t.useState([]),k=t.useMemo((()=>y.map((e=>null==e?void 0:e.pageIndex))),[y]),A=t.useMemo((()=>2===k.length&&k.every((e=>void 0!==e))),[k]),P=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");E(e.offsetHeight-t.offsetHeight-2*no[c]-30)},_=Wi(P,5);zi((()=>{_()}),[h.width]),bi((()=>{ge(a,S)||w(a)}),[a]),t.useEffect((()=>{H()}),[N]);const H=()=>Tn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=m;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:a=kn}=n;if(a(N)){v(!0);try{const t=yield r(N);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=me(t.data,i))&&void 0!==e?e:[];O(n)}}catch(e){}v(!1)}})),F=(e,t)=>{delete e[t]},D=()=>{y.forEach((e=>{e&&(F(e,dp),F(e,up))})),b([])},$=e=>{D(),I(Object.assign({},N,e))},M=jn("range-helper"),q=m.webPagination?{dataSource:R,loading:g,webPagination:!0}:{fetch:Object.assign(Object.assign({},m.fetch),{params:N})};return t.createElement("div",{ref:d,className:`${M}--wrapper`},t.createElement("div",{className:"form-wrap"},S.length?t.createElement(jc,{ref:u,items:S,initialValues:i,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>w(e),onCollapse:()=>P(),onFinish:e=>$(e),onReset:()=>Tn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();e||$(t)}))}):null),t.createElement("div",null,t.createElement(rp,vn({ref:p,height:x,columns:C,rowKey:m.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=k[0]&&e.pageIndex<=k[1]?{backgroundColor:"#f5f5f5"}:{}},q,{columnsChange:e=>T(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[dp,up].includes(n)&&(n===dp&&(e[n]?(F(e,n),b([void 0,y[1]])):e.pageIndex>k[1]?L.warning(Xt("qm.searchHelper.rangeStartTip")):(y[0]&&F(y[0],n),e[n]="[",b([e,y[1]]))),n===up&&(e[n]?(F(e,n),b([y[0],void 0])):e.pageIndex<k[0]?L.warning(Xt("qm.searchHelper.rangeEndTip")):(y[1]&&F(y[1],n),e[n]="]",b([y[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===k[0]&&(e[dp]="["),e.pageIndex===k[1]&&(e[up]="]")}))}}),t.createElement($n,{type:"primary",icon:t.createElement(xt,null),title:Xt("qm.table.alert.clear"),onClick:()=>D()}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${no[c]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement($n,{onClick:()=>o(null),style:{marginRight:8}},Xt("qm.dialog.cancel")),t.createElement($n,{type:"primary",disabled:!A,onClick:()=>o(y.map((e=>(e=>{const t={};for(const n in e)[dp,up].includes(n)||(t[n]=e[n]);return t})(e))))},Xt("qm.dialog.confirm"))))};pp.displayName="RangeTableHelper";const hp=e=>null!=e;function mp(e,n,r,i){const[a,l]=t.useState(void 0);t.useLayoutEffect((()=>{const t="function"==typeof e?e():e;l(t||null)}));const[o,s]=t.useState(null),c=()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:r,right:i,bottom:a,left:l}=e.getBoundingClientRect();return r>=0&&l>=0&&i<=t&&a<=n})(a)&&n&&a.scrollIntoView(i);const{left:e,top:t,width:r,height:l}=a.getBoundingClientRect(),o={left:e,top:t,width:r,height:l,radius:0};s((e=>JSON.stringify(e)!==JSON.stringify(o)?o:e))}else s(null)};t.useLayoutEffect((()=>{c()}),[a,n]),Wd({handler:c});return[t.useMemo((()=>{if(!o)return o;const e=(null==r?void 0:r.offset)||6,t=(null==r?void 0:r.radius)||2;return{left:o.left-e,top:o.top-e,width:o.width+2*e,height:o.height+2*e,radius:t}}),[o,r]),a]}const fp=8;const gp={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},vp={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},yp=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function bp(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a,visibleFirst:l}=e,o=t/2,s={};return Object.keys(gp).forEach((e=>{const c=r&&vp[e]||gp[e],d=Object.assign(Object.assign({},c),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,yp.has(e)&&(d.autoArrow=!1),e){case"top":case"topLeft":case"topRight":d.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+i}const u=function(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?fp:r}}({contentRadius:a,limitVerticalRadius:!0});if(r)switch(e){case"topLeft":case"bottomLeft":d.offset[0]=-u.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=u.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=-u.arrowOffsetHorizontal-o;break;case"leftBottom":case"rightBottom":d.offset[1]=u.arrowOffsetHorizontal+o}d.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};const i=r&&"object"==typeof r?r:{},a={};switch(e){case"top":case"bottom":a.shiftX=2*t.arrowOffsetHorizontal+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=2*t.arrowOffsetVertical+n,a.shiftX=!0,a.adjustX=!0}const l=Object.assign(Object.assign({},a),i);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}(e,u,t,n),l&&(d.htmlRegion="visibleFirst")})),s}const xp={fill:"transparent",pointerEvents:"auto"},Ep=e=>{const{prefixCls:n,rootClassName:r,pos:i,showMask:a,style:l={},fill:o="rgba(0,0,0,0.5)",open:s,animated:c,zIndex:d}=e,u=`${n}-mask-${Ld()}`,p="object"==typeof c?null==c?void 0:c.placeholder:c;return t.createElement(Mt,{open:s,autoLock:!0},t.createElement("div",{className:Fe(`${n}-mask`,r),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},l)},a?t.createElement("svg",{style:{width:"100%",height:"100%"}},t.createElement("defs",null,t.createElement("mask",{id:u},t.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),i&&t.createElement("rect",{x:i.left,y:i.top,rx:i.radius,width:i.width,height:i.height,fill:"black",className:p?`${n}-placeholder-animated`:""}))),t.createElement("rect",vn({},i?null:xp,{x:"0",y:"0",width:"100%",height:"100%",fill:o,mask:`url(#${u})`})),i&&t.createElement(t.Fragment,null,t.createElement("rect",vn({},xp,{x:"0",y:"0",width:"100%",height:`${i.top}px`})),t.createElement("rect",vn({},xp,{x:"0",y:"0",width:i.left,height:"100%"})),t.createElement("rect",vn({},xp,{x:"0",y:i.top+i.height,width:"100%",height:`calc(100vh - ${i.top+i.height}px)`})),t.createElement("rect",vn({},xp,{x:i.left+i.width,y:"0",width:`calc(100vw - ${i.left+i.width}px)`,height:"100%"})))):null))},Sp=e=>{const{prefixCls:n,zIndex:r,open:i,onPause:a,onPlay:l}=e,[o,s]=Dd(void 0,{value:i,postState:e=>null==e||e}),c=t.useRef(null),d=t.useRef(!1),u=Rd((e=>{p(e),e.shiftKey&&32===e.keyCode&&h()}));t.useEffect((()=>{const e=Lt(document,"keyup",u);return()=>e.remove()}),[]);const p=e=>{e.stopPropagation(),e.preventDefault()},h=()=>{d.current?d.current=!1:(s(!o),o?null==a||a():null==l||l())};return t.createElement("div",{ref:c,className:`${n}-control`,style:{zIndex:r+1},onMouseDown:e=>{p(e);const t=c.current,n=t.offsetWidth,r=t.offsetHeight,i=window.innerWidth,a=window.innerHeight,l=e.clientX-Ii(t).x,o=e.clientY-Ii(t).y;return document.onmousemove=e=>{let s=e.clientX-l,c=e.clientY-o;s<0&&(s=0),s>i-n-1&&(s=i-n-1),c<0&&(c=0),c>a-r-1&&(c=a-r-1),Ci(t,{left:`${s}px`,top:`${c}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>h()},o?t.createElement(Et,null):t.createElement(St,null))},wp=e=>{const{prefixCls:n,current:r,total:i=0,cover:a,title:l,description:o,helper:s={},type:c,zIndex:d,onClose:u,onPrev:p,onNext:h,onFinish:m,className:f,indicatorsRender:g}=e,{t:v}=Vd(),y="primary"!==c?"primary":"default",b=Rd((e=>{w(e),40===e.keyCode&&(r<i-1?null==h||h():null==m||m()),38===e.keyCode&&r>0&&(null==p||p())}));t.useEffect((()=>{const e=Lt(document,"keyup",b);return()=>e.remove()}),[]);const x=hp(a)?t.createElement("div",{className:`${n}-cover`},a):null,E=hp(o)?t.createElement("div",{className:`${n}-description`},o):null;let S;S=g?g(r,i):[...Array.from({length:i}).keys()].map(((e,i)=>t.createElement("span",{key:e,className:Fe(i===r&&`${n}-indicator-active`,`${n}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return t.createElement("div",{className:Fe(`${n}-content`,f)},t.createElement("div",{className:`${n}-inner`},t.createElement(Ze,{className:`${n}-close`,onClick:u}),s.content&&t.createElement(J,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},t.createElement(wt,{className:Fe(`${n}-close`,"help-icon")})),x,t.createElement("div",{className:`${n}-header`},t.createElement("div",{className:`${n}-title`},l)),E,t.createElement("div",{className:`${n}-footer`},i>1&&t.createElement("div",{className:`${n}-indicators`},S),t.createElement(qn,{className:`${n}-buttons`},0!==r?t.createElement($n,{className:`${n}-prev-btn`,size:"small",onMouseDown:w,onClick:p},v("qm.tour.prevStep")):null,r===i-1?t.createElement($n,{className:`${n}-finish-btn`,type:y,size:"small",onClick:m},v("qm.tour.finish")):t.createElement($n,{className:`${n}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:h},v("qm.tour.nextStep"))))))},Cp=e=>{const{current:n,renderPanel:r}=e;return t.createElement(t.Fragment,null,"function"==typeof r?r(e,n):t.createElement(wp,e))},Tp={left:"50%",top:"50%",width:1,height:1},Np=t.forwardRef(((e,n)=>{const{steps:r=[],defaultCurrent:i,current:a,onChange:l,onClose:o,onFinish:s,open:c,type:d="default",mask:u=!0,arrow:p=!0,control:h=!0,overlayClassName:m,overlayStyle:f,placement:g,helper:v,zIndex:y,renderPanel:b,indicatorsRender:x,gap:E,animated:S=!0,scrollIntoViewOptions:w=!0}=e,C=wn(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),T=t.useRef(),[N,I]=Dd(0,{value:a,defaultValue:i}),[R,O]=Dd(void 0,{value:c,postState:e=>!(N<0||N>=r.length)&&(null!=e&&e)}),[k,L]=Dd(1051,{value:y,defaultValue:y}),[A,P]=t.useState(),_=t.useRef(R);t.useLayoutEffect((()=>{R&&!_.current&&I(0),_.current=R,P(R)}),[R]),t.useImperativeHandle(n,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>L(e)})));const{target:H,type:F,placement:D,trigger:$,delay:M,style:q,arrow:j,className:V,mask:K,scrollIntoViewOptions:z,zIndex:W,action:B}=r[N]||{},U=W||k,G=F||d,Y=R&&(null!=K?K:u),X=null!=z?z:w,[Z,Q]=mp(H,!!c,E,X),J=((e,t,n)=>{var r;return null!==(r=null!=n?n:t)&&void 0!==r?r:null===e?"center":"bottom"})(Q,g,D),ee=!!Q&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;t.useLayoutEffect((()=>{var e;null===(e=T.current)||void 0===e||e.forceAlign()}),[te,N]),bi((()=>{R&&(ie(),null==B||B(Q,N))}),[R,Q]);const ne=e=>{I(e),null==l||l(e)},re=()=>{O(!1),null==o||o(N)},ie=()=>{if(!Q)return;const e=[];!function t(n){if(1===n.nodeType){var r;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===wi(r=n,"display")||"hidden"===wi(r,"visibility")||"0"===wi(r,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Q),e.length&&e[0].focus()};if(void 0===Q)return null;const ae=()=>Tn(void 0,void 0,void 0,(function*(){if(!$||!Q)return;const{left:e,top:t}=Q.getBoundingClientRect(),n=Q.offsetWidth,r=Q.offsetHeight,[i,a]=[e+n/2,t+r/2],l=new MouseEvent($,{bubbles:!0,cancelable:!0,button:0,clientX:i,clientY:a}),o=document.elementFromPoint(i,a);o&&(o.dispatchEvent(l),yield Ln(null!=M?M:320))})),le="boolean"==typeof Y?Y:!!Y,oe="boolean"==typeof Y?void 0:Y,se=Object.assign({},f,q),ce=jn("tour"),de=[{[`${ce}-primary`]:"primary"===G},m,V],ue=bp({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(Ep,{zIndex:U,prefixCls:ce,pos:Z,showMask:le,style:null==oe?void 0:oe.style,fill:null==oe?void 0:oe.color,open:A,animated:S,rootClassName:m}),t.createElement(Mt,{open:A,autoLock:!0},t.createElement(qt,vn({ref:T},C,{zIndex:U,builtinPlacements:ue,popupStyle:se,popupPlacement:J,popupVisible:A,popupClassName:Fe(de),prefixCls:ce,popup:()=>t.createElement(Cp,vn({key:"content",arrow:ee,prefixCls:ce,total:r.length,helper:v,renderPanel:b,indicatorsRender:x,onPrev:()=>Tn(void 0,void 0,void 0,(function*(){yield ae(),ne(N-1)})),onNext:()=>Tn(void 0,void 0,void 0,(function*(){yield ae(),ne(N+1)})),onClose:re,current:N,onFinish:()=>{re(),null==s||s()}},Object.assign({},r[N],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Q||document.body,forceRender:!1,destroyPopupOnHide:!0}),t.createElement("div",{className:Fe(m,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Z||Tp),{position:"fixed",pointerEvents:"none"})}))),h&&t.createElement(Mt,{open:R},t.createElement(Sp,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));Np.displayName="QmTour";const Ip=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Rp=e=>({_s:e,status:Ip[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),Op=e=>e?6:5,kp=(e,t,n,r,i)=>{clearTimeout(r.current);const a=Rp(e);t(a),n.current=a,null==i||i({current:a})},Lp=(e={})=>{const{enter:t=!0,exit:n=!0,preEnter:r,preExit:i,timeout:a,initialEntered:o,mountOnEnter:c,unmountOnExit:d,onStateChange:u}=e||{},[m,f]=p((()=>Rp(o?2:Op(c)))),g=l(m),v=l(),[y,b]=(e=>se(e)?[e.enter,e.exit]:[e,e])(a),x=h((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return Op(t)}})(g.current._s,d);e&&kp(e,f,g,v,u)}),[u,d]),E=h((e=>{const a=e=>{switch(kp(e,f,g,v,u),e){case 1:y>=0&&(v.current=setTimeout(x,y));break;case 4:b>=0&&(v.current=setTimeout(x,b));break;case 0:case 3:v.current=setTimeout((()=>a(e+1)),0)}},l=g.current.isEnter;"boolean"!=typeof e&&(e=!l),e?!l&&a(t?r?0:1:2):l&&a(n?i?3:4:Op(d))}),[x,u,t,n,r,i,y,b,d]);return s((()=>()=>clearTimeout(v.current)),[]),[m,E,x]},Ap=e=>{const{name:n,in:r,timeout:i,preEnter:a=!0,preExit:l}=e,[o,s]=Lp({timeout:i,preEnter:a,preExit:l,initialEntered:r});return zi((()=>{s()}),[r]),t.createElement(t.Fragment,null,t.Children.map(e.children,(e=>t.isValidElement(e)?Wu(e,{className:Fe(e.props.className,n,o.status)}):e)))};var Pp={previewWidth:1100,defaultDistance:.45,logoHeight:60};const _p=n(void 0);var Hp=null;function Fp(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),n=e.match(/MSIE\D?\d+/i),r=e.match(/OPR\D?\d+/i),i=e.match(/Firefox\D?\d+/i),a=e.match(/x64/i);if(!t&&!n&&a)return!0;if(i){if((i=i[0].match(/\d+/))[0]>=41||a)return!0}else if(r){if((r=r[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!n){var l=e.match(/Chrome\D?\d+/i);if(l&&(l=l[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Dp(e,t){var n;try{var r=navigator.userAgent,i=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(Fp()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void L.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!n)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{i&&r.match(/x64/i);if(e||t?n=i?e:t:Hp?n=Hp:((n=document.createElement("object")).setAttribute("width",0),n.setAttribute("height",0),n.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),i?n.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):n.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(n),Hp=n),!n||!n.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&Fp(),n}catch(e){L.error("getLodop 出错:"+e)}}Fp();const $p=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:n,deviceYDPI:r}=window.screen;if(n&&r)t[0]=n,t[1]=r;else{let n=document.createElement("DIV");n.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth.toString()),t[1]=parseInt(n.offsetHeight.toString()),null===(e=n.parentNode)||void 0===e||e.removeChild(n),n=null}return t})()[0];return Math.ceil(t)},Mp=t.forwardRef(((e,n)=>{const{templateRender:r,directPrint:i}=e,{global:a}=t.useContext(Bt),{$$preview:l}=t.useContext(_p),{state:o,isWindowsPrinter:s,pageSize:c}=l,d=t.useRef(null),u=t.useRef({}),p=t.useRef([]),h=t.useRef([]),m=t.useRef([]),[f,g]=t.useState(!0);t.useImperativeHandle(n,(()=>({createPreviewDom:O,createExportHtml:L,createPrintHtml:k,SHOW_PREVIEW:A,DIRECT_PRINT:P}))),bi((()=>{R()}),[o.form.printerType,o.form.setting.direction,o.form.setting.distance,o.form.setting.fixedLogo]),t.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const v=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*Pp.defaultDistance+10*Pp.defaultDistance:0;return("vertical"===e?c[0]:c[1])-t}),[o,s,c]),y=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*Pp.defaultDistance+10*Pp.defaultDistance:0;return("vertical"===e?c[1]:c[0])-t}),[o,s,c]),b=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return $p(v-10*(e.left-Pp.defaultDistance)-10*(e.right-Pp.defaultDistance))}),[o,v]),x=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return $p(y-10*(e.top-Pp.defaultDistance)-10*(e.bottom-Pp.defaultDistance))}),[o,y]),E=o.form.scale,S=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return{left:$p(10*e.left),right:$p(10*e.right),top:$p(10*e.top),bottom:$p(10*e.bottom)}}),[o]),w=t.useMemo((()=>{const{form:{printerType:e}}=o,{left:t,right:n,top:r,bottom:i}=S,a=b+t+n,l=Pp.previewWidth-a<=0?0:(Pp.previewWidth-a)/2,s=Math.abs((1-E)*a/2);let c=0;return E>1&&(c=s>l?-1*l:-1*s),E<1&&(c=a-2*s>Pp.previewWidth?0:l>0?s:(Pp.previewWidth-(a-2*s))/2),{width:`${b}px`,height:""+("stylus"===e?"auto":x+"px"),paddingLeft:`${t}px`,paddingRight:`${n}px`,paddingTop:`${r}px`,paddingBottom:`${i}px`,transform:`translateX(${c}px) scale(${E})`,opacity:f?0:1}}),[o,f,S,E,x,b]);p.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const C=()=>{var e,t,n,r;const i=null!==(t=null===(e=null==a?void 0:a.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",l=null!==(r=null===(n=null==a?void 0:a.print)||void 0===n?void 0:n.rightLogo)&&void 0!==r?r:"";return[`<tr style="height: ${Pp.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',l?`<img src="${l}" border="0" height="46" />`:"","</td>","</tr>"].join("")},T=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},N=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=T().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(n=u.current.templateEl.children[0]).children[0]?n.insertBefore(t,n.children[0]):n.appendChild(t),e=null},I=()=>{const e=u.current.templateEl.children[0].children,t=[],n=[];for(let r=0;r<e.length;r++){if("template-cols"===e[r].getAttribute("type"))continue;const i=e[r].clientHeight;e[r].style.height=i+"px",n.push(i),t.push(e[r].outerHTML)}h.current=n,p.current=t},R=()=>{var e;if(!p.current.length)return;const{form:{setting:t,printerType:n}}=o;if(i)return m.current.push([T(),C(),...p.current]);const r=t.fixedLogo?x-Pp.logoHeight:x;let a=[];if(m.current=[],"stylus"===n)m.current.push([T(),...t.fixedLogo?[C()]:[],...p.current]);else{let e=0;for(let n=0,i=h.current.length;n<i;n++){const l=p.current[n],o=h.current[n];t.fixedLogo||0!==n||(e+=Pp.logoHeight),e+=o,e<=r?a.push(l):(m.current.push([T(),...t.fixedLogo?[C()]:[],...a]),a=[],e=0,n-=1),n===i-1&&a.length&&m.current.push([T(),...t.fixedLogo?[C()]:[],...a])}}t.fixedLogo||null===(e=m.current[0])||void 0===e||e.splice(1,0,C());for(let e=0,t=m.current.length;e<t&&e!==t-1;e++)m.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');l.setState({currentPage:1,totalPage:m.current.length}),O()},O=()=>{var e,t;const{currentPage:n}=o;let r=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;r+=null!==(t=null===(e=m.current[n-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",r+="</table>",u.current.previewEl.innerHTML=r,u.current.previewEl.parentNode.scrollTop=0},k=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...m.current[e-1]].join("")}else for(let e=0;e<m.current.length;e++)t+=m.current[e].join("");return t+="</table>",t},L=()=>{const e=[];for(let t=0;t<p.current.length;t++)e[t]=p.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+C()+T()+e.join("")+"</table>"},A=()=>Tn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();u.current.previewEl.innerHTML||(N(),yield Ln(0),I(),R(),g(!1))})),P=()=>Tn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();N(),yield Ln(0),I(),R(),g(!1),l.doPrint(k()),yield Ln(0),l.doClose()})),_=()=>{en("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},H={[jn("print-container")]:!0,"no-visible":i};return t.createElement("div",{ref:d,className:Fe(H)},t.createElement(Di,{wrapperClassName:"spin",spinning:f,tip:"Loading..."},t.createElement("div",{className:"preview"},t.createElement("div",{className:"origin-template",style:{width:`${b}px`,marginLeft:`-${Math.floor(b/2)}px`}},null==r?void 0:r()),t.createElement("div",{className:"workspace",style:w}))))}));Mp.displayName="Container";class qp extends r{constructor(){super(...arguments),this.formRef=t.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Xt("qm.print.setPanel.printParameter")},{type:"SELECT",label:Xt("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:Xt("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Xt("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Xt("qm.print.setPanel.vertical"),value:"vertical"},{text:Xt("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Xt("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Xt("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:Xt("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Xt("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Xt("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Xt("qm.print.setPanel.noEmpty")}]}],this.getInitialvalue=()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})},this.getInitialExtra=()=>({disleft:Xt("qm.print.setPanel.sizeUnit"),disright:Xt("qm.print.setPanel.sizeUnit"),distop:Xt("qm.print.setPanel.sizeUnit"),disbottom:Xt("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Tn(this,void 0,void 0,(function*(){const[e,t]=yield this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),this.cancelHandle=()=>{this.props.onClose()}}render(){const{formList:e}=this.state;return t.createElement(t.Fragment,null,t.createElement(jc,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement($n,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Xt("qm.dialog.close")),t.createElement($n,{type:"primary",onClick:()=>this.confirmHandle()},Xt("qm.dialog.confirm"))))}}qp.contextType=Bt;class jp extends r{constructor(){var e,n,r;super(...arguments),this.provide={$$preview:this},this.containRef=t.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(n=this.props.defaultConfig)||void 0===n?void 0:n.copies)||1,scale:1,setting:{distance:{left:Pp.defaultDistance,right:Pp.defaultDistance,top:Pp.defaultDistance,bottom:Pp.defaultDistance},pageSize:"210*297",direction:(null===(r=this.props.defaultConfig)||void 0===r?void 0:r.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0},this.pageChangeHandle=e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))},this.exportClickHandle=()=>{this.doExport(this.containRef.current.createExportHtml())},this.printClickHandle=()=>Tn(this,void 0,void 0,(function*(){if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e=Object.assign(Object.assign({},this.state.form),{printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text});yield Kt.setItem(this.printerKey,e),yield this.savePrintConfig(this.printerKey,e)}catch(e){}})),this.doClose=()=>{var e,t;null===(t=(e=this.props).onClose)||void 0===t||t.call(e)},this.getPrintConfig=e=>Tn(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Tn(this,void 0,void 0,(function*(){const n=this.context.global,r=null==n?void 0:n.saveComponentConfigApi;if(r)try{yield r({[e]:t})}catch(e){}})),this.createStyle=()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ',this.doPrint=e=>{const t=Dp();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i,printerName:a,printerType:l,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=Pp,{left:d,right:u,top:p,bottom:h}=i.distance;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(a),t.SET_PRINT_COPIES(o),i.doubleSide&&("auto"===i.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===l&&("vertical"===i.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===i.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===l&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(p-c)+"mm",10*(d-c)+"mm",`RightMargin: ${10*(u-c)}mm`,`BottomMargin: ${"stylus"!==l?10*(h-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?r&&this.doClose():L.error(Xt("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=Dp();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i}}=this.state;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?r&&this.doClose():L.error(Xt("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===i.direction?1:2),t.SAVE_TO_FILE(`${g().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Xt("qm.print.laserPrinter"),value:"laser"},{text:Xt("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Dp(),t=[{text:Xt("qm.print.defaultPrinter"),value:-1}];try{const n=e.GET_PRINTER_COUNT();for(let r=0;r<n;r++)t.push({text:e.GET_PRINTER_NAME(r),value:r})}catch(e){en("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}componentDidMount(){var e,t;return Tn(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield Kt.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),se(n)&&(yield Kt.setItem(this.printerKey,n))),se(n)&&Object.keys(n).length&&xe(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:n}=this.props,{visible:r,form:i,currentPage:a,totalPage:l,printPage:o}=this.state,s=jn("print-preview"),c={visible:r,title:Xt("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[s]:!0};return e?t.createElement(t.Fragment,null,t.createElement("div",{className:Fe(d)},t.createElement("div",{className:"outer"},t.createElement("div",{className:"header"},t.createElement("span",null,Xt("qm.print.printer"),":",t.createElement($,{value:i.printerName,onChange:e=>{this.setState((t=>xe({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,Xt("qm.print.type"),":",t.createElement($,{value:i.printerType,onChange:e=>{this.setState((t=>xe({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,Xt("qm.print.copies"),":",t.createElement(j,{value:i.copies,min:1,precision:0,onChange:e=>{this.setState((t=>xe({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),t.createElement("span",null,Xt("qm.print.printPage.0"),t.createElement(j,{value:o,min:1,max:l,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),Xt("qm.print.printPage.1")),t.createElement("span",null,t.createElement(ee,{size:"small",current:a,pageSize:1,total:l,onChange:this.pageChangeHandle})),t.createElement("span",null,t.createElement($n,{type:"text",icon:t.createElement(st,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Xt("qm.print.setting"))),t.createElement("span",null,t.createElement($n,{type:"text",icon:t.createElement(Ke,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Xt("qm.print.export"))),t.createElement("span",null,t.createElement($n,{icon:t.createElement(lt,null),type:"primary",onClick:this.printClickHandle},Xt("qm.print.print")))),t.createElement("div",{className:"main"},t.createElement(_p.Provider,{value:this.provide},t.createElement(Mp,{ref:this.containRef,templateRender:n,directPrint:!1}))),t.createElement("div",{className:"footer"},t.createElement("span",null,Xt("qm.print.scale"),":",t.createElement(te,{value:i.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>xe({},t,{form:{scale:e}})))}}),t.createElement("em",{className:"scale-text"},`${Math.floor(100*i.scale)}%`)),t.createElement("span",null,Xt("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t.createElement("span",null,Xt("qm.print.pageNumber"),":",Xt("qm.print.pagination",{currentPage:a,totalPage:l}))))),t.createElement(da,c,t.createElement(qp,{setting:i.setting,onChange:e=>{this.setState((t=>xe({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t.createElement(_p.Provider,{value:this.provide},t.createElement(Mp,{ref:this.containRef,templateRender:n,directPrint:!0}))}}jp.contextType=Bt;class Vp extends r{constructor(){super(...arguments),this.previewRef=t.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Tn(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const n=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof n&&!n)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:n,uniqueKey:r,defaultConfig:i,preview:a,closeAfterPrint:l}=this.props,o={visible:e,title:Xt("qm.print.preview"),width:`${Pp.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:n,uniqueKey:r,defaultConfig:i,preview:a,closeAfterPrint:l,onClose:()=>{this.setState({visible:!1})}};return a?t.createElement(da,o,t.createElement(jp,s)):e?t.createElement(jp,s):null},this.DO_PRINT=()=>Tn(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield Ln(0),this.setState({visible:!0}),yield Ln(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:n,icon:r,type:i,disabled:a,shape:l}=this.props,o={size:n||this.context.size||"",type:i,shape:l,icon:r,loading:e,disabled:a,click:this.clickHandle};return t.createElement(t.Fragment,null,this.props.children&&t.createElement($n,o,this.props.children),this.createRender())}}function Kp(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function zp(e){const t=Kp(e);return t?t.frameElement:null}function Wp(e){const t=Gp(e);return Bp([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Bp(e){return e.reduce(((e,t)=>null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}))}function Up(e,t){const n=zp(e);if(n&&n!==t){const r=[e.getBoundingClientRect()];let i=n,a=!1;for(;i;){const e=Wp(i);if(r.push(e),i=zp(i),a)break;i&&Kp(i)===t&&(a=!0)}return Bp(r)}return e.getBoundingClientRect()}function Gp(e){const t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}Vp.propTypes={size:(e,t,n)=>{if(!nn(e[t]||""))return Jt("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:f.elementType},Vp.defaultProps={preview:!0,type:"primary",icon:t.createElement(lt,null)},Vp.contextType=Bt;const Yp=Object.assign;class Xp{constructor(e,t){this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=eh.border,this.padding.style.borderColor=eh.padding,this.content.style.backgroundColor=eh.background,Yp(this.node.style,{borderColor:eh.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),t.appendChild(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,t){Jp(t,"margin",this.node),Jp(t,"border",this.border),Jp(t,"padding",this.padding),Yp(this.content.style,{height:e.height-t.borderTop-t.borderBottom-t.paddingTop-t.paddingBottom+"px",width:e.width-t.borderLeft-t.borderRight-t.paddingLeft-t.paddingRight+"px"}),Yp(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Zp{constructor(e,t){this.tip=e.createElement("div"),Yp(this.tip.style,{display:"flex",flexFlow:"row nowrap",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"3px 5px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),Yp(this.nameSpan.style,{color:"#ee78e6",borderRight:"1px solid #aaaaaa",paddingRight:"0.5rem",marginRight:"0.5rem"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),Yp(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,n){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(n)+"px"}updatePosition(e,t){const n=this.tip.getBoundingClientRect(),r=function(e,t,n){const r=Math.max(n.height,20),i=Math.max(n.width,60),a=5;let l;l=e.top+e.height+r<=t.top+t.height?e.top+e.height<t.top+0?t.top+a:e.top+e.height+a:e.top-r<=t.top+t.height?e.top-r-a<t.top+a?t.top+a:e.top-r-a:t.top+t.height-r-a;let o=e.left+a;e.left<t.left&&(o=t.left+a);e.left+i>t.left+t.width&&(o=t.left+t.width-i-a);return l+="px",o+="px",{style:{top:l,left:o}}}(e,t,{width:n.width,height:n.height});Yp(this.tip.style,r.style)}}class Qp{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const n=e.document;this.container=n.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Zp(n,this.container),this.rects=[],n.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const n=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>n.length;){const e=this.rects.pop();null==e||e.remove()}if(0===n.length)return;for(;this.rects.length<n.length;)this.rects.push(new Xp(this.window.document,this.container));const r={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};n.forEach(((e,t)=>{const n=Up(e,this.window),i=Gp(e);r.top=Math.min(r.top,n.top-i.marginTop),r.right=Math.max(r.right,n.left+n.width+i.marginRight),r.bottom=Math.max(r.bottom,n.top+n.height+i.marginBottom),r.left=Math.min(r.left,n.left-i.marginLeft);this.rects[t].update(n,i)})),t||(t=n[0].nodeName.toLowerCase(),n[0]),this.tip.updateText(t,r.right-r.left,r.bottom-r.top);const i=Up(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:r.top,left:r.left,height:r.bottom-r.top,width:r.right-r.left},{top:i.top+this.tipBoundsWindow.scrollY,left:i.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Jp(e,t,n){Yp(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const eh={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"};let th=null,nh=null;function rh(){null!=window.document&&(th=null,null!==nh&&(nh.remove(),nh=null))}class ih{constructor(e){this._lastHoveredNode=null,this.iframesListeningTo=new Set,this.onClick=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onMouseEvent=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onPointerDown=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))},this.onPointerMove=e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>Oi(t,window.document.querySelector(e)))))return this._selectIgnore=!0,rh();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var n,r,i;n=[t],r=null,i=!1,null!=window.document?(null!==th&&clearTimeout(th),null!=n&&(null===nh&&(nh=new Qp),nh.inspect(n,r),i&&(th=setTimeout((()=>rh()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=pe((e=>{var t;this._selectIgnore||null===(t=this.onSelect)||void 0===t||t.call(this,e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let n=e;const r=[];for(;n!==t&&null!==n;){let e=n.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,r=Array.from(n.classList).reverse();e<r.length;e++)t.test(r[e])&&n.classList.remove(r[e]);if(n.id&&/^rc-\w+/.test(n.id)&&n.removeAttribute("id"),n.id)e+=`#${n.id}`;else{const t=Array.from(n.parentElement.children).filter((e=>e.tagName===n.tagName)),r=n.className.trim();if(t.filter((e=>e.className.includes(r))).length<=1){if(r){const t=r.split(/\s+/);let n="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(n+=`.${t[e]}`);e+=n}}else n.getAttribute("name")?e+=`[name=${n.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(n)+1})`}n.nodeType!==Node.TEXT_NODE&&r.unshift(e),n=n.parentElement}return r.join(" > ")}(e))}),200,{leading:!1}),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){rh(),this.removeListenersOnWindow(window),this.iframesListeningTo.forEach((function(e){try{this.removeListenersOnWindow(e.contentWindow)}catch(e){}})),this.iframesListeningTo=new Set,this._isRunning=!1}registerListenersOnWindow(e){e&&"function"==typeof e.addEventListener&&(e.addEventListener("click",this.onClick,!0),e.addEventListener("mousedown",this.onMouseEvent,!0),e.addEventListener("mouseover",this.onMouseEvent,!0),e.addEventListener("mouseup",this.onMouseEvent,!0),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0))}removeListenersOnWindow(e){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("click",this.onClick,!0),e.removeEventListener("mousedown",this.onMouseEvent,!0),e.removeEventListener("mouseover",this.onMouseEvent,!0),e.removeEventListener("mouseup",this.onMouseEvent,!0),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0))}getEventTarget(e){return e.composed?e.composedPath()[0]:e.target}}function ah(e){return document.querySelector(e)}const lh=e=>{const{action:n,onConfirm:r,onCancel:i,onFinish:a}=e,{t:l}=Vd();return t.createElement(t.Fragment,null,t.createElement("div",{style:{height:100}},l("qm.table.config.emptyText")),t.createElement(qn,{style:{width:"100%",justifyContent:"flex-end"}},t.createElement($n,{size:"small",onClick:()=>null==i?void 0:i()},l("qm.guideTracker.closeButton")),t.createElement($n,{size:"small",onClick:()=>null==r?void 0:r()},l("add"===n?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),t.createElement($n,{size:"small",onClick:()=>null==a?void 0:a()},l("qm.guideTracker.finishButton"))))},oh={left:"50%",top:"50%",width:1,height:1},sh=t.forwardRef(((e,n)=>{const{open:r,current:i,defaultCurrent:a,steps:l=[],placement:o="bottom",control:s=!0,overlayClassName:c,overlayStyle:d,destroyOnHide:u,contentRender:p,zIndex:h,helper:m={},selectFilter:f=(e=>e),onSelect:g,onChange:v,onClose:y,onFinish:b}=e,{t:x}=Vd(),E=t.useRef(),S=t.useRef(l.length),[w,C]=Dd(0,{value:i,defaultValue:a}),[N,I]=Dd(void 0,{value:r,postState:e=>null!=e&&e}),[R,O]=Dd(1051,{value:h,defaultValue:h}),[k,L]=t.useState({}),[A,P]=t.useState(!1),[_,H]=t.useState(N),[F,D]=t.useState(!1),[$,M]=mp(k.node,!!r),[j,V]=t.useState(22),K=t.useRef(!1),z=t.useMemo((()=>w>=l.length?"add":"edit"),[w,l]),W=t.useMemo((()=>`${w+1} / ${l.length}`),[w,l]);t.useLayoutEffect((()=>{E.current=new ih({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),L({id:Ga(),node:e,path:t}),C(S.current),P(!0),U(),null==g||g(t,e)}})}),[]),t.useEffect((()=>(N?B():U(),N?setTimeout((()=>H(!0)),16):H(!1),()=>{U()})),[N]),t.useEffect((()=>{S.current=l.length}),[l]);const B=()=>{E.current.startHandle()},U=()=>{E.current.stopHandle()},G=e=>{e.stopPropagation(),e.preventDefault()};t.useImperativeHandle(n,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),GET_CURRENT_STEP:()=>({current:w,selector:k.path})})));const Y=jn("guide-tracker"),X=[{[`${Y}-primary`]:!0}],Z=bp({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(Mt,{open:N&&A,autoLock:!0},t.createElement(qt,{zIndex:R,builtinPlacements:Z,popupPlacement:o,popupVisible:N&&A,popupClassName:Fe(X,c),popupStyle:d,prefixCls:Y,popup:()=>{const e=()=>{P(!1),B()};return t.createElement("div",{className:`${Y}-content`},t.createElement("div",{className:`${Y}-inner`},t.createElement(Ze,{className:`${Y}-close`,onClick:()=>{null==y||y(w),e()}}),t.createElement(q,{open:F,trigger:["click"],dropdownRender:()=>l.length?t.createElement("div",{className:"ant-dropdown-menu step-list"},t.createElement(Vt,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.id)),n=l.map((e=>e.id));if(ge(t,n))return;const r=t.findIndex((e=>e===k.id)),i=-1!==r?r:w;C(i),null==v||v(il(e),i)}},l.map(((e,n)=>t.createElement("li",{key:n,className:Fe("item",{actived:e.id===k.id})},t.createElement(Ge,{className:"handle",title:x("qm.form.draggable")}),t.createElement("span",{className:"box"},t.createElement("span",{className:"title",title:e.title,onClick:()=>{n!==w&&(L({id:e.id,node:ah(e.selector),path:e.selector}),C(n),V(22===j?j+1:j-1),null==v||v(l,n))}},e.title),t.createElement(T,{title:x("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const t=l.filter((t=>t.id!==e.id)),r=n===w;let i=n<=w?w-1:w;if(i=i<0?0:i,i=i>t.length?t.length:i,r&&t[i]){const{id:e,selector:n}=t[i];L({id:e,node:ah(n),path:n})}C(i),null==v||v(t,i)}},t.createElement(Ze,{className:"close-icon"})))))))):t.createElement(t.Fragment,null),overlayClassName:`${Y}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>D(e)},t.createElement(Ct,{className:Fe(`${Y}-close`,"menu-icon"),style:{width:j}})),m.content&&t.createElement(J,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:m.content,title:m.title},t.createElement(wt,{className:Fe(`${Y}-close`,"help-icon")})),t.createElement("div",{className:"panel-label"},t.createElement("span",{className:"title"},x("qm.guideTracker.label")),t.createElement("span",{className:"step"},x("qm.guideTracker.currentStep"),W)),p?p({id:k.id,selector:k.path,actionStatus:z,DO_CLOSE:e},w):t.createElement(lh,{action:z,onConfirm:()=>{null==v||v("add"===z?[...l,{id:k.id,selector:k.path,title:"Guide Title"}]:[...l],w),e()},onCancel:()=>{null==y||y(w),e()},onFinish:()=>{e(),null==y||y(w),null==b||b()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},t.createElement("div",{className:Fe(`${Y}-target-placeholder`),style:Object.assign(Object.assign({},$||oh),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:G,onClick:G}))),s&&t.createElement(Mt,{open:_},t.createElement(Sp,{zIndex:R,prefixCls:Y,onPause:()=>{K.current=A,P(!1),U()},onPlay:()=>{K.current?P(!0):B()}})))}));sh.displayName="QmGuideTracker";const ch=n=>{var r,i,a,l,o,s,c,d;const{content:u,image:p,width:h,height:m,font:f={},gap:g=[100,100],offset:v=[50,50],rotate:y=-22,zIndex:b=9,alpha:x=1,antiTamper:E=!0,grayscale:S,className:w,style:C}=n,T=t.useRef(null),N=t.useRef(new Map),I=null!==(r=f.fontSize)&&void 0!==r?r:16,R=null!==(i=f.fontWeight)&&void 0!==i?i:"normal",O=null!==(a=f.fontStyle)&&void 0!==a?a:"normal",k=null!==(l=f.fontFamily)&&void 0!==l?l:"sans-serif",L=null!==(o=f.color)&&void 0!==o?o:"rgba(0, 0, 0, 0.15)",A=null!==(s=f.textAlign)&&void 0!==s?s:"center",P=Array.isArray(u)?u:[u],_=g[0],H=g[1],F=_/2,D=H/2,$=null!==(c=v[0])&&void 0!==c?c:F,M=null!==(d=v[1])&&void 0!==d?d:D,q=t.useMemo((()=>{const e=$-F,t=M-D;return{position:"absolute",left:e>0?`${e}px`:0,top:t>0?`${t}px`:0,width:e>0?`calc(100% - ${e}px)`:"100%",height:t>0?`calc(100% - ${t}px)`:"100%",pointerEvents:"none",backgroundRepeat:"repeat",backgroundPosition:`${e>0?0:e}px ${t>0?0:t}px`,zIndex:b}}),[F,D,$,M,b]),j=(e,t)=>{var n;if(T.current){const r=N.current.get(T.current);r&&(T.current.contains(r)&&T.current.removeChild(r),N.current.delete(T.current));const i=document.createElement("div");i.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var n})).join(";"))(Object.assign(Object.assign({},q),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(n=T.current)||void 0===n||n.append(i),N.current.set(T.current,i)}},V=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[r,i]=(e=>{let t=120,n=64;if(!p&&e.measureText){e.font=`${I}px ${k}`;const r=P.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...r)),n=I*P.length+3*(P.length-1)}return[null!=h?h:t,null!=m?m:n]})(t),a=r*n,l=i*n,o=(_+r)*n,s=(H+i)*n,c=_/2*n,d=H/2*n,u=o/2,f=s/2,g=2*(_+r);e.width=2*o,e.height=2*s,t.globalAlpha=x,t.save(),t.translate(u,f),t.rotate(Math.PI/180*y),t.translate(-u,-f);const v=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),S&&(e=>{const t=e.getContext("2d");if(!t)return;const n=t.getImageData(0,0,e.width,e.height),{data:r}=n;for(let e=0;e<r.length;e+=4){const t=(r[e]+r[e+1]+r[e+2])/3;r[e]=t,r[e+1]=t,r[e+2]=t}t.putImageData(n,0,0)})(e),j(e.toDataURL(),g)},b=()=>{const e=Number(I)*n;t.font=`${O} normal ${R} ${e}px/${i}px ${k}`,t.fillStyle=L,t.textAlign=A,t.textBaseline="top",t.translate(a/2,0),P.forEach(((r,i)=>{t.fillText(null!=r?r:"",c,d+i*(e+3*n))})),v()};if(p){const e=new Image;e.onload=()=>{t.drawImage(e,c,d,a,l),v()},e.onerror=()=>{b()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=p}else b()},K=e=>Array.from(N.current.values()).includes(e);t.useEffect((()=>{V()}),[u,p,h,m,f,g,v,y,b,x,E,S]),function(t,n,r={}){const i=window&&"MutationObserver"in window,a=e.useRef(),l=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};e.useLayoutEffect((()=>(l(),i&&t.current&&(a.current=new MutationObserver(n),a.current.observe(t.current,r)),()=>l())),[t])}(T,(e=>{if(E)for(const t of e){const e=Array.from(t.removedNodes).some((e=>K(e))),n="attributes"===t.type&&K(t.target);if(e||n){V();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=jn("watermark");return t.createElement("div",{ref:T,className:Fe(z,w),style:Object.assign({position:"relative"},C)},n.children)},dh=new Map,uh=new WeakMap;let ph,hh=0;function mh(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(uh.has(n)||(hh+=1,uh.set(n,hh.toString())),uh.get(n)):"0"):e[t]}`;var n})).toString()}function fh(e,t,n={},r=ph){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:a,elements:l}=function(e){const t=mh(e);let n=dh.get(t);if(!n){const r=new Map;let i=[];const a=new IntersectionObserver((t=>{t.forEach((t=>{var n;const a=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=a),null===(n=r.get(t.target))||void 0===n||n.forEach((e=>{e(a,t)}))}))}),e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:r},dh.set(t,n)}return n}(n),o=l.get(e)||[];return l.has(e)||l.set(e,o),o.push(t),a.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(l.delete(e),a.unobserve(e)),0===l.size&&(a.disconnect(),dh.delete(i))}}const gh=e=>{const{forceRender:n,height:r,placeholder:i=null,unmountIfInvisible:a,className:l,style:o}=e,{ref:s,inView:c,entry:d}=(({root:e,rootMargin:n,threshold:r,triggerOnce:i,fallbackInView:a,trackVisibility:l,skip:o,delay:s,onChange:c}={})=>{var d;const[u,p]=t.useState(null),[h,m]=t.useState({inView:!1,entry:void 0}),f=t.useRef(c);t.useEffect((()=>{if(o||!u)return;let t;return t=fh(u,((e,n)=>{var r;m({inView:e,entry:n}),null===(r=f.current)||void 0===r||r.call(f,e,n),n.isIntersecting&&i&&t&&(t(),t=void 0)}),{root:e,rootMargin:n,threshold:r,trackVisibility:l,delay:s},a),()=>{t&&t()}}),[Array.isArray(r)?r.toString():r,u,e,n,i,o,l,a,s]);const g=null===(d=h.entry)||void 0===d?void 0:d.target,v=t.useRef();u||!g||i||o||v.current===g||(v.current=g,m({inView:!1,entry:void 0}));const y=[p,h.inView,h.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y})(Object.assign({},e,{triggerOnce:!a}));t.useEffect((()=>{r||en("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[jn("lazy-load")]:!0};return t.createElement("div",{ref:s,className:Fe(u,l),style:o},n||c?e.children:t.createElement("div",{className:"placeholder",style:{height:r}},i))};class vh{constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class yh{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,r=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new yh(e[1],n,r,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const r=e.x-t.x,i=e.y-t.y,a=t.x-n.x,l=t.y-n.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,c=(t.x+n.x)/2,d=(t.y+n.y)/2,u=Math.sqrt(r*r+i*i),p=Math.sqrt(a*a+l*l),h=p/(u+p),m=c+(o-c)*h,f=d+(s-d)*h,g=t.x-m,v=t.y-f;return{c1:new vh(o+g,s+v),c2:new vh(c+g,d+v)}}constructor(e,t,n,r,i,a){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=r,this.startWidth=i,this.endWidth=a}length(){let e,t,n=0;for(let r=0;r<=10;r+=1){const i=r/10,a=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),l=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){const r=a-e,i=l-t;n+=Math.sqrt(r*r+i*i)}e=a,t=l}return n}point(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e}}class bh{constructor(e,t){this.width=320,this.height=200,this.ratio=Math.max(window.devicePixelRatio||1,1),this.penColor="rgba(0,0,0,1)",this.backgroundColor="rgba(0,0,0,0)",this.canAddHistory=!1,this.openSmooth=!0,this.dotSize=0,this.throttle=16,this.minDistance=5,this.velocityFilterWeight=.7,this.compositeOperation="source-over",this.minWidth=.5,this.maxWidth=2.5,this.fontSize=16,this.eraserSize=20,this.lineHeight=1.25,this.degreeOfBlur=5,this.textInputPos={x:0,y:0},this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)},this.setTextInput=()=>{this.openSmooth||(this.textInput.setAttribute("class","signature__text-input"),this.textInput.setAttribute("contentEditable","true"),this.textInput.setAttribute("spellCheck","false"),this.canvas.parentNode.appendChild(this.textInput))},this.isTouchEvent=e=>"touches"in e,this.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)},this.removeListener=()=>{this.canvas.style.touchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("touchstart",this.onDrawStart),this.canvas.removeEventListener("touchmove",this.onDrawMove),document.removeEventListener("touchend",this.onDrawEnd),document.removeEventListener("touchcancel",this.onDrawEnd),this.canvas.removeEventListener("mousedown",this.onDrawStart),this.canvas.removeEventListener("mousemove",this.onDrawMove),document.removeEventListener("mouseup",this.onDrawEnd),this.textInput.removeEventListener("blur",this.onInputBlur)},this._isLeftButtonPressed=(e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,n;return{event:e,type:e.type,x:this.isTouchEvent(e)?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:this.isTouchEvent(e)?null===(n=e.touches[0])||void 0===n?void 0:n.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=(e,t=!0)=>{if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);const n=this._createPoint(e.x,e.y,e.pressure),r=this._data[this._data.length-1],i=r.points,a=i.length>0&&i[i.length-1],l=!!a&&n.distanceTo(a)<=this.minDistance,o=this._getPointGroupOptions(r);if(!a||!a||!l){const e=this._addPoint(n,o);t&&(a?e&&this._drawCurve(e,o):this._drawDot(n,o)),i.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}},this._strokeEnd=(e,t=!1)=>{this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const n=this.ctx,r=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=t.penColor,n.fill()},this._drawCurve=(e,t)=>{const n=this.ctx,r=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<i;n+=1){const a=n/i,l=a*a,o=l*a,s=1-a,c=s*s,d=c*s;let u=d*e.startPoint.x;u+=3*c*a*e.control1.x,u+=3*s*l*e.control2.x,u+=o*e.endPoint.x;let p=d*e.startPoint.y;p+=3*c*a*e.control1.y,p+=3*s*l*e.control2.y,p+=o*e.endPoint.y;const h=Math.min(e.startWidth+o*r,t.maxWidth);this._drawCurveSegment(u,p,h)}n.closePath(),n.fill()},this._drawCurveSegment=(e,t,n)=>{const r=this.ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1)},this._createPoint=(e,t,n)=>{const r=this.canvas.getBoundingClientRect();return new vh(e-r.left,t-r.top,n,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),r=yh.fromPoints(n,e);return n.shift(),r}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,n)=>{const r=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(r,n),a={end:i,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=i,a},this.onDrawStart=e=>{var t;e.preventDefault(),this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&(this._strokeBegin(this._pointerEventToSignatureEvent(e)),this.ctx.strokeStyle=this.penColor,this.ctx.lineWidth=this.maxWidth,"line"===this.mode&&this.createPencil(e),"eraser"===this.mode&&this.createEraser(e),"text"===this.mode&&this.createTextInput(e),null===(t=this.onStart)||void 0===t||t.call(this,e))},this.onDrawMove=e=>{e.preventDefault(),"text"!==this.mode&&(this._isLeftButtonPressed(e,!0)&&this._drawingStroke?window.requestAnimationFrame?window.requestAnimationFrame((()=>this.drawHandler(e))):this.drawHandler(e):this._strokeEnd(this._pointerEventToSignatureEvent(e)))},this.onDrawEnd=e=>{var t;this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),null===(t=this.onEnd)||void 0===t||t.call(this,e))},this.onInputBlur=e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()},this.drawHandler=e=>{switch(this.mode){case"line":this.drawLine(e);break;case"square":this.drawSquare(e);break;case"round":this.drawRound(e);break;case"arrow":this.drawArrow(e);break;case"mosaic":this.drawMosaic(e);break;case"text":this.drawText(e);break;case"eraser":this.drawEraser(e)}this.canAddHistory=!0},this.drawSquare=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,n,r-t,i-n),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),a=Math.min(r,t),l=Math.min(i,n),o=.5*(Math.max(r,t)-a),s=.5*(Math.max(i,n)-l),c=a+o,d=l+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(c,d,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),a=180*Math.atan2(n-i,t-r)/Math.PI,l=(a+25)*Math.PI/180,o=(a-25)*Math.PI/180,s=15*Math.cos(l),c=15*Math.sin(l),d=15*Math.cos(o),u=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(r,i),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(r,i);const p=r+s,h=i+c;this.ctx.lineTo(p,h);const m=r+d,f=i+u;this.ctx.lineTo(m,f),this.ctx.lineTo(r,i),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,n)=>{const r=e.width,i=e.data,a=[];return a[0]=i[4*(n*r+t)],a[1]=i[4*(n*r+t)+1],a[2]=i[4*(n*r+t)+2],a[3]=i[4*(n*r+t)+3],a},this.setAxisColor=(e,t,n,r)=>{const i=e.width,a=e.data;a[4*(n*i+t)]=r[0],a[4*(n*i+t)+1]=r[1],a[4*(n*i+t)+2]=r[2],a[4*(n*i+t)+3]=r[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=this.ctx.getImageData(t*this.ratio,n*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),i=r.width,a=r.height,l=i/this.degreeOfBlur,o=a/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<l;t++){const n=this.getAxisColor(r,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let i=0;i<this.degreeOfBlur;i++)for(let a=0;a<this.degreeOfBlur;a++)this.setAxisColor(r,t*this.degreeOfBlur+a,e*this.degreeOfBlur+i,n)}this.ctx.putImageData(r,t*this.ratio,n*this.ratio)},this.drawText=e=>{const{x:t,y:n}=this.textInputPos;if(0===t&&0===n)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const r=this.fontSize*this.lineHeight,i=this.width-t,a=e.target.innerText,l=[];let o="";for(let e=0;e<a.length;e++){const t=o+a[e];this.ctx.measureText(t).width>i&&o.length>0?(l.push(o),o=a[e]):o=t}l.push(o),l.forEach(((e,i)=>{this.ctx.fillText(e,t+1,n+i*r+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawPencil=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawEraser=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=n?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())},this.setInputStyle=()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}},this.drawBgColor=()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))},this.clearWorkSpace=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},this.addHistory=()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))},this.getLastHistory=()=>this._historyList[this._historyList.length-1],this.setLastHistory=()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()},this.clear=()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())},this.undo=()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()},this.setDrawMode=e=>{this.mode=e},this.setLineWidth=e=>{this.maxWidth=e},this.setPenColor=e=>{this.penColor=e},this.setFontSize=e=>{this.fontSize=e},this.isEmpty=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=this.canvas.width,e.height=this.canvas.height,this.backgroundColor?(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)):1!==this.ratio&&t.scale(this.ratio,this.ratio),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=(e="image/png",t=1)=>{if(this.canvas.width===this.width)return this.canvas.toDataURL(e,t);const n=document.createElement("canvas");n.width=this.width,n.height=this.height;return n.getContext("2d").drawImage(this.canvas,0,0,n.width,n.height),n.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=(e=.8)=>this.toDataURL("image/jpeg",e),this.initial(e,t)}initial(e,t={}){e&&(this.canvas=e,this.ctx=e.getContext("2d"),this.textInput=document.createElement("div"),this.width=t.width||e.clientWidth||this.width,this.height=t.height||e.clientHeight||this.height,this.penColor=t.penColor||this.penColor,this.fontSize=t.fontSize||this.fontSize,this.backgroundColor=t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,r,i,a=0,l=null;const o=()=>{a=Date.now(),l=null,n=e.apply(r,i),l||(r=null,i=[])};return function(...s){const c=Date.now(),d=t-(c-a);return r=this,i=s,d<=0||d>t?(l&&(clearTimeout(l),l=null),a=c,n=e.apply(r,i),l||(r=null,i=[])):l||(l=window.setTimeout(o,d)),n}}(this._strokeUpdate,this.throttle):this._strokeUpdate,this.minWidth=t.minWidth||this.minWidth,this.maxWidth=t.maxWidth||this.maxWidth,this.onStart=t.onStart,this.onEnd=t.onEnd,this.setCanvasSize(),this.setTextInput(),this.drawBgColor(),this.addListener())}update(){this.setCanvasSize(),this.clear()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}bh.dataURLToBlob=e=>{const t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;++e)a[e]=r.charCodeAt(e);return new Blob([a],{type:n})},bh.canvasToDataURL=e=>e.toDataURL("image/png",1),bh.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const xh=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),Eh=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M839.111111 269.198222V122.908444A9.159111 9.159111 0 0 0 829.980444 113.777778H208.213333A9.159111 9.159111 0 0 0 199.111111 122.908444v146.289778c0 5.034667 4.124444 9.159111 9.130667 9.159111h64a9.159111 9.159111 0 0 0 9.159111-9.159111V196.067556h192v640h-105.159111a9.159111 9.159111 0 0 0-9.130667 9.130666v64c0 5.034667 4.124444 9.159111 9.130667 9.159111h301.738666a9.159111 9.159111 0 0 0 9.130667-9.159111v-64a9.159111 9.159111 0 0 0-9.130667-9.130666h-105.159111v-640h192v73.130666c0 5.034667 4.124444 9.159111 9.159111 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111z"})),Sh=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M887.65217391 606.59279489a31.26857185 31.26857185 0 0 1-31.26857185-31.26857087v-363.48819946L158.38608696 909.83354065a31.26857185 31.26857185 0 1 1-44.21962762-44.21962761l697.99751609-698.06906805h-363.48819945a31.26857185 31.26857185 0 0 1 0-62.46559075h439.04795087c17.17267109 0 31.26857185 13.95279489 31.26857086 31.19701891v439.04795087a31.26857185 31.26857185 0 0 1-31.3401238 31.26857087z"})),wh=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M606.4 103.424a64 64 0 0 1 0.704 0.64l320.256 280.32a64 64 0 0 1 7.104 89.024l-330.432 398.72 320.448 0.128a32 32 0 0 1 0 64.064H397.632a32.128 32.128 0 0 1-6.208-0.64h-20.736a64 64 0 0 1-42.304-16.064l-238.08-210.112A64 64 0 0 1 83.84 620.16l432.32-509.312a64 64 0 0 1 90.24-7.36zM242.048 537.536l-87.04 101.76a32 32 0 0 0 3.584 45.248l213.12 180.672a32 32 0 0 0 20.736 7.616l-0.64-0.064a32.192 32.192 0 0 1 5.76-0.512h102.016a32 32 0 0 0 18.176-10.496l40.96-47.232-316.672-276.992zM592.96 177.28a32 32 0 0 0-45.12 3.456L283.712 488.96l316.928 277.248 264.512-304.96a32 32 0 0 0 1.024-40.704l-3.904-4.16-268.928-238.72a32 32 0 0 0-0.384-0.32z"})),Ch=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M607.75537778 291.05948444H223.6416l115.34336-115.41617778a36.37248 36.37248 0 1 0-51.48216889-51.44576L132.61937778 279.04455111c-13.54410667 13.50769778-21.04433778 31.67573333-21.11715556 50.97244444a71.72551111 71.72551111 0 0 0 21.11715556 51.51857778l154.88341333 154.91982222a36.29966222 36.29966222 0 0 0 51.48216889 0 36.37248 36.37248 0 0 0 0-51.48216889l-121.46005333-121.16878222H607.75537778c130.70791111 0 237.02186667 106.16832 237.02186667 236.65777777s-106.31395555 236.65777778-237.02186667 236.65777778h-254.13404445a36.40888889 36.40888889 0 0 0 0 72.81777779h254.13404445c170.83050667 0 309.83964445-138.82709333 309.83964444-309.47555557 0-170.64846222-139.00913778-309.47555555-309.83964444-309.47555555"})),Th=t.forwardRef(((e,n)=>{const{open:r,width:i,height:a,imageName:l,penColor:o,minWidth:s,maxWidth:c,backgroundColor:d,className:u,style:p,onOk:h,onCancel:m}=e,{t:f}=Vd(),v=t.useRef(),y=t.useRef(null),b=t.useRef(null),x=t.useRef(null),E=[2,4,6],S=[14,16,18,20,24,28],w=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[C,T]=Dd(void 0,{value:r,postState:e=>null!=e&&e}),N=t.useMemo((()=>!!e.children),[e.children]),[I,R]=t.useState(N?"square":"line"),[O,k]=t.useState(E[0]),[L,A]=t.useState(N?w[0]:w[4]),[P,_]=t.useState(S[1]),[H,F]=t.useState("bottomLeft"),[D,M]=t.useState(!1),[j,V]=t.useState(!1);t.useEffect((()=>{var e,t;const n={width:null!=i?i:null===(e=b.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=b.current)||void 0===t?void 0:t.offsetHeight,maxWidth:O,mode:I,penColor:L,fontSize:P,backgroundColor:d,openSmooth:!N};return n.openSmooth&&Object.assign(n,{penColor:o,minWidth:s,maxWidth:c}),v.current=new bh(y.current,n),()=>v.current.destroy()}),[]);const K=e=>{var t,n;const[r,l]=[null!=i?i:null===(t=b.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(n=b.current)||void 0===n?void 0:n.offsetHeight],{width:o,height:s}=v.current;let c=!1;r&&r!==o&&(v.current.width=r,c=!0),l&&l!==s&&(v.current.height=l,c=!0),(c||e)&&v.current.update()};bi((()=>{N&&C&&K()}),[C,N]),bi((()=>{v.current.setDrawMode(I)}),[I]),bi((()=>{v.current.setLineWidth(O)}),[O]),bi((()=>{v.current.setPenColor(L)}),[L]),bi((()=>{v.current.setFontSize(P)}),[P]);const z=()=>Tn(void 0,void 0,void 0,(function*(){const e=N?b.current.parentNode:y.current;if(e)try{const t=yield jt(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===x.current||e.classList.contains("spinning")});return bh.canvasToDataURL(t)}catch(e){en("Signature","生成合成图片失败!")}})),W=()=>{v.current.clear(),null==m||m()};t.useImperativeHandle(n,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>v.current.clear(),UNDO:()=>v.current.undo(),IS_EMPTY:()=>v.current.isEmpty(),UPDATE:K,GET_DATE_URL:z})));const B=e=>{e&&F((()=>{const e=x.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},U=e=>t.createElement("div",{className:Fe("ant-dropdown-menu","content")},"text"!==e?t.createElement("div",{className:"lineWidth"},E.map((e=>t.createElement("span",{key:e,className:Fe("dot",`s${e}`,{active:e===O}),onClick:()=>k(e)})))):t.createElement("div",{className:"fontSize"},t.createElement($,{size:"small",value:P,options:S.map((e=>({value:e,label:e.toString()}))),onChange:e=>_(e)})),t.createElement("span",{className:"divider"}),t.createElement("div",{className:"penColor"},w.map((e=>t.createElement("span",{key:e,className:Fe("dot",{active:e===L}),style:{backgroundColor:e},onClick:()=>A(e)},t.createElement(je,{className:"icon"})))))),G=jn("signature"),Y={[G]:!0,"is-annotation":N},X=i?Object.assign(Object.assign({},p),{width:i}):p;return t.createElement("div",{className:Fe(Y,u),style:X},N&&t.createElement(t.Fragment,null,t.createElement("div",{ref:b,className:"content"},e.children),j&&t.createElement(Di,{spinning:!0,className:"spinning"})),t.createElement("div",{className:Fe("signature",{show:C})},t.createElement("canvas",{ref:y,className:I}),N&&t.createElement("div",{ref:x,className:"signature__tool-bar"},t.createElement("div",{className:"wrapper"},t.createElement("div",{className:Fe("actions",{hidden:D})},t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("square")},t.createElement(Tt,null))),t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("round")},t.createElement(xh,null))),t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("arrow")},t.createElement(Sh,null))),t.createElement(q,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("line")},t.createElement(qe,null))),t.createElement(q,{dropdownRender:()=>U("text"),overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("text")},t.createElement(Eh,null))),t.createElement("button",{className:"btn",onClick:()=>Tn(void 0,void 0,void 0,(function*(){yield Tn(void 0,void 0,void 0,(function*(){V(!0);const e=yield z();if(e){const t=l?l.slice(0,l.lastIndexOf(".")>0?l.lastIndexOf("."):void 0):g().format(Td);Zi(bh.dataURLToBlob(e),`${t}.png`)}V(!1)})),W()}))},t.createElement(Ke,null)),t.createElement("button",{className:"btn",onClick:()=>R("eraser")},t.createElement(wh,null)),t.createElement("button",{className:"btn",onClick:()=>v.current.undo()},t.createElement(Ch,null)),t.createElement("button",{className:"btn",onClick:()=>v.current.clear()},t.createElement(xt,null)),t.createElement("span",{className:"divider"}),t.createElement("button",{className:"btn",onClick:()=>null==m?void 0:m()},t.createElement(Ze,null)),t.createElement("button",{className:"btn",onClick:()=>Tn(void 0,void 0,void 0,(function*(){V(!0),yield Ln(10);const e=yield z();V(!1),W(),null==h||h(e)}))},t.createElement(je,null))),t.createElement("button",{className:"btn btn-fold",title:f(D?"qm.divider.spread":"qm.divider.collect"),onClick:()=>M(!D)},D?t.createElement(It,null):t.createElement(Nt,null))))))}));Th.displayName="QmSignature";const Nh="1.10.7";export{fn as Calendar,gn as DatePicker,ia as DcpAnchor,$n as DcpButton,vi as DcpCollapse,Sn as DcpConfigProvider,Bu as DcpCopyToClipboard,Hi as DcpCountup,ad as DcpCropper,Vn as DcpDivider,ta as DcpDownload,oa as DcpDrawer,Fi as DcpEmpty,jc as DcpForm,sh as DcpGuideTracker,gh as DcpLazyLoad,da as DcpModal,Vp as DcpPrint,pp as DcpRangeTableHelper,Xi as DcpScrollbar,ip as DcpSearchHelper,gd as DcpSearchTree,Th as DcpSignature,qn as DcpSpace,Di as DcpSpin,_i as DcpSplit,rp as DcpTable,la as DcpTabs,id as DcpTinymce,Np as DcpTour,Ap as DcpTransition,cp as DcpTreeHelper,sp as DcpTreeTableHelper,ea as DcpUploadFile,od as DcpUploadImg,ch as DcpWatermark,ia as QmAnchor,$n as QmButton,vi as QmCollapse,Sn as QmConfigProvider,Bu as QmCopyToClipboard,Hi as QmCountup,ad as QmCropper,Vn as QmDivider,ta as QmDownload,oa as QmDrawer,Fi as QmEmpty,jc as QmForm,sh as QmGuideTracker,gh as QmLazyLoad,da as QmModal,Vp as QmPrint,pp as QmRangeTableHelper,Xi as QmScrollbar,ip as QmSearchHelper,gd as QmSearchTree,Th as QmSignature,qn as QmSpace,Di as QmSpin,_i as QmSplit,rp as QmTable,la as QmTabs,id as QmTinymce,Np as QmTour,Ap as QmTransition,cp as QmTreeHelper,sp as QmTreeTableHelper,ea as QmUploadFile,od as QmUploadImg,ch as QmWatermark,yn as TimePicker,Ml as pinyin,Nh as version};
|