@jiaozhiye/qm-design-react 1.10.9 → 1.10.10

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 CHANGED
@@ -1 +1 @@
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,forwardRef as c,useImperativeHandle as d,useState as u,useCallback as p}from"react";import*as h from"prop-types";import m from"prop-types";import f from"dayjs";import"dayjs/locale/zh-cn";import g from"dayjs/plugin/localeData";import v from"dayjs/plugin/advancedFormat";import y from"dayjs/plugin/customParseFormat";import b from"dayjs/plugin/quarterOfYear";import x from"dayjs/plugin/weekOfYear";import E from"dayjs/plugin/weekday";import{ConfigProvider as S,Button as w,Tooltip as C,Popconfirm as N,Space as T,Empty as I,Spin as R,Upload as O,message as k,Input 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,Image as Y,Tree as X,Menu as Q,Popover as Z,Pagination as J,Slider as ee}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 te from"dayjs/plugin/weekYear";import ne from"antd/es/calendar/generateCalendar";import"antd/es/calendar/style";import re from"antd/es/date-picker/generatePicker";import"antd/es/date-picker/style/index";import ie from"antd/es/locale/zh_CN";import ae from"antd/es/locale/en_GB";import{isArray as le,isPlainObject as oe,isNumber as se,isFunction as ce,isString as de,isUndefined as ue,get as pe,transform as he,isEqual as me,set as fe,xor as ge,isRegExp as ve,merge as ye,uniqBy as be,debounce as xe,intersection as Ee,map as Se,groupBy as we,flatten as Ce,spread as Ne,mergeWith as Te,isDate as Ie,omitBy as Re,sumBy as Oe,maxBy as ke,minBy as Le,union as Ae,pickBy as Pe,throttle as _e}from"lodash-es";import He from"classnames";import{UpOutlined as Fe,DownOutlined as De,UploadOutlined as $e,PaperClipOutlined as Me,EditOutlined as qe,CheckOutlined as je,EyeOutlined as Ve,DownloadOutlined as Ke,DeleteOutlined as ze,FullscreenExitOutlined as We,FullscreenOutlined as Be,HolderOutlined as Ue,UnorderedListOutlined as Ge,SearchOutlined as Ye,CloseOutlined as Xe,ExclamationCircleOutlined as Qe,ReloadOutlined as Ze,ZoomInOutlined as Je,ZoomOutOutlined as et,RotateRightOutlined as tt,RotateLeftOutlined as nt,InboxOutlined as rt,InfoCircleFilled as it,PrinterOutlined as at,ImportOutlined as lt,SettingOutlined as ot,CopyOutlined as st,CheckSquareOutlined as ct,CloseCircleOutlined as dt,MonitorOutlined as ut,PlusOutlined as pt,PieChartOutlined as ht,FunnelPlotOutlined as mt,AppstoreAddOutlined as ft,StepBackwardOutlined as gt,StepForwardOutlined as vt,InfoCircleOutlined as yt,ClearOutlined as bt,PauseOutlined as xt,CaretRightOutlined as Et,QuestionCircleOutlined as St,MenuOutlined as wt,BorderOutlined as Ct,RightOutlined as Nt,LeftOutlined as Tt}from"@ant-design/icons";import It from"react-countup";import Rt from"resize-observer-polyfill";import Ot from"sortablejs";import kt from"add-dom-event-listener";import Lt from"scroll-into-view-if-needed";import At from"react-draggable";import Pt from"memoize-one";import _t from"cropperjs";import Ht from"big.js";import Ft from"react-dom";import Dt from"copy-to-clipboard";import $t from"@rc-component/portal";import Mt from"@rc-component/trigger";import qt from"html2canvas";import{ReactSortable as jt}from"react-sortablejs";import Vt from"localforage";import Kt from"exceljs";import zt from"china-area-data";const Wt=n({locale:"zh-cn",size:"middle"});var Bt={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?",shortcutKey:"快捷键"},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:"删除文件",batchDownload:"批量下载"},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 Ut=Bt;function Gt(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const Yt=(...e)=>{const[t,n]=e;let r;const i=t.split(".");let a=Ut;for(let e=0,t=i.length;e<t;e++){if(r=a[i[e]],e===t-1)return Gt(r,n);if(!r)return"";a=r}return""},Xt=e=>{Ut=e||Ut,Ut.name&&f.locale(Ut.name)};class Qt extends Error{constructor(e){super(e),this.name="QmDesignError"}}function Zt(e,t){throw new Qt(`[${e}] ${t}`)}function Jt(e,t){console.warn(new Qt(`[${e}] ${t}`))}const en=e=>["","small","middle","large"].includes(e);f.extend(g),f.extend(v),f.extend(y),f.extend(b),f.extend(x),f.extend(E);var tn={},nn=[];function rn(e,t){if(!e&&void 0!==console){var n=nn.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function an(e,t){if(!e&&void 0!==console){var n=nn.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function ln(e,t,n){t||tn[n]||(e(!1,n),tn[n]=!0)}function on(e,t){ln(rn,e,t)}function sn(e,t){ln(an,e,t)}on.preMessage=function(e){nn.push(e)},on.resetWarned=function(){tn={}},on.noteOnce=sn,f.extend(y),f.extend(v),f.extend(E),f.extend(g),f.extend(x),f.extend(te),f.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 cn={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"},dn=function(e){return cn[e]||e.split("_")[0]},un=function(){sn(!1,"Not match any format. Please help to fire a issue about this.")},pn={getNow:function(){return f()},getFixedDate:function(e){return f(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 f().locale(dn(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(dn(e)).weekday(0)},getWeek:function(e,t){return t.locale(dn(e)).week()},getShortWeekDays:function(e){return f().locale(dn(e)).localeData().weekdaysMin()},getShortMonths:function(e){return f().locale(dn(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(dn(e)).format(n)},parse:function(e,t,n){for(var r=dn(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=f(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 un(),null}var p=f(l,a).locale(r);if(p.isValid())return p}return t&&un(),null}}};const hn=ne(pn),mn=re(pn);function fn(){return fn=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},fn.apply(null,arguments)}const gn=e.forwardRef(((t,n)=>e.createElement(mn,fn({},t,{picker:"time",mode:void 0,ref:n}))));gn.displayName="TimePicker";const vn=e.forwardRef(((t,n)=>e.createElement(mn.RangePicker,fn({},t,{picker:"time",mode:void 0,ref:n}))));vn.displayName="RangePicker",gn.RangePicker=vn;var yn={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?",shortcutKey:"Shortcut Key"},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",batchDownload:"Batch download"},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 bn={[yn.name]:{qm:yn,antd:ae},[Bt.name]:{qm:Bt,antd:ie}};class xn extends r{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},Xt(Object.assign({},bn,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&&Xt(Object.assign({},bn,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({},bn,e.langPackage);return t.createElement(Wt.Provider,{value:n},t.createElement(S,{locale:r[n.locale].antd,componentSize:n.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}function En(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 Sn(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 wn(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())}))}function Cn(){const{locale:t}=e.useContext(Wt);return{t:Yt,$locale:t}}function Nn(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 Tn(t){const{size:n}=e.useContext(Wt);return{$size:e.useMemo((()=>{var e,r;return null!==(r=null!==(e=t.size)&&void 0!==e?e:n)&&void 0!==r?r:""}),[t.size,n])}}xn.propTypes={locale:m.string,size:(e,t,n)=>{if(!en(e[t]||""))return Zt("ConfigProvider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},theme:m.string,global:m.object},xn.defaultProps={locale:"zh-cn",size:"middle",global:{}};var In="undefined"==typeof window;const Rn=e=>t.isValidElement(e),On=e=>Rn(e)&&e.type===t.Fragment,kn=()=>{},Ln=()=>!0,An=e=>wn(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),Pn=e=>{Promise.resolve().then(e)},_n=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),Hn=e=>!!(!e&&0!==e||le(e)&&!e.length||oe(e)&&!Object.keys(e).length),Fn=(e,t)=>{const n=Object.assign({},e);for(const e of t)delete n[e];return n};const Dn=(e,t=new WeakMap)=>{if(oe(e)||le(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]=Dn(e[a],t)})),r}return e},$n=e=>se(e)?`${e}px`:e.toString(),Mn=e=>{const{loading:n,shortcutKey:r,authConfig:i,click:a,confirm:l}=e,{t:o}=Cn(),{$size:s}=Tn(e);t.useEffect((()=>(r&&document.addEventListener("keyup",u),()=>document.removeEventListener("keyup",u))),[]);const[c,d]=t.useState(!1),u=Nn((e=>{var t;const n=r.split("+").map((e=>e.trim().toLowerCase())),i=n.includes("alt"),a=n.includes("ctrl"),l=n.includes("shift"),o=n[n.length-1];i&&!e.altKey||a&&!e.ctrlKey||l&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),h.disabled||null===(t=h.onClick)||void 0===t||t.call(h,e))})),p=ce(a)?{onClick:t=>wn(void 0,void 0,void 0,(function*(){var n;d(!0);try{yield null===(n=e.click)||void 0===n?void 0:n.call(e,t)}catch(e){Jt("Button","`click`方法执行出错")}d(!1)}))}:null,h=Object.assign(Object.assign(Object.assign({},Fn(e,["shortcutKey","authConfig","click","confirm"])),{size:s,loading:c||n||!1}),p);if(i){const{visible:e=1,disabled:t}=i||{};if(!e)return null;t&&(h.disabled=!0)}const m=t.createElement(w,h,e.children);return l?t.createElement(N,{title:l.title||o("qm.button.confirmTitle"),disabled:h.disabled,onConfirm:e=>{var t,n;null===(t=l.onConfirm)||void 0===t||t.call(l),null===(n=h.onClick)||void 0===n||n.call(h,e)},onCancel:e=>{var t;null===(t=l.onCancel)||void 0===t||t.call(l,e)}},t.createElement(w,fn({},h,{onClick:kn}),e.children)):!r||h.disabled?m:t.createElement(C,{placement:"top",title:`${o("qm.button.shortcutKey")}: ${r}`},m)};var qn;Mn.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(qn||(qn={}));const jn=e=>{const{$size:n}=Tn(e),r=se(e.size)?e.size:qn[n||"default"],i=Object.assign(Object.assign({},Fn(e,["size"])),{size:r});return t.createElement(T,i,e.children)};jn.displayName="QmSpace";const Vn=e=>`qm-${e}`,Kn=e=>{const{label:n,extra:r,collapse:i,bordered:a=!0,disabled:l,id:o,className:s,style:c,onCollapseChange:d}=e,{$size:u}=Tn(e),{t:p}=Cn(),h=Vn("divider"),m={[h]:!0,[`${h}-borderless`]:!a,[`${h}--lg`]:"large"===u,[`${h}--sm`]:"small"===u};return t.createElement("div",{id:o,className:He(m,s),style:c},t.createElement("span",{className:`${h}__title`},n),t.createElement("div",{className:`${h}__extra`},r),void 0!==i&&t.createElement(w,{type:"link",className:`${h}__collapse`,disabled:l,onClick:()=>{null==d||d(!i)}},p(i?"qm.divider.collect":"qm.divider.spread"),i?t.createElement(Fe,null):t.createElement(De,null)))};Kn.displayName="QmDivider";const zn=()=>({height:0,opacity:0}),Wn=(e,t)=>"height"===t.propertyName,Bn={motionName:"rc-collapse-motion",onEnterStart:zn,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:zn,onEnterEnd:Wn,onLeaveEnd:Wn,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"};function Un(e){return Un="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},Un(e)}function Gn(e){var t=function(e,t){if("object"!==Un(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Un(t)?t:String(t)}function Yn(e,t,n){return(t=Gn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(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 Qn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xn(Object(n),!0).forEach((function(t){Yn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xn(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 Jn(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 er(e){return e instanceof HTMLElement||e instanceof SVGElement}function tr(e){var n,r=function(e){return e&&"object"===Un(e)&&er(e.nativeElement)?e.nativeElement:er(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=Ft.findDOMNode)||void 0===n?void 0:n.call(Ft,e):null)}var nr,rr={exports:{}},ir={};rr.exports=(nr||(nr=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,N=i,T=d,I=u,R=!1,O=!1;ir.ContextConsumer=g,ir.ContextProvider=v,ir.Element=y,ir.ForwardRef=b,ir.Fragment=x,ir.Lazy=E,ir.Memo=S,ir.Portal=w,ir.Profiler=C,ir.StrictMode=N,ir.Suspense=T,ir.SuspenseList=I,ir.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},ir.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},ir.isContextConsumer=function(e){return f(e)===o},ir.isContextProvider=function(e){return f(e)===l},ir.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ir.isForwardRef=function(e){return f(e)===c},ir.isFragment=function(e){return f(e)===r},ir.isLazy=function(e){return f(e)===h},ir.isMemo=function(e){return f(e)===p},ir.isPortal=function(e){return f(e)===n},ir.isProfiler=function(e){return f(e)===a},ir.isStrictMode=function(e){return f(e)===i},ir.isSuspense=function(e){return f(e)===d},ir.isSuspenseList=function(e){return f(e)===u},ir.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)},ir.typeOf=f}()),ir);var ar=function(e,t){"function"==typeof e?e(t):"object"===Un(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){ar(t,e)}))}},or=function(e){var t,n,r=rr.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===rr.exports.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===rr.exports.ForwardRef)};function sr(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 cr=e.createContext({});function dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ur(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,Gn(r.key),r)}}function pr(e,t,n){return t&&ur(e.prototype,t),n&&ur(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hr(e,t)}function mr(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&&hr(e,t)}function fr(e){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fr(e)}function gr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vr(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=fr(e);if(t){var i=fr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Un(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gr(e)}(this,n)}}var yr=function(t){mr(r,e.Component);var n=vr(r);function r(){return dr(this,r),n.apply(this,arguments)}return pr(r,[{key:"render",value:function(){return this.props.children}}]),r}();function br(t){var n=e.useRef(!1),r=Jn(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 xr="none",Er="appear",Sr="enter",wr="leave",Cr="none",Nr="prepare",Tr="start",Ir="active",Rr="end",Or="prepared";function kr(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Lr(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 Ar,Pr,_r,Hr=(Ar=kr(),Pr="undefined"!=typeof window?window:{},_r={animationend:Lr("Animation","AnimationEnd"),transitionend:Lr("Transition","TransitionEnd")},Ar&&("AnimationEvent"in Pr||delete _r.animationend.animation,"TransitionEvent"in Pr||delete _r.transitionend.transition),_r),Fr={};if(kr()){var Dr=document.createElement("div");Fr=Dr.style}var $r={};function Mr(e){if($r[e])return $r[e];var t=Hr[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 Fr)return $r[e]=t[a],$r[e]}return""}var qr=Mr("animationend"),jr=Mr("transitionend"),Vr=!(!qr||!jr),Kr=qr||"animationend",zr=jr||"transitionend";function Wr(e,t){return e?"object"===Un(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var Br=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(zr,i),e.removeEventListener(Kr,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(zr,i),e.addEventListener(Kr,i),n.current=e)},a]},Ur=kr()?o:s,Gr=function(e){return+setTimeout(e,16)},Yr=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Gr=function(e){return window.requestAnimationFrame(e)},Yr=function(e){return window.cancelAnimationFrame(e)});var Xr=0,Qr=new Map;function Zr(e){Qr.delete(e)}var Jr=function(e){var t=Xr+=1;return function n(r){if(0===r)Zr(t),e();else{var i=Gr((function(){n(r-1)}));Qr.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};Jr.cancel=function(e){var t=Qr.get(e);return Zr(e),Yr(t)},Jr.ids=function(){return Qr};var ei=[Nr,Tr,Ir,Rr],ti=[Nr,Or],ni=!1,ri=!0;function ii(e){return e===Ir||e===Rr}var ai=function(t,n,r){var i=Jn(br(Cr),2),a=i[0],l=i[1],o=function(){var t=e.useRef(null);function n(){Jr.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=Jr((function(){i<=1?r({isCanceled:function(){return a!==t.current}}):e(r,i-1)}));t.current=a},n]}(),s=Jn(o,2),c=s[0],d=s[1];var u=n?ti:ei;return Ur((function(){if(a!==Cr&&a!==Rr){var e=u.indexOf(a),t=u[e+1],n=r(a);n===ni?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(Nr,!0)},a]};var li=function(t){var n=t;"object"===Un(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(cr).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,N=i.onEnterEnd,T=i.onLeaveEnd,I=i.onVisibleChanged,R=Jn(br(),2),O=R[0],k=R[1],L=Jn(br(xr),2),A=L[0],P=L[1],_=Jn(br(null),2),H=_[0],F=_[1],D=l(!1),$=l(null);function M(){return r()}var q=l(!1);function j(){P(xr,!0),F(null,!0)}function V(e){var t=M();if(!e||e.deadline||e.target===t){var n,r=q.current;A===Er&&r?n=null==C?void 0:C(t,e):A===Sr&&r?n=null==N?void 0:N(t,e):A===wr&&r&&(n=null==T?void 0:T(t,e)),A!==xr&&r&&!1!==n&&j()}}var K=Jn(Br(V),1)[0],z=function(e){var t,n,r;switch(e){case Er:return Yn(t={},Nr,f),Yn(t,Tr,y),Yn(t,Ir,E),t;case Sr:return Yn(n={},Nr,g),Yn(n,Tr,b),Yn(n,Ir,S),n;case wr:return Yn(r={},Nr,v),Yn(r,Tr,x),Yn(r,Ir,w),r;default:return{}}},W=e.useMemo((function(){return z(A)}),[A]),B=Jn(ai(A,!t,(function(e){if(e===Nr){var t=W[Nr];return t?t(M()):ni}var n;return G in W&&F((null===(n=W[G])||void 0===n?void 0:n.call(W,M(),null))||null),G===Ir&&(K(M()),h>0&&(clearTimeout($.current),$.current=setTimeout((function(){V({deadline:!0})}),h))),G===Or&&j(),ri})),2),U=B[0],G=B[1],Y=ii(G);q.current=Y,Ur((function(){k(n);var e,r=D.current;D.current=!0,!r&&n&&d&&(e=Er),r&&n&&o&&(e=Sr),(r&&!n&&p||!r&&m&&!n&&p)&&(e=wr);var i=z(e);e&&(t||i[Nr])?(P(e),U()):P(xr)}),[n]),s((function(){(A===Er&&!d||A===Sr&&!o||A===wr&&!p)&&P(xr)}),[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===xr&&((X.current||O)&&(null==I||I(O)),X.current=!0)}),[O,A]);var Q=H;return W[Nr]&&G===Tr&&(Q=Qn({transition:"none"},Q)),[A,G,Q,null!=O?O:n]}(f,a,(function(){try{return g.current instanceof HTMLElement?g.current:tr(v.current)}catch(e){return null}}),t),b=Jn(y,4),x=b[0],E=b[1],S=b[2],w=b[3],C=e.useRef(w);w&&(C.current=!0);var N,T=e.useCallback((function(e){g.current=e,ar(r,e)}),[r]),I=Qn(Qn({},m),{},{visible:a});if(u)if(x===xr)N=w?u(Qn({},I),T):!c&&C.current&&h?u(Qn(Qn({},I),{},{className:h}),T):d||!c&&!h?u(Qn(Qn({},I),{},{style:{display:"none"}}),T):null;else{var R,O;E===Nr?O="prepare":ii(E)?O="active":E===Tr&&(O="start");var k=Wr(p,"".concat(x,"-").concat(O));N=u(Qn(Qn({},I),{},{className:He(Wr(p,x),(R={},Yn(R,k,k&&O),Yn(R,p,"string"==typeof p),R)),style:S}),T)}else N=null;e.isValidElement(N)&&or(N)&&(N.ref||(N=e.cloneElement(N,{ref:T})));return e.createElement(yr,{ref:v},N)}));return r.displayName="CSSMotion",r}(Vr);function oi(){return oi=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},oi.apply(this,arguments)}var si="add",ci="keep",di="remove",ui="removed";function pi(e){var t;return Qn(Qn({},t=e&&"object"===Un(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function hi(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(pi)}var mi=["component","children","onVisibleChanged","onAllRemoved"],fi=["status"],gi=["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){mr(i,e.Component);var r=vr(i);function i(){var e;dr(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return Yn(gr(e=r.call.apply(r,[this].concat(n))),"state",{keyEntities:[]}),Yn(gr(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:Qn(Qn({},e),{},{status:ui})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==ui})).length})),e}return pr(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=sr(i,mi),d=a||e.Fragment,u={};return gi.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=sr(r,fi),c=i===si||i===ci;return e.createElement(n,oi({},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=hi(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=hi(e),l=hi(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 Qn(Qn({},e),{},{status:si})}))),r=a),n.push(Qn(Qn({},o),{},{status:ci})),r+=1,t=!0;break}}t||n.push(Qn(Qn({},e),{},{status:di}))})),r<i&&(n=n.concat(l.slice(r).map((function(e){return Qn(Qn({},e),{},{status:si})}))));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!==di}))).forEach((function(t){t.key===e&&(t.status=ci)}))})),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!==ui||e.status!==di}))}}}]),i}();Yn(r,"defaultProps",{component:"div"})}(Vr);const vi=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=Vn("collapse");return t.createElement("div",{ref:n,className:He(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},i),style:a},t.createElement("div",{className:`${d}-content-box`,style:l},e.children))}));vi.displayName="PanelContent";const yi=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=Vn("collapse"),g=He({[`${f}`]:!0,[`${f}-active`]:h,[`${f}-disabled`]:c},a);return t.createElement("div",{className:g,style:l},t.createElement(Kn,{label:r,extra:i,collapse:h,bordered:s,disabled:c,onCollapseChange:e=>{m(e),null==p||p(e)}}),t.createElement(li,fn({visible:h},Bn,{leavedClassName:`${f}-content-hidden`,forceRender:d,removeOnLeave:u}),(({className:n,style:r},i)=>t.createElement(vi,{ref:i,prefixCls:f,className:n,style:r,boxStyle:o,isActive:h,forceRender:d},e.children))))};yi.displayName="QmCollapse";const bi=t.createContext(void 0);function xi(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 Ei=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},Si=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},wi=e=>e.preventDefault(),Ci=(e,t)=>{if(In||!e||!t)return null;"float"===(t=_n(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]}},Ni=(e,t,n)=>{!In&&e&&t&&(oe(t)?Object.keys(t).forEach((n=>{Ni(e,n,t[n])})):(t=_n(t),e.style[t]=n))},Ti=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Ii=(e,t)=>Math.abs(Ti(e)-Ti(t)),Ri=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}},Oi=(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},ki=(e,t)=>{if(In||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},Li=e=>Math.pow(e,3),Ai=e=>e<.5?Li(2*e)/2:1-Li(2*(1-e))/2,Pi=e=>{const{minValues:n,onDragChange:r,onDragging:i}=e,{splitRef:a,direction:l}=t.useContext(bi),{t:o}=Cn(),s=t.useRef(In?null:document.onselectstart),c=t.useMemo((()=>"horizontal"===l),[l]),d=t.useMemo((()=>c?"X":"Y"),[c]),u=t.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),p=e=>{u.current=Object.assign({},u.current,e)},h=e=>{if(1!==e.buttons)return m();const t=e[`page${d}`]-u.current[`start${d}`],r=[n[0],u.current[`containerSize${d}`]-n[1]];let a=u.current[`firstElementSize${d}`]+t;a=Math.max(r[0],a),a=Math.min(r[1],a),i(a)},m=()=>{p({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),Si(document,"mousemove",h),Si(document,"mouseup",m),f()},f=()=>{document.onselectstart!==s.current&&(document.onselectstart=s.current)},g={[`${Vn("split")}__resize-bar`]:!0,vertical:"vertical"===l,horizontal:"horizontal"===l};return t.createElement("div",{className:He(g),title:o("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];p({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),Ei(document,"mousemove",h),Ei(document,"mouseup",m),r(!0),s.current=document.onselectstart,document.onselectstart=()=>!1}})};Pi.displayName="ResizeBar";const _i=t.forwardRef(((e,n)=>{const{offset:r,className:i,style:a}=e,{direction:l,dragging:o}=t.useContext(bi),s="vertical"===l?"height":"width",c={[Vn("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===l,vertical:"vertical"===l,[i]:!!i},d=void 0!==r?{[s]:$n(r)}:{flex:1,[s]:0};return t.createElement("div",{ref:n,className:He(c),style:Object.assign(Object.assign({},d),a)},e.children)}));_i.displayName="SplitPane";const Hi=e=>{const{direction:n="horizontal",defaultValue:r="50%",uniqueKey:i,className:a,style:l,onDragStart:o,onDrag:s=kn,onDragEnd:c}=e,{global:d}=t.useContext(Wt),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));xi((()=>{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=>wn(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)=>wn(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]),N=[];t.Children.map(e.children,(e=>{var t;Rn(e)&&!On(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const[T,I]=N,R=t.useMemo((()=>[f(T),f(I)]),[T,I]),O={[Vn("split")]:!0,vertical:"vertical"===n};return t.createElement(bi.Provider,{value:C},t.createElement("div",{ref:u,className:He(O,a),style:l},t.createElement(_i,fn({},T.props,{ref:p,offset:b})),t.createElement(Pi,{minValues:R,onDragChange:e=>y(e),onDragging:e=>{x(`${e}px`),s(e)}}),t.createElement(_i,I.props)))};Hi.displayName="QmSplit",Hi.Pane=_i;const Fi=e=>{const{className:n,style:r}=e,{$size:i}=Tn(e),a=Vn("countup"),l={[a]:!0,[`${a}--lg`]:"large"===i,[`${a}--sm`]:"small"===i};return t.createElement(It,fn({},e,{className:He(l,n),style:r}),e.children)};Fi.displayName="QmCountup";const Di=e=>{const{className:n}=e,{$size:r}=Tn(e),i=Vn("empty"),a=Object.assign(Object.assign({},e),{image:I.PRESENTED_IMAGE_SIMPLE}),l={[i]:!0,[`${i}--lg`]:"large"===r,[`${i}--sm`]:"small"===r};return t.createElement(I,fn({},a,{className:He(l,n)}))};Di.displayName="QmEmpty";const $i=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((n,r)=>(n[r]=void 0!==t[r]?t[r]:e[r],n)),{})),Mi=e=>{const n=$i({tip:"Loading..."},e),{fullHeight:r,className:i,style:a}=n,l=Vn("spin"),o={[l]:!0,[`${l}-fullHeight`]:!!r},s=Object.assign(Object.assign({wrapperClassName:He(o,i)},Fn(n,["fullHeight"])),{style:Object.assign(Object.assign({},a),{maxHeight:"none"})});return t.createElement(R,s,n.children)};Mi.displayName="QmSpin";const qi=t.createContext(void 0),ji=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},Vi=function(e,t){!In&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new Rt(ji),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},Ki=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 zi(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&&Vi(e,n),()=>{e&&Ki(e,n)}}),[t]),n}const Wi=(t,n)=>{const r=e.useRef(!0);e.useLayoutEffect((()=>t(r.current)),n),e.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function Bi(e,t){Wi((t=>{if(!t)return e()}),t)}function Ui(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 Gi=6,Yi={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"}},Xi=e=>{const{thumb:n,always:r,className:i,barSize:a=Gi,direction:l="vertical",onDrag:o=kn}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=t.useContext(qi),u=Yi[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(In?null:document.onselectstart),[b,x]=t.useState(!1);t.useLayoutEffect((()=>{p.current=n}),[n]),t.useEffect((()=>{const e=c.current;return Ei(e,"mousemove",C),Ei(e,"mouseleave",N),()=>{w(),Si(document,"mouseup",S),Si(e,"mousemove",C),Si(e,"mouseleave",N)}}),[]);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},Si(document,"mousemove",E),Si(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)},N=()=>{v.current=!0,x(g.current)},T=Vn("scrollbar"),I={[`${T}__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(Pp,{name:"fade",in:r||s||b,timeout:300},t.createElement("div",{ref:h,className:He(I,i),style:R},t.createElement("div",{ref:m,className:`${T}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),Ei(document,"mousemove",E),Ei(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])})}})))},Qi=20,Zi=t.forwardRef(((e,n)=>{const{wrapClassName:r,wrapStyle:i,barWidth:a,always:l,native:o,showTopScrollbar:s,minSize:c=Qi,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=zi(u),E=zi(h);Bi((()=>{!o&&S()}),[E.width,E.height,x.width,x.height]);const S=Ui((()=>{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)=>{se(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)*Ai(l),i(a)):e.scrollTop=t};i(a)})(p.current,e):p.current.scrollTop=e:Jt("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},N=(e,t)=>{se(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)*Ai(l),i(a)):e.scrollLeft=t};i(a)})(p.current,e):p.current.scrollLeft=e:Jt("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:N}}));const T=t.useMemo((()=>({dragging:y,scrollbarElement:u,wrapElement:p})),[y]),I=Vn("scrollbar"),R={[`${I}__wrap`]:!0,[`${I}__wrap--hidden`]:!o};return t.createElement("div",{ref:u,className:He(I,e.className),style:e.style},t.createElement("div",{ref:p,className:He(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(qi.Provider,{value:T},s&&t.createElement(Xi,{className:"top",direction:"horizontal",thumb:m,barSize:a,always:l,onDrag:w}),t.createElement(Xi,{direction:"horizontal",thumb:m,barSize:a,always:l,onDrag:w}),t.createElement(Xi,{direction:"vertical",thumb:g,barSize:a,always:l,onDrag:w})))}));Zi.displayName="QmScrollbar";const Ji=(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}},ea=(e,{fileName:t,headers:n,params:r})=>wn(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(Yt("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));Ji(o,c)})),ta=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},na=e=>{var n,r;const i=$i({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:a=[],fileDirection:l="vertical",batchDownload:o,draggable:s,editable:c,disabled:d,readOnly:u,button:p={},className:h,onPreview:m,onSortChange:f,onEditChange:g,onChange:v}=i,{t:y}=Cn(),{$size:b}=Tn(i),x=t.useRef(null),E=t.useRef(null),[S,C]=t.useState({}),N=t.useMemo((()=>d||u),[d,u]);t.useEffect((()=>(R(),()=>{var e;return null===(e=E.current)||void 0===e?void 0:e.destroy()})),[]);const T=(e,t)=>{C((n=>Object.assign({},n.actived,{[e]:null!=t?t:!n.actived[e]})))},I=Nn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...a],[r]=e.splice(t,1);e.splice(n,0,r),null==f||f(e),null==v||v({fileList:e})}})),R=()=>{s&&(E.current=Ot.create(Oi(x.current,Vn("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:I}))},A=e=>wn(void 0,void 0,void 0,(function*(){const{downloadWithHeaders:t,headers:n}=i;try{e.url&&(yield ea(e.url,Object.assign({fileName:e.name},t?{headers:n}:null)))}catch(e){k.error(y("qm.download.error"))}})),P=Vn("upload-file"),_={[P]:!0,[`${P}--lg`]:"large"===b,[`${P}--sm`]:"small"===b,[`${P}--horizontal`]:"horizontal"===l};return t.createElement(O,fn({className:He(_,h)},Fn(i,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((n,r)=>wn(void 0,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:l,maxCount:o,fileList:s=[],beforeUpload:c}=i,d=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!l||e.size/1024/1024<l,p=!(o>1)||s.length<o,h=d&&u&&p;if(d||k.warning(y("qm.upload.tooltip",{type:a.join(",")})),u||k.warning(y("qm.upload.sizeLimit",{size:l})),p||k.warning(y("qm.upload.countLimit",{count:o})),!h)return O.LIST_IGNORE;if(c){const i=c(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)})))),disabled:N,onChange:v,onPreview:e=>wn(void 0,void 0,void 0,(function*(){if("function"==typeof m)return m(e,(t=>A(t||e)));d||(yield A(e))})),onDownload:e=>wn(void 0,void 0,void 0,(function*(){yield A(e)})),itemRender:(e,n,r,l)=>((e,n)=>{const{iconRender:r}=i,{uid:l,name:o,url:u,status:p="done"}=e,h="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return t.createElement("div",{className:He("ant-upload-list-item",`ant-upload-list-item-${p}`,"ant-upload-list-item-list-type-text",{handle:s})},t.createElement("div",{className:"ant-upload-list-item-info"},t.createElement("span",{className:"ant-upload-span"},t.createElement("div",{className:"ant-upload-text-icon"},r?r(e):t.createElement(Me,null)),t.createElement("div",{className:"ant-upload-list-item-name"},S[l]?t.createElement(L,{size:"small",autoFocus:!0,defaultValue:ta(o),onBlur:t=>{const{value:n}=t.target;if(n!==ta(o)){const t=Object.assign({},e,{name:n}),r=a.map((e=>e.uid!==l?e:t));null==g||g(t,r),null==v||v({file:t,fileList:r})}T(l,!1)}}):t.createElement("a",{rel:"noreferrer",target:"_blank",title:o,href:u,onClick:e=>{e.preventDefault(),c?N||T(l,!0):n.preview()}},o)),t.createElement("span",{className:"ant-upload-list-item-card-actions"},c&&!N&&t.createElement("button",{type:"button",className:h,onClick:()=>T(l)},S[l]?t.createElement(je,null):t.createElement(qe,null)),c&&t.createElement("button",{type:"button",className:h,onClick:()=>n.preview()},t.createElement(Ve,null)),t.createElement("button",{type:"button",className:h,disabled:d,onClick:()=>n.download()},t.createElement(Ke,null)),t.createElement("button",{type:"button",className:h,disabled:N,onClick:()=>n.remove()},t.createElement(ze,null))))))})(n,l)}),t.createElement("span",{className:"inner",ref:x},i.children||u&&a.length?i.children:t.createElement(w,{type:null!==(n=p.type)&&void 0!==n?n:"default",icon:null!==(r=p.icon)&&void 0!==r?r:t.createElement($e,null),disabled:N},p.text||y("qm.upload.text")),o&&!!a.length&&t.createElement(w,{disabled:d,style:{marginLeft:8},onClick:e=>wn(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof o)yield o(a);else for(const e of a)yield A(e)}))},y("qm.upload.batchDownload"))))};na.displayName="QmUploadFile";const ra=e=>{const n=$i({icon:t.createElement(Ke,null),withCredentials:!1},e),{$size:r}=Tn(n),{t:i}=Cn(),[a,l]=t.useState(!1),o=Fn(n,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t.createElement(w,fn({},o,{size:r,loading:a,onClick:()=>wn(void 0,void 0,void 0,(function*(){var e;l(!0);try{const{action:e,fileName:t,headers:r,params:a,beforeDownload:l=Ln,onSuccess:o}=n,s=de(e)?e:yield wn(void 0,void 0,void 0,(function*(){const e=n.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!s)return Jt("Download","参数 `action` 有误!");if(!l(s))return;yield ea(s,{fileName:t,headers:r,params:a}),yield An(100),null==o||o(),k.success(i("qm.download.success"))}catch(t){null===(e=n.onError)||void 0===e||e.call(n,t),k.error(i("qm.download.error"))}l(!1)}))}),n.children||i("qm.download.text"))};function ia(t,n){const r=e.useRef(null),i=e.useRef(0);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{const r=Date.now();(!i.current||r-i.current>n)&&(t.apply(this,e),i.current=r)}),[t,n])}ra.displayName="QmDownload";const aa=e=>{const{activeKey:n,labels:r,onTabClick:i}=e;return t.createElement(t.Fragment,null,r.map(((e,r)=>{const a={item:!0,actived:r===n};return t.createElement("div",{key:r,className:He(a),onClick:e=>i(r,e)},t.createElement("span",null,e))})))},la=e=>{const{label:n,showDivider:r,className:i,style:a}=e,l={[Vn("anchor-item")]:!0};return t.createElement("div",{className:He(l,i),style:a},r&&t.createElement(Kn,{label:n,style:{marginBottom:10}}),e.children)};la.displayName="AnchorItem";const oa=t.forwardRef(((e,n)=>{const{labelList:r=[],defaultActiveIndex:i,labelWidth:a,tabPosition:l="left",onTabClick:o,className:s,style:c}=e,{$size:d}=Tn(e),u=t.useRef(null),p=t.useRef(),h=t.useRef("ready"),m=t.useRef(0),[f,g]=t.useState(i||0),v=t.useMemo((()=>!!(null==r?void 0:r.length)),[r]);t.useEffect((()=>{y();const e=kt(u.current,"scroll",E);return()=>{e.remove()}}),[]);const y=()=>{f>0&&(u.current.scrollTop=Ii(x(f),u.current))},b=e=>{const t=Math.abs(e),n=(v?r.map((e=>document.getElementById(e.id))):Array.from((null===(i=u.current)||void 0===i?void 0:i.children)||[])).map((e=>Ii(e,u.current)));var i;let a=-1;for(let e=0;e<n.length;e++){const r=n[e],i=n[e+1]||1e4;t>=r-1&&t<i&&(a=e)}return a},x=e=>v?document.getElementById(r[e].id):u.current.children[e],E=ia((e=>{if("ready"!==h.current)return;const t=b(e.target.scrollTop);-1!==t&&g(t)}),60),S=e=>{const t=x(e);t&&(g(e),h.current="stop",p.current&&clearTimeout(p.current),Lt(t,{block:"start",behavior:"smooth",boundary:u.current}),p.current=setTimeout((()=>h.current="ready"),500))};t.useImperativeHandle(n,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>m.current?m.current:e,S(e)}})));const w=Vn("anchor"),C={[w]:!0,[`${w}-left`]:"left"===l,[`${w}-top`]:"top"===l,[`${w}--lg`]:"large"===d,[`${w}--sm`]:"small"===d},N=[];t.Children.map(e.children,(e=>{var t;Rn(e)&&!On(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const T=v?r.map((e=>e.label)):N.map((e=>e.props.label)),I=v?r.map((e=>e.id)):N.map(((e,t)=>e.props["data-id"]||t.toString()));return m.current=T.length,t.createElement("div",{className:He(C,s),style:c},t.createElement("div",{className:He("anchor-nav"),style:{width:a?$n(a):""}},t.createElement(aa,{activeKey:f,labels:T,onTabClick:(e,t)=>{S(e),null==o||o({label:T[e],id:I[e]},t)}})),t.createElement("div",{ref:u,className:He("anchor-container")},v?e.children:N))}));oa.displayName="QmAnchor",oa.Item=la;const sa=e=>t.createElement(A.TabPane,e,e.children);sa.displayName="TabPane";const ca=e=>{const n=$i({tabPosition:"top"},e),{items:r,tabPosition:i,tabBarGutter:a,className:l,authConfig:o}=n,{$size:s}=Tn(n),c=Vn("tabs"),d={[c]:!0,[`${c}--lg`]:"large"===s,[`${c}--sm`]:"small"===s},u=Object.assign(Object.assign({},Fn(n,["items","authConfig"])),{size:s,tabBarGutter:null!=a?a:["top","bottom"].includes(i)?30:0}),p=[];t.Children.map(n.children,(e=>{var t;Rn(e)&&!On(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&p.push(e)}));const h=r?[...r]:p.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(o){const{fieldList:e=[]}=o||{};for(let t=0;t<h.length;t++){const n=h[t],r=e.find((e=>e.dataIndex===n.key)),{visible:i=1,disabled:a}=r||{};i?a&&(n.disabled=!0):(h.splice(t,1),t--)}}return t.createElement(A,fn({},u,{items:h,className:He(d,l)}))};ca.displayName="QmTabs",ca.TabPane=sa;const da=t.forwardRef(((e,n)=>{var r;const i=$i({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:a,open:l,className:o,loading:s,showHeader:c,showFullScreen:d,maskClosable:u,destroyOnClose:p,onClose:h,onClosed:m,onFullChange:f}=i,{global:g}=t.useContext(Wt),{$size:v}=Tn(i),y=t.useRef(null),b=t.useRef(null),x=t.useRef(!1),[E,S]=t.useState(!1),[w,C]=t.useState(!1),[N,T]=t.useState(!1);xi((()=>{(null!=l?l:a)&&(!p&&x.current||ue(s)&&C(!0))}),[null!=l?l:a]),xi((()=>{b.current&&Ni(b.current,E?{width:"100%"}:{width:$n(i.width||"72%")})}),[E]);const I=()=>{b.current=Oi(y.current,"ant-drawer-content-wrapper"),S(!E),null==f||f(!E)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>T(!0),STOP_LOADING:()=>T(!1)})));const R=Vn("drawer"),O={[R]:!0,"no-header":!c,[`${R}--lg`]:"large"===v,[`${R}--sm`]:"small"===v};return t.createElement(P,fn({},Fn(i,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=l?l:a,maskClosable:null!==(r=null!=u?u:null==g?void 0:g.maskClosable)&&void 0!==r&&r,className:He(O,o),title:t.createElement(t.Fragment,null,t.createElement("span",{ref:y,className:"text"},c&&i.title),d&&t.createElement("button",{type:"button",className:"full-screen",onClick:I},t.createElement(E?We:Be))),footer:null,afterOpenChange:e=>{e?(x.current=!0,ue(s)&&setTimeout((()=>C(!1)),100)):(S(!1),null==m||m())},onClose:h}),i.children,(s||N||w)&&t.createElement(Mi,{spinning:!0,className:He("spinning")}))}));da.displayName="QmDrawer";const ua="10vh";var pa;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(pa||(pa={}));const ha=t.forwardRef(((e,n)=>{var r;const i=$i({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:ua}},e),{visible:a,open:l,width:o,height:s,className:c,loading:d,draggable:u,showHeader:p,showFullScreen:h,maskClosable:m,destroyOnClose:f,bodyStyle:g,onFullChange:v,onClose:y,onClosed:b}=i,{global:x}=t.useContext(Wt),{$size:E}=Tn(i),S=t.createRef(),w=t.useRef(!1),C=t.useMemo((()=>`calc(100vh - ${ua} - ${ua} - ${pa[p?E:"none"]}px)`),[E,p]),[N,T]=t.useState(!1),[I,R]=t.useState(!1),[O,k]=t.useState(!1),[L,A]=t.useState(!0),[P,H]=t.useState({left:0,top:0,bottom:0,right:0}),[F,D]=t.useState();xi((()=>{if(null!=l?l:a){if(!f&&w.current||ue(d)&&R(!0),!f&&w.current)return;setTimeout((()=>{w.current=!0,ue(d)&&R(!1)}),400)}}),[null!=l?l:a]),xi((()=>{D(N?{x:0,y:0}:void 0)}),[N]);const $=e=>{const t=Oi(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body");N?(Ni(t,{width:$n(o||"60%"),height:"auto",top:ua}),Ni(n,{height:s?$n(s):C,maxHeight:"auto"===s?C:""})):(Ni(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Ni(n,{height:`calc(100vh - ${pa[p?E:"none"]}px)`,maxHeight:""})),T(!N),null==v||v(!N)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>k(!0),STOP_LOADING:()=>k(!1)})));const M=Vn("modal"),q={height:s?$n(s):C,maxHeight:"auto"===s?C:"",overflow:"auto"},j={[M]:!0,"no-header":!p,[`${M}--lg`]:"large"===E,[`${M}--sm`]:"small"===E};return t.createElement(_,fn({},Fn(i,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=l?l:a,maskClosable:null!==(r=null!=m?m:null==x?void 0:x.maskClosable)&&void 0!==r&&r,className:He(j,c),title:t.createElement("div",{onMouseOver:()=>{L&&A(!1)},onMouseOut:()=>{A(!0)}},t.createElement("span",{className:"text"},p&&i.title),h&&t.createElement("button",{type:"button",className:"full-screen",onClick:$},t.createElement(N?We:Be))),footer:null,bodyStyle:Object.assign({},q,g),onCancel:y,afterClose:()=>{null==b||b(),T(!1)},modalRender:e=>t.createElement(At,{nodeRef:S,bounds:P,position:F,disabled:!u||L||N,onStart:(e,t)=>((e,t)=>{const{clientWidth:n,clientHeight:r}=window.document.documentElement,i=S.current.getBoundingClientRect();i&&H({left:-i.left+t.x,right:n-(i.right-t.x)-1,top:-i.top+t.y,bottom:r-(i.bottom-t.y)-1})})(0,t)},t.createElement("div",{ref:S},e))}),i.children,(d||O||I)&&t.createElement(Mi,{spinning:!0,className:He("spinning")}))}));ha.displayName="QmModal";const ma=n(void 0),fa=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ga={operations:function(e){const t=e.split(" "),n=[];let r=0;n[r]=[];for(let e=0;e<t.length;e++)fa.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 va=["==","<",">","<=",">=","!=","like","likes","in","nin"];var ya=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},ba=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++)va.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),va.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return e=r.join(" ")};const xa=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,Ea=["string","number","boolean","symbol"],Sa=e=>Ea.includes(typeof e),wa=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Ca=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(xa,"\\$1"),"i");window.__query__=(...e)=>((e,t,n)=>{e=null!=e?e:"";let r=!0;switch(t){case"like":r=null!==e.toString().match(Ca(n));break;case"likes":r=n.split(/,|,/).some((t=>null!==e.toString().match(Ca(t))));break;case"in":Sa(n)&&(n=[n]),Array.isArray(n)&&(r=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":Sa(n)&&(n=[n]),Array.isArray(n)&&(r=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":r=(wa(e)?e.slice(0,10):e)!=n;break;case"<":r=(wa(e)?e.slice(0,10):e)<n;break;case"<=":r=(wa(e)?e.slice(0,10):e)<=n;break;case">":r=(wa(e)?e.slice(0,10):e)>n;break;case">=":r=(wa(e)?e.slice(0,10):e)>=n;break;default:r=(wa(e)?e.slice(0,10):e)==n}return r})(e[0],e[1],e[2]);const Na=ga.stringify,Ta=ga.array_format,Ia=ya,Ra=(e,t,n)=>{let r=[];t=ga.replace_symbols(t);try{if(n){const n=new Function("record",`return ${ba(t,"record")};`);r=ll(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${ba(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)n(e,t)&&r.push(e[t])}}catch(t){Jt("Table","组件 `initialFilter` 参数有误!"),r=e}return r},Oa=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Oa(e.children)):t.push(e)})),t},ka=e=>e.filter((e=>(e.children&&(e.children=ka(e.children)),!e.hidden&&!e.noAuth))),La=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...La(e.children))})),t},Aa=(e,t)=>e.map((e=>(e.children&&(e.children=Aa(e.children,t)),null==t||t(e),e))),Pa=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=Pa(n.children,t);if(e)return e}}return null},_a=e=>{const t=e.children;return t?t[0].children?_a(t[0]):t[0]:e},Ha=e=>{const t=e.children;return t?t[t.length-1].children?Ha(t[t.length-1]):t[t.length-1]:e},Fa=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Da=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=Da(n.children,t);if(e)return e}}return null},$a=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...$a(e.children))})),t},Ma=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 La(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},qa=(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 qa(e.offsetParent,t,n)}return n},ja=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Va=(e,t)=>he(e,((e,n,r)=>{me(n,t[r])||(e[r]=oe(n)&&oe(t[r])?Va(n,t[r]):n)})),Ka=(e,t)=>{var n;return null!==(n=pe(e,t))&&void 0!==n?n:""},za=(e,t,n,r)=>{r>=0&&null!=n&&(n=Number(n).toFixed(r)),fe(e,t,null!=n?n:"")},Wa=(e,t)=>{if(!t.includes("|"))return Ka(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(Ka(e,t))})),n.every((e=>!e))?"":n.join(" | ")},Ba=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),Ua=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]}`:""}`},Ga=(e,t)=>{const n=e.toString();if(!Ba(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)},Ya=(e,t)=>e?f(e,t):null,Xa=(e,t)=>e?f(e).format(t):"",Qa=(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)}))},Za=e=>{const n=[];if(t.isValidElement(e)){const{children:r}=e.props;t.Children.forEach(r,(e=>{n.push(...Za(e))}))}else n.push(e);return n},Ja=e=>Za(e).join(""),el=e=>e.filter((e=>!e._group)),tl=(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)?Ta(a.condition):Na(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])?Ta(l[e]):Na(l[e],"^")} and `}}n=n.slice(0,-1*r)}return n.replace(/\s+/g," ").trim()},nl=(e=[],t=[])=>{const n={};return e.forEach((e=>{const r=JSON.stringify((e=>{const n=[];return t.forEach((t=>n.push(Ka(e,t)))),n})(e));n[r]=n[r]||[],n[r].push(e)})),Object.keys(n).map((e=>n[e]))},rl=(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=rl(e[n].children,t);if(r)return[e[n],r].flat()}}},il=(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=il(e[n].children,t);if(r)return[e[n].rowKey,r].flat()}}},al=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=al(n.children,t);if(e)return e}if(t(n))return n}return null},ll=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&ll(e.children,t),t(e)||e.children&&e.children.length))),ol=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),sl=80,cl="1",dl="0",ul=400,pl=["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"],hl={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 ml,fl,gl;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(ml||(ml={})),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"}(fl||(fl={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(gl||(gl={}));const vl={items:m.arrayOf(m.shape({type:m.string.isRequired,fieldName:m.string.isRequired})),initialValues:m.object,initialExtras:m.object,layout:m.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!en(e[t]||""))return Zt("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:m.number,customClass:m.string,compactMode:m.bool,labelWidth:m.oneOfType([m.number,m.string]),labelAlign:m.oneOf(["left","right"]),labelWrap:m.bool,formType:m.oneOf(["default","search","onlyShow"]),disabled:m.bool,uniqueKey:m.string,defaultRows:m.number,defaultExpand:m.bool,searchButtonCols:m.number,scrollToFirstError:m.bool,authConfig:m.object,isAutoFocus:m.bool,isCollapse:m.bool,isFieldsDefine:m.bool,isSearchBtn:m.bool,isSubmitBtn:m.bool,fieldsChange:m.func,onValuesChange:m.func,onFieldsChange:m.func,onFinish:m.func,onFinishFailed:m.func,onReset:m.func,onCollapse:m.func},yl={layout:"horizontal",labelWidth:sl,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:kn,onFieldsChange:kn,onFinish:kn,onFinishFailed:kn,onReset:kn,onCollapse:kn},bl=(e,t)=>{if(!e)return null;if(t===fl.week){const t=e.match(/^(\d{4})-(\d+)/);return t?f().year(Number(t[1])).week(Number(t[2])):null}if(t===fl.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?f().year(Number(t[1])).quarter(Number(t[2])):null}return f(e,t)},xl=(e,t)=>e?f(e).format(t):"",El=e=>""===e||null==e,Sl=(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},wl=(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]]},Cl=(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]]},Nl=(e,t,n)=>e.map((e=>{const r={value:e[t],text:e[n]};return e.disabled&&(r.disabled=!0),ue(e.isLeaf)||(r.isLeaf=!!e.isLeaf),ue(e.selectable)||(r.selectable=!!e.selectable),Array.isArray(e.children)&&(r.children=Nl(e.children,t,n)),r})),Tl=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=Tl(n.children,t);if(e)return e}}return null},Il=(e,t,n=0)=>{const r=[];return e.forEach((e=>{e.value==t.split(",")[n]&&r.push(e),Array.isArray(e.children)&&r.push(...Il(e.children,t,n+1))})),r},Rl=e=>Rn(e)||"string"==typeof e,Ol=e=>Rn(e)?Za(e).join(""):null!=e?e:"",kl=(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 Ll={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 Al="阿",Pl="鿿",_l=1,Hl=2,Fl=3;let Dl,$l=null;function Ml(e){return e||null===$l?("object"==typeof Intl&&Intl.Collator?(Dl=new Intl.Collator(["zh-Hans-CN","zh-CN"]),$l=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):$l=!1,$l):$l}function ql(e){const t=Ll.UNIHANS,n=Ll.PINYINS,r=Ll.EXCEPTIONS,i={source:e};if(e in r)return i.type=Hl,i.target=r[e],i;let a,l=-1;if(e.charCodeAt(0)<256)return i.type=_l,i.target=e,i;if(a=Dl.compare(e,Al),a<0)return i.type=Fl,i.target=e,i;if(0===a)i.type=Hl,l=0;else{if(a=Dl.compare(e,Pl),a>0)return i.type=Fl,i.target=e,i;0===a&&(i.type=Hl,l=t.length-1)}if(i.type=Hl,l<0){let n=0,r=t.length-1;for(;n<=r;){l=~~((n+r)/2);const i=t[l];if(a=Dl.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=Fl,i.target=i.source),i}function jl(e){return"string"==typeof e&&Ml()?e.split("").map((e=>ql(e))):e}var Vl={isSupported:Ml,parse:jl,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Ll)})))},genToken:ql,convertToPinyin:(e,t,n)=>jl(e).map((e=>t&&e.type===Hl?e.target.toLowerCase():e.target)).join(n||"")};var Kl={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)}};Vl.isSupported()&&Kl.shouldPatch(Vl.genToken)&&Vl.patchDict(Kl);const zl=e=>{const{value:n,bordered:r}=e;return t.createElement(L,{value:n,title:n,bordered:r,readOnly:!0})};zl.displayName="FormItemView";const{Option:Wl}=$,Bl=e=>{const{$$form:n}=t.useContext(ma),{value:r,items:i,multiple:a,loading:l,onChange:o,onValuesChange:s}=e,{t:c}=Cn(),{fieldName:d,options:u={},style:p={},placeholder:h=c("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:f=!0,readOnly:g,disabled:v,onClear:y}=e.option,{itemList:b=[],filterable:x=!0,listHeight:E=ul,collapseTags:S,maxTagTextLength:w,dropdownStyle:C,openPyt:N=!0}=u,T=Hn(b)?i:b,I=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())||""},R=e=>a?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return n.isOnlyShow?t.createElement(zl,{value:R(r),bordered:m}):t.createElement($,fn({value:r,mode:a?"multiple":void 0,popupClassName:`form-popper__${d}`,dropdownStyle:C,placeholder:h,style:p,loading:l,bordered:m,allowClear:f,disabled:v,showSearch:x,listHeight:E,maxTagCount:S?"responsive":void 0,maxTagTextLength:w},a?{title:R(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=Vl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,R(e),T)})(e)},onClear:y}),T.map((e=>t.createElement(Wl,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Ul extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>wn(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=pe(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;me(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(a),className:He(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":$n(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(Bl,{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:$n(p.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Ul.contextType=ma;const Gl=e=>{const{$$form:n}=t.useContext(ma),{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=dl,trueValue:h=cl}=o,{t:m}=Cn(),f=e=>m(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,f(e))})(t?h:p)}},u?l:null)};class Yl 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=kn}=this.props.option,{labelToCheckbox:m}=o;return t.createElement(H.Item,{label:m?" ":e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(Gl,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Yl.contextType=ma;class Xl extends r{constructor(){super(...arguments),this.linkRef=t.createRef(),this.state={visible:!1},this.getFormFieldsConfig=e=>wn(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)=>wn(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))||Dn(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 ge(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?(ue(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 ue(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(this.formUniqueKey));me(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(ma.Consumer,null,(n=>{const r=n.$$form;return t.createElement("div",{className:He("ant-dropdown-menu","fields-list")},t.createElement("div",{className:"reset"},t.createElement(Mn,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(r.getOriginItems())},Yt("qm.table.columnFilter.reset"))),t.createElement(jt,{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(me(n,i))return;r.setExpandHandle(!0);const a=ol(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(Ue,{className:"handle",title:Yt("qm.form.draggable")}),t.createElement("span",{className:"title"},r.getFormItemLabel(n.label)))}))))}))}render(){const{visible:e}=this.state,n=Vn("form-fields-filter");return t.createElement(ma.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:He(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(Ge,null)))}))}}Xl.contextType=Wt;const Ql=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(ma),{value:i,onChange:a,onValuesChange:l}=e,{t:o}=Cn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m,onFocus:f,onBlur:g,onEnter:v,onClear:y}=e.option,{prefix:b,suffix:x,password:E,maxLength:S,pattern:w,toUpper:C,toTrim:N,autoFocus:T,autoComplete:I,secretType:R}=s,O=R&&(h||m),k=t.useRef();t.useEffect((()=>{var e;const t=()=>null==y?void 0:y(),n=null===(e=k.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return p&&n&&n.addEventListener("click",t),()=>{null==n||n.removeEventListener("click",t)}}),[]);const A=e=>{null==a||a(e),l(e)},P=E?L.Password:L,_=O?((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,R):i;return r.isOnlyShow?t.createElement(zl,{value:(e=>e&&E?new Array(e.length).fill("*").join(""):e)(_),bordered:u}):t.createElement(P,{ref:e=>{k.current=e,"function"==typeof n&&n(e)},value:_,autoComplete:E?"new-password":I,autoFocus:T,placeholder:d,style:c,title:E?"":_,prefix:b,suffix:x,maxLength:S,bordered:u,allowClear:p,readOnly:h,disabled:m,onFocus:e=>{null==f||f(e.target.value,e)},onBlur:t=>{var n;let r=null!==(n=t.target.value)&&void 0!==n?n:"";if(N){const e=r.trim();r!==e&&(r=e,A(r))}(t=>{const{onBlur:n}=e;null==n||n(t)})(r),null==g||g(r,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==v||v(n,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=k.current)||void 0===t||t.blur())}},onChange:e=>{let t=e.target.value;ve(w)&&(t=w.test(t)?t:null!=i?i:""),C&&(t=t.toUpperCase()),A(t)}})}));Ql.displayName="VInput";class Zl 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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=>{m(t),e.setViewValue(a,t)}}))),u&&t.createElement(D,null,e.renderFormItemButton(a,u)),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Zl.contextType=ma;const Jl=e=>{const{$$form:n}=t.useContext(ma),{value:r=[],onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{options:o={},placeholder:s=l("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{prefix:h,suffix:m,maxLength:f}=o,g=e=>{const t=e.every((e=>!e))?[]:e;null==i||i(t),a(t,v(t))},v=e=>e.join(" - ");return n.isOnlyShow?t.createElement(zl,{value:v(r),bordered:c}):t.createElement(L.Group,null,t.createElement(L,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],prefix:h,suffix:m,maxLength:f,allowClear:d,bordered:c,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),t.createElement(L,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t.createElement(L,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],prefix:h,suffix:m,maxLength:f,bordered:c,allowClear:d,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class eo 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(s),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(Jl,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(a,n)}}))),c&&t.createElement(D,{flex:$n(c.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},c)))))}}eo.contextType=ma;const to=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(ma),{value:i,onChange:a,onValuesChange:l}=e,{t:o}=Cn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,readOnly:p,disabled:h,onFocus:m,onBlur:f,onEnter:g}=e.option,{step:v=1,min:y,max:b,precision:x,autoFocus:E,stringMode:S,textAlign:w="left",controls:C=!0,formatter:N,parser:T}=s,I=t.useRef(),R=t.useRef(i),O=e=>{const t=El(e)?"":se(e)?e.toFixed(x):new Ht(e).toFixed(x);return"function"==typeof N?N(t):t},k={[w]:!0,controls:C};return r.isOnlyShow?t.createElement(zl,{value:O(i),bordered:u}):t.createElement(j,{ref:e=>{I.current=e,"function"==typeof n&&n(e)},value:i,className:He(k),placeholder:d,style:Object.assign({width:"100%"},c),step:v,min:y,max:b,controls:C,precision:x,autoFocus:E,stringMode:S,formatter:N,parser:T,bordered:u,readOnly:p,disabled:h,onFocus:e=>{null==m||m(e.target.value,e)},onBlur:t=>{Pn((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(R.current),null==f||f(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==g||g(i,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=I.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!S&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{R.current=e,null==a||a(e),l(e,O(e))})(t)}})}));to.displayName="VInputNumber";class no 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(to,{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:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}no.contextType=ma;const ro=e=>{const{$$form:n}=t.useContext(ma),{value:r=[],onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{options:o={},placeholder:s=l("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{step:h=1,min:m=0,max:f,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=o,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),S(e)},S=e=>{const t=e.every((e=>null===e))?[]:[...e];null==i||i(t),a(t,w(t))},w=e=>El(e)?"":e.map((e=>El(e)?"":Number(e).toFixed(y))),C={[g]:!0,controls:v};return n.isOnlyShow?t.createElement(zl,{value:w(r),bordered:c}):t.createElement(L.Group,null,t.createElement(j,{value:r[0],className:He("site-input-left",C),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:s[0],step:h,min:m,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{S([e,r[1]])},onBlur:()=>{E(r)}}),t.createElement(L,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t.createElement(j,{value:r[1],className:He("site-input-right",C),style:{width:"calc(50% - 5px)"},placeholder:s[1],step:h,min:m,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{S([r[0],e])},onBlur:()=>{E(r)}}))};class io 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(s),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(ro,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(a,n)}}))),c&&t.createElement(D,{flex:$n(c.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},c)))))}}var ao;io.contextType=ma,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(ao||(ao={}));const{Search:lo}=L;class oo extends r{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Pt((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>wn(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||Jt("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)||Jt("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&Jt("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=()=>wn(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||Hn(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=pe(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&wl(e,this.alias,c),d&&Cl(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=Sl(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(oe(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=Ln,formatter:i=(e=>e)}=t.fetch;return new Promise(((a,l)=>wn(this,void 0,void 0,(function*(){var o;const s=ye({},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=pe(e.data,t.fetch.dataKey))&&void 0!==o?o:[];a(n)}else l()}catch(e){l(e)}finally{Pn((()=>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=Sl(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=Sl(e,this.extras[n]);void 0!==r&&t.SET_FIELDS_EXTRA({[n]:r})}},this.resetSearchHelperValue=(e=[],t)=>wn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,r=e.filter((e=>{var r;return null===(r=Sl(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)=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:r}=this.searchHelper,i=(null!=r?r:Ln)(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]:Sl(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Sl(e,this.extras[n])});const r=Sl(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=Yt("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:Yt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${ao[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(zl,{value:a,bordered:p}):t.createElement(t.Fragment,null,t.createElement(lo,{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):Pn((()=>this.clearSearchHelperValue())))}}),t.createElement(ha,b,t.createElement(ap,x)))}}oo.contextType=ma;class so extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>wn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Zt("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 Jt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>wn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=kl(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:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(oo,{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:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}so.contextType=ma;const co=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=kt(document,"mousedown",this.mousedownHandler),this.event2=kt(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,fn({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,fn({},e,{forwardedRef:r}))))};function uo(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 po(e,t,n,r){var i=Ft.unstable_batchedUpdates?function(e){Ft.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 ho=c((function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,a=l(),o=l();d(t,(function(){return{}}));var c=l(!1);return!c.current&&kr()&&(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?Ft.createPortal(i,o.current):null}));function mo(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var fo;function go(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 vo(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=Qn({motionAppear:!0},go({motion:l,prefixCls:n,transitionName:s,animation:o}))),e.createElement(li,oi({},c,{visible:r,removeOnLeave:!0}),(function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:He("".concat(n,"-mask"),r)})}))}function yo(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 bo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yo(Object(n),!0).forEach((function(t){Eo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xo(e){return xo="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},xo(e)}function Eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var So={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function wo(){if(void 0!==fo)return fo;fo="";var e=document.createElement("p").style;for(var t in So)t+"Transform"in e&&(fo=t);return fo}function Co(){return wo()?"".concat(wo(),"TransitionProperty"):"transitionProperty"}function No(){return wo()?"".concat(wo(),"Transform"):"transform"}function To(e,t){var n=Co();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function Io(e,t){var n=No();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var Ro,Oo=/matrix\((.*)\)/,ko=/matrix3d\((.*)\)/;function Lo(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Ao(e,t,n){var r=n;if("object"!==xo(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):Ro(e,t);for(var i in t)t.hasOwnProperty(i)&&Ao(e,i,t[i])}function Po(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 _o(e){return Po(e)}function Ho(e){return Po(e,!0)}function Fo(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+=_o(r),t.top+=Ho(r),t}function Do(e){return null!=e&&e==e.window}function $o(e){return Do(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Mo=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),qo=/^(top|right|bottom|left)$/,jo="currentStyle",Vo="runtimeStyle",Ko="left";function zo(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function Wo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Bo(e,t,n){"static"===Ao(e,"position")&&(e.style.position="relative");var r=-999,i=-999,a=zo("left",n),l=zo("top",n),o=Wo(a),s=Wo(l);"left"!==a&&(r=999),"top"!==l&&(i=999);var c,d="",u=Fo(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[Co()]||"",To(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")),Lo(e);var p=Fo(e),h={};for(var m in t)if(t.hasOwnProperty(m)){var f=zo(m,n),g="left"===m?r:i,v=u[m]-p[m];h[f]=f===m?g+v:g-v}Ao(e,h),Lo(e),("left"in t||"top"in t)&&To(e,d);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=zo(b,n),E=t[b]-u[b];y[x]=b===x?h[x]+E:h[x]-E}Ao(e,y)}function Uo(e,t){var n=Fo(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(No());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(No());if(r&&"none"!==r){var i,a=r.match(Oo);a?((i=(a=a[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,Io(e,"matrix(".concat(i.join(","),")"))):((i=r.match(ko)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,Io(e,"matrix3d(".concat(i.join(","),")")))}else Io(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function Go(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Yo(e){return"border-box"===Ro(e,"boxSizing")}"undefined"!=typeof window&&(Ro=window.getComputedStyle?function(e,t,n){var r=n,i="",a=$o(e);return(r=r||a.defaultView.getComputedStyle(e,null))&&(i=r.getPropertyValue(t)||r[t]),i}:function(e,t){var n=e[jo]&&e[jo][t];if(Mo.test(n)&&!qo.test(t)){var r=e.style,i=r[Ko],a=e[Vo][Ko];e[Vo][Ko]=e[jo][Ko],r[Ko]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[Ko]=i,e[Vo][Ko]=a}return""===n?"auto":n});var Xo=["margin","border","padding"],Qo=-1,Zo=2,Jo=1;function es(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(Ro(e,o))||0}return l}var ts={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 ns(e,t,n){var r=n;if(Do(e))return"width"===t?ts.viewportWidth(e):ts.viewportHeight(e);if(9===e.nodeType)return"width"===t?ts.docWidth(e):ts.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],a="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),l=Yo(e),o=0;(null==a||a<=0)&&(a=void 0,(null==(o=Ro(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===r&&(r=l?Jo:Qo);var s=void 0!==a||l,c=a||o;return r===Qo?s?c-es(e,["border","padding"],i):o:s?r===Jo?c:c+(r===Zo?-es(e,["border"],i):es(e,["margin"],i)):o+es(e,Xo.slice(r),i)}Go(["Width","Height"],(function(e){ts["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],ts["viewport".concat(e)](n))},ts["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 rs={position:"absolute",visibility:"hidden",display:"block"};function is(){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=ns.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,rs,(function(){r=ns.apply(void 0,t)})),r}function as(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Go(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);ts["outer".concat(t)]=function(t,n){return t&&is(t,e,n?0:Jo)};var n="width"===e?["Left","Right"]:["Top","Bottom"];ts[e]=function(t,r){var i=r;return void 0!==i?t?(Yo(t)&&(i+=es(t,["padding","border"],n)),Ao(t,e,i)):void 0:t&&is(t,e,Qo)}}));var ls={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:$o,offset:function(e,t,n){if(void 0===t)return Fo(e);!function(e,t,n){if(n.ignoreShake){var r=Fo(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?Bo(e,t,n):n.useCssTransform&&No()in document.body.style?Uo(e,t):Bo(e,t,n)}(e,t,n||{})},isWindow:Do,each:Go,css:Ao,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:as,getWindowScrollLeft:function(e){return _o(e)},getWindowScrollTop:function(e){return Ho(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)ls.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};as(ls,ts);var os=ls.getParent;function ss(e){if(ls.isWindow(e)||9===e.nodeType)return null;var t,n=ls.getDocument(e).body,r=ls.css(e,"position");if(!("fixed"===r||"absolute"===r))return"html"===e.nodeName.toLowerCase()?null:os(e);for(t=os(e);t&&t!==n&&9!==t.nodeType;t=os(t))if("static"!==(r=ls.css(t,"position")))return t;return null}var cs=ls.getParent;function ds(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=ss(e),i=ls.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"===ls.css(r,"overflow")){if(r===l||r===o)break}else{var s=ls.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=ss(r)}var c=null;ls.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===ls.css(e,"position")&&(e.style.position="fixed"));var d=ls.getWindowScrollLeft(a),u=ls.getWindowScrollTop(a),p=ls.viewportWidth(a),h=ls.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(ls.isWindow(e)||9===e.nodeType)return!1;var t=ls.getDocument(e),n=t.body,r=null;for(r=cs(e);r&&r!==n&&r!==t;r=cs(r))if("fixed"===ls.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 us(e){var t,n,r;if(ls.isWindow(e)||9===e.nodeType){var i=ls.getWindow(e);t={left:ls.getWindowScrollLeft(i),top:ls.getWindowScrollTop(i)},n=ls.viewportWidth(i),r=ls.viewportHeight(i)}else t=ls.offset(e),n=ls.outerWidth(e),r=ls.outerHeight(e);return t.width=n,t.height=r,t}function ps(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 hs(e,t,n,r,i){var a=ps(t,n[1]),l=ps(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 ms(e,t,n){return e.left<n.left||e.left+t.width>n.right}function fs(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function gs(e,t,n){var r=[];return ls.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function vs(e,t){return e[t]=-e[t],e}function ys(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function bs(e,t){e[0]=ys(e[0],t.width),e[1]=ys(e[1],t.height)}function xs(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=ds(s,!(!(o=o||{})||!o.alwaysByViewport)),p=us(s);bs(a,p),bs(l,t);var h=hs(p,t,i,a,l),m=ls.merge(p,h);if(u&&(o.adjustX||o.adjustY)&&r){if(o.adjustX&&ms(h,p,u)){var f=gs(i,/[lr]/gi,{l:"r",r:"l"}),g=vs(a,0),v=vs(l,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(hs(p,t,f,g,v),p,u)||(d=1,i=f,a=g,l=v)}if(o.adjustY&&fs(h,p,u)){var y=gs(i,/[tb]/gi,{t:"b",b:"t"}),b=vs(a,1),x=vs(l,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(hs(p,t,y,b,x),p,u)||(d=1,i=y,a=b,l=x)}d&&(h=hs(p,t,i,a,l),ls.mix(m,h));var E=ms(h,p,u),S=fs(h,p,u);if(E||S){var w=i;E&&(w=gs(i,/[lr]/gi,{l:"r",r:"l"})),S&&(w=gs(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=ls.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)),ls.mix(i,a)}(h,p,u,c))}return m.width!==p.width&&ls.css(s,"width",ls.width(s)+m.width-p.width),m.height!==p.height&&ls.css(s,"height",ls.height(s)+m.height-p.height),ls.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 Es(e,t,n){var r=n.target||t,i=us(r),a=!function(e,t){var n=ds(e,t),r=us(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 xs(e,i,n,a)}Es.__getOffsetParent=ss,Es.__getVisibleRectForElement=ds;var Ss=kr()?e.useLayoutEffect:e.useEffect,ws=function(t,n){var r=e.useRef(!0);Ss((function(){return t(r.current)}),n),Ss((function(){return r.current=!1,function(){r.current=!0}}),[])};function Cs(e,t){var n=null,r=null;var i=new Rt((function(e){var i=Jn(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 Ns(e){return"function"!=typeof e?null:e()}function Ts(e){return"object"===Un(e)&&e?e:null}var Is=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=Ns(n),s=Ts(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=Es(a,o,r):s&&(l=function(e,t,n){var r,i,a=ls.getDocument(e),l=a.defaultView||a.parentWindow,o=ls.getWindowScrollLeft(l),s=ls.getWindowScrollTop(l),c=ls.viewportWidth(l),d=ls.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 xs(e,u,bo(bo({},n),{},{points:h}),p)}(a,s,r)),function(e,t){e!==document.activeElement&&uo(t,e)&&"function"==typeof e.focus&&e.focus()}(c,a),i&&l&&i(a,l),!0}return!1}),d),g=Jn(f,2),v=g[0],y=g[1],b=Jn(t.useState(),2),x=b[0],E=b[1],S=Jn(t.useState(),2),w=S[0],C=S[1];return ws((function(){E(Ns(a)),C(Ts(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(on(!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"===Un(t)&&"object"===Un(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 Cs(p.current,v)}),[p.current]),t.useEffect((function(){return Cs(x,v)}),[x]),t.useEffect((function(){i?y():v()}),[i]),t.useEffect((function(){if(s)return po(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},Rs=t.forwardRef(Is);function Os(){Os=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 N(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(T([])));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"==Un(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 N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function T(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=T,N.prototype={constructor:N,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:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function ks(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 Ls(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){ks(a,r,i,l,o,"next",e)}function o(e){ks(a,r,i,l,o,"throw",e)}l(void 0)}))}}Rs.displayName="Align";var As=["measure","alignPre","align",null,"motion"],Ps=e.forwardRef((function(t,n){var r=t.visible,i=t.prefixCls,a=t.className,o=t.style,c=t.children,d=t.zIndex,p=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,N=l(),T=l(),I=Jn(u(),2),R=I[0],O=I[1],k=function(t){var n=Jn(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})}]}(p),L=Jn(k,2),A=L[0],P=L[1];var _=function(e,t){var n=Jn(br(null),2),r=n[0],i=n[1],a=l();function o(e){i(e,!0)}function c(){Jr.cancel(a.current)}return s((function(){o("measure")}),[e]),s((function(){"measure"===r&&t(),r&&(a.current=Jr(Ls(Os().mark((function e(){var t,n;return Os().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=As.indexOf(r),(n=As[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=Jr((function(){o((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r,(function(){p&&P(v())})),H=Jn(_,2),F=H[0],D=H[1],$=Jn(u(0),2),M=$[0],q=$[1],j=l();function V(){var e;null===(e=N.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))}ws((function(){"alignPre"===F&&q(0)}),[F]),ws((function(){"align"===F&&(M<3?V():D((function(){var e;null===(e=j.current)||void 0===e||e.call(j)})))}),[M]);var z=Qn({},go(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 T.current}}}));var B=Qn(Qn({},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,oi({visible:r,ref:T,leavedClassName:"".concat(i,"-hidden")},z,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:h,forceRender:m}),(function(t,n){var r=t.className,l=t.style,o=He(i,a,R,r);return e.createElement(Rs,{target:g||v,key:"popup",ref:N,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:Qn(Qn({},l),B)},G))}))}));Ps.displayName="PopupInner";var _s=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=Qn({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(li,oi({visible:i,ref:m,removeOnLeave:!0},u),(function(t,n){var i=t.className,a=t.style,l=He(r,s,i);return e.createElement("div",{ref:n,className:l,onClick:h,style:Qn(Qn({},a),f)},g)}))}));_s.displayName="MobilePopupInner";var Hs=["visible","mobile"],Fs=e.forwardRef((function(t,n){var r=t.visible,i=t.mobile,a=sr(t,Hs),l=Jn(u(r),2),o=l[0],c=l[1],d=Jn(u(!1),2),p=d[0],h=d[1],m=Qn(Qn({},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=p?e.createElement(_s,oi({},m,{mobile:i,ref:n})):e.createElement(Ps,oi({},m,{ref:n}));return e.createElement("div",null,e.createElement(vo,m),f)}));Fs.displayName="Popup";var Ds=e.createContext(null);function $s(){}function Ms(){return""}function qs(e){return e?e.ownerDocument:window.document}var js=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var Vs=function(t){var n=function(n){mr(i,e.Component);var r=vr(i);function i(t){var n,a;return dr(this,i),Yn(gr(n=r.call(this,t)),"popupRef",e.createRef()),Yn(gr(n),"triggerRef",e.createRef()),Yn(gr(n),"portalContainer",void 0),Yn(gr(n),"attachId",void 0),Yn(gr(n),"clickOutsideHandler",void 0),Yn(gr(n),"touchOutsideHandler",void 0),Yn(gr(n),"contextMenuOutsideHandler1",void 0),Yn(gr(n),"contextMenuOutsideHandler2",void 0),Yn(gr(n),"mouseDownTimeout",void 0),Yn(gr(n),"focusTime",void 0),Yn(gr(n),"preClickTime",void 0),Yn(gr(n),"preTouchTime",void 0),Yn(gr(n),"delayTimer",void 0),Yn(gr(n),"hasPopupMouseDown",void 0),Yn(gr(n),"onMouseEnter",(function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)})),Yn(gr(n),"onMouseMove",(function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)})),Yn(gr(n),"onMouseLeave",(function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Yn(gr(n),"onPopupMouseEnter",(function(){n.clearDelayTimer()})),Yn(gr(n),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&uo(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Yn(gr(n),"onFocus",(function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))})),Yn(gr(n),"onMouseDown",(function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()})),Yn(gr(n),"onTouchStart",(function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()})),Yn(gr(n),"onBlur",(function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)})),Yn(gr(n),"onContextMenu",(function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)})),Yn(gr(n),"onContextMenuClose",(function(){n.isContextMenuToShow()&&n.close()})),Yn(gr(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)})),Yn(gr(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)})),Yn(gr(n),"onDocumentClick",(function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),i=n.getPopupDomNode();uo(r,t)&&!n.isContextMenuOnly()||uo(i,t)||n.hasPopupMouseDown||n.close()}})),Yn(gr(n),"getRootDomNode",(function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=tr(n.triggerRef.current);if(t)return t}catch(e){}return Ft.findDOMNode(gr(n))})),Yn(gr(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(mo(e[o].points,i,r))return"".concat(t,"-placement-").concat(o)}return""}(a,l,e,o)),s&&t.push(s(e)),t.join(" ")})),Yn(gr(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,N=n.getPopupAlign(),T={};return n.isMouseEnterToShow()&&(T.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(T.onMouseLeave=n.onPopupMouseLeave),T.onMouseDown=n.onPopupMouseDown,T.onTouchStart=n.onPopupMouseDown,e.createElement(Fs,oi({prefixCls:r,destroyPopupOnHide:i,visible:w,point:y&&C,className:a,align:N,onAlign:l,animation:s,getClassNameFromAlign:n.getPopupClassNameFromAlign},T,{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)})),Yn(gr(n),"attachParent",(function(e){Jr.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=Jr((function(){n.attachParent(e)}))})),Yn(gr(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})),Yn(gr(n),"setPoint",(function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Yn(gr(n),"handlePortalUpdate",(function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)})),Yn(gr(n),"triggerContextValue",{onPopupMouseDown:n.onPopupMouseDown}),a="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,n.state={prevPopupVisible:a,popupVisible:a},js.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),n}return pr(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=po(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=po(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=po(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=po(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Jr.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 Qn(Qn({},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=He(c&&c.props&&c.props.className,o);u&&(d.className=u);var p=Qn({},d);or(c)&&(p.ref=lr(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(Ds.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 Yn(n,"contextType",Ds),Yn(n,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Ms,getDocument:qs,onPopupVisibleChange:$s,afterPopupVisibleChange:$s,onPopupAlign:$s,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}(ho);let Ks=class extends r{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Pt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Jt("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Jt("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=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:Ln)(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(be([...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;me(n,r)||me(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return wn(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(Hn(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=pe(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=Yt("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:Yt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${ao[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:ye({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),C=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},C.length?C.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Yt("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=Vn("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(zl,{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(Vs,{popupVisible:!y&&l,popup:N,popupClassName:He(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:hl,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(w,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Ye,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(ha,E,t.createElement(ap,S)))}};Ks.contextType=ma,Ks=Sn([co],Ks);class zs extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>wn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Zt("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 Jt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>wn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=kl(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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,r)=>{f(t,r),e.setViewValue(l,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(l,p)),u&&t.createElement(D,{flex:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}zs.contextType=ma;const{Search:Ws}=L;class Bs extends r{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Pt((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>wn(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||Jt("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)||Jt("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&Jt("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=()=>wn(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||Hn(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=pe(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&wl(e,this.alias,c),d&&Cl(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=Sl(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=Sl(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]:Sl(e,this.extras[n])})},this.openSearchHelper=e=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:Ln)(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]:Sl(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Sl(e,this.extras[n])});const r=Sl(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=Yt("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:Yt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${ao[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:ye({},c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return n.isOnlyShow?t.createElement(zl,{value:a,bordered:p}):t.createElement(t.Fragment,null,t.createElement(Ws,{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(ha,b,t.createElement(cp,x)))}}Bs.contextType=ma;class Us extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>wn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Zt("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 Jt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>wn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=kl(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(Bs,{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:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Us.contextType=ma;let Gs=class extends r{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Pt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Jt("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Jt("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=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:Ln)(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(be([...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;me(n,r)||me(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return wn(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(Hn(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=pe(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=Yt("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:Yt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${ao[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:ye({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),C=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},C.length?C.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Yt("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=Vn("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(zl,{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(Vs,{popupVisible:!y&&l,popup:N,popupClassName:He(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:hl,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(w,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Ye,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(ha,E,t.createElement(cp,S)))}};Gs.contextType=ma,Gs=Sn([co],Gs);class Ys extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>wn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Zt("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 Jt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>wn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=kl(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(Gs,{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:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Ys.contextType=ma;const Xs=new Array(2).fill("");class Qs extends r{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Xs},this.getSearchHelper=Pt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Jt("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Jt("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(Xs),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=>wn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:Ln)(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]:Hn(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=Ln,formatter:i=(e=>e)}=t.fetch;return new Promise(((a,l)=>wn(this,void 0,void 0,(function*(){var o;const s=ye({},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(Pn((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=pe(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return a(n)}}catch(e){this.setState({loading:!1})}l()}))))},this.resetSearchHelperValue=(e=[])=>wn(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;me(t,n)||me(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:i}=this.props.option;if(!me(r[i],this._ceho_data)&&(this._ceho_data=r[i],this.setItemList(r[i]),n.length)){const e=Xs.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 wn(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(Hn(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=pe(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=Yt("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||s,m=a.every((e=>El(e)))?"":a.join(" - "),f={visible:r,title:Yt("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${ao[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},g=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:ye({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(zl,{value:m,bordered:d}):t.createElement(t.Fragment,null,t.createElement(L.Group,null,t.createElement(L,{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(L,{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(L.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(ha,f,t.createElement(hp,g)))}}Qs.contextType=ma;class Zs extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>wn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Zt("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 Jt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>wn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=kl(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(c),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(Qs,{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:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Zs.contextType=ma;const Js=e=>{const{$$form:n}=t.useContext(ma),{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=Hn(p)?i:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return n.isOnlyShow?t.createElement(zl,{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 ec 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;me(r,i)||this.getItemList()}getItemList(){var e;return wn(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=pe(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(Js,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,{flex:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}ec.contextType=ma;const tc=e=>{const{$$form:n}=t.useContext(ma),{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 nc 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(tc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}nc.contextType=ma;const rc=e=>{const{$$form:n}=t.useContext(ma),{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=Hn(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(zl,{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 ic extends r{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>wn(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=pe(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;me(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(rc,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,{flex:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}ic.contextType=ma;const ac=e=>{const{$$form:n}=t.useContext(ma),{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=dl,trueValue:h=cl}=o,{t:m}=Cn();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(Xe,null),onChange:e=>{(e=>{null==i||i(e),a(e,m(e===h?"am.form.trueText":"am.form.falseText"))})(e?h:p)}}),u?t.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},l):null)};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=kn}=this.props.option,{labelToSwitch:m}=o;return t.createElement(H.Item,{label:m?" ":e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(ac,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}lc.contextType=ma;const oc=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{options:o={},style:s={},placeholder:c=l("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u,readOnly:p,disabled:h,onBlur:m,onEnter:f}=e.option,{showCount:g,maxLength:v,autoSize:y}=o,b=Object.assign({},{minRows:1,maxRows:3},y);return t.createElement(L.TextArea,{value:r,placeholder:c,style:s,maxLength:v,showCount:g,autoSize:b,bordered:d,allowClear:u,readOnly:p||n.isOnlyShow,disabled:h,onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),null==m||m(n,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==f||f(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==i||i(e),a(e)})(t)}})};class sc 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(oc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}sc.contextType=ma;const cc=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.datePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{dateType:g="date",format:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=s,S=t.createRef(),w=e=>{e&&"date"===g&&(e=e.slice(0,10)+" 00:00:00"),null==i||i(e),a(e,C(e))},C=e=>El(e)?"":["date","exactdate"].includes(g)?e.slice(0,10):e,N=e=>{let t=xl(f().subtract(e,"day"),fl[g]);"date"===g&&(t=t.slice(0,10)),w(t),S.current.blur(),S.current.focus()};return n.isOnlyShow?t.createElement(zl,{value:C(r),bordered:u}):t.createElement(mn,{ref:S,style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:ml[g],format:v,bordered:u,showToday:!1,showTime:"datetime"===g&&{defaultValue:f("00:00:00","HH:mm:ss")},allowClear:p,disabled:m,inputReadOnly:h,disabledDate:null!=y?y: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,[b,x]),renderExtraFooter:E&&g.includes("date")?()=>"function"==typeof E?E():t.createElement(t.Fragment,null,t.createElement(W,{color:"processing",onClick:()=>N(0)},l("qm.form.datePickers")[0]),t.createElement(W,{color:"processing",onClick:()=>N(1)},l("qm.form.datePickers")[1]),t.createElement(W,{color:"processing",onClick:()=>N(7)},l("qm.form.datePickers")[2]),t.createElement(W,{color:"processing",onClick:()=>N(30)},l("qm.form.datePickers")[3])):void 0,value:bl(r,fl[g]),onChange:(e,t)=>{w(xl(e,fl[g]))}})};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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}dc.contextType=ma;const uc=e=>[f().subtract(e,"day"),f()],pc=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m=n.isFormDisabled}=e.option,{dateType:g="date",format:v,disableds:y=[!1,!1],allowEmpty:b,disabledDate:x,minDateTime:E,maxDateTime:S,shortCuts:w=!0}=s,C={[l("qm.form.dateRangePickers")[0]]:uc(7),[l("qm.form.dateRangePickers")[1]]:uc(30),[l("qm.form.dateRangePickers")[2]]:uc(90),[l("qm.form.dateRangePickers")[3]]:uc(180)},N=e=>El(e)?"":e.map((e=>["date","exactdate"].includes(g)?null==e?void 0:e.slice(0,10):e)).join(" - ");return n.isOnlyShow?t.createElement(zl,{value:N(r),bordered:u}):t.createElement(mn.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:ml[g],format:v,bordered:u,showTime:"datetime"===g&&{defaultValue:[f("00:00:00","HH:mm:ss"),f("23:59:59","HH:mm:ss")]},allowClear:p,allowEmpty:b,disabled:m?[!0,!0]:y,inputReadOnly:h,disabledDate:null!=x?x: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,[E,S]),ranges:w&&g.includes("date")?C:void 0,value:Hn(r)?null:[bl(null==r?void 0:r[0],fl[g]),bl(null==r?void 0:r[1],fl[g])],onChange:(e,t)=>{(e=>{"date"===g&&(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,N(e))})([xl(null==e?void 0:e[0],fl[g]),xl(null==e?void 0:e[1],fl[g])])}})};class hc 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}hc.contextType=ma;const mc=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.timePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{timeType:f="hour-minute-second",hourStep:g=1,minuteStep:v=1,secondStep:y=1}=s;return n.isOnlyShow?t.createElement(zl,{value:r,bordered:u}):t.createElement(gn,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!0,hourStep:g,minuteStep:v,secondStep:y,allowClear:p,disabled:m,inputReadOnly:h,format:gl[f],value:bl(r,gl[f]),onChange:(e,t)=>{(e=>{const t=xl(e,gl[f]);null==i||i(t),a(t)})(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}fc.contextType=ma;const gc=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Cn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m=n.isFormDisabled}=e.option,{timeType:f="hour-minute-second",disableds:g=[!1,!1],allowEmpty:v,hourStep:y=1,minuteStep:b=1,secondStep:x=1}=s,E=e=>El(e)?"":e.join(" - ");return n.isOnlyShow?t.createElement(zl,{value:E(r),bordered:u}):t.createElement(gn.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!1,hourStep:y,minuteStep:b,secondStep:x,allowClear:p,allowEmpty:v,disabled:m?[!0,!0]:g,inputReadOnly:h,format:gl[f],value:Hn(r)?null:[bl(null==r?void 0:r[0],gl[f]),bl(null==r?void 0:r[1],gl[f])],onChange:(e,t)=>{(e=>{const t=[xl(null==e?void 0:e[0],gl[f]),xl(null==e?void 0:e[1],gl[f])];null==i||i(t),a(t,E(t))})(e)}})};class vc 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(gc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}vc.contextType=ma;class yc 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=Pt(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.initialHandle=()=>wn(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||Jt("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)||Jt("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),a&&!this.valueKey&&Jt("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&Jt("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=()=>wn(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(Hn(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=pe(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&wl(e,this.alias,c),d&&Cl(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=Sl(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=Sl(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]:Sl(e,this.extras[n])})},this.fetchHandle=xe(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]:Sl(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:Sl(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=Sl(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(me(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 wn(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=pe(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=Yt("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{listHeight:f=ul}=s,{hideHeader:g,onlySelect:v=!0}=this.searchHelper||s,y=this.searchHelper.columns||[],b=Vn("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:He("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},pe(e,n.dataIndex))))))))):t.createElement(Di,null));return t.createElement(Wt.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(zl,{value:l,bordered:u}):t.createElement(Vs,{action:m?[]:["click"],popupVisible:!m&&n,popup:E,popupClassName:He(s,`form-popper__${o}`),popupStyle:{minWidth:x,maxHeight:f},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:hl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(L,{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)}})))}))}}yc.contextType=ma;class bc extends r{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>wn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Zt("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 Jt("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>wn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=kl(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(i),className:He(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":$n(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(yc,{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:$n(u.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}bc.contextType=ma;class xc 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=kn}=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(Kn,{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)}}))}}xc.contextType=ma;const Ec=(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:Ec(e.children,t,n,r)}):e)),Sc=e=>{const{$$form:n}=t.useContext(ma),{value:r,items:i,multiple:a,loading:l,onChange:o,onValuesChange:s}=e,{t:c}=Cn(),{fieldName:d,options:u={},style:p={},placeholder:h=c("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:f=!0,asyncLoad:g,readOnly:v,disabled:y}=e.option,{itemList:b,filterable:x=!0,listHeight:E=ul,checkStrictly:S,checkStrategy:w="SHOW_CHILD",collapseTags:C,defaultExpandAll:N=!g,defaultExpandedKeys:T,dropdownStyle:I,openPyt:R=!0}=u,[O,k]=t.useState(Hn(b)?i:b),L=t.useRef(O);xi((()=>{const e=Hn(b)?i:b;g?me(e,L.current)||(k(e),L.current=e):k(e)}),[b,i]);const A=e=>{var t;return(null===(t=Tl(O,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},P=e=>a?(null==e?void 0:e.map((e=>A(e))).join(","))||"":A(e);return n.isOnlyShow?t.createElement(zl,{value:P(r),bordered:m}):t.createElement(B,fn({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:a,treeCheckable:a,treeCheckStrictly:S,showCheckedStrategy:B[w],popupClassName:`form-popper__${d}`,dropdownStyle:I,placeholder:h,listHeight:E,style:p,loading:l,bordered:m,allowClear:f,disabled:y,treeDefaultExpandAll:N,treeDefaultExpandedKeys:T,showSearch:x,maxTagCount:C?"responsive":void 0,loadData:g?({key:e,children:t})=>wn(void 0,void 0,void 0,(function*(){var n;if(!g||t)return;const{fetchApi:r,params:i,dataKey:a,textKey:l="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=g;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=pe(t.data,a))&&void 0!==n?n:[],i=Ec(O,e,o,Nl(r,o,l));k(i),null==s||s(r)}}catch(e){}})):void 0,treeData:O},a?{title:P(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=Vl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(R?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,P(e),O)})(e)}}))};class wc extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>wn(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=pe(t.data,i))&&void 0!==e?e:[],r=Nl(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;me(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(a),className:He(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":$n(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(Sc,{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:$n(p.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}wc.contextType=ma;const Cc=e=>{const{$$form:n}=t.useContext(ma),{value:r,multiple:i,items:a}=e,{t:l}=Cn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,asyncLoad:h,readOnly:m,disabled:f}=e.option,{itemList:g,changeOnSelect:v,checkStrictly:y,checkStrategy:b="SHOW_PARENT",filterable:x=!0,dropdownStyle:E,openPyt:S=!0}=s,[w,C]=t.useState(Hn(g)?a:g),N=t.useRef(w);xi((()=>{const e=Hn(g)?a:g;h?me(e,N.current)||(C(e),N.current=e):C(e)}),[g,a]);const T=e=>Il(w,null!=e?e:"").map((e=>e.text)).join("/"),I=e=>i?(null==e?void 0:e.map((e=>T(e))).join(","))||"":T(e);return n.isOnlyShow?t.createElement(zl,{value:I(r),bordered:u}):t.createElement(U,fn({value:(e=>Hn(e)?[]:i?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:w,multiple:i,maxTagCount:"responsive",changeOnSelect:v||y,showCheckedStrategy:U[b],popupClassName:`form-popper__${o}`,dropdownStyle:E,placeholder:d,style:c,bordered:u,allowClear:p,disabled:f,showSearch:x&&!h&&{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=Vl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(S?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:h?e=>wn(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!h||n.children)return;const{fetchApi:r,params:i,dataKey:a,textKey:l="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=h;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=pe(e.data,a))&&void 0!==t?t:[],i=Ec(w,n.value,o,Nl(r,o,l));C(i),null==s||s(r)}}catch(e){}})):void 0},i?{title:I(r)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:r}=e;null==n||n(t),r(t,I(t),w)})(((e=[])=>i?e.map((e=>e.join(","))):e.join(","))(t))}}))};class Nc extends r{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>wn(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=pe(t.data,i))&&void 0!==e?e:[],r=Nl(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;me(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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(a),className:He(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":$n(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(Cc,{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:$n(p.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Nc.contextType=ma;const Tc=["110000","120000","310000","500000"],Ic=["810000","820000"],Rc=[{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"}],Oc=[{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"}],kc=e=>Vl.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Lc=(e,t,n=1)=>{if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Tc,...Ic].includes(e))):Object.keys(e[t])).map((r=>({l:kc(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Lc(e,r,n+1)})))},Ac=(e,t)=>t.map((t=>({l:kc(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Pc 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}),Lt(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:Ac(zt,Tc)},{l:"Z2",n:"港澳",c:"",p:"",children:Ac(zt,Ic)}]}createProvince(){var e;return(null!==(e=Lc(zt,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Oc.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Tc,...Ic].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"},Yt("qm.form.citySelectType.0")),t.createElement(K.Button,{value:"1"},Yt("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:n}=this.state;return("0"===n?Rc:Oc).map((n=>t.createElement("li",{key:n.value,className:He({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:Yt("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:He({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=Yt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=Vn("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(Wt.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(zl,{value:m,bordered:s}):t.createElement(Vs,{action:u?[]:["click"],popupVisible:!u&&n,popup:f,popupClassName:He(a,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:hl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(L,{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)}})))}))}}Pc.contextType=ma;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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}_c.contextType=ma;const Hc=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:Hc(e,n)})))};class Fc 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=Hc(zt,"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=Tl(e,t[r]);if(i&&Hn(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 wn(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=pe(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)||`${Yt("qm.form.selectPlaceholder").replace("...","")}(${Yt("qm.form.regionSelectLabel")[r]})`;return t.createElement(ca.TabPane,{key:r.toString(),tab:a},t.createElement("div",{className:"region-box"},n.map((n=>t.createElement("span",{key:n.value,className:He({"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(ca,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},n):t.createElement(Di,null)}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:a={},style:l={},placeholder:o=Yt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=Vn("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(Wt.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(zl,{value:f,bordered:s}):t.createElement(Vs,{action:u?[]:["click"],popupVisible:!u&&n,popup:m,popupClassName:He(a,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:hl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(L,{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&&Pn((()=>this.initial()))}})))}))}}Fc.contextType=ma;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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(Fc,{option:this.props.option,onValuesChange:(t,n)=>{h(t,n),e.setViewValue(a,n)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Dc.contextType=ma;const $c=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:h,draggable:m,editable:f,batchDownload:g,fileDirection:v,onPreview:y,onRemove:b,onSortChange:x,onEditChange:E}=l,{action:S,headers:w,params:C,withCredentials:N=!1,dataKey:T="",downloadWithHeaders:I,fieldAliasMap:R,beforeUpload:O,button:L}=o,A="function"==typeof R?R():R||{},{t:P}=Cn();return t.createElement(na,{name:"file",action:S,multiple:d,headers:w,data:C,withCredentials:N,downloadWithHeaders:I,beforeUpload:O,maxCount:u,fileTypes:p,fileSize:h,draggable:m,editable:f,batchDownload:g,fileDirection:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,button:L,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&&k.error(n.message||P("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(T?pe(n.data,T):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 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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($c,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,"")}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Mc.contextType=ma;const qc=e=>{const{$$form:n}=t.useContext(ma),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,draggable:v,onRemove:y,onSortChange:b}=l,{action:x,headers:E,params:S,withCredentials:w=!1,dataKey:C="",popupClassName:N,fieldAliasMap:T,beforeUpload:I}=o,R="function"==typeof T?T():T||{},{t:O}=Cn();return t.createElement(dd,{name:"file",action:x,multiple:d,headers:E,data:S,withCredentials:w,popupClassName:N,beforeUpload:I,maxCount:u,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,draggable:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in R)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[R[i]])||"";return e.response&&200!==n.code&&k.error(n.message||O("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(C?pe(n.data,C):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onRemove:y,onSortChange:b})};class jc 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(qc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,"")}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}jc.contextType=ma;const Vc=e=>{const{$$form:n}=t.useContext(ma),{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(od,{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 Kc 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=kn}=this.props.option;return t.createElement(H.Item,{label:e.renderFormLabel(r),className:He(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":$n(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(Vc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(D,{flex:$n(d.labelWidth||sl)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Kc.contextType=ma;class zc 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=xe(this.resizeObserveHandler,10),this.getFormItems=Pt((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=Pt((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{oe(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:Yt("qm.form.validatePrompt"),description:n,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&Lt(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(){Vi(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){Ki(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&&Jt("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=>oe(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=>oe(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,pl.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:dl),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=Dn(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),Pn((()=>{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(Rl(e))return Ol(e);if(oe(e)){const{fieldName:l,label:o,options:s={}}=e;if(Rl(o))return Ol(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(El(i)&&(e[r]=""),Array.isArray(i)&&i.forEach(((t,n)=>{El(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)Hn(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return wn(this,void 0,void 0,(function*(){const{authConfig:r}=this.props;if(!r)return;let i=Fn(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?pe(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(Zl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t.createElement(eo,{option:e})}INPUT_NUMBER(e){return t.createElement(no,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t.createElement(io,{option:e})}SEARCH_HELPER(e){return t.createElement(so,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t.createElement(zs,{option:e})}TREE_TABLE_HELPER(e){return t.createElement(Us,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t.createElement(Ys,{option:e})}RANGE_SEARCH_HELPER(e){return t.createElement(Zs,{option:e})}CHECKBOX(e){return t.createElement(Yl,{option:e})}MULTIPLE_CHECKBOX(e){return t.createElement(ec,{option:e})}RATE(e){return t.createElement(nc,{option:e})}RADIO(e){return t.createElement(ic,{option:e})}SWITCH(e){return t.createElement(lc,{option:e})}TEXT_AREA(e){return t.createElement(sc,{option:e})}DATE(e){return t.createElement(dc,{option:e})}RANGE_DATE(e){return t.createElement(hc,{option:e})}TIME(e){return t.createElement(fc,{option:e})}RANGE_TIME(e){return t.createElement(vc,{option:e})}SELECT(e){return t.createElement(Ul,{option:e})}MULTIPLE_SELECT(e){return t.createElement(Ul,{option:e,multiple:!0})}IMMEDIATE(e){return t.createElement(bc,{option:e})}DIVIDER(e){return t.createElement(xc,{option:e})}TREE_SELECT(e){return t.createElement(wc,{option:e})}MULTIPLE_TREE_SELECT(e){return t.createElement(wc,{option:e,multiple:!0})}CASCADER(e){return t.createElement(Nc,{option:e})}MULTIPLE_CASCADER(e){return t.createElement(Nc,{option:e,multiple:!0})}CITY_SELECT(e){return t.createElement(_c,{option:e})}REGION_SELECT(e){return t.createElement(Dc,{option:e})}UPLOAD_FILE(e){return t.createElement(Mc,{option:e})}UPLOAD_IMG(e){return t.createElement(jc,{option:e})}TINYMCE(e){return t.createElement(Kc,{option:e})}renderFormLabel(e){if(Rl(e)||!oe(e))return e;const{type:n,fieldName:r,label:i,options:a={},onChange:l=kn}=e,{itemList:o=[]}=a;return"SELECT"===n?t.createElement(H.Item,{name:r,noStyle:!0},t.createElement(Bl,{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(Gl,{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(C,{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 Hn(this.state.formData)?null:t.createElement(H.Item,{label:this.renderFormLabel(n),name:r,rules:c,tooltip:a,hidden:i,className:He(l),style:Object.assign({width:"100%"},d),labelCol:{flex:this.verticalLayout?"initial":$n(o)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(n)}},null==u?void 0:u(e,this))}createFormItem(e){return ce(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(Jt("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(Dn(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(T,{style:{marginBottom:12}},t.createElement(Mn,{type:"primary",size:this.$size,icon:t.createElement(Ye,null),onClick:()=>this.SUBMIT_FORM()},Yt("qm.form.search")),t.createElement(Mn,{size:this.$size,icon:t.createElement(Ze,null),onClick:()=>this.RESET_FORM()},Yt("qm.form.reset")),l?this.createFieldsDefine():null,this.showFilterCollapse&&t.createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t.createElement(Fe,null):t.createElement(De,null)," ",Yt(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(T,{style:{marginBottom:12}},t.createElement(Mn,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Yt("qm.form.save")),t.createElement(Mn,{size:this.$size,onClick:()=>this.RESET_FORM()},Yt("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:n,fieldsChange:r}=this.props;return t.createElement(Xl,{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)=>wn(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:[Yt("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 wn(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 wn(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 wn(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){Jt("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 Jt("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!oe(t))return Jt("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(a.noAuth)return Jt("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||fe(a,n,t[n]));n&&(i?i([...r]):Jt("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:n,layout:r,disabled:i,labelWidth:a,labelAlign:l,labelWrap:o,customClass:s}=this.props,c=Vn("form"),d={required:"${label}"+Yt("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:He(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":$n(a)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t.createElement(ma.Provider,{value:this.provide},t.createElement(F,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}zc.contextType=Wt,zc.propTypes=vl,zc.defaultProps=yl;const Wc={onActivate:h.func,onAddUndo:h.func,onBeforeAddUndo:h.func,onBeforeExecCommand:h.func,onBeforeGetContent:h.func,onBeforeRenderUI:h.func,onBeforeSetContent:h.func,onBeforePaste:h.func,onBlur:h.func,onChange:h.func,onClearUndos:h.func,onClick:h.func,onContextMenu:h.func,onCommentChange:h.func,onCopy:h.func,onCut:h.func,onDblclick:h.func,onDeactivate:h.func,onDirty:h.func,onDrag:h.func,onDragDrop:h.func,onDragEnd:h.func,onDragGesture:h.func,onDragOver:h.func,onDrop:h.func,onExecCommand:h.func,onFocus:h.func,onFocusIn:h.func,onFocusOut:h.func,onGetContent:h.func,onHide:h.func,onInit:h.func,onKeyDown:h.func,onKeyPress:h.func,onKeyUp:h.func,onLoadContent:h.func,onMouseDown:h.func,onMouseEnter:h.func,onMouseLeave:h.func,onMouseMove:h.func,onMouseOut:h.func,onMouseOver:h.func,onMouseUp:h.func,onNodeChange:h.func,onObjectResizeStart:h.func,onObjectResized:h.func,onObjectSelected:h.func,onPaste:h.func,onPostProcess:h.func,onPostRender:h.func,onPreProcess:h.func,onProgressState:h.func,onRedo:h.func,onRemove:h.func,onReset:h.func,onSaveContent:h.func,onSelectionChange:h.func,onSetAttrib:h.func,onSetContent:h.func,onShow:h.func,onSubmit:h.func,onUndo:h.func,onVisualAid:h.func,onSkinLoadError:h.func,onThemeLoadError:h.func,onModelLoadError:h.func,onPluginLoadError:h.func,onIconsLoadError:h.func,onLanguageLoadError:h.func},Bc=Object.assign({apiKey:h.string,id:h.string,inline:h.bool,init:h.object,initialValue:h.string,onEditorChange:h.func,value:h.string,tagName:h.string,cloudChannel:h.string,plugins:h.oneOfType([h.string,h.array]),toolbar:h.oneOfType([h.string,h.array]),disabled:h.bool,textareaName:h.string,tinymceScriptSrc:h.string,rollback:h.oneOfType([h.number,h.oneOf([!1])]),scriptLoading:h.shape({async:h.bool,defer:h.bool,delay:h.number})},Wc),Uc=e=>"function"==typeof e,Gc=e=>e in Wc,Yc=e=>e.substr(2),Xc=(e,t,n,r,i)=>((e,t,n,r,i,a,l)=>{const o=Object.keys(i).filter(Gc),s=Object.keys(a).filter(Gc),c=o.filter((e=>void 0===a[e])),d=s.filter((e=>void 0===i[e]));c.forEach((e=>{const t=Yc(e),r=l[t];n(t,r),delete l[t]})),d.forEach((n=>{const i=r(e,n),a=Yc(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 Qc=0;const Zc=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return Qc++,e+"_"+n+Qc+String(t)},Jc=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),ed=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),td=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},nd=()=>({listeners:[],scriptId:Zc("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),rd=(()=>{let e=nd();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=nd()}}})(),id=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class ad 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=id(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,ed(o).concat(ed(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&&!Jc(i)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&Uc(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;td(this.editor,i?"readonly":"design"),this.props.init&&Uc(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(i.style.visibility=""),Jc(i)&&(i.value=this.getInitialValue()),a.init(l)},this.id=this.props.id||Zc("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;td(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,r,i,a;null!==id(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&rd.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=id(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){Xc(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 ld;ad.propTypes=Bc,ad.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(ld||(ld={}));const od=e=>{var n;const{className:r,style:i,tinymce:a={},upload:l={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:d,onResizeEditor:u,onChange:p}=e,{global:h}=t.useContext(Wt),{$size:m}=Tn(e),{$locale:f,t:g}=Cn(),v=400,y="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",b="file edit view insert format tools table help",x="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",E=Object.assign(Object.assign({height:a.height||v,plugins:a.plugins||y,toolbar:a.toolbar||x,menubar:a.menubar||b,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:ld[f],skin:"tinymce-5"},Fn(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>wn(void 0,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(g("qm.upload.uploadError"));const a=yield e.json();if(200===a.code){const e=i?pe(a.data,i):a.data;t(e)}}catch(e){k.error(g("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)}))}}),S=Vn("tinymce"),w={[S]:!0,[`${S}--lg`]:"large"===m,[`${S}--sm`]:"small"===m},C={init:E,value:d,disabled:c,tinymceScriptSrc:s||(null===(n=null==h?void 0:h.tinymce)||void 0===n?void 0:n.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return t.createElement("div",{className:He(w,r),style:i},t.createElement(ad,C))};od.displayName="QmTinymce";class sd extends r{constructor(){super(...arguments),this.imgRef=t.createRef()}componentDidMount(){const e=En(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 _t(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={[Vn("cropper")]:!0};return t.createElement("div",{className:He(l,e),style:n},t.createElement("img",{ref:this.imgRef,src:r,alt:i,style:Object.assign({maxWidth:"100%"},a)}))}}sd.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};const cd=e=>{const{fileTypes:n=[],fileSize:r,fixedSize:i,quality:a,beforeCrop:l,className:o}=e,{t:s}=Cn(),c=t.useRef(null),d=t.useRef(),u=t.useRef(),p=t.useRef(),h=t.useRef(),[m,f]=t.useState(""),g=e=>{c.current.relativeZoom(e,void 0)},v=e=>{c.current.rotate(e)},y=()=>{f("")},b=Vn("cropper-preview");return t.createElement(t.Fragment,null,(()=>{const n=Array.isArray(e.children)?e.children[0]:e.children;if(!n)return null;const r=n.props,{beforeUpload:i}=r,a=En(r,["beforeUpload"]);return d.current=i,t.createElement(n.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((n,r)=>wn(void 0,void 0,void 0,(function*(){const r=()=>n(O.LIST_IGNORE);if(l&&!(yield l(e,t)))return void r();u.current=e,p.current=n,h.current=r;const i=new FileReader;i.onload=()=>{f(i.result),i.onload=null},i.readAsDataURL(e)}))))}))})(),m&&t.createElement(_,{open:!0,wrapClassName:He(b,o),title:s("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{wn(void 0,void 0,void 0,(function*(){const{type:e,name:t,uid:r}=u.current;c.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((i=>wn(void 0,void 0,void 0,(function*(){let a=new File([i],t,{type:e});if(Object.assign(a,{uid:r}),n.length&&!n.includes(a.name.slice(a.name.lastIndexOf(".")+1).toLowerCase()))return k.warning(s("qm.upload.tooltip",{type:n.join(",")})),h.current("file type is error");if("function"!=typeof d.current)return p.current(a);const l=d.current(a,[a]);if("boolean"==typeof l||l){if(!0===l)return p.current(a);if(!1===l)return h.current("not upload");if(l&&"function"==typeof l.then)try{const e=yield l,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(a=e),p.current(a)}catch(e){h.current(e)}}else Jt("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,a),yield An(100),y()}))},onCancel:y,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:i?`calc(380px * ${i[1]/i[0]})`:"auto"};return t.createElement("div",{className:"cropper-preview"},t.createElement("div",{className:"cropper-area"},t.createElement("div",{className:"img-cropper"},t.createElement(sd,{ref:c,aspectRatio:i?i[0]/i[1]:i,src:m,dragMode:"move",preview:".preview"})),t.createElement("div",{className:"actions"},t.createElement(T,{size:"small"},t.createElement(w,{type:"primary",size:"middle",icon:t.createElement(Je,null),onClick:()=>g(.2)},s("qm.uploadCropper.zoomIn")),t.createElement(w,{type:"primary",size:"middle",icon:t.createElement(et,null),onClick:()=>g(-.2)},s("qm.uploadCropper.zoomOut")),t.createElement(w,{type:"primary",size:"middle",icon:t.createElement(tt,null),onClick:()=>v(90)},s("qm.uploadCropper.rotatePlus")),t.createElement(w,{type:"primary",size:"middle",icon:t.createElement(nt,null),onClick:()=>v(-90)},s("qm.uploadCropper.rotateSubtract"))))),t.createElement("div",{className:"preview-area"},t.createElement("div",{className:"preview",style:e})))})()))},dd=e=>{const n=$i({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:r=[],openCropper:i=!0,fixedSize:a,quality:l=1,fileTypes:o,fileSize:s,maxCount:c,draggable:d,disabled:u,readOnly:p,className:h,popupClassName:m,beforeCrop:f,onSortChange:g,onChange:v}=n,{t:y}=Cn(),{$size:b}=Tn(n),x=t.useRef(null),E=t.useRef(null),S=t.useRef(!1),[w,C]=t.useState(!1),[N,T]=t.useState(0),I=t.useMemo((()=>u||p),[u,p]),R=t.useMemo((()=>!c||r.length<c),[r,c]);t.useEffect((()=>(A(),document.addEventListener("paste",_),()=>{var e;null===(e=E.current)||void 0===e||e.destroy(),document.removeEventListener("paste",_)})),[]),xi((()=>{R||(S.current=!1)}),[r]);const L=Nn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...r],[i]=e.splice(t,1);e.splice(n,0,i),null==g||g(e),null==v||v({fileList:e})}})),A=()=>{d&&(E.current=Ot.create(Oi(x.current,Vn("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:L}))},P=(e,t)=>new Promise(((r,i)=>wn(void 0,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:l,beforeUpload:o}=n,s=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),c=!l||e.size/1024/1024<l,d=s&&c;if(s||k.warning(y("qm.upload.tooltip",{type:a.join(",")})),c||k.warning(y("qm.upload.sizeLimit",{size:l})),!d)return O.LIST_IGNORE;if(o){const n=o(e,t);if(!0===n)return r(e);if(!1===n)return i("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;r(e)}catch(e){i(e)}}else r(e)})))),_=Nn((e=>wn(void 0,void 0,void 0,(function*(){const{action:t,data:i,headers:a}=n;if(S.current&&R&&t)for(const n of e.clipboardData.items)if("file"===n.kind&&n.type.startsWith("image/")){const e=n.getAsFile(),l=Date.now(),o=new File([e],`screenshot-${l}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${l}`});try{yield P(o,[...r,o]);const e=new FormData;if(e.append("file",o),i)for(const t in i)e.append(t,i[t]);const n="string"==typeof t?t:yield t(o),l=yield fetch(n,{method:"POST",body:e,headers:a});if(!l.ok)throw new Error(y("qm.upload.uploadError"));const s=yield l.json();null==v||v({file:o,fileList:[...r,{uid:o.uid,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate,name:o.name,type:o.type,size:o.size,response:s,status:"done",percent:100,originFileObj:o}]})}catch(e){}}})))),H=Vn("upload-img"),F={[H]:!0,[`${H}--lg`]:"large"===b,[`${H}--sm`]:"small"===b},D=t.createElement(O,fn({className:He(F,h)},Fn(n,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:I,onPreview:e=>{const t=r.findIndex((t=>t.url===e.url));t<0||(T(t),C(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,n,r,i)=>t.createElement("div",{className:He("upload-item",{handle:d})},e,!I&&t.createElement(Xe,{title:y("qm.upload.remove"),className:"icon",onClick:()=>i.remove()}))}),t.createElement("span",{className:"inner",ref:x},R&&!(p&&r.length)&&t.createElement(t.Fragment,null,t.createElement("p",{className:"ant-upload-drag-icon"},t.createElement(rt,null)),t.createElement("p",{className:"ant-upload-text"},y("qm.uploadCropper.dragableText")),t.createElement("button",{className:He("ant-upload-button",{disabled:I}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{S.current=!0},onBlur:()=>{S.current=!1}},y("qm.uploadCropper.pasteText")))));return t.createElement(t.Fragment,null,i?t.createElement(cd,{className:m,fixedSize:a,quality:l,fileTypes:o,fileSize:s,beforeCrop:f},D):D,t.createElement("div",{style:{display:"none"}},t.createElement(Y.PreviewGroup,{preview:{visible:w,current:N,rootClassName:m,onVisibleChange:e=>C(e)}},r.map(((e,n)=>{var r;return t.createElement(Y,{key:null!==(r=e.uid)&&void 0!==r?r:n,src:e.url,alt:""})})))))};dd.displayName="QmUploadImg";const ud=(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=ud(a.children,t,n);e&&(r=e)}}return r},pd=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&pd(e.children,t),t(e)||e.children&&e.children.length))),hd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...hd(e.children,t)),t(e)&&n.push(e)})),n},md=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=md(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},fd=(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:fd(e.children,t,n,r)}):e)),gd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...gd(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},vd=(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=vd(e[r].children,t,n);if(i)return[e[r][n],i].flat()}}},yd=(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(...yd(e,t)))),r},bd=t.forwardRef(((e,n)=>{const{className:r,style:i,filterable:a=!0,multiple:l,draggable:o,dataSource:s,fetch:c,autoFocus:d,asyncLoad:u,checkStrictly:p,checkStrategy:h="SHOW_CHILD",placeholder:m,fieldsDefine:f,value:g,height:v,defaultSelectedKeys:y=[],defaultExpandAll:b=!0,showSearchBar:x=!0,showCollapse:E=!0,onSelectChange:S,onCheckChange:w,onDragStart:C,onDragChange:N,onExpand:T}=e,{$size:I}=Tn(e),{t:R}=Cn(),O=(null==f?void 0:f.valueKey)||"value",k=(null==f?void 0:f.textKey)||"text";null==f||f.children;const A=t.useRef(null),P=t.useRef(null),_=zi(A),[H,F]=t.useState(v),[D,$]=t.useState(!1),M=Ui((()=>{F(A.current.offsetHeight-J.current.offsetHeight-10)}),5);Bi((()=>{v||M()}),[_.height]);const[q,j]=t.useState([]),[V,K]=t.useState({}),[z,W]=t.useState([]),[B,U]=t.useState([]),[G,Y]=t.useState(""),[Q,Z]=t.useState(b),J=t.useRef(null),ee=t.useRef([]),te=t.useRef([]);t.useEffect((()=>{Array.isArray(s)&&(ne(s),W(re(s)),K({}))}),[s]),t.useEffect((()=>{var e;le(),d&&(null===(e=P.current)||void 0===e||e.focus())}),[]),xi((()=>{le()}),[null==c?void 0:c.params]),xi((()=>{U(ae())}),[V]),t.useImperativeHandle(n,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],r=md(q,(t=>e===t[O]));r&&(Array.isArray(r.children)?r.children.push(...n):r.children=[...n],ne([...q]))},REMOVE_RECORD:e=>{var t;const n=ud(q,e,O);if(void 0===n&&q.find((t=>t[O]===e)))ne(q.filter((t=>t[O]!==e)));else{const r=md(q,(e=>n===e[O]));if(!r)return;const i=null===(t=r.children)||void 0===t?void 0:t.findIndex((t=>e===t[O]));i>=0&&(r.children.splice(i,1),ne([...q]))}},UPDATE_RECORD:(e,t)=>{const n=md(q,(t=>e===t[O]));n&&(ye(n,t),ne([...q]))}})));const ne=e=>{j(e),ee.current=e,te.current=gd(e,O)},re=e=>{if(l)return y;const t=hd(e,(e=>y.includes(e[k])));return 1===t.length?[t[0][O]]:[]},ie=e=>{var t;return(null===(t=vd(q,e,O))||void 0===t?void 0:t.slice(0,-1))||[]},ae=()=>{if(b)return te.current;const e=[];return z.forEach((t=>{if(l){if("SHOW_ALL"===h&&!te.current.includes(t)&&e.push(...ie(t)),"SHOW_CHILD"===h&&e.push(...ie(t)),"SHOW_PARENT"===h){const n=Tl(q,t);if(n){const r=ie(t),i=yd(n,O);e.push(...r,...[t,...i].filter((e=>te.current.includes(e))))}}}else e.push(...ie(t))})),[...new Set(e)]},le=()=>wn(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{$(!0);const l=yield t(n);if(200===l.code){let t=Array.isArray(l.data)?l.data:null!==(e=pe(l.data,r))&&void 0!==e?e:[];t="function"==typeof i?yield i(t):t,ne(t),W(re(t)),K({}),null==a||a(t)}}catch(e){}$(!1)})),oe=e=>`${e}|${Vl.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,se=Vn("search-tree"),ce={[se]:!0,[`${se}--lg`]:"large"===I,[`${se}--sm`]:"small"===I};return t.createElement("div",{ref:A,className:He(ce,r),style:i},t.createElement("div",{ref:J,className:"topper"},x&&t.createElement(L.Search,{ref:P,value:G,size:I,placeholder:m||R("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=pd(ee.current,(t=>{if(!e)return!0;const n=t[k]||"";return-1!==oe(n).indexOf(e)}));Y(e),j(t),b||e?U(gd(t,O)):K({})})(e.target.value)}),E&&t.createElement("a",{className:"trigger",onClick:()=>{Z(!Q),U(Q?[]:te.current)}},Q?t.createElement(Fe,null):t.createElement(De,null)," ",R(Q?"qm.form.collect":"qm.form.spread"))),t.createElement(Mi,{spinning:D},t.createElement(X,{fieldNames:{title:k,key:O,children:"children"},multiple:l,draggable:o,blockNode:o,checkable:l,selectable:!l,height:H,disabled:e.disabled,checkStrictly:p,selectedKeys:null!=g?g:z,checkedKeys:null!=g?g:z,expandedKeys:B,treeData:q,loadData:u?({key:e,children:t})=>wn(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),{[O]:e})));if(200===t.code){let r=Array.isArray(t.data)?t.data:null!==(n=pe(t.data,a))&&void 0!==n?n:[];r="function"==typeof o?yield o(r):r;const i=fd(ee.current,e,O,r);ne(i)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!G)return!1;const t=e[k]||"";return-1!==oe(t).indexOf(G)},onDragStart:C,onDragEnter:e=>{U(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][O]===t)return n(e[r],r,e);e[r].children&&a(e[r].children,t,n)}},l=[...q];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)}));ne(l)},onDragEnd:e=>{null==N||N(e,q)},onExpand:(e,t)=>{Hn(e)&&Z(!1),te.current.every((t=>e.includes(t)))&&Z(!0),U(e),null==T||T(e,t)},onSelect:e=>{W(e);const t=hd(ee.current,(t=>e.includes(pe(t,O))));null==S||S(l?t:t[0])},onCheck:e=>{p&&(e=e.checked),W(e),"SHOW_CHILD"===h&&(e=e.filter((e=>!te.current.includes(e)))),"SHOW_PARENT"===h&&(e=e.filter(((e,t,n)=>!n.includes(ud(q,e,O)))));const t=hd(ee.current,(t=>e.includes(pe(t,O))));null==w||w(l?t:t[0])}})))}));bd.displayName="QmSearchTree";const xd=n(void 0),Ed={dataIndex:m.string.isRequired,title:m.string.isRequired,description:m.string,colSpan:m.number,width:m.number,minWidth:m.number,fixed:m.oneOf(["left","right"]),align:m.oneOf(["left","center","right"]),theadAlign:m.oneOf(["left","center","right"]),printFixed:m.bool,hidden:m.bool,noAuth:m.bool,noFixed:m.bool,ellipsis:m.bool,className:m.string,theadClassName:m.string,children:m.array,sorter:m.oneOfType([m.bool,m.func]),filter:m.shape({type:m.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:m.arrayOf(m.shape({text:m.string,value:m.oneOfType([m.string,m.number])})),style:m.object}),precision:m.number,displayPrecision:m.number,formatType:m.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:m.bool,canCopy:m.bool,editRender:m.func,dictItems:m.arrayOf(m.shape({text:m.string,value:m.oneOfType([m.string,m.number])})),summation:m.shape({sumBySelection:m.bool,displayWhenNotSelect:m.bool,dataKey:m.string,unit:m.string,render:m.func}),groupSummary:m.shape({dataKey:m.string,unit:m.string,render:m.func}),shouldCellUpdate:m.func,headRender:m.func,render:m.func};m.arrayOf(m.shape(Ed)).isRequired,m.func,m.array,m.oneOfType([m.string,m.func]).isRequired,m.number,m.bool,m.bool,m.shape({api:m.func.isRequired,params:m.object.isRequired,formatter:m.func,beforeFetch:m.func,afterFetch:m.func,stopToFirst:m.bool,dataKey:m.string,callback:m.func}),m.bool,m.bool,m.string,m.string,m.bool,m.bool,m.bool,m.bool,m.oneOfType([m.object,m.func]),m.oneOfType([m.object,m.func]),m.array,m.func,m.bool,m.object,m.object,m.shape({type:m.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:m.array,selectedRowKeys:m.array,hideSelectAll:m.bool,checkStrictly:m.bool,filterable:m.bool,selectByClickRow:m.bool,selectFirstRowOnChange:m.bool,clearableAfterFetched:m.bool,selectAllOnCurrentPage:m.bool,fetchSelectedRows:m.shape({api:m.func.isRequired,params:m.object,dataKey:m.string}),fetchAllRowKeys:m.shape({api:m.func.isRequired,params:m.object,dataKey:m.string}),disabled:m.func,onChange:m.func,onSelect:m.func,onSelectAll:m.func}),m.shape({currentRowKey:m.oneOfType([m.number,m.string]),disabled:m.func,onChange:m.func}),m.shape({virtual:m.bool,doubleXScrollbar:m.bool}),m.shape({virtual:m.bool,expandIconColumn:m.string}),m.shape({defaultExpandAllRows:m.bool,defaultExpandedRowKeys:m.array,expandedRowKeys:m.array,hideExpandAll:m.bool,rowExpandable:m.func,expandedRowClassName:m.string,expandedRowRender:m.func,onExpand:m.func,onChange:m.func}),m.shape({cellMerge:m.bool,onCellMerge:m.func,onSelectChange:m.func}),m.shape({groupItems:m.arrayOf(m.shape({dataIndex:m.string.isRequired,titleIndex:m.string,color:m.string,backgroundColor:m.string})),fetch:m.shape({api:m.func.isRequired,params:m.object,dataKey:m.string}),onChange:m.func}),m.func,m.bool,m.bool,m.bool,m.bool,m.shape({current:m.number,pageSize:m.number,pageSizeOptions:m.array,showSizeChanger:m.bool,showQuickJumper:m.bool}),m.shape({fileName:m.string,fetch:m.shape({api:m.func.isRequired,params:m.object}),beforeExport:m.func,cellStyle:m.bool,hideIcon:m.bool}),m.shape({showLogo:m.bool}),m.shape({fetch:m.shape({api:m.func.isRequired,params:m.object,dataKey:m.string}),fieldList:m.arrayOf(m.object)}),m.shape({position:m.oneOf(["top","bottom"]),hideAlert:m.bool,hideClearButton:m.bool}),m.oneOf(["left","right"]),m.func,m.func,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.bool,m.func,m.func,m.func,m.func,m.func,m.func,m.func,m.func,m.func;const Sd={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},wd=10,Cd="1",Nd="0",Td="YYYY-MM-DD",Id="YYYY-MM-DD HH:mm:ss",Rd="YYYYMMDDHHmmss",Od={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 kd;!function(e){e.left="flex-start",e.right="flex-end"}(kd||(kd={}));const Ld=Object.assign({},e).useId;let Ad=0;var Pd=Ld?function(e){const t=Ld();return e||t}:function(t){const[n]=e.useState(`qm_unique_${Ad}`);return e.useEffect((()=>{Ad+=1}),[]),t||n};let _d=[];const Hd={_getInstance:function(e){var t;return null!==(t=_d.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=_d[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==_d.findIndex((e=>e===t))&&(this.deregister(e),_d=[t,..._d])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),_d=[{id:e,vm:t},..._d])},deregister:function(e){e&&(_d=_d.filter((t=>t.id!==e)))}};class Fd{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 Dd={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 $d(e){return void 0!==e}function Md(t,n){const{defaultValue:r,value:i,onChange:a,postState:l}=n||{},[o,s]=e.useState((()=>$d(i)?i:$d(r)?"function"==typeof r?r():r:"function"==typeof t?t():t)),c=$d(i)?i:o,d=l?l(c):c,u=Nn(a),[p,h]=e.useState([c]);Bi((()=>{const e=p[0];o!==e&&u(o,e)}),[p]),Bi((()=>{$d(i)||s(i)}),[i]);return[d,Nn((e=>{s(e),h([c])}))]}let qd;const jd=()=>{var e;if(In)return 0;if(void 0!==qd)return qd;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),qd=n-i,qd},Vd=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=Vd(t.children)),t})),Kd=(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:N,selectionKeys:T,sorter:I,filters:R,superFilters:O,pagination:k,mergedTdCells:L}=n,{selectionRows:A,summaries:P}=S.current,{expandIconColumn:_=""}=p||{},{t:H}=Cn(),F=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]})(Vd(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Dd.selectionColumn,title:"radio"===t?H("qm.table.config.selectionText"):"",width:Dd.selectionColumnWidth,fixed:"left",type:t}})(c),r=(null==(i=u)?void 0:i.expandedRowRender)?{dataIndex:Dd.expandableColumn,title:"",width:Dd.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return n&&t.unshift(n),r&&t.unshift(r),ka(t)},D=t.useMemo((()=>!!(null==r?void 0:r.api)),[null==r?void 0:r.api]),$=t.useMemo((()=>!D&&!!h),[D,h]),M=t.useMemo((()=>D&&!!m),[D,m]),q=t.useMemo((()=>(D||$)&&!M),[D,$,M]),j=t.useMemo((()=>!!(a||l||o)),[a,l,o]),V=t.useMemo((()=>F(i)),[i]),K=t.useMemo((()=>Oa(V)),[V]),z=t.useMemo((()=>K.filter((e=>"function"==typeof e.editRender))),[K]),W=t.useMemo((()=>K.filter((e=>!!e.summation))),[K]),B=t.useMemo((()=>K.filter((e=>"left"===e.fixed))),[K]),U=t.useMemo((()=>K.filter((e=>"right"===e.fixed))),[K]),G=t.useMemo((()=>(e=>{const t=[];return e.forEach((e=>{const n=C.find((t=>w(t,t.index)===e.rowKey)),r=K.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,K,C]),Y=t.useMemo((()=>{var e,t;const n=K.filter((e=>![Dd.expandableColumn,Dd.selectionColumn,Dd.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:""}),[K,_]),X=t.useMemo((()=>W.length>0),[W]),Q=t.useMemo((()=>!!E||X),[E,X]),Z=t.useMemo((()=>Ma(V).length>1),[V]),J=t.useMemo((()=>s||Z),[s,Z]),ee=t.useMemo((()=>K.some((e=>e.sorter))),[K]),te=t.useMemo((()=>K.some((e=>e.filter))),[K]),ne=t.useMemo((()=>W.some((e=>!!e.summation.dataKey))),[W]),re=t.useMemo((()=>!D&&!!y),[D,y]),ie=t.useMemo((()=>!!b&&z.length>0),[b,z]),ae=t.useMemo((()=>!!x&&"checkbox"===(null==c?void 0:c.type)),[x,c]),le=t.useMemo((()=>!!f&&te),[f,te]),oe=t.useMemo((()=>!D&&!!g&&te),[D,g,te]),se=t.useMemo((()=>!!v&&K.some((e=>!!e.groupSummary))),[K]),ce=t.useMemo((()=>{var e;return!!(null===(e=null==d?void 0:d.groupItems)||void 0===e?void 0:e.length)}),[d]),de=t.useMemo((()=>C.some((e=>Array.isArray(e.children)))),[C]),ue=t.useMemo((()=>!N.length),[N]),pe=t.useMemo((()=>(()=>{const e={};return W.forEach((t=>{const{dataIndex:n,precision:r,displayPrecision:i,summation:a}=t,{sumBySelection:l,displayWhenNotSelect:o,unit:s}=a,c=ce?el(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[Dd.summaryIgnore])return e;const r=Ka(t,n);return Ba(r)?e.plus(r):e}),new Ht(0));!Object.keys(P).includes(n)||l&&!d||(u=new Ht(Ka(P,n))),za(e,n,u.toNumber());let p=r>=0?u.toFixed(r):u.toString();i>=0&&""!==p&&(p=Ga(p,i)),p=Ua(p),za(e,`${n}_text`,s?`${p} ${s}`:p)})),[e]})()),[N,T,P]),he=t.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(W)),[W]),me=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?{[Dd.sorterFieldName]:t}:null,a=n.length?{[Dd.filterFieldName]:n}:null,l=he?{[Dd.groupSummary.summaryFieldName]:he,usedJH:1}:null,o=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:null,s={[Dd.currentPageName]:k.current,[Dd.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,he]);return{isFetch:D,isWebPagination:$,isScrollPagination:M,showPagination:q,shouldUpdateHeight:j,tableColumns:V,flattenColumns:K,editableColumns:z,summationColumns:W,leftFixedColumns:B,rightFixedColumns:U,derivedMergeCells:G,treeExpandIndex:Y,showSummary:X,showFooter:Q,isHeadGroup:Z,bordered:J,isHeadSorter:ee,isHeadFilter:te,isServiceSummation:ne,isSelectCollection:ae,isTableImport:re,isTableClipboard:ie,isSuperSearch:le,isFastSearch:oe,isGroupSummary:se,isGroupSubtotal:ce,isTreeTable:de,isTableEmpty:ue,summationRows:pe,fetchParams:me}},zd=(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:N,$size:T,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:Q,setTableOriginData:Z,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:he,setScrollXStore:me,setScrollYStore:fe,computeVirtualX:ge,computeVirtualY:ve,setFieldAuth:ye,setResizeState:be,setSummaries:xe,setPermission:Se,setRecordsMap:we,resetTableScroll:Ce,clearElementStore:Ne,clearRecordsMap:Te}=n,{t:Ie}=Cn(),{store:Re,scrollBarRef:Oe}=w.current,ke=Number.parseInt(t.version)>=18?Ft.flushSync:null,Le=t.useRef(Object.assign({},F)),Ae=t.useRef(new Map),Pe=t.useRef(!1),_e=zi(C);Bi((()=>{qe(),w.current.scrollXLoad?Ve(Oe.current.scrollLeft):Ke(),G()}),[I]),Bi((()=>{He()}),[_e,T,i,A.tableAutoHeight]),xi((()=>{It(),Rt(),Ot(),V||(z&&gt(),dt(a)),s&&ie(s),c&&ae(c)}),[a,null==o?void 0:o.params]),xi((()=>{const e=at(F,Le.current);e||V&&(null==d?void 0:d.clearableAfterFetched)&&kt(),!e&&F[Dd.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?gt():V&&st(),Le.current=F}),[F]),xi((()=>{z&&wt(),W||Ce(),nt()}),[L.current,L.pageSize]),xi((()=>{w.current.scrollYLoad&&Be(Oe.current.scrollTop),V||De(k.length),G()}),[k]),xi((()=>{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&&N.current.setClickedValues([M,""]),"radio"===(null==d?void 0:d.type)&&D.length&&N.current.setClickedValues([D[0],""])},De=e=>{e!==L.total&&ne((t=>Object.assign({},t,{total:e})))},$e=e=>{Pe.current=e},Me=Ui((e=>{ht(),null==x||x(e)})),qe=()=>{ue(R.length>Dd.virtualScrollX)},je=(e=[])=>{let t=e.length>Dd.virtualScrollY;(null==p?void 0:p.virtual)&&(t=!0),(null==h?void 0:h.virtual)&&(t=!0),he(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||(me(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 nl(e,[i.dataIndex]).map((e=>{const n={children:Xe(e,t+1),_group:i.dataIndex};return"function"!=typeof r&&za(n,r.toString(),Qa()),i.titleIndex&&za(n,i.titleIndex,Ka(e[0],i.titleIndex)),za(n,i.dataIndex,Ka(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[Dd.summaryIgnore])return e;const n=Number(Ka(t,r));return Number.isNaN(n)?e:e+n}),0);za(n,r,i)})),n}))},Qe=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))},Ze=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=Da(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=il(i,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Da(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&&Jt("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];M&&e.unshift(M);let o=[];return e.forEach((e=>{const t=il(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=Ui((()=>{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(Va(e,t));return 1===n.length&&(n.includes(Dd.currentPageName)||n.includes(Dd.pageSizeName))},lt=()=>wn(void 0,void 0,void 0,(function*(){var t;if(!m)return;let n=Fn(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?pe(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;Se((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!r})))}if(Array.isArray(n.fieldList)){const{originColumns:t}=w.current,r=Aa(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=Pa(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=()=>wn(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:r=(e=>e),beforeFetch:i=Ln,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:Dd.dataKey;let l=null!==(n=pe(e.data,r))&&void 0!==n?n:[];l="function"==typeof a?yield a(l):l;const c=pe(e.data,r.replace(/[^.]+$/,Dd.totalKey))||l.length||0,d=Math.max(Math.ceil(c/L.pageSize),1);if(F[Dd.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=Ui(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),Nt(t),Qe(Ze()),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:Dd.summationKey,a=null!==(r=i?pe(e,i):e)&&void 0!==r?r:{},o={};q.filter((e=>!!e.summation.dataKey)).forEach((e=>{za(o,e.dataIndex,Number(Ka(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);Qe([t])}else Qe([])}},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=>{Q(e),ee(e),te(e),Tt(),vt(),wt()},Nt=e=>{Z(e)},Tt=()=>{Te(),w.current.allTableData.forEach((e=>we(S(e,e.index),e)))},It=()=>{ie({})},Rt=()=>{ae({})},Ot=()=>{le([])},kt=()=>{Qe([])};return{initialTable:()=>{lt(),Fe(),qe(),je(),V?ot():dt(a)},checkDataIndex:()=>{const e=R.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&Jt("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:Ct,getTableData:ot,handleTableData:Et,createWebPageData:bt,createTableData:dt,createGroupData:Ge,createSelectionKeys:Ze,createRowExpandedKeys:Je,setSelectionKeysEffect:Qe,findParentRowKeys:tt,getAllChildRowKeys:et,doFieldValidate:(e,t,n,r)=>{if(!Array.isArray(e))return Jt("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Re.removeFromRequired({x:n,y:r}),Re.removeFromValidate({x:n,y:r}),e.forEach((e=>{var i;e.required&&Hn(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=Ee(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=>![...Ee(r,n),...Ee(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;Ne(),Re.destroy(),e.deregister(t)}}},Wd=(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:N,setScrollY:T,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:`${ja(i)}px`}),a&&Object.assign(n,{maxHeight:`${ja(a)}px`}),w?Object.assign(Object.assign({},n),{maxHeight:"",minHeight:"",height:`${e}px`}):r?Object.assign(Object.assign({},n),{height:"auto"!==r?`${ja(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+wd:0,r=e.$pager?e.$pager.offsetHeight+wd:0;u=n.winHeight-t-r-20}(t||l!==y.viewportHeight)&&F(l),L.current=c,T(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]):oe(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=_a(Pa(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=Ha(Pa(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?ao["small"!==h?"middle":h]+wd:0)-wd;C((e=>Object.assign({},e,{tableAutoHeight:n})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&$("",0),k(!0)},computeVirtualX:H,computeVirtualY:D,doLayout:()=>{l?P():Pn((()=>P())),(()=>{const{elementStore:e,scrollXLoad:t}=d.current,n=e.$table.clientWidth,r=L.current?y.gutterWidth:0,{defaultColumnWidth:i}=Dd,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){N(!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 N(!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),N(l>n),C((e=>Object.assign(Object.assign({},e),{tableBodyWidth:l})));C((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&_(n)})()}}};function Bd({handler:t,delay:n=0}){const r=ia(t,n),i=Nn(n>0?r:t);e.useEffect((()=>(window.addEventListener("resize",i),()=>window.removeEventListener("resize",i))),[i])}const Ud=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(xd),{infoBarConfig:h,rowSelection:m,rowHighlight:f}=r.current.props,{allTableData:g,invalidRowKeys:v}=r.current,{hideAlert:y,hideClearButton:b}=h||{},{t:x}=Cn(),E=t.useMemo((()=>!y),[y]),S=t.useMemo((()=>!b&&!!(a||l||m||f)),[b,a,l,m,f]),w={[`${Vn("table")}__alert`]:!0};return E?t.createElement("div",{className:He(w)},t.createElement("i",{className:"svgicon icon"},t.createElement(it,null)),t.createElement("span",null,x("qm.table.alert.total",{total:o?g.length:n}),m?`,${x("qm.table.alert.selected",{total:Math.max(i.length-v.length,0)})}`:""),S&&t.createElement("em",{onClick:()=>{c(),d(),u(),p(),Pn((()=>s()))}},x("qm.table.alert.clear"))):null},Gd=t.forwardRef(((e,n)=>{const{isFullScreen:r,open:i=!0}=e,{setFullScreen:a}=t.useContext(xd),{t:l}=Cn(),o=()=>{a(!r)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=Vn("table");return i?t.createElement("span",{className:`${s}-full-screen`,title:l(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},r?t.createElement(We,null):t.createElement(Be,null))):null}));Gd.displayName="FullScreen";const Yd=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{getTableData:i}=t.useContext(xd),{t:a}=Cn(),l=()=>{i()};t.useImperativeHandle(n,(()=>({clickHandle:l})));const o=Vn("table");return r?t.createElement("span",{className:`${o}-reload`,title:a("qm.table.refresh.text"),onClick:()=>l()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ze,null))):null}));Yd.displayName="Reload";const Xd=()=>{const e={dateFormat:e=>{const t=e?f(e).format(Td):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?f(e).format(Id):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?f(e).format(Id.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Ba(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>Ua(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=Ba(m)?new Ht(m).toFixed(c):m),d>=0&&""!==m&&(m=Ga(m,d)),u){const t=e[`${_n(u)}Format`];t?m=t(m):Jt("Table","字段的格式化类型 `formatType` 配置不正确")}return m},n=e=>Rn(e)?Za(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,r,i,a)=>{const l=Ka(e,r.dataIndex),o=r.render?r.render(l,e,r,i,a):t(l,r,e);return n(o)}}},Qd=t.forwardRef(((e,n)=>{var r,i,a,l;const{tableColumns:o,open:s=!0}=e,{global:c}=t.useContext(Wt),{tableRef:d,flattenColumns:u,summationRows:p,showSummary:h,getSpan:m}=t.useContext(xd),{tablePrint:f,showHeader:g}=d.current.props,{t:v}=Cn(),{getTitleFromCellValue:y}=Xd(),b=null!==(i=null===(r=null==c?void 0:c.print)||void 0===r?void 0:r.leftLogo)&&void 0!==i?i:"",x=null!==(l=null===(a=null==c?void 0:c.print)||void 0===a?void 0:a.rightLogo)&&void 0!==l?l:"",E=!(!b&&!x),S=t.useMemo((()=>Dn(Fa(o,[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn]))),[o]),w=t.useMemo((()=>Dn(Fa(u,[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn]))),[u]),C=t.useMemo((()=>Dn(o.filter((e=>e.printFixed)))),[o]),N=e=>{const t=Object.assign({},rl(S,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?N(t):t},T=(e,t)=>Se(we(Ce(e),t),Ne(((...e)=>Te(...e,((e,n)=>{if(Array.isArray(e))return T(e.concat(n),t)}))))),I=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(N(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(Ma(n))})),t},R=()=>{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||Dd.defaultColumnWidth,r<=Dd.printWidth?(n.push(a),i===e.length-1&&t.push(n),i++):i>0?(e.splice(0,i),C.length&&e.unshift(...C),t.push(n),n=[],r=0,i=0):(a.width=Dd.printWidth,n.push(a),t.push(n),i++)}return t})([...w]),n=I(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+=O(n[i],t[i],e),r+='<div class="page-break"></div>';return r+"</body></html>"},O=(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||Dd.defaultColumnWidth}px">`)).join("")}</colgroup>`,g&&(i+=["<thead>",r&&E?`<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">',b?`<img src="${b}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',x?`<img src="${x}" 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}">${Ja(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(i+=`<tbody>${$a(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*Dd.treeTable.textIndent}px"></span>`:""}${y(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):Ka(e,`${i}_text`);return`<td>${0===r&&""===l?v("qm.table.config.summaryText"):Rn(l)?Za(l).join(""):l}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},k=()=>{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});Ji(e,a)}})({filename:"print",type:"html",isDownload:!1},R()))||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:k})));const L=Vn("table");return s?t.createElement("span",{className:`${L}-print`,title:v("qm.table.print.text"),onClick:()=>k()},t.createElement("i",{className:"svgicon icon"},t.createElement(at,null))):null}));Qd.displayName="TablePrint";const Zd="606060",Jd="thin",eu="d4d4d4",tu=(e,t)=>{t&&(e.height=Math.floor(.75*t))},nu=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},ru=()=>({top:{style:Jd,color:{argb:eu}},left:{style:Jd,color:{argb:eu}},bottom:{style:Jd,color:{argb:eu}},right:{style:Jd,color:{argb:eu}}}),iu=e=>{const{children:t}=e;return t&&t.length?iu(t[0]):e},au=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(xd),{spanMethod:a,showHeader:l}=e.current.props,{t:o}=Cn(),s=(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,s,c,d)=>wn(void 0,void 0,void 0,(function*(){const{columns:u,footSummation:p}=t,{scrollYStore:{rowHeight:h}}=e.current,m=Oa(u),f=Ma(u),g=[],v=[],y=[],b=[];let x=0;const E={};m.forEach((e=>{const{dataIndex:t,width:n,minWidth:r,renderWidth:i}=e;E[t]=Ja(e.title),y.push({key:t,width:(n||i||r||Dd.defaultColumnWidth)/8})})),l&&(i?f.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:r,rowSpan:i}=e,a=iu(e),l=m.findIndex((({dataIndex:e})=>e===a.dataIndex));n[a.dataIndex]=Ja(e.title),0!==r&&(r>1||i>1)&&b.push({s:{r:t,c:l},e:{r:t+i-1,c:l+r-1}})})),g.push(n)})):(m.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;(n>1||r>1)&&b.push({s:{r:x,c:t},e:{r:x+r-1,c:t+n-1}})})),g.push(E)),x+=g.length);const S=$a(s).map(((e,t)=>{const r={};return m.forEach(((i,l)=>{if("function"==typeof a){const{rowSpan:r,colSpan:a}=n(e,i,t,l,s);(a>1||r>1)&&b.push({s:{r:t+x,c:l},e:{r:t+x+r-1,c:l+a-1}})}const o=["percent","finance"].includes(i.formatType);r[i.dataIndex]=o?Ka(e,i.dataIndex):d(e,t,i,l)})),r._level=e._level,r}));x+=S.length,r&&p&&c(m,s).forEach(((e,t)=>{const n={};m.forEach(((t,r)=>{const{dataIndex:i,summation:a}=t,l=(null==a?void 0:a.render)?a.render(s):Ka(e,i);n[i]=0===r&&""===l?o("qm.table.config.summaryText"):Rn(l)?Za(l).join(""):l})),v.push(n)}));const{sheetName:w,useStyle:C}=t,N=new Kt.Workbook,T=N.addWorksheet(w);T.columns=y,l&&T.addRows(g).forEach((e=>{C&&tu(e,h),e.eachCell((e=>{const t=T.getColumn(e.col),n=Pa(u,t.key),{align:r,theadAlign:i}=n;nu(e,i||r),C&&Object.assign(e,{font:{bold:!0,color:{argb:Zd}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:ru()})}))})),T.addRows(S).forEach(((e,t)=>{const{_level:n}=S[t];C&&tu(e,h),e.eachCell((e=>{const t=T.getColumn(e.col),r=Pa(u,t.key),{align:i}=r;nu(e,i),Object.assign(e,au(r)),C&&Object.assign(e,{font:{color:{argb:Zd}},border:ru()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),r&&p&&T.addRows(v).forEach((e=>{C&&tu(e,h),e.eachCell((e=>{const t=T.getColumn(e.col),n=Pa(u,t.key),{align:r}=n;nu(e,r),Object.assign(e,au(n)),C&&Object.assign(e,{font:{color:{argb:Zd}},border:ru()})}))})),b.forEach((({s:e,e:t})=>{T.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const I=yield N.xlsx.writeBuffer();return new Blob([I],{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=Oa(n),a=new FileReader;a.onerror=()=>{k.error(o("qm.table.import.error"))},a.onload=e=>{const n=i.map((e=>Ja(e.title))),r=new Kt.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],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,l);if(c){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("")),oe(i)&&"text"in i&&(i=i.text),Ie(i)&&(i=Xa(i,Id)),(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:o}=i[n];Array.isArray(o)&&((null===(a=t[e])||void 0===a?void 0:a.toString().includes(","))?t[e]=t[e].split(",").map((e=>s(o,e))).filter((e=>""!==e)):t[e]=s(o,t[e])),za(r,l,t[e])})),r}));null==t||t(r)}else k.error(o("qm.table.import.error"))}else k.error(o("qm.table.import.error"))})):k.error(o("qm.table.import.error"))},a.readAsArrayBuffer(r)}}},ou=e=>{const{fileType:n,onChange:r}=e,{t:i}=Cn();let a,l;const o=Vn("table"),s=e=>{const t=e.name,n=t.lastIndexOf("."),r=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:r}},c=()=>wn(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return a||(a=document.createElement("form"),l=document.createElement("input"),a.className=`${o}--file-form`,l.name="file",l.type="file",a.appendChild(l),document.body.appendChild(a)),new Promise(((e,n)=>{const r=!t.type;l.multiple=!!t.multiple,l.accept=r?"":`.${t.type}`,l.onchange=o=>{const{files:c}=o.target,d=c[0];let u="";if(!r)for(let e=0;e<c.length;e++){const{type:n}=s(c[e]);if(t.type!==n){u=n;break}}u?(k.warning(i("qm.upload.notType",{type:u})),n()):e(d),document.body.removeChild(a),a=null,l=null},a.reset(),l.click()}))})({type:n});null==r||r(e.name,e)}catch(e){}}));return t.createElement(Mn,{onClick:()=>c()},i("qm.upload.text"))},su=e=>{const{columns:n,onClose:r}=e,{tableRef:i,createTableData:a,dataChange:l}=t.useContext(xd),{beforeTableImport:o}=i.current.props,{t:s}=Cn(),{importXLSX:c}=lu(),d=t.useRef(null),[u,p]=t.useState(!1),[h,m]=t.useState(!0),f=e=>e.filter((e=>![Dd.expandableColumn,Dd.selectionColumn,"index","pageIndex",Dd.operationColumn].includes(e.dataIndex))),g={posIndex:"条"},[v,y]=t.useState([{type:"INPUT",label:s("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(ou,{fileType:n.state.formData.fileType,onChange:(e,t)=>{n.SET_FIELDS_VALUE({fileName:e,file:t}),t&&m(!1)}}))}},{type:"SELECT",label:s("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:s("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:s("qm.table.import.fillText"),value:"fill"},{text:s("qm.table.import.addText"),value:"add"},{text:s("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{v.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&d.current.SET_FIELDS_EXTRA(g),y([...v])}},{type:"INPUT_NUMBER",label:s("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}}]),b=Vn("table");return t.createElement("div",{className:`${b}-import__setting`},t.createElement(zc,{ref:d,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:g,items:v,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(Mn,{onClick:()=>r(),style:{marginRight:8}},s("qm.table.export.closeButton")),t.createElement(Mn,{type:"primary",loading:u,disabled:h,onClick:()=>wn(void 0,void 0,void 0,(function*(){const[e,t]=yield d.current.GET_FORM_DATA();e||(p(!0),c({columns:f(n),file:t.file},(e=>wn(void 0,void 0,void 0,(function*(){const{tableFullData:n,store:c}=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=>{c.addToInserted(e)})),l(),k.success(s("qm.table.import.success",{total:e.length})),p(!1),r()})))))}))},s("qm.table.import.text"))))},cu=t.forwardRef(((e,n)=>{const{tableColumns:r,open:i=!0}=e,{t:a}=Cn(),[l,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={[`${Vn("table")}-import`]:!0},d={visible:l,title:a("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:He(c),title:a("qm.table.import.textNoSpace"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(lt,null))),t.createElement(ha,d,t.createElement(su,{columns:r,onClose:()=>o(!1)})))}));cu.displayName="TableImport";const du=e=>{const{columns:n,onChange:r}=e,{$size:i}=t.useContext(xd),{t:a}=Cn(),l=t.useRef([]),[o,s]=t.useState(!1),[c,d]=t.useState(n);xi((()=>{p()}),[c]),t.useEffect((()=>{u()}),[n]);const u=()=>{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))})),l.current=e},p=()=>{const e=[];c.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((({dataIndex:e},n)=>{const r=c.find((t=>t.dataIndex===e));return n>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==r||r(e)},h=Vn("table"),m={[`${h}__popper`]:!0,"column-filter__popper":!0,[`${h}--lg`]:"large"===i,[`${h}--sm`]:"small"===i},f=[`${h}-column-filter`,{selected:o}];return t.createElement(Vs,{action:["click"],popupVisible:o,popup:t.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"main"},t.createElement(jt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:c,setList:e=>{const t=e.map((e=>e.dataIndex)),n=c.map((e=>e.dataIndex));me(t,n)||d(ol(e))}},c.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,d([...c])}}),t.createElement("i",{className:He(i),title:a("qm.table.columnFilter.draggable")},t.createElement(Ue,null)),t.createElement("span",{className:"text"},Ja(e.title)))})(e,"main")))))),popupClassName:He(m),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{s(e)},builtinPlacements:Od,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:He(f),title:a("qm.table.columnFilter.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(ot,null)),t.createElement("span",null,a("qm.table.columnFilter.text"))))},uu=e=>{const{defaultValue:n,onClose:r,onOk:i}=e,{tableRef:a,selectionKeys:l,pagination:o,showSummary:s}=t.useContext(xd),{rowSelection:c}=a.current.props,{t:d}=Cn(),u=t.useRef(null),[p,h]=t.useState(!1),m=t.useMemo((()=>Object.assign({},{fileName:`${f().format(Rd)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:l.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},n,{columns:Dn(n.columns||[])})),[]),[g,v]=t.useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:d("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:d("qm.table.export.all"),value:"all"},{text:d("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==c?void 0:c.type)},{text:d("qm.table.export.custom"),value:"custom"}]},onChange:e=>{g.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,v([...g])}},options:{min:1},disabled:!0},{type:"INPUT",label:d("qm.table.columnFilter.text"),fieldName:"columns",render:(e,n)=>t.createElement(du,{columns:n.state.formData.columns,onChange:e=>{n.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:d("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:d("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),y=Vn("table");return t.createElement("div",{className:`${y}-export__setting`},t.createElement(zc,{ref:u,initialValues:m,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(Mn,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t.createElement(Mn,{type:"primary",loading:p,onClick:()=>wn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();if(!e){h(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);i(t),yield An(1e3),h(!1),r()}}))},d("qm.table.export.text"))))},pu=t.forwardRef(((e,n)=>{var r;const{tableColumns:i,open:a=!0}=e,{global:l}=t.useContext(Wt),{tableRef:o,flattenColumns:s,pagination:c,fetchParams:d,isFetch:u,isGroupSubtotal:p,showSummary:h,getSpan:m}=t.useContext(xd),{exportExcel:g,fetch:v,showHeader:y}=o.current.props,{t:b}=Cn(),{getTitleFromCellValue:x}=Xd(),[E,S]=t.useState(!1),[w,C]=t.useState(!1),N=t.useMemo((()=>{var e;return!!(null===(e=null==g?void 0:g.fetch)||void 0===e?void 0:e.api)}),[g]),T=t.useMemo((()=>!c.total||w),[c.total,w]),I=t.useMemo((()=>Fa(i,[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn])),[i]),R=t.useMemo((()=>Fa(s,[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn])),[s]),O=(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=O(e.children,a,n+1)),R.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&za(i,t,Ka(i,t))})),i})),L=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,i=(p?el(t):t).reduce(((e,t)=>{if(null==t?void 0:t[Dd.summaryIgnore])return e;const n=Number(Ka(t,r));return Number.isNaN(n)?e:e+n}),0);za(n,r,i)})),[n]},A=(e,t,n,r)=>{const{precision:i,formatType:a}=n;let l=x(e,n,t,r);return i>=0&&!a&&""!==l&&(l=Number(l)),l},{exportXLSX:P,exportCSV:_}=lu(),H=e=>wn(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:r=(e=>e),afterFetch:i,dataKey:a}=v;let l=[];try{C(!0);const o=yield n(Object.assign(Object.assign({},r(d)),{[Dd.currentPageName]:1,[Dd.pageSizeName]:null!=e?e:c.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=pe(o.data,a))&&void 0!==t?t:[];e="function"==typeof i?yield i(e):e,l=O(e)}}catch(e){}return C(!1),l})),F=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){}},D=(e,t)=>{const{columns:n,footSummation:r}=e,i=Ma(n),a=Oa(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||Dd.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}">${Ja(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(l+=`<tbody>${$a(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}">${A(e,e.index,n,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),h&&r&&(l+=["<tfoot>",L(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):Ka(e,i);return`<td>${0===r&&""===l?b("qm.table.config.summaryText"):Rn(l)?Za(l).join(""):l}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),l+="</table>",l},$=null!==(r=null==g?void 0:g.fileName)&&void 0!==r?r:`${f().format(Rd)}.xlsx`,M=$.slice($.lastIndexOf(".")+1).toLowerCase(),q=()=>{if(T)return k.warning(b("qm.table.export.warnText"));var e;N?(e=$,wn(void 0,void 0,void 0,(function*(){C(!0);try{const{api:t,params:n}=g.fetch,r=yield t(Object.assign(Object.assign(Object.assign({columns:R.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,[Dd.currentPageName]:void 0,[Dd.pageSizeName]:void 0}));r.data&&(Ji(r.data,e),F(e))}catch(e){}C(!1)}))):S(!0)};t.useImperativeHandle(n,(()=>({clickHandle:q})));const j={[`${Vn("table")}-export`]:!0},V={visible:E,title:b("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},K={fileName:$.slice(0,$.lastIndexOf(".")),fileType:M,columns:I,useStyle:(null==g?void 0:g.cellStyle)?1:0};return t.createElement(t.Fragment,null,a&&t.createElement("span",{className:He(j),title:b("qm.table.export.textNoSpace"),onClick:()=>q()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ke,null))),t.createElement(ha,V,t.createElement(uu,{defaultValue:K,onClose:()=>S(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ka(e.columns)}),wn(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 H()),"custom"===r&&(c=yield H(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==g?void 0:g.beforeExport))try{c=null==g?void 0:g.beforeExport(c)}catch(e){}if("xlsx"===n){const n=yield P(t,c,L,A);Ji(n,`${e}.xlsx`),F(`${e}.xlsx`)}if("csv"===n){const n=_(t,D(t,c));Ji(n,`${e}.csv`),F(`${e}.csv`)}}))}})))}));pu.displayName="TableExport";const hu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,tableBodyRef:a,dataChange:l}=t.useContext(xd),{beforeClipboard:o}=i.current.props,{t:s}=Cn(),c=t.useRef(null),[d,u]=t.useState([{type:"INPUT_NUMBER",label:s("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:s("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:n.map(((e,t)=>({value:t,text:Ja(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:s("qm.table.clipboard.content"),fieldName:"content",placeholder:s("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[p,h]=t.useState(!1),m=Vn("table");return t.createElement("div",{className:`${m}-clipboard__setting`},t.createElement("h3",{className:"info"},s("qm.table.clipboard.supportText")),t.createElement(zc,{ref:c,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:d,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(Mn,{onClick:()=>r(),style:{marginRight:8}},s("qm.table.export.closeButton")),t.createElement(Mn,{type:"primary",loading:p,onClick:()=>wn(void 0,void 0,void 0,(function*(){var e;const[t,d]=yield c.current.GET_FORM_DATA();if(t)return;const{tableFullData:u,store:p}=i.current;h(!0);const m=d.content.trim().replace(/(\r|\n)$/,"");let f=m.replace(/"[^"]+"/g,"^");((null===(e=m.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{f=f.replace(/\^/,e)}));let g=f.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{g=yield o(g,g[0].map(((e,t)=>n[d.colIndex+t].dataIndex)))}catch(t){}g.forEach(((e,t)=>{e.forEach(((e,r)=>{var a,l;const o=u[d.rowIndex-1+t],s=n[d.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&&(za(o,s.dataIndex,e),p.addToUpdated(o))}}))})),a.current.forceUpdate(),l(),k.success(s("qm.table.clipboard.success",{total:g.length})),h(!1),r()}))},s("qm.table.clipboard.text"))))},mu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{flattenColumns:i}=t.useContext(xd),{t:a}=Cn(),[l,o]=t.useState(!1),s=t.useMemo((()=>(e=>e.filter((e=>![Dd.expandableColumn,Dd.selectionColumn,"index","pageIndex",Dd.operationColumn].includes(e.dataIndex))))(i)),[i]),c=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:c})));const d={[`${Vn("table")}-clipboard`]:!0},u={visible:l,title:a("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:He(d),title:a("qm.table.clipboard.textNoSpace"),onClick:()=>c()},t.createElement("i",{className:"svgicon icon"},t.createElement(st,null))),t.createElement(ha,u,t.createElement(hu,{columns:s,onClose:()=>o(!1)})))}));mu.displayName="TableClipboard";const fu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,$size:a,selectionKeys:l,setSelectionKeysEffect:o}=t.useContext(xd),{rowKey:s,rowSelection:c}=i.current.props,{t:d}=Cn(),u=t.useRef(null),p=zi(u),h=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=h(e.children)),n})),[m,f]=t.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...h(n.filter((e=>![Dd.expandableColumn,Dd.selectionColumn,"index","pageIndex",Dd.operationColumn].includes(e.dataIndex))))]),[g]=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})()),[v,y]=t.useState(300),b=Ui((()=>{const e=u.current;y(e.offsetHeight-2*ao[a]-30)}),5);return Bi((()=>{b()}),[p.width]),t.createElement("div",{ref:u,style:{height:"100%"}},t.createElement(ip,{size:a,columns:m,dataSource:g,rowKey:s,height:v,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=>f(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(Mn,{onClick:()=>r()},d("qm.table.selectCollection.closeButton"))))},gu=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(xd),{rowSelection:p}=a.current.props,{t:h}=Cn(),[m,f]=t.useState(!1),g=t.useRef(!1);xi((()=>{!g.current&&v()}),[c]);const v=()=>wn(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=pe(r.data,t.dataKey))&&void 0!==e?e:[];i=i.filter((e=>!n(e))),d(i.map(((e,t)=>l(e,t)))),u(i),g.current=!0}}catch(e){}})),y=()=>{f(!0)};t.useImperativeHandle(n,(()=>({clickHandle:y})));const b=Vn("table"),x={visible:m,title:h("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>f(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:`${b}-select-collection`,title:h("qm.table.selectCollection.text"),onClick:()=>y()},t.createElement("i",{className:"svgicon icon"},t.createElement(ct,null))),t.createElement(ha,x,t.createElement(fu,{columns:r,onClose:()=>f(!1)})))}));gu.displayName="SelectCollection";const vu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Wt),{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(xd),{uniqueKey:g}=i.current.props,{t:v}=Cn(),y=t.useRef(null),b=t.useRef(null),x=t.useRef([]),E=t.useRef(""),S=t.useRef(-1),w=t.useRef("stop");xi((()=>{const e=$a(c()).findIndex((e=>a(e,e.index)===E.current));u("",e)}),[s.current]);const C=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},N=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>{var t;return{type:C(e.filter.type),fieldName:e.dataIndex,label:Ja(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:null!==(t=e.dictItems)&&void 0!==t?t:[]},onChange:()=>wn(void 0,void 0,void 0,(function*(){const[e,t]=yield y.current.GET_FORM_DATA(),[n,r]=yield b.current.GET_FORM_DATA(),i=Re(Object.assign({},t,r),Hn);O(i)}))}})),T={case:0,fullchar:0},I=t.useMemo((()=>o.filter((e=>![Dd.expandableColumn,Dd.selectionColumn,"index","pageIndex",Dd.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[o]),[R,O]=t.useState({}),[k,A]=t.useState(T),[P]=t.useState(N([I[0]])),[H]=t.useState(N(I.slice(1))),[F,D]=t.useState(0),$=t.useMemo((()=>!Object.keys(R).length),[R]);xi((()=>{w.current="ready"}),[R,k]);const q=e=>{A(Object.assign({},k,e))},j=(e,t,n)=>new Promise(((r,i)=>{_.confirm({title:v("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{n(),r()}})})),V=e=>wn(void 0,void 0,void 0,(function*(){if(!Object.keys(R).length)return _.warning({title:v("qm.button.confirmPrompt"),content:v("qm.table.fastSearch.queryCondition")});if("ready"===w.current&&(w.current="stop",x.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}=I.find((e=>e.dataIndex===t)).filter;let i=Ka(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})(R),D(x.current.length)),!x.current.length)return p(""),_.warning({title:v("qm.button.confirmPrompt"),content:v("qm.table.fastSearch.notMatch")});"next"===e&&(S.current=S.current<0?0:S.current+1,S.current>x.current.length-1&&(yield j(v("qm.table.fastSearch.toTheEnd"),(()=>S.current=0),(()=>S.current=x.current.length-1)))),"prev"===e&&(S.current=S.current<0?x.current.length-1:S.current-1,S.current<0&&(yield j(v("qm.table.fastSearch.toStart"),(()=>S.current=x.current.length-1),(()=>S.current=0))));const t=x.current[S.current],n=a(t,t.index);let r=t.index;if(m&&f){const e=il(i.current.deriveRowKeys,n)[0];r=i.current.tableFullData.findIndex((t=>a(t,t.index)===e))}((e,t)=>{if(E.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)})),K=()=>{y.current.RESET_FORM(),b.current.RESET_FORM()},z=t.useMemo((()=>g?`fastSearch_${g}`:""),[g]),[W,B]=t.useState([]),[U,G]=t.useState(""),[Y,X]=t.useState("");xi((()=>{if(Y){const{filters:e,config:t}=W.find((e=>e.value===Y)).list;y.current.SET_FIELDS_VALUE(Fn(e,H.map((e=>e.fieldName)))),b.current.SET_FIELDS_VALUE(Fn(e,P.map((e=>e.fieldName)))),O(e),A(t)}else K(),O({}),A(T)}),[Y]),t.useEffect((()=>{Q()}),[]);const Q=()=>wn(void 0,void 0,void 0,(function*(){if(!z)return;let e=yield Vt.getItem(z);e||(e=yield Z(z),Array.isArray(e)&&(yield Vt.setItem(z,e))),Array.isArray(e)&&e.length&&(B(e),X(e[0].value))})),Z=e=>wn(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){}})),J=(e,t)=>wn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),ee=Vn("table");return t.createElement("div",{className:`${ee}-fast-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"top"},t.createElement("div",{className:"container"},t.createElement(ca,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t.createElement("span",null,v("qm.table.alert.total",{total:F}))},t.createElement(ca.TabPane,{tab:v("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t.createElement(zc,{ref:y,items:P,cols:1,labelWidth:110})),t.createElement(ca.TabPane,{tab:v("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t.createElement(zc,{ref:b,items:H,cols:1,labelWidth:110})))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(L,{size:l,value:U,placeholder:v("qm.table.highSearch.configText"),disabled:$,onChange:e=>{const{value:t}=e.target;G(t)}}),t.createElement(Mn,{type:"primary",disabled:!U||$,style:{marginLeft:"10px"},onClick:()=>wn(void 0,void 0,void 0,(function*(){if(!z)return Jt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Qa(),t=[...W,{text:U,value:e,list:{filters:R,config:k}}];B(t),X(e),G(""),yield Vt.setItem(z,t),yield J(z,t)}))},v("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Dd.rowHeightMaps[l]}px`}},t.createElement("span",null,v("qm.table.fastSearch.savedSetting"))),t.createElement("ul",null,W.map((e=>t.createElement("li",{key:e.value,className:He({selected:e.value===Y}),title:e.text,onClick:()=>{return t=e.value,void X(t!==Y?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:v("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,wn(void 0,void 0,void 0,(function*(){if(!n)return;const e=W.filter((e=>e.value!==n));B(e),n===Y&&X(""),yield Vt.setItem(z,e),yield J(z,e)}))}},t.createElement(dt,null))))),!W.length&&t.createElement("div",{style:{padding:wd}},t.createElement(Di,null)))))),t.createElement("div",{className:"bottom"},t.createElement("div",null,t.createElement(M,{checked:!!k.case,onChange:e=>q({case:e.target.checked})},v("qm.table.fastSearch.matchCase")),t.createElement(M,{checked:!!k.fullchar,onChange:e=>q({fullchar:e.target.checked})},v("qm.table.fastSearch.matchFullchar"))),t.createElement("div",null,t.createElement(Mn,{onClick:()=>K()},v("qm.table.fastSearch.clear"))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${ao[l]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(Mn,{onClick:()=>n(),style:{marginRight:8}},v("qm.table.fastSearch.closeButton")),t.createElement(Mn,{type:"primary",style:{marginRight:8},onClick:()=>V("prev")},v("qm.table.fastSearch.queryPrev")),t.createElement(Mn,{type:"primary",onClick:()=>V("next")},v("qm.table.fastSearch.queryNext"))))},yu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{$size:i}=t.useContext(xd),{t:a}=Cn(),[l,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c=Vn("table"),d={visible:l,title:a("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${ao[i]+20}px`},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${c}-super-search`,title:a("qm.table.fastSearch.text"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(ut,null))),t.createElement(ha,d,t.createElement(vu,{onClose:()=>o(!1)})))}));yu.displayName="FastSearch";const bu=e=>{const{columns:n,group:r,summary:i}=e,{tableRef:a,$size:l,pagination:o,fetchParams:s,isFetch:c}=t.useContext(xd),{fetch:d}=a.current.props,{t:u}=Cn(),p=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:[]}},h=r.map((e=>Object.assign({dataIndex:e.group},p(e.group)))),m=i.map((e=>e.summary===Dd.groupSummary.total.value?{dataIndex:e.summary,title:Dd.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},p(e.summary)),{formula:e.formula}))),g=t.useMemo((()=>Object.assign({},s,{[Dd.sorterFieldName]:void 0,[Dd.groupSummary.summaryFieldName]:i.map((e=>`${e.formula}|${e.summary}`)).join(","),[Dd.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[Dd.currentPageName]:1})),[s,r,i]),[v,y]=t.useState(((e,t)=>[{title:u("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===Dd.groupSummary.total.value&&(i={dataIndex:Dd.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?i:null)}))])(h,m)),[b]=t.useState(c?[]:(e=>{const t=nl(e,r.map((e=>e.group))),n=[];return t.forEach((e=>{const t={};v.forEach((n=>{const{dataIndex:r}=n;"index"!==r&&za(t,r,Ka(e[0],r))})),i.forEach((n=>{const r=n.summary!==Dd.groupSummary.total.value?n.summary:Dd.groupSummary.recordTotalIndex,i=n.formula;"count"===i&&za(t,r,e.length),"sum"===i&&za(t,r,Oe(e,r)),"max"===i&&za(t,r,ke(e,r)[r]),"min"===i&&za(t,r,Le(e,r)[r]),"avg"===i&&za(t,r,(Oe(e,r)/e.length).toFixed(2))})),n.push(t)})),n})(a.current.tableFullData)),x=Object.assign(Object.assign({size:l,height:400},c?{fetch:{api:d.api,params:g,dataKey:null==d?void 0:d.dataKey}}:{dataSource:b}),{columns:v,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${f().format(Rd)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>y(e)});return t.createElement(ip,x)},xu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Wt),{tableRef:i,$size:a,flattenColumns:l}=t.useContext(xd),{uniqueKey:o}=i.current.props,{t:s}=Cn(),c=t.useRef(null),d=t.useRef(null),[u,p]=t.useState(!1),[h,m]=t.useState([]),[f,g]=t.useState(""),[v,y]=t.useState("");xi((()=>{if(v){const{group:e,summary:t}=h.find((e=>e.value===v)).list;N(e),O(t)}else{const e=H();N((null==e?void 0:e.group)||[]),O((null==e?void 0:e.summary)||[])}}),[v]),t.useEffect((()=>{F()}),[]);const b=t.useMemo((()=>o?`summary_${o}`:""),[o]),x=t.useMemo((()=>l.filter((e=>![Dd.expandableColumn,Dd.selectionColumn,"index","pageIndex",Dd.operationColumn].includes(e.dataIndex)))),[l]),E=x.filter((e=>!e.groupSummary)).map((e=>({text:Ja(e.title),value:e.dataIndex}))),S=[Dd.groupSummary.total,...x.filter((e=>!!e.groupSummary)).map((e=>({text:Ja(e.title),value:e.dataIndex})))],w=[{text:s("qm.table.groupSummary.sumText"),value:"sum"},{text:s("qm.table.groupSummary.maxText"),value:"max"},{text:s("qm.table.groupSummary.minText"),value:"min"},{text:s("qm.table.groupSummary.avgText"),value:"avg"},{text:s("qm.table.groupSummary.countText"),value:"count"}],[C,N]=t.useState([]),[T,I]=t.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(Mn,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(n)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:s("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:E.map((e=>Object.assign(Object.assign({},e),{disabled:C.findIndex((t=>t.group===e.value))>-1})))})}]),[R,O]=t.useState([]),[k,A]=t.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(Mn,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(n)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:s("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:S.map((e=>Object.assign(Object.assign({},e),{disabled:R.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:s("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Dd.groupSummary.total.value?w.slice(w.length-1):w})}]),P=t.useMemo((()=>{const e=C.length&&C.every((e=>Object.values(e).every((e=>""!==e)))),t=R.length&&R.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[C,R]),_=()=>{b&&sessionStorage.setItem(b,JSON.stringify({group:C.filter((e=>!!e.group)),summary:R.filter((e=>!!e.summary))}))},H=()=>{if(!b)return;const e=sessionStorage.getItem(b);return e?JSON.parse(e):null},F=()=>wn(void 0,void 0,void 0,(function*(){if(!b)return;const e=H();if(e){const{group:t,summary:n}=e;N(t),O(n)}let t=yield Vt.getItem(b);t||(t=yield D(b),Array.isArray(t)&&(yield Vt.setItem(b,t))),Array.isArray(t)&&t.length&&(m(t),!e&&y(t[0].value))})),D=e=>wn(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){}})),$=(e,t)=>wn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),M=Vn("table"),q={visible:u,title:s("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return t.createElement("div",{className:`${M}-group-summary__setting`},t.createElement("div",{className:"main"},t.createElement("div",{style:{width:"30%"}},t.createElement(ip,{ref:c,size:a,columns:T,dataSource:C,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>I(e),onDataChange:e=>{N(e)}},t.createElement(Mn,{type:"primary",icon:t.createElement(pt,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"container line"},t.createElement(ip,{ref:d,size:a,columns:k,dataSource:R,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onDataChange:e=>{O(e)}},t.createElement(Mn,{type:"primary",icon:t.createElement(pt,null),onClick:()=>{d.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(L,{size:a,value:f,placeholder:s("qm.table.groupSummary.configText"),disabled:P,onChange:e=>{const{value:t}=e.target;g(t)}}),t.createElement(Mn,{type:"primary",disabled:!f||P,style:{marginLeft:"10px"},onClick:()=>wn(void 0,void 0,void 0,(function*(){if(!b)return Jt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Qa(),t=[...h,{text:f,value:e,list:{group:C.filter((e=>!!e.group)),summary:R.filter((e=>!!e.summary))}}];m(t),y(e),g(""),yield Vt.setItem(b,t),yield $(b,t)}))},s("qm.table.groupSummary.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Dd.rowHeightMaps[a]}px`}},t.createElement("span",null,s("qm.table.groupSummary.savedSetting"))),t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.value,className:He({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:s("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,wn(void 0,void 0,void 0,(function*(){if(!n)return;const e=h.filter((e=>e.value!==n));m(e),n===v&&y(""),yield Vt.setItem(b,e),yield $(b,e)}))}},t.createElement(dt,null))))),!h.length&&t.createElement("div",{style:{padding:wd}},t.createElement(Di,null)))))),t.createElement(ha,q,t.createElement(bu,{columns:x,group:C,summary:R})),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(Mn,{onClick:()=>n(),style:{marginRight:8}},s("qm.table.groupSummary.closeButton")),t.createElement(Mn,{type:"primary",disabled:P,onClick:()=>(_(),void p(!0))},s("qm.table.groupSummary.confirmButton"))))},Eu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{t:i}=Cn(),[a,l]=t.useState(!1),o=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=Vn("table"),c={visible:a,title:i("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:`${s}-group-summary`,title:i("qm.table.groupSummary.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(ht,null))),t.createElement(ha,c,t.createElement(xu,{onClose:()=>l(!1)})))}));Eu.displayName="GroupSummary";const Su=e=>{const{onClose:n}=e,{global:r}=t.useContext(Wt),{tableRef:i,$size:a,flattenColumns:l,setSuperFilters:o,clearTableFilter:s}=t.useContext(xd),{uniqueKey:c}=i.current.props,{t:d}=Cn(),u=t.useRef(null),[p,h]=t.useState([]),[m,f]=t.useState([]),[g,v]=t.useState(""),[y,b]=t.useState("");xi((()=>{h(y?m.find((e=>e.value===y)).list:H()||[])}),[y]),t.useEffect((()=>{F()}),[]);const x=t.useMemo((()=>c?`superSearch_${c}`:""),[c]),E=t.useMemo((()=>l.filter((e=>!!e.filter))),[l]),S=tl(p),w=t.useMemo((()=>!(S&&Ia(S))),[S]),C=t.useMemo((()=>!!p.length&&w),[p,w]),N=[{value:"and",text:d("qm.table.highSearch.andText")},{value:"or",text:d("qm.table.highSearch.orText")}],T=l.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:Ja(e.title)}))),I=e=>["in","nin"].includes(e),R=(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},O=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:d("qm.table.highSearch.gtText")},{value:"<",text:d("qm.table.highSearch.ltText")},{value:">=",text:d("qm.table.highSearch.gteText")},{value:"<=",text:d("qm.table.highSearch.lteText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:d("qm.table.highSearch.inText")},{value:"nin",text:d("qm.table.highSearch.ninText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:d("qm.table.highSearch.likeText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}]}return t},[k,A]=t.useState([{title:d("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(Mn,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(n)}},d("qm.table.highSearch.removeText")))},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:T,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:d("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,r;const i=Object.values(t)[0],a=null===(n=E.find((e=>e.dataIndex===i)))||void 0===n?void 0:n.filter.type,l=O(a);e.fieldType=a,e.expression=i?null===(r=l[0])||void 0===r?void 0:r.value:"",e.condition=I(e.expression)?[]:"",i||(e.bracketLeft=e.bracketRight="")}})},{title:d("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:d("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=E.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:O(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=I(e.expression)?[]:""}}}},{title:d("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,r;const i=E.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:R(a,I(e.expression)),editable:!0,items:l,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:N,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),P=()=>{s(),o(p.map((e=>Fn(e,["index","pageIndex"])))),_(),n()},_=()=>{x&&sessionStorage.setItem(x,JSON.stringify(p.filter((e=>!!e.fieldName))))},H=()=>{if(!x)return;const e=sessionStorage.getItem(x);return e?JSON.parse(e):null},F=()=>wn(void 0,void 0,void 0,(function*(){if(!x)return;const e=H();e&&h(e);let t=yield Vt.getItem(x);t||(t=yield D(x),Array.isArray(t)&&(yield Vt.setItem(x,t))),Array.isArray(t)&&t.length&&(f(t),!e&&b(t[0].value))})),D=e=>wn(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){}})),$=(e,t)=>wn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),M=Vn("table");return t.createElement("div",{className:`${M}-super-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement(ip,{ref:u,size:a,columns:k,dataSource:p,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(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]?"":")"),h([...p]))},onDataChange:e=>{h(e)}},t.createElement(Mn,{type:"primary",icon:t.createElement(pt,null),onClick:()=>{u.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Dd.highSearch.showSQL&&S&&t.createElement("code",{className:"lang-js"},S)),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(L,{size:a,value:g,placeholder:d("qm.table.highSearch.configText"),disabled:w,onChange:e=>{const{value:t}=e.target;v(t)}}),t.createElement(Mn,{type:"primary",disabled:!g||w,style:{marginLeft:"10px"},onClick:()=>wn(void 0,void 0,void 0,(function*(){if(!x)return Jt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Qa(),t=[...m,{text:g,value:e,list:p.filter((e=>!!e.fieldName))}];f(t),b(e),v(""),yield Vt.setItem(x,t),yield $(x,t)}))},d("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Dd.rowHeightMaps[a]}px`}},t.createElement("span",null,d("qm.table.highSearch.savedSetting"))),t.createElement("ul",null,m.map((e=>t.createElement("li",{key:e.value,className:He({selected:e.value===y}),title:e.text,onClick:()=>{return t=e.value,void b(t!==y?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:d("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,wn(void 0,void 0,void 0,(function*(){if(!n)return;const e=m.filter((e=>e.value!==n));f(e),n===y&&b(""),yield Vt.setItem(x,e),yield $(x,e)}))}},t.createElement(dt,null))))),!m.length&&t.createElement("div",{style:{padding:wd}},t.createElement(Di,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(Mn,{onClick:()=>n(),style:{marginRight:8}},d("qm.table.highSearch.closeButton")),t.createElement(Mn,{type:"primary",disabled:C,onClick:()=>P()},d("qm.table.highSearch.searchButton"))))},wu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{t:i}=Cn(),[a,l]=t.useState(!1),o=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=Vn("table"),c={visible:a,title:i("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:`${s}-super-search`,title:i("qm.table.highSearch.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(mt,null))),t.createElement(ha,c,t.createElement(Su,{onClose:()=>l(!1)})))}));wu.displayName="SuperSearch";const Cu=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(Wt),{tableRef:g,isFullScreen:v,$size:y}=t.useContext(xd),{uniqueKey:b,exportExcel:x}=g.current.props,{t:E}=Cn(),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),N=t.useRef(null),T=t.useRef(null),I=t.useRef(null),R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(!1),P=t.useMemo((()=>b?`toolBox_${b}`:""),[b]),[_,H]=t.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),F={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},[D,$]=t.useState(!1);xi((()=>{A.current&&(V(),A.current=!1)}),[_]),t.useEffect((()=>{j()}),[]),t.useImperativeHandle(n,(()=>({exportHandle:()=>{if(!T.current)return Jt("Table","执行导出需要配置 `exportExcel` 参数");T.current.clickHandle()}})));const j=()=>{if(!P||!m)return;const e=JSON.parse(localStorage.getItem(P));e||K(P).then((e=>{e&&(H(Object.assign({},_,e)),localStorage.setItem(P,JSON.stringify(e)))})).catch((()=>{})),e&&H(Object.assign({},_,e))},V=()=>{if(!P||!m)return;const e={};for(const t in _)_[t]&&(e[t]=_[t]);localStorage.setItem(P,JSON.stringify(e)),z(P,e)},K=e=>wn(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){}})),z=(e,t)=>wn(void 0,void 0,void 0,(function*(){const n=null==f?void 0:f.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),W=e=>wn(void 0,void 0,void 0,(function*(){$(!1),yield An(100),e.current.clickHandle()})),B=(e,t)=>{A.current=!0,H(Object.assign({},_,{[t]:e}))},U=Vn("table"),G={"top-toolbox__popper":!0,[`${U}--lg`]:"large"===y,[`${U}--sm`]:"small"===y};return t.createElement(t.Fragment,null,i&&t.createElement(Gd,{ref:S,isFullScreen:v,open:!m||_.fullScreen}),a&&t.createElement(Yd,{ref:w,open:!m||_.reload}),l&&t.createElement(Qd,{ref:C,tableColumns:r,open:!m||_.print}),o&&t.createElement(cu,{ref:N,tableColumns:r,open:!m||_.import}),s&&t.createElement(pu,{ref:T,tableColumns:r,open:(!m||_.export)&&!(null==x?void 0:x.hideIcon)}),c&&t.createElement(mu,{ref:I,open:!m||_.clipboard}),d&&t.createElement(gu,{ref:R,columns:r,open:!m||_.collection}),u&&t.createElement(yu,{ref:O,open:!m||_.fastSearch}),h&&t.createElement(Eu,{ref:k,open:!m||_.groupSummary}),p&&t.createElement(wu,{ref:L,open:!m||_.superSearch}),m&&t.createElement(q,{open:D,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.fullScreen,style:{marginRight:6},onChange:e=>B(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.screen.full"))),onClick:()=>W(S)},{key:"reload",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.reload,style:{marginRight:6},onChange:e=>B(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.refresh.text"))),onClick:()=>W(w)},{key:"print",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.print,style:{marginRight:6},onChange:e=>B(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.print.text"))),onClick:()=>W(C)},{key:"import",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.import,style:{marginRight:6},onChange:e=>B(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.import.textNoSpace"))),onClick:()=>W(N)},{key:"export",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.export,style:{marginRight:6},onChange:e=>B(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.export.textNoSpace"))),onClick:()=>W(T)},{key:"clipboard",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.clipboard,style:{marginRight:6},onChange:e=>B(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.clipboard.textNoSpace"))),onClick:()=>W(I)},{key:"collection",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.collection,style:{marginRight:6},onChange:e=>B(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.selectCollection.text"))),onClick:()=>W(R)},{key:"fastSearch",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.fastSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.fastSearch.text"))),onClick:()=>W(O)},{key:"groupSummary",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.groupSummary,style:{marginRight:6},onChange:e=>B(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.groupSummary.text"))),onClick:()=>W(k)},{key:"superSearch",label:t.createElement(t.Fragment,null,t.createElement(M,{checked:_.superSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.highSearch.text"))),onClick:()=>W(L)}];return t.createElement(Q,{items:e.filter((e=>F[e.key]))})})(),overlayClassName:He(G),overlayStyle:{minWidth:120},onOpenChange:e=>{$(e)}},t.createElement("span",{className:`${U}-toolbox`,title:E("qm.table.toolbox.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(ft,null)))))}));Cu.displayName="ToolBox";const Nu=(e,t)=>e.map((e=>(e.children&&(e.children=Nu(e.children,t)),t(e)))),Tu=t.forwardRef(((e,n)=>{const{columns:r}=e,{global:i}=t.useContext(Wt),{tableRef:a,$size:l}=t.useContext(xd),{showColumnDefine:o,uniqueKey:s,onlyShowIcon:c,columnsChange:d}=a.current.props,{t:u}=Cn(),p=t.useRef([]),[h,m]=t.useState(!1),f=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),g=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),v=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),y=t.useMemo((()=>s?`table_${s}`:""),[s]);xi((()=>{E(r)}),[r]),t.useLayoutEffect((()=>{S()}),[]),t.useImperativeHandle(n,(()=>({initialHandler:S})));const b=()=>{if(!y)return;const e=JSON.parse(localStorage.getItem(y));var t;if(e||(t=y,wn(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(y,JSON.stringify(e)),S()):(null==i?void 0:i.getComponentConfigApi)&&E(r)})).catch((()=>{})),!e)return;return ge(La(e).map((e=>e.dataIndex)),La(r).map((e=>e.dataIndex))).length>0?Nu(r,(t=>{const n=Pa(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})):Nu(e,(e=>{const t=Pa(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},x=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=x(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)})),E=e=>{if(!y)return;const t=x(e),n=JSON.parse(localStorage.getItem(y));var r,l;a.current.columnsDefined&&!me(t,n)&&(localStorage.setItem(y,JSON.stringify(t)),r=y,l=t,wn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.saveComponentConfigApi;if(e)try{yield e({[r]:l})}catch(e){}})))},S=()=>{const e=b();var t;e&&(t=w(e),p.current=t,null==d||d(e))},w=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},C=()=>{const e=t=>t.map((t=>{const n=Pa(r,t.dataIndex)||Dn(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))},N=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=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===a)return t.push(n);t.push(...p.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,N(r))},I=(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=Ja(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,N(r)}}),t.createElement("i",{className:He(s),title:u("qm.table.columnFilter.draggable")},t.createElement(Ue,null)),t.createElement("span",{className:"text",title:o},o),"main"===n?t.createElement("span",{className:He("fixed",l?"disabled":"")},t.createElement("i",{className:"svgicon",title:u("qm.table.columnFilter.fixedLeft"),onClick:()=>T(e,"left")},t.createElement(gt,null)),t.createElement("i",{className:"svgicon",title:u("qm.table.columnFilter.fixedRight"),onClick:()=>T(e,"right")},t.createElement(vt,null))):"sub"!==n?t.createElement("span",{className:He("fixed",l?"disabled":"")},t.createElement("i",{className:"svgicon",title:u("qm.table.columnFilter.cancelFixed"),onClick:()=>T(e)},t.createElement(dt,null))):null);return!e.hidden&&(null===(i=e.children)||void 0===i?void 0:i.length)?t.createElement(Z,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:R(e.children,e.dataIndex)},c):c},R=(e,n)=>t.createElement("div",{className:"column-filter--wrap"},t.createElement(jt,{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));me(i,a)||((e,t)=>{Pa(r,t).children=e,null==d||d([...r])})(ol(t),n)}},e.map((e=>I(e,"sub"))))),O=Vn("table"),k={[`${O}__popper`]:!0,"column-filter__popper":!0,[`${O}--lg`]:"large"===l,[`${O}--sm`]:"small"===l},L=[`${O}-column-filter`,{selected:h}];return o?t.createElement(Vs,{action:["click"],popupVisible:h,popup:t.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"reset"},t.createElement(Mn,{type:"text",size:"small",onClick:C},u("qm.table.columnFilter.reset"))),t.createElement("div",{className:"left"},t.createElement(jt,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:f,setList:e=>{const t=e.map((e=>e.dataIndex)),n=f.map((e=>e.dataIndex));me(t,n)||N([...ol(e),...v,...g])}},f.map((e=>I(e,"left"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"main"},t.createElement(jt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:v,setList:e=>{const t=e.map((e=>e.dataIndex)),n=v.map((e=>e.dataIndex));me(t,n)||N([...f,...ol(e),...g])}},v.map((e=>I(e,"main"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"right"},t.createElement(jt,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),n=g.map((e=>e.dataIndex));me(t,n)||N([...f,...v,...ol(e)])}},g.map((e=>I(e,"right")))))),popupClassName:He(k),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{m(e)},builtinPlacements:Od,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:He(L),title:c?u("qm.table.columnFilter.text"):void 0},t.createElement("i",{className:"svgicon icon"},t.createElement(ot,null)),!c&&t.createElement("span",null,u("qm.table.columnFilter.text")))):null}));Tu.displayName="ColumnFilter";const Iu=()=>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"})),Ru=e=>{const{column:n,filters:r}=e,{$size:i,setFilters:a,clearSuperFilters:l}=t.useContext(xd),{t:o}=Cn(),s=t.useRef(null),c=t.useRef(null),d=t.useRef(null),[u,p]=t.useState(!1),[h,m]=t.useState(!1),[f,g]=t.useState({}),v=t.useMemo((()=>{const{dataIndex:e,filter:t}=n;return`${e}|${t.type}`}),[n]),y=t.useMemo((()=>{let e=!1;for(const t in r[v])if(!Hn(r[v][t])||h){e=!0;break}return e}),[v,r,h]);t.useLayoutEffect((()=>{u&&setTimeout((()=>b()),20)}),[u]),t.useEffect((()=>{var e;me(f[v],r[v])||g({[v]:r[v]||{}}),m(""===(null===(e=r[v])||void 0===e?void 0:e["=="]))}),[r]);const b=()=>{switch(n.filter.type){case"text":s.current.focus();break;case"number":c.current.focus();break;case"textarea":d.current.focus()}},x=e=>{e&&g(e),l(),a((e=>{for(const t in e){for(const n in e[t])if(Hn(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),f),e))),p(!1)},E={text:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(L,{ref:s,size:i,placeholder:o("qm.table.filter.searchText",{text:Ja(e.title)}),style:{width:"180px"},value:null!==(r=null===(n=f[v])||void 0===n?void 0:n.like)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[v]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&x()}}),t.createElement("div",{style:{marginTop:8}},t.createElement(M,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;g((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),m(t)}},o("qm.table.filter.nullValue"))))},textarea:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(L.TextArea,{ref:d,size:i,placeholder:o("qm.table.filter.searchAreaText",{text:Ja(e.title)}),style:{width:"220px"},value:null!==(r=null===(n=f[v])||void 0===n?void 0:n.likes)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[v]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),x())}}),t.createElement("div",{style:{marginTop:8}},t.createElement(M,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;g((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),m(t)}},o("qm.table.filter.nullValue"))))},number:e=>{const n=e=>{var t,n;return{value:null!==(n=null===(t=f[v])||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||g((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(j,fn({ref:c},n(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(j,fn({},n("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(j,fn({},n("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(j,fn({},n("!="),{placeholder:o("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const n=e=>{var t;return{value:Ya(null===(t=f[v])||void 0===t?void 0:t[e],Td),format:Td,size:i,onChange:t=>{g((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:Xa(t,Td)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(mn,fn({},n(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(mn,fn({},n("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(mn,fn({},n("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(mn,fn({},n("!="),{placeholder:o("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=f[v])||void 0===n?void 0:n["=="],onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[v]:{"==":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=f[v])||void 0===n?void 0:n.in,onChange:e=>{g((t=>Object.assign({},t,{[v]:{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(bd,{multiple:!0,value:(null===(n=f[v])||void 0===n?void 0:n.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));g((e=>Object.assign({},e,{[v]:{in:t}})))}}))}},S=()=>t.createElement(T,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t.createElement(Mn,{size:i,onClick:()=>(x({[v]:{}}),void m(!1))},o("qm.table.filter.reset")),t.createElement(Mn,{type:"primary",size:i,onClick:()=>x()},o("qm.table.filter.search"))),w=Vn("table"),C={"head-filter__popper":!0,[`${w}--lg`]:"large"===i,[`${w}--sm`]:"small"===i},N=["cell--filter",{selected:u,actived:y}];return t.createElement(Vs,{action:["click"],popupVisible:u,popup:(()=>{const e=n.filter.type,r=E[e];return r?t.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t.createElement("div",null,r(n)),S()):(Jt("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:He(C),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{p(e)},builtinPlacements:Od,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("div",{className:He(N),title:o("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t.createElement("span",{className:"svgicon icon"},t.createElement(Iu,null))))},Ou=e=>{const{column:n}=e,{tableRef:r,bordered:i}=t.useContext(xd),{columns:a,resizable:l,columnsChange:o=kn}=r.current.props,s=t.useMemo((()=>Ha(n)),[n]),c={resizable:!0,"is--line":l&&!i};return t.createElement("div",{className:He(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n}=r.current,i=n.$resizableBar,l=t.offsetWidth/2,c=e.clientX,d=qa(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||Dd.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&&(Pa(a,s.dataIndex).width=p,o([...a]))},!1}})},ku=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(xd),{rowSelection:p}=r.current.props,{fetchAllRowKeys:h,selectAllOnCurrentPage:m,filterable:f,onSelectAll:g}=p,{t:v}=Cn(),y=t.useRef([]),b=t.useMemo((()=>d&&!!h),[d,h]),x=t.useMemo((()=>!b&&!!m),[b,m]),E=t.useMemo((()=>(null==f||f)&&!x),[f,x]),S=()=>u?l():r.current.tableFullData,w=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>i(e,e.index)))},N=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:n}=p;if(b)return y.current.length?y.current:Ae(t,w());if(!x)return n?t.filter((t=>!n(e.get(t)))):t;const a=n?S().filter((e=>!n(e))).map((e=>i(e,e.index))):S().map((e=>i(e,e.index)));return Ae(a,w())})(),T=n.filter((e=>!N.includes(e))),I=n.length-T.length,R=I>0&&I<N.length,O=!!I&&I===N.length;s(T);const k=()=>wn(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=pe(r.data,t.dataKey))&&void 0!==e?e:[];const{disabled:a}=p;a&&(n=ge(n,S().filter((e=>a(e))).map((e=>i(e,e.index))))),y.current=n}}catch(e){}return c(!1),n})),L=e=>wn(void 0,void 0,void 0,(function*(){let t=[];t=b?e?yield k():[]:e?N.slice(0):[],t=[...new Set([...t,...T])],o(t),null==g||g(e,t)})),A=()=>{const e=[{key:1,label:v("qm.table.selection.all"),onClick:()=>{L(!0)}},{key:2,label:v("qm.table.selection.invert"),onClick:()=>wn(void 0,void 0,void 0,(function*(){let e=[];e=ge(n,b?yield k():N),e=[...new Set([...e,...T])],o(e)}))},{key:3,label:v("qm.table.selection.clear"),onClick:()=>{L(!1)}}];return t.createElement(Q,{items:e})};return t.createElement("div",{className:"cell--selection"},t.createElement(M,{checked:O,indeterminate:R,disabled:!N.length,onChange:e=>L(e.target.checked)}),E&&t.createElement(q,{overlayClassName:"all-selection__popper",dropdownRender:()=>A()},t.createElement(De,{className:"svgicon icon"})),x&&t.createElement(C,{placement:"top",title:v("qm.table.selection.currentPage")},t.createElement(yt,{className:"info"})))},Lu=e=>{const{style:n}=e,{tableRef:r,isTreeTable:i,setRowExpandedKeys:a}=t.useContext(xd),{expandable:l}=r.current.props,[o,s]=t.useState((null==l?void 0:l.defaultExpandAllRows)||!1);xi((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;a(o?e.filter((e=>!(i&&t.includes(e)))):[])}),[o]);const c={[`${Vn("expand")}--icon`]:!0,expanded:o,collapsed:!o};return t.createElement("span",{className:He(c),title:"",onClick:e=>{e.stopPropagation(),s(!o)},style:n})},Au=()=>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"})),Pu=()=>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"})),_u=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(xd),{ellipsis:N,resizable:T,multipleSort:I,rowSelection:R,expandable:O}=a.current.props,[k,L]=Dd.sortDirections,{tableOriginData:A}=a.current,{t:P}=Cn(),_=t.useRef(null),H=t.useMemo((()=>A.some((e=>Array.isArray(e.children)))),[A]),F=t.useMemo((()=>!h),[h]),D=t.useMemo((()=>!h),[h]),$=t.useMemo((()=>!(null==O?void 0:O.hideExpandAll)),[O]),M=t.useMemo((()=>!!R&&(h?!(!R.selectAllOnCurrentPage&&!R.fetchAllRowKeys):!R.hideSelectAll)),[h,R]);xi((()=>{B(),g(),b()}),[r]),xi((()=>{Y(),g(),b()}),[i]),xi((()=>{Y(),g(),b()}),[c]),t.useEffect((()=>{!Hn(r)&&Pn((()=>B())),!Hn(i)&&Pn((()=>Y()))}),[]),t.useLayoutEffect((()=>{q()}),[]);const q=()=>{y("$header",_.current)},j=(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:C,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:N,"col--center":"center"===R,"col--right":"right"===R,"column--required":!!C,"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&&![Dd.expandableColumn,Dd.selectionColumn].includes(h);return t.createElement("th",{key:h,className:He(O),colSpan:m,rowSpan:f,style:Object.assign({},k),onClick:t=>W(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"},V(e)),w?z(e):null)),L&&t.createElement(Ou,{column:e}))},V=e=>{const{dataIndex:n,type:i,sorter:a,title:l,description:o}=e;if(n===Dd.selectionColumn&&"checkbox"===i){if("checkbox"===i)return t.createElement("div",{className:"cell"},M?t.createElement(ku,{selectionKeys:d}):P("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:Ja(l)},m&&n===p&&$?t.createElement(Lu,null):null,n===Dd.expandableColumn&&$?t.createElement(Lu,null):l)),o&&s.push(t.createElement(C,{key:1,placement:"top",title:o},t.createElement(yt,{className:"tip"}))),a&&s.push(K(r[n])),s},K=e=>{const n=["svgicon cell--sorter__asc",{actived:e===k}],r=["svgicon cell--sorter__desc",{actived:e===L}];return t.createElement("div",{key:2,className:"cell--sorter",title:P("qm.table.sorter.text")},t.createElement("span",{className:He(n)},t.createElement(Au,null)),t.createElement("span",{className:He(r)},t.createElement(Pu,null)))},z=e=>t.createElement(Ru,{column:e,filters:i}),W=(e,t)=>{const{sorter:n,dataIndex:i}=t;if(n){const e=r[i],t=e?e===L?null:L:k;I?(delete r[i],v(Object.assign({},r,{[i]:t}))):v(Object.assign({},{[i]:t}))}},B=()=>{F&&U()},U=e=>{const t=Pe(r,(e=>null!==e));for(const e in t){const n=s.find((t=>t.dataIndex===e));n?G(n,t[e]):delete t[e]}e||Object.keys(t).length||G({dataIndex:"index"},k)},G=(e,t)=>{const{tableFullData:n}=a.current,{dataIndex:r,sorter:i}=e,l=(e,n)=>{const i=Ka(e,r),a=Ka(n,r);return Number.isNaN(i-a)?t===k?i.toString().localeCompare(a.toString()):a.toString().localeCompare(i.toString()):t===k?i-a:a-i},o=f?S(el(n).sort("function"==typeof i?i:l)):n.sort("function"==typeof i?i:l).slice(0);w(o)},Y=()=>{D&&X()},X=()=>{const e=c.length?tl(c):tl(i),t=""!==e?f?S(Ra(el(A),e,H)):Ra(A,e,H):A;w(t),U(!0)},Q=Ma(n),Z=Vn("table"),{tableBodyWidth:J}=l;return t.createElement("div",{ref:_,className:`${Z}--header-wrapper`},t.createElement("table",{className:`${Z}--header`,cellSpacing:"0",cellPadding:"0",style:{width:J?`${J}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)=>j(t,n,e))),o&&t.createElement("th",{className:He(r),style:Object.assign({},i)}))))})(Q))))},Hu=t.createContext([]),Fu=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Du=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),$u=(e,t)=>{var n;const r=e.target;return!("button"in e&&e.button>0)&&(!(r&&!Fu(r).contains(r))&&!(null===(n=t.current)||void 0===n?void 0:n.contains(r)))};function Mu({ref:t,handler:n,enabled:r=!0,omitClassNames:i=[]}){const a=Nn(n),l=e.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});e.useEffect((()=>{if(!r)return;const e=e=>{$u(e,t)&&(l.current.isPointerDown=!0)},o=e=>{l.current.ignoreEmulatedMouseEvents?l.current.ignoreEmulatedMouseEvents=!1:n&&l.current.isPointerDown&&$u(e,t)&&Du(e,i)&&(l.current.isPointerDown=!1,a(e))},s=e=>{l.current.ignoreEmulatedMouseEvents=!0,n&&l.current.isPointerDown&&$u(e,t)&&Du(e,i)&&(l.current.isPointerDown=!1,a(e))},c=Fu(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 qu(){const[,t]=e.useReducer((e=>e+1),0);return t}const ju=e=>{const{selectionKeys:n,column:r,record:i,rowKey:a}=e,{tableRef:l,isTreeTable:o,getAllChildRowKeys:s}=t.useContext(xd),{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=Da(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})})()},Vu=e=>{const{record:n,rowKey:r,style:i}=e,{tableRef:a,rowExpandedKeys:l,setRowExpandedKeys:o}=t.useContext(xd),{expandable:s={}}=a.current.props,[c]=t.useState("function"==typeof s.rowExpandable&&!s.rowExpandable(n)),d=t.useMemo((()=>l.includes(r)),[l,r]);xi((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,n)}),[d]);const u={[`${Vn("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t.createElement("span",{className:He(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?l.filter((e=>e!==r)):[...l,r];o(t)},style:i})},Ku=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 Ht(t).toFixed(p)),t},E=void 0!==a,[S,w]=t.useState(null!=i?i:""),C=v(E?a:S),N=y(C);xi((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[S]);return t.createElement(L,{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(N);null===(t=e.onBlur)||void 0===t||t.call(e,n,N)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(N),N))}})}));Ku.displayName="InputNumber";const{Search:zu}=L,Wu=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(xd),x=t.useContext(Hu),E="table-editable__popper",{t:S}=Cn(),C=qu(),{store:N,fieldAuth:T}=h.current,I=(null===(r=c.editRender)||void 0===r?void 0:r.call(c,d,c))||{},R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),A=t.useRef(null),P=t.useRef(null),_=t.useRef(!1),H=t.useRef({}),F=t.useRef({}),D=t.useRef([]),[q,j]=t.useState(!1),[V,K]=t.useState(!1),[W,B]=t.useState(I.items||[]),[U,G]=t.useState(),Y=(I.editable||me(x,[u,p]))&&!I.disabled&&!(null===(i=T[p])||void 0===i?void 0:i.disabled),X=`${u}|${p}`,Q=2===x.length?`${x[0]}|${x[1]}`:"",Z=![...N.state.required,...N.state.validate].some((({x:e,y:t})=>e===u&&t===p)),J=(null===(a=N.state.required.find((({x:e,y:t})=>e===u&&t===p)))||void 0===a?void 0:a.text)||"",ee=(null===(l=N.state.validate.find((({x:e,y:t})=>e===u&&t===p)))||void 0===l?void 0:l.text)||"",te=N.state.edited.some((({x:e,y:t})=>e===u&&t===p)),ne=Y||!Z||q||V,re=!!(null===(o=I.helper)||void 0===o?void 0:o.combinedDataIndex)&&("search-helper"===I.type||"tree-helper"===I.type),ie=null===(s=I.type)||void 0===s?void 0:s.endsWith("multiple");t.useLayoutEffect((()=>{ne&&Q===X?ce():de()}),[x]),t.useLayoutEffect((()=>{const{items:e}=I;ie&&e&&se(e.map((e=>({[F.current.valueKey]:e.value,[F.current.textKey]:e.text}))))}),[]);const ae=()=>{v(),b()},le=(e,t)=>{j(e),null==t||t()},se=e=>{D.current=e},ce=()=>{var e,t,n,r;const{type:i}=I;switch(i){case"text":null===(e=O.current)||void 0===e||e.focus();break;case"number":null===(t=k.current)||void 0===t||t.select();break;case"search-helper":null===(n=A.current)||void 0===n||n.focus();break;case"tree-helper":null===(r=P.current)||void 0===r||r.focus()}},de=()=>{var e,t,n,r;const{type:i}=I;switch(i){case"text":null===(e=O.current)||void 0===e||e.blur();break;case"number":null===(t=k.current)||void 0===t||t.blur();break;case"search-helper":null===(n=A.current)||void 0===n||n.blur();break;case"tree-helper":null===(r=P.current)||void 0===r||r.blur()}};t.useImperativeHandle(n,(()=>({focus:ce,isEditable:()=>!I.disabled,isOpening:()=>q})));const ue=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},he=(e,t,n)=>{const{cornerSign:r=!0}=I.extra||{};N.addToUpdated(e),r&&N.addToEdited({x:t,y:n})},fe=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",ge={text:(e,n,r)=>{const{dataIndex:i}=n,{type:a,extra:l={},rules:o=[],onInput:s,onChange:c,onEnter:d,onBlur:h}=I,m=Ka(e,i),g=Object.assign({},{minRows:1,maxRows:4},l.autoSize),v=r?{rows:g.minRows,autoSize:g}:null,b=l.password?L.Password:r?L.TextArea:L;return t.createElement(b,fn({ref:O,size:f,value:m,maxLength:l.maxLength,showCount:l.showCount},v,{autoComplete:l.password?"new-password":"off",placeholder:l.placeholder||S("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:"";za(e,i,r),y(o,r,u,p),C(),null==s||s({[X]:r}),_.current=!0},onBlur:t=>{var n;const r=null!==(n=t.target.value)&&void 0!==n?n:"";_.current&&(_.current=!1,he(e,u,p),null==c||c({[X]:r},e),null==h||h({[X]: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({[X]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&d&&e.preventDefault()}}))},textarea:(e,t)=>ge.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}=I,v=Ka(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 Ht(e).times(100).toNumber()}`,x=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new Ht(e).times(.01).toString()),t.createElement(Ku,{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||S("qm.table.editable.inputPlaceholder"),maxLength:s.maxLength,allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,formatter:b,parser:x,onChange:t=>{za(e,i,t),y(c,t,u,p),C(),null==d||d({[X]:t}),_.current=!0},onBlur:(t,n)=>{if(!_.current)return;_.current=!1;let r=s.stringMode?t:fe(t);"percent"===l&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),za(e,i,r),he(e,u,p),null==h||h({[X]:r},e),null==g||g({[X]:r},e),ae()},onEnter:(t,n)=>{let r=s.stringMode?t:fe(t);"percent"===l&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),null==m||m({[X]: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}=I,g=d||l,v=Ka(e,a);let b=v;return t.createElement($,{mode:r?"multiple":void 0,size:f,popupClassName:E,value:v||void 0,placeholder:s.placeholder||S("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}|${Vl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onDropdownVisibleChange:e=>j(e),onChange:t=>{za(e,a,t),y(c,t,u,p),he(e,u,p),null==h||h({[X]:t},e),ae()},onSelect:e=>{b=e},onInputKeyDown:t=>{13===t.keyCode&&Pn((()=>null==m?void 0:m({[X]:b},e)))}},g.map((e=>t.createElement($.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ge.select(e,t,!0),date:(e,n,r)=>{var i;const{dataIndex:a}=n,{type:l,extra:o={},rules:s=[],onChange:c}=I,d=r||"exactdate",h=Ka(e,a);return t.createElement(mn,{size:f,popupClassName:E,value:null!==(i=Ya(h,fl[d]))&&void 0!==i?i:void 0,picker:ml[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=Xa(t,fl[d]);za(e,a,n),y(s,n,u,p),he(e,u,p),null==c||c({[X]:n},e),ae()}})},datetime:(e,t)=>ge.date(e,t,"datetime"),month:(e,t)=>ge.date(e,t,"month"),year:(e,t)=>ge.date(e,t,"year"),time:(e,n)=>{var r;const{dataIndex:i}=n,{type:a,extra:l={},rules:o=[],onChange:s}=I,c="HH:mm:ss",d=Ka(e,i);return t.createElement(gn,{size:f,popupClassName:E,value:null!==(r=Ya(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=Xa(t,c);za(e,i,n),y(o,n,u,p),he(e,u,p),null==s||s({[X]:n},e),ae()}})},checkbox:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],onChange:o}=I,{trueValue:s=Cd,falseValue:c=Nd,disabled:d}=a,h=Ka(e,r);return t.createElement(M,{checked:h===s,disabled:d,onChange:t=>{const n=t.target.checked?s:c;za(e,r,n),y(l,n,u,p),he(e,u,p),null==o||o({[X]:n},e),ae()}})},switch:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],onChange:o}=I,{trueValue:s=Cd,falseValue:c=Nd,disabled:d}=a,h=Ka(e,r);return t.createElement(z,{checked:h===s,disabled:d,onChange:t=>{const n=t?s:c;za(e,r,n),y(l,n,u,p),he(e,u,p),null==o||o({[X]:n},e),ae()}})},"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}=I,v=Wa(e,re?c.combinedDataIndex:i),b=c.fieldAliasMap;b||Jt("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(i)||Jt("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),re&&(c.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||Jt("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[i].includes("|")&&Jt("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const w=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(oe(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a},C=e=>{const{autoQueryAssign:t=!0}=c;t&&(H.current=w(e)),j(!0)},N=(t,r)=>{const{beforeOpen:i}=c,a=(null!=i?i:Ln)({[X]:v},e,n);(null==a?void 0:a.then)?a.then((()=>{C(t),null==r||r()})).catch((()=>{})):!1!==a&&(C(t),null==r||r())},T=e=>{const t={};for(const n in x){const r=x[n];n!==i&&(t[n]=Wa(e,r))}const n=x[i]?Wa(e,x[i]):"";k(n,t);const{closed:r}=c;le(!1,(()=>ue(R.current))),ce(),null==r||r(e)},O=()=>{const{onlySelect:e=!0}=c;_.current&&k(e?"":v),le(!1,(()=>ue(R.current)))},k=(t="",n)=>{var r;if(oe(n)&&Object.keys(n).length)for(const t in n){const i=n[t],a=g.find((e=>e.dataIndex===t));if(a){za(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 za(e,t,i)}re&&!t&&((e,t,n,r)=>{if(!t.includes("|"))return za(e,t,n,r);const i=n.split("|")||[];t.split("|").forEach(((t,n)=>{var r;t&&za(e,t,null===(r=i[n])||void 0===r?void 0:r.trim())}))})(e,c.combinedDataIndex,""),za(e,i,t,a),y(s,t,u,p),he(e,u,p),null==h||h({[X]:t},e),ae(),H.current={},_.current=!1,G(void 0)},L={visible:q,title:S("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${ao[f]+20}px`},onClose:()=>{O()}},P=Object.assign(Object.assign({},c),{size:f,initialValue:Object.assign({},H.current,c.initialValue),onClose:e=>{e?T(e):O()}});return t.createElement(t.Fragment,null,t.createElement(zu,{ref:A,value:null!=U?U:v,placeholder:o.placeholder||S("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(_.current&&!q)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=Ln}=t.fetch;return new Promise(((i,a)=>wn(void 0,void 0,void 0,(function*(){var l;const o=ye({},t.fetch.params,Object.assign(Object.assign({},n),w(e)),{currentPage:1,pageSize:500});if(!r(o))return a();K(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(l=pe(e.data,t.fetch.dataKey))&&void 0!==l?l:[];i(n)}else a()}catch(e){a(e)}finally{Pn((()=>K(!1)))}}))))})(n).then((e=>((e=[],t)=>{const n=e.filter((e=>Wa(e,x[i]).toString().includes(t)));if(1===n.length)return T(n[0]);N(t)})(e,n))).catch((()=>k(""))):void k(n)},onChange:e=>{const{value:t}=e.target;null==d||d({[X]:t}),_.current=!0,G(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const n=null!==(t=e.target.value)&&void 0!==t?t:"";!q&&N(n)}},onDoubleClick:e=>{const{value:t}=e.target;N(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&N(e)}}),t.createElement(ha,L,t.createElement(ap,P)))},"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}=I,g=Ka(e,i),v=c.fieldAliasMap;v||Jt("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||Jt("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),F.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:Ln)({[X]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{j(!0),null==t||t()})).catch((()=>{})):!1!==i&&(j(!0),null==t||t())},C=()=>{le(!1,(()=>ue(R.current)))},N=t=>{za(e,i,t),y(s,t,u,p),he(e,u,p),null==h||h({[X]:t},e,D.current),ae()},T={visible:q,title:S("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${ao[f]+20}px`},onClose:()=>{C()}},O=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:ye({},c.initialValue),defaultSelectedKeys:g,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:r}=b;se(be([...D.current.filter((e=>t.includes(e[r]))),...e],r));const i=D.current.map((e=>({text:e[n],value:e[r]}))),a=be([...i,...l],"value").filter((e=>t.includes(e.value)));B(a),N(a.map((e=>e.value)));const{closed:o}=c;le(!1,(()=>ue(R.current))),null==o||o(D.current)})(e,t):C()}});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||S("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!q&&x()},onDoubleClick:()=>{o.disabled||x()},onChange:e=>{const{valueKey:t}=b;se(D.current.filter((n=>e.includes(n[t])))),N(e)}},W.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(w,{className:"ant-input-search-button",disabled:o.disabled,icon:t.createElement(Ye,null),onClick:()=>{x()}})))),t.createElement(ha,T,t.createElement(ap,O)))},"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}=I,v=Wa(e,re?d.combinedDataIndex:a),b=d.fieldAliasMap;b||Jt("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(a)||Jt("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),re&&(d.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||Jt("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[a].includes("|")&&Jt("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const w=t=>{const{beforeOpen:r}=d,i=(null!=r?r:Ln)({[X]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{j(!0),null==t||t()})).catch((()=>{})):!1!==i&&(j(!0),null==t||t())},C=()=>{le(!1,(()=>ue(R.current)))},N=(t="",n)=>{var r;if(oe(n)&&Object.keys(n).length)for(const t in n){const i=n[t],a=g.find((e=>e.dataIndex===t));if(a){za(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 za(e,t,i)}za(e,a,t,l),y(c,t,u,p),he(e,u,p),null==h||h({[X]:t},e),ae()},T={visible:q,title:S("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${ao[f]+20}px`},onClose:()=>{C()}},O=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]=Wa(e,r))}const n=x[a]?Wa(e,x[a]):"";N(n,t);const{closed:r}=d;le(!1,(()=>ue(R.current))),ce(),null==r||r(e)})(e):C()}});return t.createElement(t.Fragment,null,t.createElement(zu,{ref:P,value:v,allowClear:null===(i=s.allowClear)||void 0===i||i,readOnly:s.readOnly,disabled:s.disabled,placeholder:s.placeholder||S("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!q&&w())},onDoubleClick:()=>{w()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?w():N(""))}}),t.createElement(ha,T,t.createElement(dp,O)))},"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}=I,g=Ka(e,i),v=c.fieldAliasMap;v||Jt("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||Jt("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),F.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:Ln)({[X]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{j(!0),null==t||t()})).catch((()=>{})):!1!==i&&(j(!0),null==t||t())},C=()=>{le(!1,(()=>ue(R.current)))},N=t=>{za(e,i,t),y(s,t,u,p),he(e,u,p),null==h||h({[X]:t},e,D.current),ae()},T={visible:q,title:S("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:E,bodyStyle:{paddingBottom:`${ao[f]+20}px`},onClose:()=>{C()}},O=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:ye({},c.initialValue),defaultSelectedKeys:g,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=b;se(e);const r=D.current.map((e=>({text:e[t],value:e[n]})));B(r),N(r.map((e=>e.value)));const{closed:i}=c;le(!1,(()=>ue(R.current))),null==i||i(D.current)})(e):C()}});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||S("qm.table.editable.selectPlaceholder"),allowClear:l.allowClear,maxTagCount:l.collapseTags?"responsive":void 0,maxTagTextLength:l.maxTagTextLength,disabled:l.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!q&&x()},onDoubleClick:()=>{l.disabled||x()},onChange:e=>{const{valueKey:t}=b;se(D.current.filter((n=>e.includes(n[t])))),N(e)}},W.map((e=>t.createElement($.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(w,{className:"ant-input-search-button",disabled:l.disabled,icon:t.createElement(Ye,null),onClick:()=>{x()}})))),t.createElement(ha,T,t.createElement(dp,O)))},custom:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],render:o,onChange:s}=I;if(!o)return Jt("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const c=Ka(e,r),d=t=>{za(e,r,t),y(l,t,u,p),he(e,u,p),null==s||s({[X]:t},e),ae()},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,ne?(()=>{const{type:e}=I,n=ge[e];if(!n)return Jt("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!Z}];return t.createElement("div",{ref:R,className:He(r)},n(d,c),!Z&&t.createElement("div",{className:"cell-error"},J||ee))})():(()=>{const{disabled:n,extra:r={}}=I,{disabledColor:i,disabledBgColor:a}=r,l=["cell--show",{"is-cell-bg":n&&a}];return t.createElement(t.Fragment,null,t.createElement("span",{className:He(l),style:{color:n?i:""}},e.children),n&&a&&t.createElement("i",{className:"cell--bg",style:{background:a}}))})(),te&&t.createElement("i",{className:"cell--sign"}))}));Wu.displayName="CellEdit";const Bu=(e,...n)=>t.isValidElement(e)?t.cloneElement(e,...n):null,Uu=e=>{const{text:n,options:r,showMessage:i=!0,onCopy:a}=e,{t:l}=Cn();return Bu(e.children,{onClick:o=>{const s=t.Children.only(e.children),c=Dt(n,r);null==a||a(n,c),c&&i&&k.success(l("qm.clipboard.success")),s&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(o)}})};Uu.displayName="QmCopyToClipboard";const Gu=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(xd),{dataIndex:m,canCopy:f,render:g,editRender:v,shouldCellUpdate:y}=i,{t:b}=Cn(),{renderText:x,getTitleFromCellNode:E}=Xd(),S=t.useRef(null),w=Ka(a,m),[C,N]=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(Wu,{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([Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn].includes(m))return;const e=S.current.parentNode;c?e.title=E(C):e.removeAttribute("title")}),[c,C]);const T=e=>Array.isArray(e.children);return t.createElement("div",{ref:S,className:"cell"},(()=>{if(m===Dd.expandableColumn)return t.createElement(Vu,{record:a,rowKey:s});if(m===Dd.selectionColumn)return t.createElement(ju,{selectionKeys:d,column:i,record:a,rowKey:s});if(N)return N;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*Dd.treeTable.textIndent+"px"}}):null,t.createElement(Vu,{key:"expand",record:a,rowKey:s,style:T(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(Uu,{text:e},t.createElement(st,{className:"icon",title:b("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return C})())}));Gu.displayName="Cell";const Yu={startX:0,startY:0,startOffsetX:0,startOffsetY:0,containerSizeX:0,containerSizeY:0},Xu={open:!1,offsetX:0,offsetY:0},Qu=t.forwardRef(((e,n)=>{const{tableRef:r,getRowKey:i,flattenColumns:a,mergedTdCells:l,setMergedCells:o}=t.useContext(xd),{areaSelection:s={}}=r.current.props,{elementStore:c,tableFlatData:d}=r.current,{t:u}=Cn(),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);Mu({ref:h,handler:()=>D()});const E=t.useRef(Yu),S=e=>{E.current=Object.assign({},E.current,e)};t.useEffect((()=>{const e=kt(c.$tableBody,"mousedown",L),t=kt(c.$tableBody,"contextmenu",O),n=kt(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,N=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}},T=Ui(((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(N(n))}),5),I=Nn((()=>{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:Ka(t,r)})}})),e})),R=e=>{var t;o(e),null===(t=s.onCellMerge)||void 0===t||t.call(s,e),Pn((()=>w()))},O=Nn((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=Nn((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(N(t)),y(N(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;T(Math.min(r,E.current.containerSizeX),Math.min(i,E.current.containerSizeY))},P=()=>{var e;S(Yu),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=Vn("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||Xu,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(Vs,{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}})))})())}));Qu.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:N,setElementStore:T,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(xd),{height:z,minHeight:W,maxHeight:B,rowHeight:U,rowSelection:G,rowHighlight:Y,expandable:X,stripe:Q,summation:Z,rowStyle:J,cellStyle:ee,spanMethod:te,tableConfig:ne,areaSelection:re,nativeScrollBar:ie,ellipsis:ae,showHeader:le,rowDraggable:se,onRowClick:ce,onRowDblclick:de,onRowContextmenu:ue,onRowEnter:pe}=l.current.props,he=t.useRef(null),fe=t.useRef({}),ge=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:ja(W)-e-n+"px"}),B&&Object.assign(a,{maxHeight:ja(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([]),Ne=qu();Mu({ref:he,omitClassNames:[".table-editable__popper"],handler:()=>{var e;Ae([]),null===(e=ye.current)||void 0===e||e.blur()}}),t.useImperativeHandle(n,(()=>({setClickedValues:Ae,createFocus:Re,forceUpdate:Ne}))),xi((()=>{we.length&&l.current.tableManager.focus(l.current.uid)}),[we]),t.useLayoutEffect((()=>{Ie();const e=kt(document,"keydown",Te);return()=>e.remove()}),[]);const Te=Nn((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&&(Ae([]),O(""),$(!1)),we.length&&(ki(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(!ke(we[0],we[1])){if(38===p||40===p){wi(e);const{allTableData:t}=l.current,n=N?$a(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),m=Oe(h,we[1]);"radio"!==(null==G?void 0:G.type)||(null===(d=G.disabled)||void 0===d?void 0:d.call(G,c))||m||R([h]),!Y||(null===(u=Y.disabled)||void 0===u?void 0:u.call(Y,c))||m||O(h),_(s)||(38===p&&P(h,s),40===p&&P(h,Se>s+1?0:s+1-Se)),Ae([h,we[1]])}if(9===p||e.shiftKey&&9===p){if(wi(e),!s.length)return Ae([]);const t=s.length;let n=s.findIndex((e=>e.dataIndex===we[1]));const r=e.shiftKey&&9===p?(--n+t)%t:++n%t,i=s[r].dataIndex;Ae([we[0],i]),A(i)}}}})),Ie=()=>{T("$tableBody",he.current),T("$tableXspace",ge.current),T("$tableYspace",ve.current)},Re=(e,t)=>{var n;null===(n=fe.current[`${e}-${t}`])||void 0===n||n.focus()},Oe=(e,t)=>{var n,r;return null!==(r=null===(n=fe.current[`${e}-${t}`])||void 0===n?void 0:n.isEditable())&&void 0!==r&&r},ke=(e,t)=>{var n,r;return null!==(r=null===(n=fe.current[`${e}-${t}`])||void 0===n?void 0:n.isOpening())&&void 0!==r&&r},Le=(e,t,n)=>{var r;const{dataIndex:i}=n;if([Dd.expandableColumn,Dd.operationColumn].includes(i))return;const l=a(t,t.index);Ae([l,i]);const o=Oe(l,i),{type:s,selectByClickRow:c=!0,disabled:d=kn}=G||{};!s||d(t)||o||(c||i===Dd.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?_e(e,v,n):Pe(e,v,n);R(a),null==i||i(n,t,a)}})(l,t),[Dd.selectionColumn].includes(i)||(!Y||(null===(r=Y.disabled)||void 0===r?void 0:r.call(Y,t))||o||O(l),null==ce||ce(t,n,e))},Ae=e=>{me(e,we)||Ce(e)},Pe=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),_e=(e,t,n)=>{var r;const{disabled:i}=G||{},{deriveRowKeys:a,recordsMap:o}=l.current,s=Da(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=il(a,e))||void 0===r?void 0:r.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Da(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},Fe=(e,n=0)=>{const r=[];return e.forEach((e=>{const i=e.index,o=a(e,e.index);if(r.push(De(e,i,o,n)),null==X?void 0:X.expandedRowRender){const{expandedRowClassName:n,rowExpandable:a=Ln}=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*Dd.selectionColumnWidth:Dd.selectionColumnWidth}},t.createElement("div",{className:He("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(...Fe(e.children,n+1))}})),r},De=(e,n,r,i=0)=>{const{disabled:a}=G||{},l=["body--row",Object.assign({"body--row-striped":Q&&n%2!=0,"body--row-selected":v.includes(r)&&!(null==a?void 0:a(e)),"body--row-current":b===r},C?je(e._group):null)];return t.createElement("tr",{key:r,"data-row-key":r,className:He(l)},xe.map(((t,a)=>$e(t,a,e,n,r,i))))},$e=(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}=Me(r,e,i,n);if(!x||!E)return null;const S=null!==(u=e.ellipsis)&&void 0!==u?u:ae,w=!f&&"left"===v,N=!f&&"right"===v,T=["body--column",{"col--ellipsis":S,"col--center":"center"===y,"col--right":"right"===y,"column--sort":!!p[g],"cell-fix-left":w,"cell-fix-right":N,"cell-fix-left-last":w&&(null===(h=c[c.length-E])||void 0===h?void 0:h.dataIndex)===g,"cell-fix-right-first":N&&(null===(m=d[0])||void 0===m?void 0:m.dataIndex)===g,[b]:!!b}],I=N&&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:N?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?qe(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:He(T),style:_,onClick:t=>Le(t,r,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:r}=n;[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn].includes(r)||null==de||de(t,n,e)})(t,r,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:r}=n;[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn].includes(r)||null==ue||ue(t,n,e)})(t,r,e)},t.createElement(Gu,{ref:e=>fe.current[`${a}-${g}`]=e,row:r,column:e,rowIndex:i,columnIndex:n,rowKey:a,depth:s,showTitle:S}))},Me=(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]):oe(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}=Me(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}},qe=e=>{var t;const{backgroundColor:n,color:r}=null!==(t=Z.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:r}},je=e=>{const t=Z.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ve=Vn("table");return t.createElement(t.Fragment,null,t.createElement(Zi,{ref:l.current.scrollBarRef,wrapClassName:`${Ve}--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:kn,stopPropagation:kn})}be.current.prevST=s,be.current.prevSL=c}},t.createElement("div",{ref:ve,className:"body--y-space"}),t.createElement("div",{ref:ge,className:"body--x-space",style:{width:g?h.tableBodyWidth-h.gutterWidth:h.tableBodyWidth}}),t.createElement(Hu.Provider,{value:we},t.createElement("table",{ref:he,className:`${Ve}--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`}})}))),se?t.createElement(jt,{itemKey:e=>a(e,e.index),tag:"tbody",filter:".cell--edit input",preventOnFilter:!1,animation:200,list:i,setList:e=>{const t=e.map((e=>a(e,e.index))),n=i.map((e=>a(e,e.index)));if(me(t,n))return;const r=ol(e),o=[];l.current.tableFullData.forEach((e=>{i.includes(e)?o.push(r.shift()):o.push(e)})),I(o),H()}},i.map((e=>De(e,e.index,a(e,e.index))))):t.createElement("tbody",null,Fe(i)))),!!re&&t.createElement(Qu,{ref:ye})))}));Zu.displayName="TableBody";const Ju=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(xd),{footRender:h}=r.current.props,{t:m}=Cn(),f=t.useRef(null);t.useLayoutEffect((()=>{g()}),[]);const g=()=>{d("$footer",f.current)},v=(e,n,o)=>{var d,h;const{isIE:f}=r.current,{gutterWidth:g}=a,{dataIndex:v,fixed:y,align:b,summation:x}=e,E=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!i[v],"cell-fix-left":!f&&"left"===y,"cell-fix-right":!f&&"right"===y,"cell-fix-left-last":!f&&"left"===y&&(null===(d=s[s.length-1])||void 0===d?void 0:d.dataIndex)===v,"cell-fix-right-first":!f&&"right"===y&&(null===(h=c[0])||void 0===h?void 0:h.dataIndex)===v}],S=f?null:{left:"left"===y?`${u(v)}px`:"",right:"right"===y?`${p(v)+(l?g:0)}px`:""},w=(null==x?void 0:x.render)?x.render(r.current.tableFullData):Ka(n,`${v}_text`),C=0===o&&""===w?m("qm.table.config.summaryText"):w;return t.createElement("td",{key:v,title:C,className:He(E),style:Object.assign({},S)},t.createElement("div",{className:"cell"},C))},y=Vn("table"),{tableBodyWidth:b}=a;return t.createElement("div",{ref:f,className:`${y}--footer-wrapper`},h?h(o,r.current.tableFullData):t.createElement("table",{className:`${y}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:b?`${b}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)=>v(t,e,n))),l&&t.createElement("td",{className:He(i),style:Object.assign({},a)}))))})())))};var ep;!function(e){e.small="small",e.middle="default",e.large="default"}(ep||(ep={}));const tp=e=>{var n,r,i,a;const{current:l,pageSize:o,total:s,onChange:c}=e,{global:d}=t.useContext(Wt),{tableRef:u,$size:p,setElementStore:h}=t.useContext(xd),{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:Dd.pagination.showSizeChanger,E=null!==(r=null==f?void 0:f.showQuickJumper)&&void 0!==r?r:Dd.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)||Dd.pagination.pageSizeOptions,w=()=>wn(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=>wn(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){}})),N=(e,t)=>wn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),T={[`${Vn("table")}-pager`]:!0};return t.createElement("div",{ref:v,className:He(T)},t.createElement("div",{className:"pager-alert"},"bottom"===(null==g?void 0:g.position)&&t.createElement(Ud,{total:s})),t.createElement(J,{size:ep[p],showSizeChanger:x,showQuickJumper:E,pageSizeOptions:S,current:l,pageSize:o,total:s,onChange:(e,t)=>{c(e,t)},onShowSizeChange:(e,t)=>{y&&(N(y,t),localStorage.setItem(y,`${t}`))}}))},np=()=>{const{layout:e}=t.useContext(xd),n=t.useMemo((()=>{const{headerHeight:t,viewportHeight:n}=e;return{top:`${t}px`,height:`${n}px`}}),[e]),r=Vn("table");return t.createElement("div",{className:`${r}--empty`,style:n},t.createElement(Di,null))},rp=()=>{const{setElementStore:e}=t.useContext(xd),n=t.useRef(null);t.useLayoutEffect((()=>{r()}),[]);const r=()=>{e("$resizableBar",n.current)},i=Vn("table");return t.createElement("div",{ref:n,className:`${i}--resizable-bar`})},ip=t.forwardRef(((e,n)=>{const r=$i(Sd,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}=Tn(r),x=t.useRef(null),E=t.useRef(null),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),N=Nn(((e,t)=>{const n="function"==typeof i?i(e,t):null==e?void 0:e[i];return void 0===n?(Jt("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),{tableRef:T,tableFullData:I,setElementStore:R,setOriginColumns:O,setTableFullData:k,setTableOriginData:L,setTableFlatData:A,setAllTableData:P,setDeriveRowKeys:_,setInvalidRowKeys:H,setFieldAuth:F,setColumnsDefined:D,setScrollXStore:$,setScrollYStore:M,setScrollXLoad:q,setScrollYLoad:j,setResizeState:V,setHandleState:K,setSummaries:z,setSelectionRows:W,setShouldToTop:B,setRecordsMap:U,setUnMounted:G,clearElementStore:Y,clearRecordsMap:X}=((e,{getRowKey:n,$size:r})=>{const{rowHeight:i,dynamicThead:a}=e,l=t.useRef({props:e,uid:Pd(),tableManager:Hd,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||Dd.rowHeightMaps[r]},store:new Fd,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:!In&&/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=$a(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:b}),{tableData:Q,setTableData:Z,tableFlatColumns:J,setTableFlatColumns:ee,filters:te,setFilters:ne,sorter:re,setSorter:ie,superFilters:ae,setSuperFilters:le,pagination:se,setPagination:ce,selectionKeys:de,setSelectionKeys:ue,rowExpandedKeys:pe,setRowExpandedKeys:he,highlightKey:ge,setHighlightKey:ve,updateMark:ye,forceUpdate:be,mergedTdCells:xe,setMergedCells:Ee,layout:Se,setLayout:we,permission:Ce,setPermission:Ne,spinning:Te,setSpinning:Ie,scrollX:Re,setScrollX:Oe,scrollY:ke,setScrollY:Le,isPingLeft:Ae,setPingLeft:Pe,isPingRight:_e,setPingRight:Fe,isFullScreen:De,setFullScreen:$e,updateTableData:Me}=(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(Wt),w={current:null!==(n=null==v?void 0:v.current)&&void 0!==n?n:Dd.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:Dd.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:[],N=null!==(u=null!==(d=null==b?void 0:b.expandedRowKeys)&&void 0!==d?d:null==b?void 0:b.defaultExpandedRowKeys)&&void 0!==u?u:[],[T,I]=t.useState([]),[R,O]=t.useState([]),[k,L]=t.useReducer(((e,t)=>me(e,t)?e:t),g),[A,P]=t.useReducer(((e,t)=>me(e,t)?e:t),f),[_,H]=t.useReducer(((e,t)=>me(e,t)?e:t),[]),[F,D]=t.useState(w),[$,M]=t.useReducer(((e,t)=>me(e,t)?e:t),C),[q,j]=t.useReducer(((e,t)=>me(e,t)?e:t),N),[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]=Md([],{value:E}),[G,Y]=t.useState({gutterWidth:m?jd():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[X,Q]=t.useState({export:!0,import:!0,print:!0}),[Z,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:T,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:Q,setLayout:Y,spinning:Z,setSpinning:J,scrollX:ee,setScrollX:te,scrollY:ne,setScrollY:re,isPingLeft:ie,setPingLeft:ae,isPingRight:le,setPingRight:oe,isFullScreen:se,setFullScreen:ce,updateTableData:()=>I([...T])}})(r),{isFetch:qe,isWebPagination:je,isScrollPagination:Ve,showPagination:Ke,shouldUpdateHeight:ze,tableColumns:We,flattenColumns:Be,editableColumns:Ue,summationColumns:Ge,leftFixedColumns:Ye,rightFixedColumns:Xe,derivedMergeCells:Qe,treeExpandIndex:Ze,showSummary:Je,showFooter:et,isHeadGroup:tt,bordered:nt,isHeadSorter:rt,isHeadFilter:it,isServiceSummation:at,isSelectCollection:lt,isTableImport:ot,isTableClipboard:st,isSuperSearch:ct,isFastSearch:dt,isGroupSummary:ut,isGroupSubtotal:pt,isTreeTable:ht,isTableEmpty:mt,summationRows:ft,fetchParams:gt}=Kd(r,{getRowKey:N,tableRef:T,tableFullData:I,tableData:Q,sorter:re,filters:te,superFilters:ae,selectionKeys:de,pagination:se,mergedTdCells:xe}),{createElementStore:vt,tableStyles:yt,getSpan:bt,getStickyLeft:xt,getStickyRight:Et,scrollXToColumn:St,scrollYToRecord:wt,rowInViewport:Ct,calcTableHeight:Nt,resetTableScroll:Tt,computeVirtualX:It,computeVirtualY:Rt,doLayout:Ot}=Wd(r,{getRowKey:N,tableRef:T,topElementRef:x,tableElementRef:E,$size:b,tableColumns:We,flattenColumns:Be,leftFixedColumns:Ye,derivedMergeCells:Qe,layout:Se,scrollX:Re,scrollY:ke,showFooter:et,showPagination:Ke,isFullScreen:De,setLayout:we,setScrollX:Oe,setScrollY:Le,setElementStore:R,setScrollXStore:$,setScrollYStore:M,setShouldToTop:B}),{initialTable:kt,checkDataIndex:Lt,createTableFullData:At,getTableData:Pt,handleTableData:_t,createWebPageData:Ht,createTableData:Ft,createGroupData:Dt,createSelectionKeys:$t,createRowExpandedKeys:Mt,setSelectionKeysEffect:qt,findParentRowKeys:jt,getAllChildRowKeys:Vt,doFieldValidate:Kt,getTableLog:zt,dataChange:Bt,tableChange:Ut,toLastPage:Gt,toFirstPage:Yt,getPageCount:Xt,pagerChangeHandle:Qt,triggerScrollXEvent:Zt,triggerScrollYEvent:en,scrollBottomDebouncer:tn,clearTableSorter:nn,clearTableFilter:rn,clearSuperFilters:an,clearRowSelection:ln,clearRowHighlight:on,clearTableLog:sn,destroy:cn}=zd(r,{getRowKey:N,tableRef:T,tableElementRef:E,tableBodyRef:S,$size:b,tableColumns:We,flattenColumns:Be,editableColumns:Ue,tableFullData:I,pagination:se,layout:Se,filters:te,sorter:re,superFilters:ae,fetchParams:gt,selectionKeys:de,rowExpandedKeys:pe,highlightKey:ge,summationColumns:Ge,shouldUpdateHeight:ze,isFetch:qe,isTreeTable:ht,isWebPagination:je,isScrollPagination:Ve,isServiceSummation:at,isGroupSubtotal:pt,doLayout:Ot,setTableData:Z,setTableFlatColumns:ee,setTableFullData:k,setTableOriginData:L,setTableFlatData:A,setAllTableData:P,setDeriveRowKeys:_,setPagination:ce,setSpinning:Ie,setSorter:ie,setFilters:ne,setSuperFilters:le,setSelectionKeys:ue,setRowExpandedKeys:he,setHighlightKey:ve,setSelectionRows:W,setScrollXLoad:q,setScrollYLoad:j,setScrollXStore:$,setScrollYStore:M,computeVirtualX:It,computeVirtualY:Rt,setFieldAuth:F,setResizeState:V,setSummaries:z,setPermission:Ne,setRecordsMap:U,resetTableScroll:Tt,clearElementStore:Y,clearRecordsMap:X});((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:N,scrollYToRecord:T,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);xi((()=>{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]),xi((()=>{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]),xi((()=>{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]),xi((()=>{var e;me(g,M.current)||(M.current=g,v&&i&&(null===(e=i.onChange)||void 0===e||e.call(i,g)))}),[g]),xi((()=>{const e=H(a.selectedRowKeys);me(e,h)||(e.__prevent__=!0,I(e),x&&O(F()))}),[null==a?void 0:a.selectedRowKeys]),xi((()=>{const e=F(l.expandedRowKeys);me(e,m)||(e.__prevent__=!0,O(e))}),[null==l?void 0:l.expandedRowKeys]),xi((()=>{const{currentRowKey:e}=o;e!==f&&k(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),xi((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(y&&("after"===e?S():w()),T("","after"===e?1e5:0)),t&&p.current>C()&&S(),(e||t)&&N({insert:null,remove:!1})}),[p.total]),xi((()=>{A(u)}),[u]),xi((()=>{_()}),[d]),xi((()=>{s.current.scrollYLoad&&(e.height||e.maxHeight||Jt("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||Jt("Table","必须设置组件参数 `ellipsis`")),b&&(e.height||e.maxHeight||Jt("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,b]),Bd({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(Dn(r)),D(),E(),Pn((()=>_())),()=>{$(),P(!0)})),[])})(r,{tableRef:T,tableBodyRef:S,$size:b,scrollX:Re,pagination:se,selectionKeys:de,rowExpandedKeys:pe,highlightKey:ge,showSummary:Je,summationRows:ft,isWebPagination:je,isScrollPagination:Ve,isTreeTable:ht,checkDataIndex:Lt,toLastPage:Gt,toFirstPage:Yt,getPageCount:Xt,setHandleState:K,scrollYToRecord:wt,setOriginColumns:O,setSelectionKeysEffect:qt,setRowExpandedKeys:he,setHighlightKey:ve,setResizeState:V,setPingRight:Fe,setUnMounted:G,calcTableHeight:Nt,createSelectionKeys:$t,createRowExpandedKeys:Mt,initialTable:kt,destroy:cn});const dn=t.useMemo((()=>({getRowKey:N,tableRef:T,tableBodyRef:S,$size:b,flattenColumns:Be,editableColumns:Ue,leftFixedColumns:Ye,rightFixedColumns:Xe,treeExpandIndex:Ze,sorter:re,filters:te,superFilters:ae,layout:Se,bordered:nt,showFooter:et,showSummary:Je,summationRows:ft,scrollX:Re,scrollY:ke,pagination:se,fetchParams:gt,selectionKeys:de,rowExpandedKeys:pe,highlightKey:ge,mergedTdCells:xe,derivedMergeCells:Qe,updateMark:ye,isFetch:qe,isPingLeft:Ae,isPingRight:_e,isHeadSorter:rt,isHeadFilter:it,isFullScreen:De,isTableEmpty:mt,isHeadGroup:tt,isTreeTable:ht,isGroupSubtotal:pt,isWebPagination:je,dataChange:Bt,tableChange:Ut,getTableData:Pt,setElementStore:R,createWebPageData:Ht,createTableFullData:At,updateTableData:Me,setSorter:ie,setFilters:ne,setSuperFilters:le,setHighlightKey:ve,setRowExpandedKeys:he,setSelectionRows:W,setSelectionKeysEffect:qt,setInvalidRowKeys:H,setMergedCells:Ee,getSpan:bt,getStickyLeft:xt,getStickyRight:Et,scrollXToColumn:St,scrollYToRecord:wt,rowInViewport:Ct,setPagination:ce,setPingLeft:Pe,setPingRight:Fe,setSpinning:Ie,setFullScreen:$e,setShouldToTop:B,doFieldValidate:Kt,createTableData:Ft,createGroupData:Dt,findParentRowKeys:jt,getAllChildRowKeys:Vt,triggerScrollXEvent:Zt,triggerScrollYEvent:en,scrollBottomDebouncer:tn,resetTableScroll:Tt,clearTableSorter:nn,clearTableFilter:rn,clearSuperFilters:an,clearRowSelection:ln,clearRowHighlight:on})),[b,Be,Ue,Ye,Xe,Ze,re,te,ae,Se,nt,et,Je,ft,Re,ke,se,gt,de,pe,ge,Qe,ye,qe,Ae,_e,rt,it,De,mt,tt,ht,pt,je]);((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:N,setHandleState:T,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=>wn(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=Pa(j,e);if(!r)return Jt("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!oe(t))return Jt("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(r.noAuth)return Jt("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&fe(r,e,t[e]);n&&(V?V([...j]):Jt("Table","需要设置 `columnsChange` 参数"),P())},INSERT_RECORDS:(e,t)=>{const{store:n,tableFullData:a}=i.current,l=(Array.isArray(e)?e:[e]).filter((e=>oe(e)));if(!l.length)return;l.forEach((e=>{s.forEach((t=>{const{dataIndex:n}=t;[Dd.expandableColumn,Dd.selectionColumn,Dd.operationColumn].includes(n)||za(e,n,Ka(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=al(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&&T(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=>oe(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&&(T(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(),Pn((()=>{N(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,Ka(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:T,toolBoxRef:w,tableBodyRef:S,columnFilterRef:C,flattenColumns:Be,editableColumns:Ue,pagination:se,fetchParams:gt,selectionKeys:de,rowExpandedKeys:pe,highlightKey:ge,isFetch:qe,dataChange:Bt,getTableData:Pt,handleTableData:_t,createTableData:Ft,createTableFullData:At,calcTableHeight:Nt,scrollXToColumn:St,scrollYToRecord:wt,doFieldValidate:Kt,setTableOriginData:L,setHandleState:K,setColumnsDefined:D,setSelectionKeysEffect:qt,setRowExpandedKeys:he,setHighlightKey:ve,setSelectionRows:W,setOriginColumns:O,forceUpdate:be,getTableLog:zt,clearRowSelection:ln,clearRowHighlight:on,clearTableSorter:nn,clearTableFilter:rn,clearSuperFilters:an,clearTableLog:sn}),t.useLayoutEffect((()=>{vt(),T.current.tableManager.register(T.current.uid,null!=n?n:{current:null})}),[]);const un=Vn("table"),pn={[`${un}--wrapper`]:!0,[`${un}--lg`]:"large"===b,[`${un}--sm`]:"small"===b,[`${un}--maximize`]:De,[s]:!!s},hn={[un]:!0,"is--border":nt,"is--fixed":Ye.length||Xe.length,"is--sortable":rt,"is--filterable":it,"is--head-group":tt,"is--area-select":!!c,"is--ping-left":Ae,"is--ping-right":_e};return t.createElement(xd.Provider,{value:dn},t.createElement("div",{className:He(pn)},m&&t.createElement("div",{ref:x,className:`${un}-top`},t.createElement("div",{className:`${un}-top__space`},"bottom"!==(null==p?void 0:p.position)&&t.createElement(Ud,{total:se.total}),t.createElement("div",{className:`${un}-top__space-slot`,style:{justifyContent:kd[h]}},r.children)),t.createElement("div",{className:`${un}-top__actions`},t.createElement(Cu,{ref:w,showFullScreen:f,showReload:g&&qe,showPrint:Ce.print&&!!d,showImport:Ce.import&&ot,showExport:Ce.export&&!!u,showClipboard:st,showCollection:lt,showFastSearch:dt,showSuperSearch:ct,showGroupSummary:ut,showToolBox:v,tableColumns:We}),t.createElement(Tu,{ref:C,columns:a}))),t.createElement(Mi,{spinning:null!=l?l:Te},t.createElement("div",{ref:E,className:He(hn),style:yt},t.createElement("div",{className:`${un}--main-wrapper`},y&&t.createElement(_u,{tableColumns:We,sorter:re,filters:te}),t.createElement(Zu,{ref:S,tableFlatColumns:J,tableData:Q}),et&&t.createElement(Ju,{summationRows:ft})),nt&&t.createElement("div",{className:`${un}--border-line`}),mt&&t.createElement(np,null),o&&t.createElement(rp,null))),Ke&&t.createElement(tp,fn({},se,{onChange:(e,t)=>Qt({current:e,pageSize:t})}))))}));ip.displayName="QmTable";const ap=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}=Tn(e),{t:m}=Cn(),f=t.useRef(null),g=t.useRef(null),v=t.useRef(null),y=zi(f),[b,x]=t.useState(c),[E,S]=t.useState(),[w,C]=t.useState(o),[N,T]=t.useState(!1),[I,R]=t.useState(300),[O,k]=t.useState(s),[L,A]=t.useState((e=>[{title:m("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[P,_]=t.useState(ye({},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*ao[h]-30)},$=Ui(D,5);Bi((()=>{$()}),[y.width]),xi((()=>{me(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=()=>wn(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=Ln}=n;if(l(P)){T(!0);try{const t=yield r(P);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=pe(t.data,a))&&void 0!==e?e:[];i||(C([]),yield An(0)),F(n)}}catch(e){}T(!1)}})),q=e=>{i||(S(e),p(e))},j=e=>{_(Object.assign({},P,e))},V={[`${Vn("search-helper")}--wrapper`]:!0},K=b.webPagination?{dataSource:H,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:P})};return t.createElement("div",{ref:f,className:He(V,d),style:u},t.createElement("div",{className:"form-wrap"},O.length?t.createElement(zc,{ref:g,items:O,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>D(),onFinish:e=>j(e),onReset:()=>wn(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(ip,fn({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:`${ao[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(Mn,{onClick:()=>p(null),style:{marginRight:8}},m("qm.dialog.cancel")),t.createElement(Mn,{type:"primary",disabled:!E,onClick:()=>p(E,i?w:void 0)},m("qm.dialog.confirm"))))};ap.displayName="QmSearchHelper";const lp=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...lp(e.children)),e.children&&t.push(e.value)})),t},op=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=op(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},sp=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&sp(e.children,t),t(e)||e.children&&e.children.length))),cp=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}=Tn(e),{t:f}=Cn(),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=zi(g),[x,E]=t.useState(c),[S,w]=t.useState(),[C,N]=t.useState(o),[T,I]=t.useState(!1),[R,O]=t.useState(300),[k,A]=t.useState(300),[P,_]=t.useState(s),[H,F]=t.useState((e=>[{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[D,$]=t.useState(ye({},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");O(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*ao[m]-30)},V=Ui(j,5);Bi((()=>{V()}),[b.width]),xi((()=>{me(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=()=>wn(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=Ln}=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=pe(t.data,a))&&void 0!==e?e:[];i||(N([]),yield An(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([]),[Q,Z]=t.useState(""),J=t.useRef(B),ee=t.useRef([]);xi((()=>{Y(lp(B))}),[B]);const te=()=>wn(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=pe(l.data,r))&&void 0!==e?e:[],n=Nl(t,i,a);U(n),J.current=n,ee.current=t}}catch(e){}})),ne=e=>`${e}|${Vl.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${Vn("tree-table-helper")}--wrapper`]:!0},ie=x.webPagination?{dataSource:M,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},x.fetch),{params:D})};return t.createElement("div",{ref:g,className:He(re,u),style:p},t.createElement(Hi,{defaultValue:200,style:{height:"100%"}},t.createElement(Hi.Pane,{min:100,style:{overflowY:"auto"}},t.createElement(L.Search,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:f("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=sp(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==ne(n).indexOf(e)}));Z(e),U(t)})(e.target.value)}),t.createElement(X,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:G,treeData:B,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==ne(t).indexOf(Q)},onExpand:e=>{Y(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return Jt("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const r in t)n[r]=pe(e,t[r]);W(n)})(op(ee.current,(n=>pe(n,t)===e[0]))||{})}})),t.createElement(Hi.Pane,{className:"split-pane"},t.createElement("div",{className:"form-wrap"},P.length?t.createElement(zc,{ref:v,items:P,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>j(),onFinish:e=>W(e),onReset:()=>wn(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(ip,fn({ref:y,uniqueKey:r,height:k,columns:H,rowKey:x.rowKey||"pageIndex"},ie,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{N(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:`${ao[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(Mn,{onClick:()=>h(null),style:{marginRight:8}},f("qm.dialog.cancel")),t.createElement(Mn,{type:"primary",disabled:!S,onClick:()=>h(S,i?C:void 0)},f("qm.dialog.confirm"))))};cp.displayName="TreeTableHelper";const dp=e=>{var n,r,i;const{multiple:a,tree:l={},defaultSelectedKeys:o,className:s,style:c,onClose:d}=e,{$size:u}=Tn(e),{t:p}=Cn(),[h,m]=t.useState(),[f]=t.useState(null===(n=l.fetch)||void 0===n?void 0:n.params),g={[`${Vn("tree-helper")}--wrapper`]:!0},v=l.fetch?Object.assign(Object.assign({},Fn(l.fetch,["params","valueKey","textKey"])),{params:f}):void 0;return t.createElement("div",{className:He(g,s),style:c},t.createElement(bd,{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},autoFocus:!0,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:`${ao[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(Mn,{onClick:()=>d(null),style:{marginRight:8}},p("qm.dialog.cancel")),t.createElement(Mn,{type:"primary",disabled:!h,onClick:()=>d(h)},p("qm.dialog.confirm"))))};dp.displayName="TreeHelper";const up="_startSign",pp="_endSign",hp=e=>{var n;const{uniqueKey:r,initialValue:i,filters:a=[],table:l={},onClose:o}=e,{$size:s}=Tn(e),{t:c}=Cn(),d=t.useRef(null),u=t.useRef(null),p=t.useRef(null),h=zi(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,N]=t.useState((e=>[{title:c("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},{title:c("qm.form.rangeSearchHelper")[0],dataIndex:up,width:80,align:"right",render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)},...e||(l.columns||[]),{title:c("qm.form.rangeSearchHelper")[1],dataIndex:pp,fixed:"right",width:80,render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)}])()),[T,I]=t.useState(ye({},null===(n=l.fetch)||void 0===n?void 0:n.params,i)),[R,O]=t.useState([]),L=t.useMemo((()=>y.map((e=>null==e?void 0:e.pageIndex))),[y]),A=t.useMemo((()=>2===L.length&&L.every((e=>void 0!==e))),[L]),P=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");E(e.offsetHeight-t.offsetHeight-2*ao[s]-30)},_=Ui(P,5);Bi((()=>{_()}),[h.width]),xi((()=>{me(a,S)||w(a)}),[a]),t.useEffect((()=>{H()}),[T]);const H=()=>wn(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=Ln}=n;if(a(T)){v(!0);try{const t=yield r(T);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=pe(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,up),F(e,pp))})),b([])},$=e=>{D(),I(Object.assign({},T,e))},M=Vn("range-helper"),q=m.webPagination?{dataSource:R,loading:g,webPagination:!0}:{fetch:Object.assign(Object.assign({},m.fetch),{params:T})};return t.createElement("div",{ref:d,className:`${M}--wrapper`},t.createElement("div",{className:"form-wrap"},S.length?t.createElement(zc,{ref:u,items:S,initialValues:i,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>w(e),onCollapse:()=>P(),onFinish:e=>$(e),onReset:()=>wn(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(ip,fn({ref:p,height:x,columns:C,rowKey:m.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=L[0]&&e.pageIndex<=L[1]?{backgroundColor:"#f5f5f5"}:{}},q,{columnsChange:e=>N(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[up,pp].includes(n)&&(n===up&&(e[n]?(F(e,n),b([void 0,y[1]])):e.pageIndex>L[1]?k.warning(c("qm.searchHelper.rangeStartTip")):(y[0]&&F(y[0],n),e[n]="[",b([e,y[1]]))),n===pp&&(e[n]?(F(e,n),b([y[0],void 0])):e.pageIndex<L[0]?k.warning(c("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===L[0]&&(e[up]="["),e.pageIndex===L[1]&&(e[pp]="]")}))}}),t.createElement(Mn,{type:"primary",icon:t.createElement(bt,null),title:c("qm.table.alert.clear"),onClick:()=>D()}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${ao[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(Mn,{onClick:()=>o(null),style:{marginRight:8}},c("qm.dialog.cancel")),t.createElement(Mn,{type:"primary",disabled:!A,onClick:()=>o(y.map((e=>(e=>{const t={};for(const n in e)[up,pp].includes(n)||(t[n]=e[n]);return t})(e))))},c("qm.dialog.confirm"))))};hp.displayName="RangeTableHelper";const mp=e=>null!=e;function fp(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]),Bd({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 gp=8;const vp={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"]}},yp={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"]}},bp=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function xp(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a,visibleFirst:l}=e,o=t/2,s={};return Object.keys(vp).forEach((e=>{const c=r&&yp[e]||vp[e],d=Object.assign(Object.assign({},c),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,bp.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?gp: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 Ep={fill:"transparent",pointerEvents:"auto"},Sp=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-${Pd()}`,p="object"==typeof c?null==c?void 0:c.placeholder:c;return t.createElement($t,{open:s,autoLock:!0},t.createElement("div",{className:He(`${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",fn({},i?null:Ep,{x:"0",y:"0",width:"100%",height:"100%",fill:o,mask:`url(#${u})`})),i&&t.createElement(t.Fragment,null,t.createElement("rect",fn({},Ep,{x:"0",y:"0",width:"100%",height:`${i.top}px`})),t.createElement("rect",fn({},Ep,{x:"0",y:"0",width:i.left,height:"100%"})),t.createElement("rect",fn({},Ep,{x:"0",y:i.top+i.height,width:"100%",height:`calc(100vh - ${i.top+i.height}px)`})),t.createElement("rect",fn({},Ep,{x:i.left+i.width,y:"0",width:`calc(100vw - ${i.left+i.width}px)`,height:"100%"})))):null))},wp=e=>{const{prefixCls:n,zIndex:r,open:i,onPause:a,onPlay:l}=e,[o,s]=Md(void 0,{value:i,postState:e=>null==e||e}),c=t.useRef(null),d=t.useRef(!1),u=Nn((e=>{p(e),e.shiftKey&&32===e.keyCode&&h()}));t.useEffect((()=>{const e=kt(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-Ri(t).x,o=e.clientY-Ri(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),Ni(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(xt,null):t.createElement(Et,null))},Cp=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}=Cn(),y="primary"!==c?"primary":"default",b=Nn((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=kt(document,"keyup",b);return()=>e.remove()}),[]);const x=mp(a)?t.createElement("div",{className:`${n}-cover`},a):null,E=mp(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:He(i===r&&`${n}-indicator-active`,`${n}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return t.createElement("div",{className:He(`${n}-content`,f)},t.createElement("div",{className:`${n}-inner`},t.createElement(Xe,{className:`${n}-close`,onClick:u}),s.content&&t.createElement(Z,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},t.createElement(St,{className:He(`${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(jn,{className:`${n}-buttons`},0!==r?t.createElement(Mn,{className:`${n}-prev-btn`,size:"small",onMouseDown:w,onClick:p},v("qm.tour.prevStep")):null,r===i-1?t.createElement(Mn,{className:`${n}-finish-btn`,type:y,size:"small",onClick:m},v("qm.tour.finish")):t.createElement(Mn,{className:`${n}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:h},v("qm.tour.nextStep"))))))},Np=e=>{const{current:n,renderPanel:r}=e;return t.createElement(t.Fragment,null,"function"==typeof r?r(e,n):t.createElement(Cp,e))},Tp={left:"50%",top:"50%",width:1,height:1},Ip=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=En(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),N=t.useRef(),[T,I]=Md(0,{value:a,defaultValue:i}),[R,O]=Md(void 0,{value:c,postState:e=>!(T<0||T>=r.length)&&(null!=e&&e)}),[k,L]=Md(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[T]||{},U=W||k,G=F||d,Y=R&&(null!=K?K:u),X=null!=z?z:w,[Q,Z]=fp(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"})(Z,g,D),ee=!!Z&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;t.useLayoutEffect((()=>{var e;null===(e=N.current)||void 0===e||e.forceAlign()}),[te,T]),xi((()=>{R&&(ie(),null==B||B(Z,T))}),[R,Z]);const ne=e=>{I(e),null==l||l(e)},re=()=>{O(!1),null==o||o(T)},ie=()=>{if(!Z)return;const e=[];!function t(n){if(1===n.nodeType){var r;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===Ci(r=n,"display")||"hidden"===Ci(r,"visibility")||"0"===Ci(r,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ae=()=>wn(void 0,void 0,void 0,(function*(){if(!$||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),n=Z.offsetWidth,r=Z.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 An(null!=M?M:320))})),le="boolean"==typeof Y?Y:!!Y,oe="boolean"==typeof Y?void 0:Y,se=Object.assign({},f,q),ce=Vn("tour"),de=[{[`${ce}-primary`]:"primary"===G},m,V],ue=xp({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(Sp,{zIndex:U,prefixCls:ce,pos:Q,showMask:le,style:null==oe?void 0:oe.style,fill:null==oe?void 0:oe.color,open:A,animated:S,rootClassName:m}),t.createElement($t,{open:A,autoLock:!0},t.createElement(Mt,fn({ref:N},C,{zIndex:U,builtinPlacements:ue,popupStyle:se,popupPlacement:J,popupVisible:A,popupClassName:He(de),prefixCls:ce,popup:()=>t.createElement(Np,fn({key:"content",arrow:ee,prefixCls:ce,total:r.length,helper:v,renderPanel:b,indicatorsRender:x,onPrev:()=>wn(void 0,void 0,void 0,(function*(){yield ae(),ne(T-1)})),onNext:()=>wn(void 0,void 0,void 0,(function*(){yield ae(),ne(T+1)})),onClose:re,current:T,onFinish:()=>{re(),null==s||s()}},Object.assign({},r[T],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),t.createElement("div",{className:He(m,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Q||Tp),{position:"fixed",pointerEvents:"none"})}))),h&&t.createElement($t,{open:R},t.createElement(wp,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));Ip.displayName="QmTour";const Rp=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Op=e=>({_s:e,status:Rp[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),kp=e=>e?6:5,Lp=(e,t,n,r,i)=>{clearTimeout(r.current);const a=Op(e);t(a),n.current=a,null==i||i({current:a})},Ap=(e={})=>{const{enter:t=!0,exit:n=!0,preEnter:r,preExit:i,timeout:a,initialEntered:o,mountOnEnter:c,unmountOnExit:d,onStateChange:h}=e||{},[m,f]=u((()=>Op(o?2:kp(c)))),g=l(m),v=l(),[y,b]=(e=>oe(e)?[e.enter,e.exit]:[e,e])(a),x=p((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return kp(t)}})(g.current._s,d);e&&Lp(e,f,g,v,h)}),[h,d]),E=p((e=>{const a=e=>{switch(Lp(e,f,g,v,h),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:kp(d))}),[x,h,t,n,r,i,y,b,d]);return s((()=>()=>clearTimeout(v.current)),[]),[m,E,x]},Pp=e=>{const{name:n,in:r,timeout:i,preEnter:a=!0,preExit:l}=e,[o,s]=Ap({timeout:i,preEnter:a,preExit:l,initialEntered:r});return Bi((()=>{s()}),[r]),t.createElement(t.Fragment,null,t.Children.map(e.children,(e=>t.isValidElement(e)?Bu(e,{className:He(e.props.className,n,o.status)}):e)))};var _p={previewWidth:1100,defaultDistance:.45,logoHeight:60};const Hp=n(void 0);var Fp=null;function Dp(){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 $p(e,t){var n;try{var r=navigator.userAgent,i=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(Dp()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void k.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:Fp?n=Fp:((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),Fp=n),!n||!n.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&Dp(),n}catch(e){k.error("getLodop 出错:"+e)}}Dp();const Mp=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)},qp=t.forwardRef(((e,n)=>{const{templateRender:r,directPrint:i}=e,{global:a}=t.useContext(Wt),{$$preview:l}=t.useContext(Hp),{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}))),xi((()=>{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*_p.defaultDistance+10*_p.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*_p.defaultDistance+10*_p.defaultDistance:0;return("vertical"===e?c[1]:c[0])-t}),[o,s,c]),b=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return Mp(v-10*(e.left-_p.defaultDistance)-10*(e.right-_p.defaultDistance))}),[o,v]),x=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return Mp(y-10*(e.top-_p.defaultDistance)-10*(e.bottom-_p.defaultDistance))}),[o,y]),E=o.form.scale,S=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return{left:Mp(10*e.left),right:Mp(10*e.right),top:Mp(10*e.top),bottom:Mp(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=_p.previewWidth-a<=0?0:(_p.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>_p.previewWidth?0:l>0?s:(_p.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: ${_p.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("")},N=()=>{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},T=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().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([N(),C(),...p.current]);const r=t.fixedLogo?x-_p.logoHeight:x;let a=[];if(m.current=[],"stylus"===n)m.current.push([N(),...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+=_p.logoHeight),e+=o,e<=r?a.push(l):(m.current.push([N(),...t.fixedLogo?[C()]:[],...a]),a=[],e=0,n-=1),n===i-1&&a.length&&m.current.push([N(),...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()+N()+e.join("")+"</table>"},A=()=>wn(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||(T(),yield An(0),I(),R(),g(!1))})),P=()=>wn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();T(),yield An(0),I(),R(),g(!1),l.doPrint(k()),yield An(0),l.doClose()})),_=()=>{Jt("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},H={[Vn("print-container")]:!0,"no-visible":i};return t.createElement("div",{ref:d,className:He(H)},t.createElement(Mi,{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}))))}));qp.displayName="Container";class jp extends r{constructor(){super(...arguments),this.formRef=t.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Yt("qm.print.setPanel.printParameter")},{type:"SELECT",label:Yt("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:Yt("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Yt("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Yt("qm.print.setPanel.vertical"),value:"vertical"},{text:Yt("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Yt("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Yt("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:Yt("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Yt("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:_p.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:_p.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:_p.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:_p.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("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:Yt("qm.print.setPanel.sizeUnit"),disright:Yt("qm.print.setPanel.sizeUnit"),distop:Yt("qm.print.setPanel.sizeUnit"),disbottom:Yt("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>wn(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(zc,{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(Mn,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Yt("qm.dialog.close")),t.createElement(Mn,{type:"primary",onClick:()=>this.confirmHandle()},Yt("qm.dialog.confirm"))))}}jp.contextType=Wt;class Vp 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:_p.defaultDistance,right:_p.defaultDistance,top:_p.defaultDistance,bottom:_p.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=()=>wn(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 Vt.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=>wn(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)=>wn(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=$p();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}=_p,{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():k.error(Yt("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=$p();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():k.error(Yt("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(`${f().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Yt("qm.print.laserPrinter"),value:"laser"},{text:Yt("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=$p(),t=[{text:Yt("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){Jt("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 wn(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield Vt.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),oe(n)&&(yield Vt.setItem(this.printerKey,n))),oe(n)&&Object.keys(n).length&&ye(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=Vn("print-preview"),c={visible:r,title:Yt("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:He(d)},t.createElement("div",{className:"outer"},t.createElement("div",{className:"header"},t.createElement("span",null,Yt("qm.print.printer"),":",t.createElement($,{value:i.printerName,onChange:e=>{this.setState((t=>ye({},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,Yt("qm.print.type"),":",t.createElement($,{value:i.printerType,onChange:e=>{this.setState((t=>ye({},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,Yt("qm.print.copies"),":",t.createElement(j,{value:i.copies,min:1,precision:0,onChange:e=>{this.setState((t=>ye({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),t.createElement("span",null,Yt("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"}}),Yt("qm.print.printPage.1")),t.createElement("span",null,t.createElement(J,{size:"small",current:a,pageSize:1,total:l,onChange:this.pageChangeHandle})),t.createElement("span",null,t.createElement(Mn,{type:"text",icon:t.createElement(ot,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Yt("qm.print.setting"))),t.createElement("span",null,t.createElement(Mn,{type:"text",icon:t.createElement(Ke,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Yt("qm.print.export"))),t.createElement("span",null,t.createElement(Mn,{icon:t.createElement(at,null),type:"primary",onClick:this.printClickHandle},Yt("qm.print.print")))),t.createElement("div",{className:"main"},t.createElement(Hp.Provider,{value:this.provide},t.createElement(qp,{ref:this.containRef,templateRender:n,directPrint:!1}))),t.createElement("div",{className:"footer"},t.createElement("span",null,Yt("qm.print.scale"),":",t.createElement(ee,{value:i.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>ye({},t,{form:{scale:e}})))}}),t.createElement("em",{className:"scale-text"},`${Math.floor(100*i.scale)}%`)),t.createElement("span",null,Yt("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t.createElement("span",null,Yt("qm.print.pageNumber"),":",Yt("qm.print.pagination",{currentPage:a,totalPage:l}))))),t.createElement(ha,c,t.createElement(jp,{setting:i.setting,onChange:e=>{this.setState((t=>ye({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t.createElement(Hp.Provider,{value:this.provide},t.createElement(qp,{ref:this.containRef,templateRender:n,directPrint:!0}))}}Vp.contextType=Wt;class Kp extends r{constructor(){super(...arguments),this.previewRef=t.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>wn(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:Yt("qm.print.preview"),width:`${_p.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(ha,o,t.createElement(Vp,s)):e?t.createElement(Vp,s):null},this.DO_PRINT=()=>wn(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield An(0),this.setState({visible:!0}),yield An(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(Mn,o,this.props.children),this.createRender())}}function zp(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Wp(e){const t=zp(e);return t?t.frameElement:null}function Bp(e){const t=Yp(e);return Up([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Up(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 Gp(e,t){const n=Wp(e);if(n&&n!==t){const r=[e.getBoundingClientRect()];let i=n,a=!1;for(;i;){const e=Bp(i);if(r.push(e),i=Wp(i),a)break;i&&zp(i)===t&&(a=!0)}return Up(r)}return e.getBoundingClientRect()}function Yp(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)}}Kp.propTypes={size:(e,t,n)=>{if(!en(e[t]||""))return Zt("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:m.elementType},Kp.defaultProps={preview:!0,type:"primary",icon:t.createElement(at,null)},Kp.contextType=Wt;const Xp=Object.assign;class Qp{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=th.border,this.padding.style.borderColor=th.padding,this.content.style.backgroundColor=th.background,Xp(this.node.style,{borderColor:th.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){eh(t,"margin",this.node),eh(t,"border",this.border),eh(t,"padding",this.padding),Xp(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"}),Xp(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"),Xp(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),Xp(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),Xp(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});Xp(this.tip.style,r.style)}}class Jp{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 Qp(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=Gp(e,this.window),i=Yp(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=Gp(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 eh(e,t,n){Xp(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 th={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 nh=null,rh=null;function ih(){null!=window.document&&(nh=null,null!==rh&&(rh.remove(),rh=null))}class ah{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=>ki(t,window.document.querySelector(e)))))return this._selectIgnore=!0,ih();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!==nh&&clearTimeout(nh),null!=n&&(null===rh&&(rh=new Jp),rh.inspect(n,r),i&&(nh=setTimeout((()=>ih()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=_e((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(){ih(),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 oh=e=>{const{action:n,onConfirm:r,onCancel:i,onFinish:a}=e,{t:l}=Cn();return t.createElement(t.Fragment,null,t.createElement("div",{style:{height:100}},l("qm.table.config.emptyText")),t.createElement(jn,{style:{width:"100%",justifyContent:"flex-end"}},t.createElement(Mn,{size:"small",onClick:()=>null==i?void 0:i()},l("qm.guideTracker.closeButton")),t.createElement(Mn,{size:"small",onClick:()=>null==r?void 0:r()},l("add"===n?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),t.createElement(Mn,{size:"small",onClick:()=>null==a?void 0:a()},l("qm.guideTracker.finishButton"))))},sh={left:"50%",top:"50%",width:1,height:1},ch=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}=Cn(),E=t.useRef(),S=t.useRef(l.length),[w,C]=Md(0,{value:i,defaultValue:a}),[T,I]=Md(void 0,{value:r,postState:e=>null!=e&&e}),[R,O]=Md(1051,{value:h,defaultValue:h}),[k,L]=t.useState({}),[A,P]=t.useState(!1),[_,H]=t.useState(T),[F,D]=t.useState(!1),[$,M]=fp(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 ah({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),L({id:Qa(),node:e,path:t}),C(S.current),P(!0),U(),null==g||g(t,e)}})}),[]),t.useEffect((()=>(T?B():U(),T?setTimeout((()=>H(!0)),16):H(!1),()=>{U()})),[T]),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=Vn("guide-tracker"),X=[{[`${Y}-primary`]:!0}],Q=xp({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement($t,{open:T&&A,autoLock:!0},t.createElement(Mt,{zIndex:R,builtinPlacements:Q,popupPlacement:o,popupVisible:T&&A,popupClassName:He(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(Xe,{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(jt,{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(me(t,n))return;const r=t.findIndex((e=>e===k.id)),i=-1!==r?r:w;C(i),null==v||v(ol(e),i)}},l.map(((e,n)=>t.createElement("li",{key:n,className:He("item",{actived:e.id===k.id})},t.createElement(Ue,{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(l,n))}},e.title),t.createElement(N,{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:lh(n),path:n})}C(i),null==v||v(t,i)}},t.createElement(Xe,{className:"close-icon"})))))))):t.createElement(t.Fragment,null),overlayClassName:`${Y}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>D(e)},t.createElement(wt,{className:He(`${Y}-close`,"menu-icon"),style:{width:j}})),m.content&&t.createElement(Z,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:m.content,title:m.title},t.createElement(St,{className:He(`${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(oh,{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:He(`${Y}-target-placeholder`),style:Object.assign(Object.assign({},$||sh),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:G,onClick:G}))),s&&t.createElement($t,{open:_},t.createElement(wp,{zIndex:R,prefixCls:Y,onPause:()=>{K.current=A,P(!1),U()},onPlay:()=>{K.current?P(!0):B()}})))}));ch.displayName="QmGuideTracker";const dh=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,N=t.useRef(null),T=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(N.current){const r=T.current.get(N.current);r&&(N.current.contains(r)&&N.current.removeChild(r),T.current.delete(N.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=N.current)||void 0===n||n.append(i),T.current.set(N.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(T.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])}(N,(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=Vn("watermark");return t.createElement("div",{ref:N,className:He(z,w),style:Object.assign({position:"relative"},C)},n.children)},uh=new Map,ph=new WeakMap;let hh,mh=0;function fh(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(ph.has(n)||(mh+=1,ph.set(n,mh.toString())),ph.get(n)):"0"):e[t]}`;var n})).toString()}function gh(e,t,n={},r=hh){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=fh(e);let n=uh.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},uh.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(),uh.delete(i))}}const vh=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=gh(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||Jt("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[Vn("lazy-load")]:!0};return t.createElement("div",{ref:s,className:He(u,l),style:o},n||c?e.children:t.createElement("div",{className:"placeholder",style:{height:r}},i))};class yh{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 bh{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 bh(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 yh(o+g,s+v),c2:new yh(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 xh{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 yh(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=bh.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)}}xh.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})},xh.canvasToDataURL=e=>e.toDataURL("image/png",1),xh.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const Eh=()=>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"})),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:"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"})),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:"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"})),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:"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"})),Nh=()=>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:g}=Cn(),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,N]=Md(void 0,{value:r,postState:e=>null!=e&&e}),T=t.useMemo((()=>!!e.children),[e.children]),[I,R]=t.useState(T?"square":"line"),[O,k]=t.useState(E[0]),[L,A]=t.useState(T?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:!T};return n.openSmooth&&Object.assign(n,{penColor:o,minWidth:s,maxWidth:c}),v.current=new xh(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()};xi((()=>{T&&C&&K()}),[C,T]),xi((()=>{v.current.setDrawMode(I)}),[I]),xi((()=>{v.current.setLineWidth(O)}),[O]),xi((()=>{v.current.setPenColor(L)}),[L]),xi((()=>{v.current.setFontSize(P)}),[P]);const z=()=>wn(void 0,void 0,void 0,(function*(){const e=T?b.current.parentNode:y.current;if(e)try{const t=yield qt(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===x.current||e.classList.contains("spinning")});return xh.canvasToDataURL(t)}catch(e){Jt("Signature","生成合成图片失败!")}})),W=()=>{v.current.clear(),null==m||m()};t.useImperativeHandle(n,(()=>({OPEN:()=>N(!0),CLOSE:()=>N(!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:He("ant-dropdown-menu","content")},"text"!==e?t.createElement("div",{className:"lineWidth"},E.map((e=>t.createElement("span",{key:e,className:He("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:He("dot",{active:e===L}),style:{backgroundColor:e},onClick:()=>A(e)},t.createElement(je,{className:"icon"})))))),G=Vn("signature"),Y={[G]:!0,"is-annotation":T},X=i?Object.assign(Object.assign({},p),{width:i}):p;return t.createElement("div",{className:He(Y,u),style:X},T&&t.createElement(t.Fragment,null,t.createElement("div",{ref:b,className:"content"},e.children),j&&t.createElement(Mi,{spinning:!0,className:"spinning"})),t.createElement("div",{className:He("signature",{show:C})},t.createElement("canvas",{ref:y,className:I}),T&&t.createElement("div",{ref:x,className:"signature__tool-bar"},t.createElement("div",{className:"wrapper"},t.createElement("div",{className:He("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(Ct,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(Eh,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(wh,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(Sh,null))),t.createElement("button",{className:"btn",onClick:()=>wn(void 0,void 0,void 0,(function*(){yield wn(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):f().format(Rd);Ji(xh.dataURLToBlob(e),`${t}.png`)}V(!1)})),W()}))},t.createElement(Ke,null)),t.createElement("button",{className:"btn",onClick:()=>R("eraser")},t.createElement(Ch,null)),t.createElement("button",{className:"btn",onClick:()=>v.current.undo()},t.createElement(Nh,null)),t.createElement("button",{className:"btn",onClick:()=>v.current.clear()},t.createElement(bt,null)),t.createElement("span",{className:"divider"}),t.createElement("button",{className:"btn",onClick:()=>null==m?void 0:m()},t.createElement(Xe,null)),t.createElement("button",{className:"btn",onClick:()=>wn(void 0,void 0,void 0,(function*(){V(!0),yield An(10);const e=yield z();V(!1),W(),null==h||h(e)}))},t.createElement(je,null))),t.createElement("button",{className:"btn btn-fold",title:g(D?"qm.divider.spread":"qm.divider.collect"),onClick:()=>M(!D)},D?t.createElement(Tt,null):t.createElement(Nt,null))))))}));Th.displayName="QmSignature";const Ih="1.10.9";export{hn as Calendar,mn as DatePicker,oa as DcpAnchor,Mn as DcpButton,yi as DcpCollapse,xn as DcpConfigProvider,Uu as DcpCopyToClipboard,Fi as DcpCountup,sd as DcpCropper,Kn as DcpDivider,ra as DcpDownload,da as DcpDrawer,Di as DcpEmpty,zc as DcpForm,ch as DcpGuideTracker,vh as DcpLazyLoad,ha as DcpModal,Kp as DcpPrint,hp as DcpRangeTableHelper,Zi as DcpScrollbar,ap as DcpSearchHelper,bd as DcpSearchTree,Th as DcpSignature,jn as DcpSpace,Mi as DcpSpin,Hi as DcpSplit,ip as DcpTable,ca as DcpTabs,od as DcpTinymce,Ip as DcpTour,Pp as DcpTransition,dp as DcpTreeHelper,cp as DcpTreeTableHelper,na as DcpUploadFile,dd as DcpUploadImg,dh as DcpWatermark,oa as QmAnchor,Mn as QmButton,yi as QmCollapse,xn as QmConfigProvider,Uu as QmCopyToClipboard,Fi as QmCountup,sd as QmCropper,Kn as QmDivider,ra as QmDownload,da as QmDrawer,Di as QmEmpty,zc as QmForm,ch as QmGuideTracker,vh as QmLazyLoad,ha as QmModal,Kp as QmPrint,hp as QmRangeTableHelper,Zi as QmScrollbar,ap as QmSearchHelper,bd as QmSearchTree,Th as QmSignature,jn as QmSpace,Mi as QmSpin,Hi as QmSplit,ip as QmTable,ca as QmTabs,od as QmTinymce,Ip as QmTour,Pp as QmTransition,dp as QmTreeHelper,cp as QmTreeTableHelper,na as QmUploadFile,dd as QmUploadImg,dh as QmWatermark,gn as TimePicker,Vl as pinyin,Ih as version};
1
+ import*as e from"react";import t,{createContext as n,version as r,isValidElement as i,useRef as a,useLayoutEffect as l,useEffect as o,Component as s,forwardRef as c,useImperativeHandle as d,useState as u,useCallback as p}from"react";import h from"dayjs";import"dayjs/locale/zh-cn";import m from"dayjs/plugin/localeData";import f from"dayjs/plugin/advancedFormat";import g from"dayjs/plugin/customParseFormat";import v from"dayjs/plugin/quarterOfYear";import y from"dayjs/plugin/weekOfYear";import b from"dayjs/plugin/weekday";import{ConfigProvider as x,Button as E,Tooltip as S,Popconfirm as w,Space as C,Empty as N,Spin as T,Upload as I,message as R,Input as O,Tabs as k,Drawer as L,Modal as A,Form as P,Row as _,Col as H,Select as F,Checkbox as D,Dropdown as $,InputNumber as M,Rate as q,Radio as j,Switch as V,Tag as K,TreeSelect as z,Cascader as W,notification as B,Image as U,Tree as G,Menu as Y,Popover as X,Pagination as Q,Slider as Z}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 J from"dayjs/plugin/weekYear";import ee from"antd/es/calendar/generateCalendar";import"antd/es/calendar/style";import te from"antd/es/date-picker/generatePicker";import"antd/es/date-picker/style/index";import ne from"antd/es/locale/zh_CN";import re from"antd/es/locale/en_GB";import{isArray as ie,isPlainObject as ae,isNumber as le,isFunction as oe,isString as se,isUndefined as ce,get as de,transform as ue,isEqual as pe,set as he,xor as me,isRegExp as fe,merge as ge,uniqBy as ve,debounce as ye,intersection as be,map as xe,groupBy as Ee,flatten as Se,spread as we,mergeWith as Ce,isDate as Ne,omitBy as Te,sumBy as Ie,maxBy as Re,minBy as Oe,union as ke,pickBy as Le,throttle as Ae}from"lodash-es";import Pe from"classnames";import{UpOutlined as _e,DownOutlined as He,UploadOutlined as Fe,PaperClipOutlined as De,EditOutlined as $e,CheckOutlined as Me,EyeOutlined as qe,DownloadOutlined as je,DeleteOutlined as Ve,FullscreenExitOutlined as Ke,FullscreenOutlined as ze,HolderOutlined as We,UnorderedListOutlined as Be,SearchOutlined as Ue,CloseOutlined as Ge,ExclamationCircleOutlined as Ye,ReloadOutlined as Xe,ZoomInOutlined as Qe,ZoomOutOutlined as Ze,RotateRightOutlined as Je,RotateLeftOutlined as et,InboxOutlined as tt,InfoCircleFilled as nt,PrinterOutlined as rt,ImportOutlined as it,SettingOutlined as at,CopyOutlined as lt,CheckSquareOutlined as ot,CloseCircleOutlined as st,MonitorOutlined as ct,PlusOutlined as dt,PieChartOutlined as ut,FunnelPlotOutlined as pt,AppstoreAddOutlined as ht,StepBackwardOutlined as mt,StepForwardOutlined as ft,InfoCircleOutlined as gt,ClearOutlined as vt,PauseOutlined as yt,CaretRightOutlined as bt,QuestionCircleOutlined as xt,MenuOutlined as Et,BorderOutlined as St,RightOutlined as wt,LeftOutlined as Ct}from"@ant-design/icons";import Nt from"react-countup";import Tt from"resize-observer-polyfill";import It from"sortablejs";import Rt from"add-dom-event-listener";import Ot from"scroll-into-view-if-needed";import kt from"react-draggable";import Lt from"memoize-one";import*as At from"prop-types";import Pt from"prop-types";import _t from"cropperjs";import Ht from"big.js";import Ft from"react-dom";import Dt from"copy-to-clipboard";import $t from"@rc-component/portal";import Mt from"@rc-component/trigger";import qt from"html2canvas";import{ReactSortable as jt}from"react-sortablejs";import Vt from"localforage";import Kt from"exceljs";import zt from"china-area-data";const Wt=n({locale:"zh-cn",size:"middle"});var Bt={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?",shortcutKey:"快捷键"},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:"删除文件",batchDownload:"批量下载"},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 Ut=Bt;function Gt(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const Yt=(...e)=>{const[t,n]=e;let r;const i=t.split(".");let a=Ut;for(let e=0,t=i.length;e<t;e++){if(r=a[i[e]],e===t-1)return Gt(r,n);if(!r)return"";a=r}return""},Xt=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((n,r)=>(n[r]=void 0!==t[r]?t[r]:e[r],n)),{})),Qt=(t,n)=>{const r=e.useRef(!0);e.useLayoutEffect((()=>t(r.current)),n),e.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function Zt(e,t){Qt((t=>{if(!t)return e()}),t)}h.extend(m),h.extend(f),h.extend(g),h.extend(v),h.extend(y),h.extend(b);var Jt={},en=[];function tn(e,t){if(!e&&void 0!==console){var n=en.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function nn(e,t){if(!e&&void 0!==console){var n=en.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function rn(e,t,n){t||Jt[n]||(e(!1,n),Jt[n]=!0)}function an(e,t){rn(tn,e,t)}function ln(e,t){rn(nn,e,t)}an.preMessage=function(e){en.push(e)},an.resetWarned=function(){Jt={}},an.noteOnce=ln,h.extend(g),h.extend(f),h.extend(b),h.extend(m),h.extend(y),h.extend(J),h.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 on={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"},sn=function(e){return on[e]||e.split("_")[0]},cn=function(){ln(!1,"Not match any format. Please help to fire a issue about this.")},dn={getNow:function(){return h()},getFixedDate:function(e){return h(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 h().locale(sn(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(sn(e)).weekday(0)},getWeek:function(e,t){return t.locale(sn(e)).week()},getShortWeekDays:function(e){return h().locale(sn(e)).localeData().weekdaysMin()},getShortMonths:function(e){return h().locale(sn(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(sn(e)).format(n)},parse:function(e,t,n){for(var r=sn(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=h(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 cn(),null}var p=h(l,a).locale(r);if(p.isValid())return p}return t&&cn(),null}}};const un=ee(dn),pn=te(dn);function hn(){return hn=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},hn.apply(null,arguments)}const mn=e.forwardRef(((t,n)=>e.createElement(pn,hn({},t,{picker:"time",mode:void 0,ref:n}))));mn.displayName="TimePicker";const fn=e.forwardRef(((t,n)=>e.createElement(pn.RangePicker,hn({},t,{picker:"time",mode:void 0,ref:n}))));fn.displayName="RangePicker",mn.RangePicker=fn;var gn={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?",shortcutKey:"Shortcut Key"},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",batchDownload:"Batch download"},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 vn={[gn.name]:{qm:gn,antd:re},[Bt.name]:{qm:Bt,antd:ne}},yn=e=>{const n=Xt({locale:"zh-cn",size:"middle"},e),{locale:r,size:i,global:a}=n;t.useMemo((()=>{return e=Object.assign({},vn,null==a?void 0:a.langPackage)[r].qm,Ut=e||Ut,void(Ut.name&&h.locale(Ut.name));var e}),[r]);const l=t.useMemo((()=>Object.assign({},vn,null==a?void 0:a.langPackage)),[a]),[o,s]=t.useState({locale:r,size:i,global:a});return Zt((()=>{s((e=>Object.assign({},e,{locale:r,size:i})))}),[i,r]),t.createElement(Wt.Provider,{value:o},t.createElement(x,{locale:l[o.locale].antd,componentSize:o.size,autoInsertSpaceInButton:null==a?void 0:a.autoInsertSpaceInButton},n.children))};function bn(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 xn(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 En(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())}))}function Sn(){const{locale:t}=e.useContext(Wt);return{t:Yt,$locale:t}}function wn(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 Cn(t){const{size:n}=e.useContext(Wt);return{$size:e.useMemo((()=>{var e,r;return null!==(r=null!==(e=t.size)&&void 0!==e?e:n)&&void 0!==r?r:""}),[t.size,n])}}yn.displayName="QmConfigProvider";var Nn="undefined"==typeof window;const Tn=e=>t.isValidElement(e),In=e=>Tn(e)&&e.type===t.Fragment,Rn=()=>{},On=()=>!0,kn=e=>En(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),Ln=e=>{Promise.resolve().then(e)},An=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),Pn=e=>!!(!e&&0!==e||ie(e)&&!e.length||ae(e)&&!Object.keys(e).length),_n=(e,t)=>{const n=Object.assign({},e);for(const e of t)delete n[e];return n};const Hn=(e,t=new WeakMap)=>{if(ae(e)||ie(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]=Hn(e[a],t)})),r}return e},Fn=e=>le(e)?`${e}px`:e.toString();class Dn extends Error{constructor(e){super(e),this.name="QmDesignError"}}function $n(e,t){throw new Dn(`[${e}] ${t}`)}function Mn(e,t){console.warn(new Dn(`[${e}] ${t}`))}const qn=e=>{const{loading:n,shortcutKey:r,authConfig:i,click:a,confirm:l}=e,{t:o}=Sn(),{$size:s}=Cn(e);t.useEffect((()=>(r&&document.addEventListener("keyup",u),()=>document.removeEventListener("keyup",u))),[]);const[c,d]=t.useState(!1),u=wn((e=>{var t;const n=r.split("+").map((e=>e.trim().toLowerCase())),i=n.includes("alt"),a=n.includes("ctrl"),l=n.includes("shift"),o=n[n.length-1];i&&!e.altKey||a&&!e.ctrlKey||l&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),h.disabled||null===(t=h.onClick)||void 0===t||t.call(h,e))})),p=oe(a)?{onClick:t=>En(void 0,void 0,void 0,(function*(){var n;d(!0);try{yield null===(n=e.click)||void 0===n?void 0:n.call(e,t)}catch(e){Mn("Button","`click`方法执行出错")}d(!1)}))}:null,h=Object.assign(Object.assign(Object.assign({},_n(e,["shortcutKey","authConfig","click","confirm"])),{size:s,loading:c||n||!1}),p);if(i){const{visible:e=1,disabled:t}=i||{};if(!e)return null;t&&(h.disabled=!0)}const m=t.createElement(E,h,e.children);return l?t.createElement(w,{title:l.title||o("qm.button.confirmTitle"),disabled:h.disabled,onConfirm:e=>{var t,n;null===(t=l.onConfirm)||void 0===t||t.call(l),null===(n=h.onClick)||void 0===n||n.call(h,e)},onCancel:e=>{var t;null===(t=l.onCancel)||void 0===t||t.call(l,e)}},t.createElement(E,hn({},h,{onClick:Rn}),e.children)):!r||h.disabled?m:t.createElement(S,{placement:"top",title:`${o("qm.button.shortcutKey")}: ${r}`},m)};var jn;qn.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(jn||(jn={}));const Vn=e=>{const{$size:n}=Cn(e),r=le(e.size)?e.size:jn[n||"default"],i=Object.assign(Object.assign({},_n(e,["size"])),{size:r});return t.createElement(C,i,e.children)};Vn.displayName="QmSpace";const Kn=e=>`qm-${e}`,zn=e=>{const{label:n,extra:r,collapse:i,bordered:a=!0,disabled:l,id:o,className:s,style:c,onCollapseChange:d}=e,{$size:u}=Cn(e),{t:p}=Sn(),h=Kn("divider"),m={[h]:!0,[`${h}-borderless`]:!a,[`${h}--lg`]:"large"===u,[`${h}--sm`]:"small"===u};return t.createElement("div",{id:o,className:Pe(m,s),style:c},t.createElement("span",{className:`${h}__title`},n),t.createElement("div",{className:`${h}__extra`},r),void 0!==i&&t.createElement(E,{type:"link",className:`${h}__collapse`,disabled:l,onClick:()=>{null==d||d(!i)}},p(i?"qm.divider.collect":"qm.divider.spread"),i?t.createElement(_e,null):t.createElement(He,null)))};zn.displayName="QmDivider";const Wn=()=>({height:0,opacity:0}),Bn=(e,t)=>"height"===t.propertyName,Un={motionName:"rc-collapse-motion",onEnterStart:Wn,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:Wn,onEnterEnd:Bn,onLeaveEnd:Bn,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"};function Gn(e){return Gn="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},Gn(e)}function Yn(e){var t=function(e,t){if("object"!==Gn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Gn(t)?t:String(t)}function Xn(e,t,n){return(t=Yn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qn(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 Zn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qn(Object(n),!0).forEach((function(t){Xn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jn(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 er(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 Jn(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)?Jn(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 tr(e){return e instanceof HTMLElement||e instanceof SVGElement}function nr(e){var n,r=function(e){return e&&"object"===Gn(e)&&tr(e.nativeElement)?e.nativeElement:tr(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=Ft.findDOMNode)||void 0===n?void 0:n.call(Ft,e):null)}var rr,ir={exports:{}},ar={};ir.exports=(rr||(rr=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,N=i,T=d,I=u,R=!1,O=!1;ar.ContextConsumer=g,ar.ContextProvider=v,ar.Element=y,ar.ForwardRef=b,ar.Fragment=x,ar.Lazy=E,ar.Memo=S,ar.Portal=w,ar.Profiler=C,ar.StrictMode=N,ar.Suspense=T,ar.SuspenseList=I,ar.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},ar.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},ar.isContextConsumer=function(e){return f(e)===o},ar.isContextProvider=function(e){return f(e)===l},ar.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ar.isForwardRef=function(e){return f(e)===c},ar.isFragment=function(e){return f(e)===r},ar.isLazy=function(e){return f(e)===h},ar.isMemo=function(e){return f(e)===p},ar.isPortal=function(e){return f(e)===n},ar.isProfiler=function(e){return f(e)===a},ar.isStrictMode=function(e){return f(e)===i},ar.isSuspense=function(e){return f(e)===d},ar.isSuspenseList=function(e){return f(e)===u},ar.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)},ar.typeOf=f}()),ar);var lr=function(e,t){"function"==typeof e?e(t):"object"===Gn(e)&&e&&"current"in e&&(e.current=t)},or=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){lr(t,e)}))}},sr=function(e){var t,n,r=ir.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===ir.exports.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===ir.exports.ForwardRef)};function cr(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(r.split(".")[0]);var dr=e.createContext({});function ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pr(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,Yn(r.key),r)}}function hr(e,t,n){return t&&pr(e.prototype,t),n&&pr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mr(e,t){return mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mr(e,t)}function fr(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&&mr(e,t)}function gr(e){return gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gr(e)}function vr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yr(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=gr(e);if(t){var i=gr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Gn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return vr(e)}(this,n)}}var br=function(t){fr(r,e.Component);var n=yr(r);function r(){return ur(this,r),n.apply(this,arguments)}return hr(r,[{key:"render",value:function(){return this.props.children}}]),r}();function xr(t){var n=e.useRef(!1),r=er(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 Er="none",Sr="appear",wr="enter",Cr="leave",Nr="none",Tr="prepare",Ir="start",Rr="active",Or="end",kr="prepared";function Lr(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Ar(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 Pr,_r,Hr,Fr=(Pr=Lr(),_r="undefined"!=typeof window?window:{},Hr={animationend:Ar("Animation","AnimationEnd"),transitionend:Ar("Transition","TransitionEnd")},Pr&&("AnimationEvent"in _r||delete Hr.animationend.animation,"TransitionEvent"in _r||delete Hr.transitionend.transition),Hr),Dr={};if(Lr()){var $r=document.createElement("div");Dr=$r.style}var Mr={};function qr(e){if(Mr[e])return Mr[e];var t=Fr[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 Dr)return Mr[e]=t[a],Mr[e]}return""}var jr=qr("animationend"),Vr=qr("transitionend"),Kr=!(!jr||!Vr),zr=jr||"animationend",Wr=Vr||"transitionend";function Br(e,t){return e?"object"===Gn(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var Ur=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(Wr,i),e.removeEventListener(zr,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(Wr,i),e.addEventListener(zr,i),n.current=e)},l]},Gr=Lr()?l:o,Yr=function(e){return+setTimeout(e,16)},Xr=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Yr=function(e){return window.requestAnimationFrame(e)},Xr=function(e){return window.cancelAnimationFrame(e)});var Qr=0,Zr=new Map;function Jr(e){Zr.delete(e)}var ei=function(e){var t=Qr+=1;return function n(r){if(0===r)Jr(t),e();else{var i=Yr((function(){n(r-1)}));Zr.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};ei.cancel=function(e){var t=Zr.get(e);return Jr(e),Xr(t)},ei.ids=function(){return Zr};var ti=[Tr,Ir,Rr,Or],ni=[Tr,kr],ri=!1,ii=!0;function ai(e){return e===Rr||e===Or}var li=function(t,n,r){var i=er(xr(Nr),2),a=i[0],l=i[1],o=function(){var t=e.useRef(null);function n(){ei.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=ei((function(){i<=1?r({isCanceled:function(){return a!==t.current}}):e(r,i-1)}));t.current=a},n]}(),s=er(o,2),c=s[0],d=s[1];var u=n?ni:ti;return Gr((function(){if(a!==Nr&&a!==Or){var e=u.indexOf(a),t=u[e+1],n=r(a);n===ri?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(Tr,!0)},a]};var oi=function(t){var n=t;"object"===Gn(t)&&(n=t.transitionSupport);var r=e.forwardRef((function(t,r){var i=t.visible,l=void 0===i||i,s=t.removeOnLeave,c=void 0===s||s,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(dr).motion),g=a(),v=a();var y=function(t,n,r,i){var l=i.motionEnter,s=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,N=i.onEnterEnd,T=i.onLeaveEnd,I=i.onVisibleChanged,R=er(xr(),2),O=R[0],k=R[1],L=er(xr(Er),2),A=L[0],P=L[1],_=er(xr(null),2),H=_[0],F=_[1],D=a(!1),$=a(null);function M(){return r()}var q=a(!1);function j(){P(Er,!0),F(null,!0)}function V(e){var t=M();if(!e||e.deadline||e.target===t){var n,r=q.current;A===Sr&&r?n=null==C?void 0:C(t,e):A===wr&&r?n=null==N?void 0:N(t,e):A===Cr&&r&&(n=null==T?void 0:T(t,e)),A!==Er&&r&&!1!==n&&j()}}var K=er(Ur(V),1)[0],z=function(e){var t,n,r;switch(e){case Sr:return Xn(t={},Tr,f),Xn(t,Ir,y),Xn(t,Rr,E),t;case wr:return Xn(n={},Tr,g),Xn(n,Ir,b),Xn(n,Rr,S),n;case Cr:return Xn(r={},Tr,v),Xn(r,Ir,x),Xn(r,Rr,w),r;default:return{}}},W=e.useMemo((function(){return z(A)}),[A]),B=er(li(A,!t,(function(e){if(e===Tr){var t=W[Tr];return t?t(M()):ri}var n;return G in W&&F((null===(n=W[G])||void 0===n?void 0:n.call(W,M(),null))||null),G===Rr&&(K(M()),h>0&&(clearTimeout($.current),$.current=setTimeout((function(){V({deadline:!0})}),h))),G===kr&&j(),ii})),2),U=B[0],G=B[1],Y=ai(G);q.current=Y,Gr((function(){k(n);var e,r=D.current;D.current=!0,!r&&n&&d&&(e=Sr),r&&n&&s&&(e=wr),(r&&!n&&p||!r&&m&&!n&&p)&&(e=Cr);var i=z(e);e&&(t||i[Tr])?(P(e),U()):P(Er)}),[n]),o((function(){(A===Sr&&!d||A===wr&&!s||A===Cr&&!p)&&P(Er)}),[d,s,p]),o((function(){return function(){D.current=!1,clearTimeout($.current)}}),[]);var X=e.useRef(!1);o((function(){O&&(X.current=!0),void 0!==O&&A===Er&&((X.current||O)&&(null==I||I(O)),X.current=!0)}),[O,A]);var Q=H;return W[Tr]&&G===Ir&&(Q=Zn({transition:"none"},Q)),[A,G,Q,null!=O?O:n]}(f,l,(function(){try{return g.current instanceof HTMLElement?g.current:nr(v.current)}catch(e){return null}}),t),b=er(y,4),x=b[0],E=b[1],S=b[2],w=b[3],C=e.useRef(w);w&&(C.current=!0);var N,T=e.useCallback((function(e){g.current=e,lr(r,e)}),[r]),I=Zn(Zn({},m),{},{visible:l});if(u)if(x===Er)N=w?u(Zn({},I),T):!c&&C.current&&h?u(Zn(Zn({},I),{},{className:h}),T):d||!c&&!h?u(Zn(Zn({},I),{},{style:{display:"none"}}),T):null;else{var R,O;E===Tr?O="prepare":ai(E)?O="active":E===Ir&&(O="start");var k=Br(p,"".concat(x,"-").concat(O));N=u(Zn(Zn({},I),{},{className:Pe(Br(p,x),(R={},Xn(R,k,k&&O),Xn(R,p,"string"==typeof p),R)),style:S}),T)}else N=null;e.isValidElement(N)&&sr(N)&&(N.ref||(N=e.cloneElement(N,{ref:T})));return e.createElement(br,{ref:v},N)}));return r.displayName="CSSMotion",r}(Kr);function si(){return si=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},si.apply(this,arguments)}var ci="add",di="keep",ui="remove",pi="removed";function hi(e){var t;return Zn(Zn({},t=e&&"object"===Gn(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function mi(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(hi)}var fi=["component","children","onVisibleChanged","onAllRemoved"],gi=["status"],vi=["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]:oi,r=function(t){fr(i,e.Component);var r=yr(i);function i(){var e;ur(this,i);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return Xn(vr(e=r.call.apply(r,[this].concat(n))),"state",{keyEntities:[]}),Xn(vr(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:Zn(Zn({},e),{},{status:pi})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==pi})).length})),e}return hr(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=cr(i,fi),d=a||e.Fragment,u={};return vi.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=cr(r,gi),c=i===ci||i===di;return e.createElement(n,si({},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=mi(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=mi(e),l=mi(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 Zn(Zn({},e),{},{status:ci})}))),r=a),n.push(Zn(Zn({},o),{},{status:di})),r+=1,t=!0;break}}t||n.push(Zn(Zn({},e),{},{status:ui}))})),r<i&&(n=n.concat(l.slice(r).map((function(e){return Zn(Zn({},e),{},{status:ci})}))));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!==ui}))).forEach((function(t){t.key===e&&(t.status=di)}))})),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!==pi||e.status!==ui}))}}}]),i}();Xn(r,"defaultProps",{component:"div"})}(Kr);const yi=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=Kn("collapse");return t.createElement("div",{ref:n,className:Pe(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},i),style:a},t.createElement("div",{className:`${d}-content-box`,style:l},e.children))}));yi.displayName="PanelContent";const bi=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=Kn("collapse"),g=Pe({[`${f}`]:!0,[`${f}-active`]:h,[`${f}-disabled`]:c},a);return t.createElement("div",{className:g,style:l},t.createElement(zn,{label:r,extra:i,collapse:h,bordered:s,disabled:c,onCollapseChange:e=>{m(e),null==p||p(e)}}),t.createElement(oi,hn({visible:h},Un,{leavedClassName:`${f}-content-hidden`,forceRender:d,removeOnLeave:u}),(({className:n,style:r},i)=>t.createElement(yi,{ref:i,prefixCls:f,className:n,style:r,boxStyle:o,isActive:h,forceRender:d},e.children))))};bi.displayName="QmCollapse";const xi=t.createContext(void 0);function Ei(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 Si=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},wi=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},Ci=e=>e.preventDefault(),Ni=(e,t)=>{if(Nn||!e||!t)return null;"float"===(t=An(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]}},Ti=(e,t,n)=>{!Nn&&e&&t&&(ae(t)?Object.keys(t).forEach((n=>{Ti(e,n,t[n])})):(t=An(t),e.style[t]=n))},Ii=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Ri=(e,t)=>Math.abs(Ii(e)-Ii(t)),Oi=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}},ki=(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},Li=(e,t)=>{if(Nn||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},Ai=e=>Math.pow(e,3),Pi=e=>e<.5?Ai(2*e)/2:1-Ai(2*(1-e))/2,_i=e=>{const{minValues:n,onDragChange:r,onDragging:i}=e,{splitRef:a,direction:l}=t.useContext(xi),{t:o}=Sn(),s=t.useRef(Nn?null:document.onselectstart),c=t.useMemo((()=>"horizontal"===l),[l]),d=t.useMemo((()=>c?"X":"Y"),[c]),u=t.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),p=e=>{u.current=Object.assign({},u.current,e)},h=e=>{if(1!==e.buttons)return m();const t=e[`page${d}`]-u.current[`start${d}`],r=[n[0],u.current[`containerSize${d}`]-n[1]];let a=u.current[`firstElementSize${d}`]+t;a=Math.max(r[0],a),a=Math.min(r[1],a),i(a)},m=()=>{p({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),wi(document,"mousemove",h),wi(document,"mouseup",m),f()},f=()=>{document.onselectstart!==s.current&&(document.onselectstart=s.current)},g={[`${Kn("split")}__resize-bar`]:!0,vertical:"vertical"===l,horizontal:"horizontal"===l};return t.createElement("div",{className:Pe(g),title:o("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];p({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),Si(document,"mousemove",h),Si(document,"mouseup",m),r(!0),s.current=document.onselectstart,document.onselectstart=()=>!1}})};_i.displayName="ResizeBar";const Hi=t.forwardRef(((e,n)=>{const{offset:r,className:i,style:a}=e,{direction:l,dragging:o}=t.useContext(xi),s="vertical"===l?"height":"width",c={[Kn("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===l,vertical:"vertical"===l,[i]:!!i},d=void 0!==r?{[s]:Fn(r)}:{flex:1,[s]:0};return t.createElement("div",{ref:n,className:Pe(c),style:Object.assign(Object.assign({},d),a)},e.children)}));Hi.displayName="SplitPane";const Fi=e=>{const{direction:n="horizontal",defaultValue:r="50%",uniqueKey:i,className:a,style:l,onDragStart:o,onDrag:s=Rn,onDragEnd:c}=e,{global:d}=t.useContext(Wt),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));Ei((()=>{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=>En(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)=>En(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]),N=[];t.Children.map(e.children,(e=>{var t;Tn(e)&&!In(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const[T,I]=N,R=t.useMemo((()=>[f(T),f(I)]),[T,I]),O={[Kn("split")]:!0,vertical:"vertical"===n};return t.createElement(xi.Provider,{value:C},t.createElement("div",{ref:u,className:Pe(O,a),style:l},t.createElement(Hi,hn({},T.props,{ref:p,offset:b})),t.createElement(_i,{minValues:R,onDragChange:e=>y(e),onDragging:e=>{x(`${e}px`),s(e)}}),t.createElement(Hi,I.props)))};Fi.displayName="QmSplit",Fi.Pane=Hi;const Di=e=>{const{className:n,style:r}=e,{$size:i}=Cn(e),a=Kn("countup"),l={[a]:!0,[`${a}--lg`]:"large"===i,[`${a}--sm`]:"small"===i};return t.createElement(Nt,hn({},e,{className:Pe(l,n),style:r}),e.children)};Di.displayName="QmCountup";const $i=e=>{const{className:n}=e,{$size:r}=Cn(e),i=Kn("empty"),a=Object.assign(Object.assign({},e),{image:N.PRESENTED_IMAGE_SIMPLE}),l={[i]:!0,[`${i}--lg`]:"large"===r,[`${i}--sm`]:"small"===r};return t.createElement(N,hn({},a,{className:Pe(l,n)}))};$i.displayName="QmEmpty";const Mi=e=>{const n=Xt({tip:"Loading..."},e),{fullHeight:r,className:i,style:a}=n,l=Kn("spin"),o={[l]:!0,[`${l}-fullHeight`]:!!r},s=Object.assign(Object.assign({wrapperClassName:Pe(o,i)},_n(n,["fullHeight"])),{style:Object.assign(Object.assign({},a),{maxHeight:"none"})});return t.createElement(T,s,n.children)};Mi.displayName="QmSpin";const qi=t.createContext(void 0),ji=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},Vi=function(e,t){!Nn&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new Tt(ji),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},Ki=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 zi(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&&Vi(e,n),()=>{e&&Ki(e,n)}}),[t]),n}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=Rn}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=t.useContext(qi),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 Si(e,"mousemove",C),Si(e,"mouseleave",N),()=>{w(),wi(document,"mouseup",S),wi(e,"mousemove",C),wi(e,"mouseleave",N)}}),[]);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},wi(document,"mousemove",E),wi(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)},N=()=>{v.current=!0,x(g.current)},T=Kn("scrollbar"),I={[`${T}__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:Pe(I,i),style:R},t.createElement("div",{ref:m,className:`${T}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),Si(document,"mousemove",E),Si(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=zi(u),E=zi(h);Zt((()=>{!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)=>{le(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)*Pi(l),i(a)):e.scrollTop=t};i(a)})(p.current,e):p.current.scrollTop=e:Mn("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},N=(e,t)=>{le(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)*Pi(l),i(a)):e.scrollLeft=t};i(a)})(p.current,e):p.current.scrollLeft=e:Mn("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:N}}));const T=t.useMemo((()=>({dragging:y,scrollbarElement:u,wrapElement:p})),[y]),I=Kn("scrollbar"),R={[`${I}__wrap`]:!0,[`${I}__wrap--hidden`]:!o};return t.createElement("div",{ref:u,className:Pe(I,e.className),style:e.style},t.createElement("div",{ref:p,className:Pe(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(qi.Provider,{value:T},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 Qi=(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}},Zi=(e,{fileName:t,headers:n,params:r})=>En(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(Yt("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));Qi(o,c)})),Ji=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},ea=e=>{var n,r;const i=Xt({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:a=[],fileDirection:l="vertical",batchDownload:o,draggable:s,editable:c,disabled:d,readOnly:u,button:p={},className:h,onPreview:m,onSortChange:f,onEditChange:g,onChange:v}=i,{t:y}=Sn(),{$size:b}=Cn(i),x=t.useRef(null),S=t.useRef(null),[w,C]=t.useState({}),N=t.useMemo((()=>d||u),[d,u]);t.useEffect((()=>(L(),()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.destroy()})),[]);const T=(e,t)=>{C((n=>Object.assign({},n.actived,{[e]:null!=t?t:!n.actived[e]})))},k=wn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...a],[r]=e.splice(t,1);e.splice(n,0,r),null==f||f(e),null==v||v({fileList:e})}})),L=()=>{s&&(S.current=It.create(ki(x.current,Kn("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:k}))},A=e=>En(void 0,void 0,void 0,(function*(){const{downloadWithHeaders:t,headers:n}=i;try{e.url&&(yield Zi(e.url,Object.assign({fileName:e.name},t?{headers:n}:null)))}catch(e){R.error(y("qm.download.error"))}})),P=Kn("upload-file"),_={[P]:!0,[`${P}--lg`]:"large"===b,[`${P}--sm`]:"small"===b,[`${P}--horizontal`]:"horizontal"===l};return t.createElement(I,hn({className:Pe(_,h)},_n(i,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((n,r)=>En(void 0,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:l,maxCount:o,fileList:s=[],beforeUpload:c}=i,d=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!l||e.size/1024/1024<l,p=!(o>1)||s.length<o,h=d&&u&&p;if(d||R.warning(y("qm.upload.tooltip",{type:a.join(",")})),u||R.warning(y("qm.upload.sizeLimit",{size:l})),p||R.warning(y("qm.upload.countLimit",{count:o})),!h)return I.LIST_IGNORE;if(c){const i=c(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)})))),disabled:N,onChange:v,onPreview:e=>En(void 0,void 0,void 0,(function*(){if("function"==typeof m)return m(e,(t=>A(t||e)));d||(yield A(e))})),onDownload:e=>En(void 0,void 0,void 0,(function*(){yield A(e)})),itemRender:(e,n,r,l)=>((e,n)=>{const{iconRender:r}=i,{uid:l,name:o,url:u,status:p="done"}=e,h="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return t.createElement("div",{className:Pe("ant-upload-list-item",`ant-upload-list-item-${p}`,"ant-upload-list-item-list-type-text",{handle:s})},t.createElement("div",{className:"ant-upload-list-item-info"},t.createElement("span",{className:"ant-upload-span"},t.createElement("div",{className:"ant-upload-text-icon"},r?r(e):t.createElement(De,null)),t.createElement("div",{className:"ant-upload-list-item-name"},w[l]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:Ji(o),onBlur:t=>{const{value:n}=t.target;if(n!==Ji(o)){const t=Object.assign({},e,{name:n}),r=a.map((e=>e.uid!==l?e:t));null==g||g(t,r),null==v||v({file:t,fileList:r})}T(l,!1)}}):t.createElement("a",{rel:"noreferrer",target:"_blank",title:o,href:u,onClick:e=>{e.preventDefault(),c?N||T(l,!0):n.preview()}},o)),t.createElement("span",{className:"ant-upload-list-item-card-actions"},c&&!N&&t.createElement("button",{type:"button",className:h,onClick:()=>T(l)},w[l]?t.createElement(Me,null):t.createElement($e,null)),c&&t.createElement("button",{type:"button",className:h,onClick:()=>n.preview()},t.createElement(qe,null)),t.createElement("button",{type:"button",className:h,disabled:d,onClick:()=>n.download()},t.createElement(je,null)),t.createElement("button",{type:"button",className:h,disabled:N,onClick:()=>n.remove()},t.createElement(Ve,null))))))})(n,l)}),t.createElement("span",{className:"inner",ref:x},i.children||u&&a.length?i.children:t.createElement(E,{type:null!==(n=p.type)&&void 0!==n?n:"default",icon:null!==(r=p.icon)&&void 0!==r?r:t.createElement(Fe,null),disabled:N},p.text||y("qm.upload.text")),o&&!!a.length&&t.createElement(E,{disabled:d,style:{marginLeft:8},onClick:e=>En(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof o)yield o(a);else for(const e of a)yield A(e)}))},y("qm.upload.batchDownload"))))};ea.displayName="QmUploadFile";const ta=e=>{const n=Xt({icon:t.createElement(je,null),withCredentials:!1},e),{$size:r}=Cn(n),{t:i}=Sn(),[a,l]=t.useState(!1),o=_n(n,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t.createElement(E,hn({},o,{size:r,loading:a,onClick:()=>En(void 0,void 0,void 0,(function*(){var e;l(!0);try{const{action:e,fileName:t,headers:r,params:a,beforeDownload:l=On,onSuccess:o}=n,s=se(e)?e:yield En(void 0,void 0,void 0,(function*(){const e=n.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!s)return Mn("Download","参数 `action` 有误!");if(!l(s))return;yield Zi(s,{fileName:t,headers:r,params:a}),yield kn(100),null==o||o(),R.success(i("qm.download.success"))}catch(t){null===(e=n.onError)||void 0===e||e.call(n,t),R.error(i("qm.download.error"))}l(!1)}))}),n.children||i("qm.download.text"))};function na(t,n){const r=e.useRef(null),i=e.useRef(0);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{const r=Date.now();(!i.current||r-i.current>n)&&(t.apply(this,e),i.current=r)}),[t,n])}ta.displayName="QmDownload";const ra=e=>{const{activeKey:n,labels:r,onTabClick:i}=e;return t.createElement(t.Fragment,null,r.map(((e,r)=>{const a={item:!0,actived:r===n};return t.createElement("div",{key:r,className:Pe(a),onClick:e=>i(r,e)},t.createElement("span",null,e))})))},ia=e=>{const{label:n,showDivider:r,className:i,style:a}=e,l={[Kn("anchor-item")]:!0};return t.createElement("div",{className:Pe(l,i),style:a},r&&t.createElement(zn,{label:n,style:{marginBottom:10}}),e.children)};ia.displayName="AnchorItem";const aa=t.forwardRef(((e,n)=>{const{labelList:r=[],defaultActiveIndex:i,labelWidth:a,tabPosition:l="left",onTabClick:o,className:s,style:c}=e,{$size:d}=Cn(e),u=t.useRef(null),p=t.useRef(),h=t.useRef("ready"),m=t.useRef(0),[f,g]=t.useState(i||0),v=t.useMemo((()=>!!(null==r?void 0:r.length)),[r]);t.useEffect((()=>{y();const e=Rt(u.current,"scroll",E);return()=>{e.remove()}}),[]);const y=()=>{f>0&&(u.current.scrollTop=Ri(x(f),u.current))},b=e=>{const t=Math.abs(e),n=(v?r.map((e=>document.getElementById(e.id))):Array.from((null===(i=u.current)||void 0===i?void 0:i.children)||[])).map((e=>Ri(e,u.current)));var i;let a=-1;for(let e=0;e<n.length;e++){const r=n[e],i=n[e+1]||1e4;t>=r-1&&t<i&&(a=e)}return a},x=e=>v?document.getElementById(r[e].id):u.current.children[e],E=na((e=>{if("ready"!==h.current)return;const t=b(e.target.scrollTop);-1!==t&&g(t)}),60),S=e=>{const t=x(e);t&&(g(e),h.current="stop",p.current&&clearTimeout(p.current),Ot(t,{block:"start",behavior:"smooth",boundary:u.current}),p.current=setTimeout((()=>h.current="ready"),500))};t.useImperativeHandle(n,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>m.current?m.current:e,S(e)}})));const w=Kn("anchor"),C={[w]:!0,[`${w}-left`]:"left"===l,[`${w}-top`]:"top"===l,[`${w}--lg`]:"large"===d,[`${w}--sm`]:"small"===d},N=[];t.Children.map(e.children,(e=>{var t;Tn(e)&&!In(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const T=v?r.map((e=>e.label)):N.map((e=>e.props.label)),I=v?r.map((e=>e.id)):N.map(((e,t)=>e.props["data-id"]||t.toString()));return m.current=T.length,t.createElement("div",{className:Pe(C,s),style:c},t.createElement("div",{className:Pe("anchor-nav"),style:{width:a?Fn(a):""}},t.createElement(ra,{activeKey:f,labels:T,onTabClick:(e,t)=>{S(e),null==o||o({label:T[e],id:I[e]},t)}})),t.createElement("div",{ref:u,className:Pe("anchor-container")},v?e.children:N))}));aa.displayName="QmAnchor",aa.Item=ia;const la=e=>t.createElement(k.TabPane,e,e.children);la.displayName="TabPane";const oa=e=>{const n=Xt({tabPosition:"top"},e),{items:r,tabPosition:i,tabBarGutter:a,className:l,authConfig:o}=n,{$size:s}=Cn(n),c=Kn("tabs"),d={[c]:!0,[`${c}--lg`]:"large"===s,[`${c}--sm`]:"small"===s},u=Object.assign(Object.assign({},_n(n,["items","authConfig"])),{size:s,tabBarGutter:null!=a?a:["top","bottom"].includes(i)?30:0}),p=[];t.Children.map(n.children,(e=>{var t;Tn(e)&&!In(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&p.push(e)}));const h=r?[...r]:p.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(o){const{fieldList:e=[]}=o||{};for(let t=0;t<h.length;t++){const n=h[t],r=e.find((e=>e.dataIndex===n.key)),{visible:i=1,disabled:a}=r||{};i?a&&(n.disabled=!0):(h.splice(t,1),t--)}}return t.createElement(k,hn({},u,{items:h,className:Pe(d,l)}))};oa.displayName="QmTabs",oa.TabPane=la;const sa=t.forwardRef(((e,n)=>{var r;const i=Xt({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:a,open:l,className:o,loading:s,showHeader:c,showFullScreen:d,maskClosable:u,destroyOnClose:p,onClose:h,onClosed:m,onFullChange:f}=i,{global:g}=t.useContext(Wt),{$size:v}=Cn(i),y=t.useRef(null),b=t.useRef(null),x=t.useRef(!1),[E,S]=t.useState(!1),[w,C]=t.useState(!1),[N,T]=t.useState(!1);Ei((()=>{(null!=l?l:a)&&(!p&&x.current||ce(s)&&C(!0))}),[null!=l?l:a]),Ei((()=>{b.current&&Ti(b.current,E?{width:"100%"}:{width:Fn(i.width||"72%")})}),[E]);const I=()=>{b.current=ki(y.current,"ant-drawer-content-wrapper"),S(!E),null==f||f(!E)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>T(!0),STOP_LOADING:()=>T(!1)})));const R=Kn("drawer"),O={[R]:!0,"no-header":!c,[`${R}--lg`]:"large"===v,[`${R}--sm`]:"small"===v};return t.createElement(L,hn({},_n(i,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=l?l:a,maskClosable:null!==(r=null!=u?u:null==g?void 0:g.maskClosable)&&void 0!==r&&r,className:Pe(O,o),title:t.createElement(t.Fragment,null,t.createElement("span",{ref:y,className:"text"},c&&i.title),d&&t.createElement("button",{type:"button",className:"full-screen",onClick:I},t.createElement(E?Ke:ze))),footer:null,afterOpenChange:e=>{e?(x.current=!0,ce(s)&&setTimeout((()=>C(!1)),100)):(S(!1),null==m||m())},onClose:h}),i.children,(s||N||w)&&t.createElement(Mi,{spinning:!0,className:Pe("spinning")}))}));sa.displayName="QmDrawer";const ca="10vh";var da;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(da||(da={}));const ua=t.forwardRef(((e,n)=>{var r;const i=Xt({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:ca}},e),{visible:a,open:l,width:o,height:s,className:c,loading:d,draggable:u,showHeader:p,showFullScreen:h,maskClosable:m,destroyOnClose:f,bodyStyle:g,onFullChange:v,onClose:y,onClosed:b}=i,{global:x}=t.useContext(Wt),{$size:E}=Cn(i),S=t.createRef(),w=t.useRef(!1),C=t.useMemo((()=>`calc(100vh - ${ca} - ${ca} - ${da[p?E:"none"]}px)`),[E,p]),[N,T]=t.useState(!1),[I,R]=t.useState(!1),[O,k]=t.useState(!1),[L,P]=t.useState(!0),[_,H]=t.useState({left:0,top:0,bottom:0,right:0}),[F,D]=t.useState();Ei((()=>{if(null!=l?l:a){if(!f&&w.current||ce(d)&&R(!0),!f&&w.current)return;setTimeout((()=>{w.current=!0,ce(d)&&R(!1)}),400)}}),[null!=l?l:a]),Ei((()=>{D(N?{x:0,y:0}:void 0)}),[N]);const $=e=>{const t=ki(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body");N?(Ti(t,{width:Fn(o||"60%"),height:"auto",top:ca}),Ti(n,{height:s?Fn(s):C,maxHeight:"auto"===s?C:""})):(Ti(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Ti(n,{height:`calc(100vh - ${da[p?E:"none"]}px)`,maxHeight:""})),T(!N),null==v||v(!N)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>k(!0),STOP_LOADING:()=>k(!1)})));const M=Kn("modal"),q={height:s?Fn(s):C,maxHeight:"auto"===s?C:"",overflow:"auto"},j={[M]:!0,"no-header":!p,[`${M}--lg`]:"large"===E,[`${M}--sm`]:"small"===E};return t.createElement(A,hn({},_n(i,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=l?l:a,maskClosable:null!==(r=null!=m?m:null==x?void 0:x.maskClosable)&&void 0!==r&&r,className:Pe(j,c),title:t.createElement("div",{onMouseOver:()=>{L&&P(!1)},onMouseOut:()=>{P(!0)}},t.createElement("span",{className:"text"},p&&i.title),h&&t.createElement("button",{type:"button",className:"full-screen",onClick:$},t.createElement(N?Ke:ze))),footer:null,bodyStyle:Object.assign({},q,g),onCancel:y,afterClose:()=>{null==b||b(),T(!1)},modalRender:e=>t.createElement(kt,{nodeRef:S,bounds:_,position:F,disabled:!u||L||N,onStart:(e,t)=>((e,t)=>{const{clientWidth:n,clientHeight:r}=window.document.documentElement,i=S.current.getBoundingClientRect();i&&H({left:-i.left+t.x,right:n-(i.right-t.x)-1,top:-i.top+t.y,bottom:r-(i.bottom-t.y)-1})})(0,t)},t.createElement("div",{ref:S},e))}),i.children,(d||O||I)&&t.createElement(Mi,{spinning:!0,className:Pe("spinning")}))}));ua.displayName="QmModal";const pa=n(void 0),ha=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ma={operations:function(e){const t=e.split(" "),n=[];let r=0;n[r]=[];for(let e=0;e<t.length;e++)ha.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 fa=["==","<",">","<=",">=","!=","like","likes","in","nin"];var ga=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},va=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++)fa.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),fa.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return e=r.join(" ")};const ya=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,ba=["string","number","boolean","symbol"],xa=e=>ba.includes(typeof e),Ea=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Sa=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(ya,"\\$1"),"i");window.__query__=(...e)=>((e,t,n)=>{e=null!=e?e:"";let r=!0;switch(t){case"like":r=null!==e.toString().match(Sa(n));break;case"likes":r=n.split(/,|,/).some((t=>null!==e.toString().match(Sa(t))));break;case"in":xa(n)&&(n=[n]),Array.isArray(n)&&(r=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":xa(n)&&(n=[n]),Array.isArray(n)&&(r=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":r=(Ea(e)?e.slice(0,10):e)!=n;break;case"<":r=(Ea(e)?e.slice(0,10):e)<n;break;case"<=":r=(Ea(e)?e.slice(0,10):e)<=n;break;case">":r=(Ea(e)?e.slice(0,10):e)>n;break;case">=":r=(Ea(e)?e.slice(0,10):e)>=n;break;default:r=(Ea(e)?e.slice(0,10):e)==n}return r})(e[0],e[1],e[2]);const wa=ma.stringify,Ca=ma.array_format,Na=ga,Ta=(e,t,n)=>{let r=[];t=ma.replace_symbols(t);try{if(n){const n=new Function("record",`return ${va(t,"record")};`);r=il(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${va(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)n(e,t)&&r.push(e[t])}}catch(t){Mn("Table","组件 `initialFilter` 参数有误!"),r=e}return r},Ia=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Ia(e.children)):t.push(e)})),t},Ra=e=>e.filter((e=>(e.children&&(e.children=Ra(e.children)),!e.hidden&&!e.noAuth))),Oa=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Oa(e.children))})),t},ka=(e,t)=>e.map((e=>(e.children&&(e.children=ka(e.children,t)),null==t||t(e),e))),La=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=La(n.children,t);if(e)return e}}return null},Aa=e=>{const t=e.children;return t?t[0].children?Aa(t[0]):t[0]:e},Pa=e=>{const t=e.children;return t?t[t.length-1].children?Pa(t[t.length-1]):t[t.length-1]:e},_a=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ha=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=Ha(n.children,t);if(e)return e}}return null},Fa=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Fa(e.children))})),t},Da=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 Oa(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},$a=(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 $a(e.offsetParent,t,n)}return n},Ma=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,qa=(e,t)=>ue(e,((e,n,r)=>{pe(n,t[r])||(e[r]=ae(n)&&ae(t[r])?qa(n,t[r]):n)})),ja=(e,t)=>{var n;return null!==(n=de(e,t))&&void 0!==n?n:""},Va=(e,t,n,r)=>{r>=0&&null!=n&&(n=Number(n).toFixed(r)),he(e,t,null!=n?n:"")},Ka=(e,t)=>{if(!t.includes("|"))return ja(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(ja(e,t))})),n.every((e=>!e))?"":n.join(" | ")},za=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),Wa=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]}`:""}`},Ba=(e,t)=>{const n=e.toString();if(!za(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)},Ua=(e,t)=>e?h(e,t):null,Ga=(e,t)=>e?h(e).format(t):"",Ya=(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)}))},Xa=e=>{const n=[];if(t.isValidElement(e)){const{children:r}=e.props;t.Children.forEach(r,(e=>{n.push(...Xa(e))}))}else n.push(e);return n},Qa=e=>Xa(e).join(""),Za=e=>e.filter((e=>!e._group)),Ja=(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)?Ca(a.condition):wa(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])?Ca(l[e]):wa(l[e],"^")} and `}}n=n.slice(0,-1*r)}return n.replace(/\s+/g," ").trim()},el=(e=[],t=[])=>{const n={};return e.forEach((e=>{const r=JSON.stringify((e=>{const n=[];return t.forEach((t=>n.push(ja(e,t)))),n})(e));n[r]=n[r]||[],n[r].push(e)})),Object.keys(n).map((e=>n[e]))},tl=(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=tl(e[n].children,t);if(r)return[e[n],r].flat()}}},nl=(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=nl(e[n].children,t);if(r)return[e[n].rowKey,r].flat()}}},rl=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=rl(n.children,t);if(e)return e}if(t(n))return n}return null},il=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&il(e.children,t),t(e)||e.children&&e.children.length))),al=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),ll=e=>["","small","middle","large"].includes(e),ol=80,sl="1",cl="0",dl=400,ul=["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"],pl={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 hl,ml,fl;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(hl||(hl={})),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"}(ml||(ml={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(fl||(fl={}));const gl={items:Pt.arrayOf(Pt.shape({type:Pt.string.isRequired,fieldName:Pt.string.isRequired})),initialValues:Pt.object,initialExtras:Pt.object,layout:Pt.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!ll(e[t]||""))return $n("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:Pt.number,customClass:Pt.string,compactMode:Pt.bool,labelWidth:Pt.oneOfType([Pt.number,Pt.string]),labelAlign:Pt.oneOf(["left","right"]),labelWrap:Pt.bool,formType:Pt.oneOf(["default","search","onlyShow"]),disabled:Pt.bool,uniqueKey:Pt.string,defaultRows:Pt.number,defaultExpand:Pt.bool,searchButtonCols:Pt.number,scrollToFirstError:Pt.bool,authConfig:Pt.object,isAutoFocus:Pt.bool,isCollapse:Pt.bool,isFieldsDefine:Pt.bool,isSearchBtn:Pt.bool,isSubmitBtn:Pt.bool,fieldsChange:Pt.func,onValuesChange:Pt.func,onFieldsChange:Pt.func,onFinish:Pt.func,onFinishFailed:Pt.func,onReset:Pt.func,onCollapse:Pt.func},vl={layout:"horizontal",labelWidth:ol,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Rn,onFieldsChange:Rn,onFinish:Rn,onFinishFailed:Rn,onReset:Rn,onCollapse:Rn},yl=(e,t)=>{if(!e)return null;if(t===ml.week){const t=e.match(/^(\d{4})-(\d+)/);return t?h().year(Number(t[1])).week(Number(t[2])):null}if(t===ml.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?h().year(Number(t[1])).quarter(Number(t[2])):null}return h(e,t)},bl=(e,t)=>e?h(e).format(t):"",xl=e=>""===e||null==e,El=(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},Sl=(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]]},wl=(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]]},Cl=(e,t,n)=>e.map((e=>{const r={value:e[t],text:e[n]};return e.disabled&&(r.disabled=!0),ce(e.isLeaf)||(r.isLeaf=!!e.isLeaf),ce(e.selectable)||(r.selectable=!!e.selectable),Array.isArray(e.children)&&(r.children=Cl(e.children,t,n)),r})),Nl=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=Nl(n.children,t);if(e)return e}}return null},Tl=(e,t,n=0)=>{const r=[];return e.forEach((e=>{e.value==t.split(",")[n]&&r.push(e),Array.isArray(e.children)&&r.push(...Tl(e.children,t,n+1))})),r},Il=e=>Tn(e)||"string"==typeof e,Rl=e=>Tn(e)?Xa(e).join(""):null!=e?e:"",Ol=(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 kl={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 Ll="阿",Al="鿿",Pl=1,_l=2,Hl=3;let Fl,Dl=null;function $l(e){return e||null===Dl?("object"==typeof Intl&&Intl.Collator?(Fl=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Dl=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Dl=!1,Dl):Dl}function Ml(e){const t=kl.UNIHANS,n=kl.PINYINS,r=kl.EXCEPTIONS,i={source:e};if(e in r)return i.type=_l,i.target=r[e],i;let a,l=-1;if(e.charCodeAt(0)<256)return i.type=Pl,i.target=e,i;if(a=Fl.compare(e,Ll),a<0)return i.type=Hl,i.target=e,i;if(0===a)i.type=_l,l=0;else{if(a=Fl.compare(e,Al),a>0)return i.type=Hl,i.target=e,i;0===a&&(i.type=_l,l=t.length-1)}if(i.type=_l,l<0){let n=0,r=t.length-1;for(;n<=r;){l=~~((n+r)/2);const i=t[l];if(a=Fl.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=Hl,i.target=i.source),i}function ql(e){return"string"==typeof e&&$l()?e.split("").map((e=>Ml(e))):e}var jl={isSupported:$l,parse:ql,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(kl)})))},genToken:Ml,convertToPinyin:(e,t,n)=>ql(e).map((e=>t&&e.type===_l?e.target.toLowerCase():e.target)).join(n||"")};var Vl={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)}};jl.isSupported()&&Vl.shouldPatch(jl.genToken)&&jl.patchDict(Vl);const Kl=e=>{const{value:n,bordered:r}=e;return t.createElement(O,{value:n,title:n,bordered:r,readOnly:!0})};Kl.displayName="FormItemView";const{Option:zl}=F,Wl=e=>{const{$$form:n}=t.useContext(pa),{value:r,items:i,multiple:a,loading:l,onChange:o,onValuesChange:s}=e,{t:c}=Sn(),{fieldName:d,options:u={},style:p={},placeholder:h=c("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:f=!0,readOnly:g,disabled:v,onClear:y}=e.option,{itemList:b=[],filterable:x=!0,listHeight:E=dl,collapseTags:S,maxTagTextLength:w,dropdownStyle:C,openPyt:N=!0}=u,T=Pn(b)?i:b,I=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())||""},R=e=>a?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return n.isOnlyShow?t.createElement(Kl,{value:R(r),bordered:m}):t.createElement(F,hn({value:r,mode:a?"multiple":void 0,popupClassName:`form-popper__${d}`,dropdownStyle:C,placeholder:h,style:p,loading:l,bordered:m,allowClear:f,disabled:v,showSearch:x,listHeight:E,maxTagCount:S?"responsive":void 0,maxTagTextLength:w},a?{title:R(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=jl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,R(e),T)})(e)},onClear:y}),T.map((e=>t.createElement(zl,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Bl extends s{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>En(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=de(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;pe(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(a),className:Pe(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Fn(d)},required:e.getFormItemRequired(f)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(a)}},t.createElement(Wl,{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(H,null,e.renderFormItemButton(o,h)),p&&t.createElement(H,{flex:Fn(p.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Bl.contextType=pa;const Ul=e=>{const{$$form:n}=t.useContext(pa),{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=cl,trueValue:h=sl}=o,{t:m}=Sn(),f=e=>m(e===h?"am.form.trueText":"am.form.falseText");return t.createElement(D,{checked:r===h,style:s,disabled:d||n.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==i||i(e),a(e,f(e))})(t?h:p)}},u?l:null)};class Gl extends s{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=Rn}=this.props.option,{labelToCheckbox:m}=o;return t.createElement(P.Item,{label:m?" ":e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Ul,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Gl.contextType=pa;class Yl extends s{constructor(){super(...arguments),this.linkRef=t.createRef(),this.state={visible:!1},this.getFormFieldsConfig=e=>En(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)=>En(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))||Hn(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 me(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?(ce(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 ce(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(this.formUniqueKey));pe(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(pa.Consumer,null,(n=>{const r=n.$$form;return t.createElement("div",{className:Pe("ant-dropdown-menu","fields-list")},t.createElement("div",{className:"reset"},t.createElement(qn,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(r.getOriginItems())},Yt("qm.table.columnFilter.reset"))),t.createElement(jt,{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(pe(n,i))return;r.setExpandHandle(!0);const a=al(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(D,{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(We,{className:"handle",title:Yt("qm.form.draggable")}),t.createElement("span",{className:"title"},r.getFormItemLabel(n.label)))}))))}))}render(){const{visible:e}=this.state,n=Kn("form-fields-filter");return t.createElement(pa.Consumer,null,(r=>{const{$size:i}=r.$$form,a={[n]:!0,[`${n}--lg`]:"large"===i,[`${n}--sm`]:"small"===i};return t.createElement($,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:Pe(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(Be,null)))}))}}Yl.contextType=Wt;const Xl=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(pa),{value:i,onChange:a,onValuesChange:l}=e,{t:o}=Sn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m,onFocus:f,onBlur:g,onEnter:v,onClear:y}=e.option,{prefix:b,suffix:x,password:E,maxLength:S,pattern:w,toUpper:C,toTrim:N,autoFocus:T,autoComplete:I,secretType:R}=s,k=R&&(h||m),L=t.useRef();t.useEffect((()=>{var e;const t=()=>null==y?void 0:y(),n=null===(e=L.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return p&&n&&n.addEventListener("click",t),()=>{null==n||n.removeEventListener("click",t)}}),[]);const A=e=>{null==a||a(e),l(e)},P=E?O.Password:O,_=k?((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,R):i;return r.isOnlyShow?t.createElement(Kl,{value:(e=>e&&E?new Array(e.length).fill("*").join(""):e)(_),bordered:u}):t.createElement(P,{ref:e=>{L.current=e,"function"==typeof n&&n(e)},value:_,autoComplete:E?"new-password":I,autoFocus:T,placeholder:d,style:c,title:E?"":_,prefix:b,suffix:x,maxLength:S,bordered:u,allowClear:p,readOnly:h,disabled:m,onFocus:e=>{null==f||f(e.target.value,e)},onBlur:t=>{var n;let r=null!==(n=t.target.value)&&void 0!==n?n:"";if(N){const e=r.trim();r!==e&&(r=e,A(r))}(t=>{const{onBlur:n}=e;null==n||n(t)})(r),null==g||g(r,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==v||v(n,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=L.current)||void 0===t||t.blur())}},onChange:e=>{let t=e.target.value;fe(w)&&(t=w.test(t)?t:null!=i?i:""),C&&(t=t.toUpperCase()),A(t)}})}));Xl.displayName="VInput";class Ql extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Xl,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(a,t)}}))),u&&t.createElement(H,null,e.renderFormItemButton(a,u)),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ql.contextType=pa;const Zl=e=>{const{$$form:n}=t.useContext(pa),{value:r=[],onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{options:o={},placeholder:s=l("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{prefix:h,suffix:m,maxLength:f}=o,g=e=>{const t=e.every((e=>!e))?[]:e;null==i||i(t),a(t,v(t))},v=e=>e.join(" - ");return n.isOnlyShow?t.createElement(Kl,{value:v(r),bordered:c}):t.createElement(O.Group,null,t.createElement(O,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],prefix:h,suffix:m,maxLength:f,allowClear:d,bordered:c,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([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:c,disabled:p,readOnly:!0}),t.createElement(O,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],prefix:h,suffix:m,maxLength:f,bordered:c,allowClear:d,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class Jl extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(s),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(o)},required:e.getFormItemRequired(u)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Zl,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(a,n)}}))),c&&t.createElement(H,{flex:Fn(c.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},c)))))}}Jl.contextType=pa;const eo=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(pa),{value:i,onChange:a,onValuesChange:l}=e,{t:o}=Sn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,readOnly:p,disabled:h,onFocus:m,onBlur:f,onEnter:g}=e.option,{step:v=1,min:y,max:b,precision:x,autoFocus:E,stringMode:S,textAlign:w="left",controls:C=!0,formatter:N,parser:T}=s,I=t.useRef(),R=t.useRef(i),O=e=>{const t=xl(e)?"":le(e)?e.toFixed(x):new Ht(e).toFixed(x);return"function"==typeof N?N(t):t},k={[w]:!0,controls:C};return r.isOnlyShow?t.createElement(Kl,{value:O(i),bordered:u}):t.createElement(M,{ref:e=>{I.current=e,"function"==typeof n&&n(e)},value:i,className:Pe(k),placeholder:d,style:Object.assign({width:"100%"},c),step:v,min:y,max:b,controls:C,precision:x,autoFocus:E,stringMode:S,formatter:N,parser:T,bordered:u,readOnly:p,disabled:h,onFocus:e=>{null==m||m(e.target.value,e)},onBlur:t=>{Ln((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(R.current),null==f||f(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==g||g(i,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=I.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!S&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{R.current=e,null==a||a(e),l(e,O(e))})(t)}})}));eo.displayName="VInputNumber";class to extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(eo,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(a,n)}}))),u&&t.createElement(H,null,e.renderFormItemButton(a,u)),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}to.contextType=pa;const no=e=>{const{$$form:n}=t.useContext(pa),{value:r=[],onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{options:o={},placeholder:s=l("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{step:h=1,min:m=0,max:f,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=o,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),S(e)},S=e=>{const t=e.every((e=>null===e))?[]:[...e];null==i||i(t),a(t,w(t))},w=e=>xl(e)?"":e.map((e=>xl(e)?"":Number(e).toFixed(y))),C={[g]:!0,controls:v};return n.isOnlyShow?t.createElement(Kl,{value:w(r),bordered:c}):t.createElement(O.Group,null,t.createElement(M,{value:r[0],className:Pe("site-input-left",C),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:s[0],step:h,min:m,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{S([e,r[1]])},onBlur:()=>{E(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:c,disabled:p,readOnly:!0}),t.createElement(M,{value:r[1],className:Pe("site-input-right",C),style:{width:"calc(50% - 5px)"},placeholder:s[1],step:h,min:m,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{S([r[0],e])},onBlur:()=>{E(r)}}))};class ro extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(s),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(o)},required:e.getFormItemRequired(u)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(no,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(a,n)}}))),c&&t.createElement(H,{flex:Fn(c.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},c)))))}}var io;ro.contextType=pa,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(io||(io={}));const{Search:ao}=O;class lo extends s{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Lt((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>En(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||Mn("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)||Mn("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&Mn("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=()=>En(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||Pn(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=de(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Sl(e,this.alias,c),d&&wl(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=El(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(ae(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=On,formatter:i=(e=>e)}=t.fetch;return new Promise(((a,l)=>En(this,void 0,void 0,(function*(){var o;const s=ge({},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=de(e.data,t.fetch.dataKey))&&void 0!==o?o:[];a(n)}else l()}catch(e){l(e)}finally{Ln((()=>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=El(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=El(e,this.extras[n]);void 0!==r&&t.SET_FIELDS_EXTRA({[n]:r})}},this.resetSearchHelperValue=(e=[],t)=>En(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,r=e.filter((e=>{var r;return null===(r=El(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)=>En(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:r}=this.searchHelper,i=(null!=r?r:On)(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]:El(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:El(e,this.extras[n])});const r=El(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=Yt("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:Yt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${io[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(Kl,{value:a,bordered:p}):t.createElement(t.Fragment,null,t.createElement(ao,{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):Ln((()=>this.clearSearchHelperValue())))}}),t.createElement(ua,b,t.createElement(ip,x)))}}lo.contextType=pa;class oo extends s{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>En(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){$n("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 Mn("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>En(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ol(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(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(lo,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(l,t)}}))),p&&t.createElement(H,null,e.renderFormItemButton(l,p)),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}oo.contextType=pa;const so=e=>{class n extends s{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=Rt(document,"mousedown",this.mousedownHandler),this.event2=Rt(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,hn({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,hn({},e,{forwardedRef:r}))))};function co(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 uo(e,t,n,r){var i=Ft.unstable_batchedUpdates?function(e){Ft.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 po=c((function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,l=a(),s=a();d(t,(function(){return{}}));var c=a(!1);return!c.current&&Lr()&&(s.current=r(),l.current=s.current.parentNode,c.current=!0),o((function(){null==n||n(e)})),o((function(){return null===s.current.parentNode&&null!==l.current&&l.current.appendChild(s.current),function(){var e;null===(e=s.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(s.current)}}),[]),s.current?Ft.createPortal(i,s.current):null}));function ho(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var mo;function fo(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 go(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=Zn({motionAppear:!0},fo({motion:l,prefixCls:n,transitionName:s,animation:o}))),e.createElement(oi,si({},c,{visible:r,removeOnLeave:!0}),(function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:Pe("".concat(n,"-mask"),r)})}))}function vo(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 yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vo(Object(n),!0).forEach((function(t){xo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bo(e){return bo="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},bo(e)}function xo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Eo={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function So(){if(void 0!==mo)return mo;mo="";var e=document.createElement("p").style;for(var t in Eo)t+"Transform"in e&&(mo=t);return mo}function wo(){return So()?"".concat(So(),"TransitionProperty"):"transitionProperty"}function Co(){return So()?"".concat(So(),"Transform"):"transform"}function No(e,t){var n=wo();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function To(e,t){var n=Co();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var Io,Ro=/matrix\((.*)\)/,Oo=/matrix3d\((.*)\)/;function ko(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Lo(e,t,n){var r=n;if("object"!==bo(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):Io(e,t);for(var i in t)t.hasOwnProperty(i)&&Lo(e,i,t[i])}function Ao(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 Po(e){return Ao(e)}function _o(e){return Ao(e,!0)}function Ho(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+=Po(r),t.top+=_o(r),t}function Fo(e){return null!=e&&e==e.window}function Do(e){return Fo(e)?e.document:9===e.nodeType?e:e.ownerDocument}var $o=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Mo=/^(top|right|bottom|left)$/,qo="currentStyle",jo="runtimeStyle",Vo="left";function Ko(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function zo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Wo(e,t,n){"static"===Lo(e,"position")&&(e.style.position="relative");var r=-999,i=-999,a=Ko("left",n),l=Ko("top",n),o=zo(a),s=zo(l);"left"!==a&&(r=999),"top"!==l&&(i=999);var c,d="",u=Ho(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[wo()]||"",No(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")),ko(e);var p=Ho(e),h={};for(var m in t)if(t.hasOwnProperty(m)){var f=Ko(m,n),g="left"===m?r:i,v=u[m]-p[m];h[f]=f===m?g+v:g-v}Lo(e,h),ko(e),("left"in t||"top"in t)&&No(e,d);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=Ko(b,n),E=t[b]-u[b];y[x]=b===x?h[x]+E:h[x]-E}Lo(e,y)}function Bo(e,t){var n=Ho(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(Co());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(Co());if(r&&"none"!==r){var i,a=r.match(Ro);a?((i=(a=a[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,To(e,"matrix(".concat(i.join(","),")"))):((i=r.match(Oo)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,To(e,"matrix3d(".concat(i.join(","),")")))}else To(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function Uo(e,t){for(var n=0;n<e.length;n++)t(e[n])}function Go(e){return"border-box"===Io(e,"boxSizing")}"undefined"!=typeof window&&(Io=window.getComputedStyle?function(e,t,n){var r=n,i="",a=Do(e);return(r=r||a.defaultView.getComputedStyle(e,null))&&(i=r.getPropertyValue(t)||r[t]),i}:function(e,t){var n=e[qo]&&e[qo][t];if($o.test(n)&&!Mo.test(t)){var r=e.style,i=r[Vo],a=e[jo][Vo];e[jo][Vo]=e[qo][Vo],r[Vo]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[Vo]=i,e[jo][Vo]=a}return""===n?"auto":n});var Yo=["margin","border","padding"],Xo=-1,Qo=2,Zo=1;function Jo(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(Io(e,o))||0}return l}var es={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 ts(e,t,n){var r=n;if(Fo(e))return"width"===t?es.viewportWidth(e):es.viewportHeight(e);if(9===e.nodeType)return"width"===t?es.docWidth(e):es.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],a="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),l=Go(e),o=0;(null==a||a<=0)&&(a=void 0,(null==(o=Io(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===r&&(r=l?Zo:Xo);var s=void 0!==a||l,c=a||o;return r===Xo?s?c-Jo(e,["border","padding"],i):o:s?r===Zo?c:c+(r===Qo?-Jo(e,["border"],i):Jo(e,["margin"],i)):o+Jo(e,Yo.slice(r),i)}Uo(["Width","Height"],(function(e){es["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],es["viewport".concat(e)](n))},es["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 ns={position:"absolute",visibility:"hidden",display:"block"};function rs(){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=ts.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,ns,(function(){r=ts.apply(void 0,t)})),r}function is(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}Uo(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);es["outer".concat(t)]=function(t,n){return t&&rs(t,e,n?0:Zo)};var n="width"===e?["Left","Right"]:["Top","Bottom"];es[e]=function(t,r){var i=r;return void 0!==i?t?(Go(t)&&(i+=Jo(t,["padding","border"],n)),Lo(t,e,i)):void 0:t&&rs(t,e,Xo)}}));var as={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Do,offset:function(e,t,n){if(void 0===t)return Ho(e);!function(e,t,n){if(n.ignoreShake){var r=Ho(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?Wo(e,t,n):n.useCssTransform&&Co()in document.body.style?Bo(e,t):Wo(e,t,n)}(e,t,n||{})},isWindow:Fo,each:Uo,css:Lo,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:is,getWindowScrollLeft:function(e){return Po(e)},getWindowScrollTop:function(e){return _o(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)as.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};is(as,es);var ls=as.getParent;function os(e){if(as.isWindow(e)||9===e.nodeType)return null;var t,n=as.getDocument(e).body,r=as.css(e,"position");if(!("fixed"===r||"absolute"===r))return"html"===e.nodeName.toLowerCase()?null:ls(e);for(t=ls(e);t&&t!==n&&9!==t.nodeType;t=ls(t))if("static"!==(r=as.css(t,"position")))return t;return null}var ss=as.getParent;function cs(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=os(e),i=as.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"===as.css(r,"overflow")){if(r===l||r===o)break}else{var s=as.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=os(r)}var c=null;as.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===as.css(e,"position")&&(e.style.position="fixed"));var d=as.getWindowScrollLeft(a),u=as.getWindowScrollTop(a),p=as.viewportWidth(a),h=as.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(as.isWindow(e)||9===e.nodeType)return!1;var t=as.getDocument(e),n=t.body,r=null;for(r=ss(e);r&&r!==n&&r!==t;r=ss(r))if("fixed"===as.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 ds(e){var t,n,r;if(as.isWindow(e)||9===e.nodeType){var i=as.getWindow(e);t={left:as.getWindowScrollLeft(i),top:as.getWindowScrollTop(i)},n=as.viewportWidth(i),r=as.viewportHeight(i)}else t=as.offset(e),n=as.outerWidth(e),r=as.outerHeight(e);return t.width=n,t.height=r,t}function us(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 ps(e,t,n,r,i){var a=us(t,n[1]),l=us(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 hs(e,t,n){return e.left<n.left||e.left+t.width>n.right}function ms(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function fs(e,t,n){var r=[];return as.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function gs(e,t){return e[t]=-e[t],e}function vs(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function ys(e,t){e[0]=vs(e[0],t.width),e[1]=vs(e[1],t.height)}function bs(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=cs(s,!(!(o=o||{})||!o.alwaysByViewport)),p=ds(s);ys(a,p),ys(l,t);var h=ps(p,t,i,a,l),m=as.merge(p,h);if(u&&(o.adjustX||o.adjustY)&&r){if(o.adjustX&&hs(h,p,u)){var f=fs(i,/[lr]/gi,{l:"r",r:"l"}),g=gs(a,0),v=gs(l,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(ps(p,t,f,g,v),p,u)||(d=1,i=f,a=g,l=v)}if(o.adjustY&&ms(h,p,u)){var y=fs(i,/[tb]/gi,{t:"b",b:"t"}),b=gs(a,1),x=gs(l,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(ps(p,t,y,b,x),p,u)||(d=1,i=y,a=b,l=x)}d&&(h=ps(p,t,i,a,l),as.mix(m,h));var E=hs(h,p,u),S=ms(h,p,u);if(E||S){var w=i;E&&(w=fs(i,/[lr]/gi,{l:"r",r:"l"})),S&&(w=fs(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=as.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)),as.mix(i,a)}(h,p,u,c))}return m.width!==p.width&&as.css(s,"width",as.width(s)+m.width-p.width),m.height!==p.height&&as.css(s,"height",as.height(s)+m.height-p.height),as.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 xs(e,t,n){var r=n.target||t,i=ds(r),a=!function(e,t){var n=cs(e,t),r=ds(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 bs(e,i,n,a)}xs.__getOffsetParent=os,xs.__getVisibleRectForElement=cs;var Es=Lr()?e.useLayoutEffect:e.useEffect,Ss=function(t,n){var r=e.useRef(!0);Es((function(){return t(r.current)}),n),Es((function(){return r.current=!1,function(){r.current=!0}}),[])};function ws(e,t){var n=null,r=null;var i=new Tt((function(e){var i=er(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 Cs(e){return"function"!=typeof e?null:e()}function Ns(e){return"object"===Gn(e)&&e?e:null}var Ts=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=Cs(n),s=Ns(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=xs(a,o,r):s&&(l=function(e,t,n){var r,i,a=as.getDocument(e),l=a.defaultView||a.parentWindow,o=as.getWindowScrollLeft(l),s=as.getWindowScrollTop(l),c=as.viewportWidth(l),d=as.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 bs(e,u,yo(yo({},n),{},{points:h}),p)}(a,s,r)),function(e,t){e!==document.activeElement&&co(t,e)&&"function"==typeof e.focus&&e.focus()}(c,a),i&&l&&i(a,l),!0}return!1}),d),g=er(f,2),v=g[0],y=g[1],b=er(t.useState(),2),x=b[0],E=b[1],S=er(t.useState(),2),w=S[0],C=S[1];return Ss((function(){E(Cs(a)),C(Ns(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(an(!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"===Gn(t)&&"object"===Gn(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 ws(p.current,v)}),[p.current]),t.useEffect((function(){return ws(x,v)}),[x]),t.useEffect((function(){i?y():v()}),[i]),t.useEffect((function(){if(s)return uo(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:or(h.ref,p)})),h},Is=t.forwardRef(Ts);function Rs(){Rs=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 N(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(T([])));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"==Gn(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 N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function T(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=T,N.prototype={constructor:N,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:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Os(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 ks(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){Os(a,r,i,l,o,"next",e)}function o(e){Os(a,r,i,l,o,"throw",e)}l(void 0)}))}}Is.displayName="Align";var Ls=["measure","alignPre","align",null,"motion"],As=e.forwardRef((function(t,n){var r=t.visible,i=t.prefixCls,l=t.className,s=t.style,c=t.children,d=t.zIndex,p=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,N=a(),T=a(),I=er(u(),2),R=I[0],O=I[1],k=function(t){var n=er(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})}]}(p),L=er(k,2),A=L[0],P=L[1];var _=function(e,t){var n=er(xr(null),2),r=n[0],i=n[1],l=a();function s(e){i(e,!0)}function c(){ei.cancel(l.current)}return o((function(){s("measure")}),[e]),o((function(){"measure"===r&&t(),r&&(l.current=ei(ks(Rs().mark((function e(){var t,n;return Rs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Ls.indexOf(r),(n=Ls[t+1])&&-1!==t&&s(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),o((function(){return function(){c()}}),[]),[r,function(e){c(),l.current=ei((function(){s((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r,(function(){p&&P(v())})),H=er(_,2),F=H[0],D=H[1],$=er(u(0),2),M=$[0],q=$[1],j=a();function V(){var e;null===(e=N.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))}Ss((function(){"alignPre"===F&&q(0)}),[F]),Ss((function(){"align"===F&&(M<3?V():D((function(){var e;null===(e=j.current)||void 0===e||e.call(j)})))}),[M]);var z=Zn({},fo(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 T.current}}}));var B=Zn(Zn({},A),{},{zIndex:d,opacity:"motion"!==F&&"stable"!==F&&r?0:void 0,pointerEvents:r||"stable"===F?void 0:"none"},s),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(oi,si({visible:r,ref:T,leavedClassName:"".concat(i,"-hidden")},z,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:h,forceRender:m}),(function(t,n){var r=t.className,a=t.style,o=Pe(i,l,R,r);return e.createElement(Is,{target:g||v,key:"popup",ref:N,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:Zn(Zn({},a),B)},G))}))}));As.displayName="PopupInner";var Ps=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=Zn({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(oi,si({visible:i,ref:m,removeOnLeave:!0},u),(function(t,n){var i=t.className,a=t.style,l=Pe(r,s,i);return e.createElement("div",{ref:n,className:l,onClick:h,style:Zn(Zn({},a),f)},g)}))}));Ps.displayName="MobilePopupInner";var _s=["visible","mobile"],Hs=e.forwardRef((function(t,n){var r=t.visible,i=t.mobile,a=cr(t,_s),l=er(u(r),2),s=l[0],c=l[1],d=er(u(!1),2),p=d[0],h=d[1],m=Zn(Zn({},a),{},{visible:s});o((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=p?e.createElement(Ps,si({},m,{mobile:i,ref:n})):e.createElement(As,si({},m,{ref:n}));return e.createElement("div",null,e.createElement(go,m),f)}));Hs.displayName="Popup";var Fs=e.createContext(null);function Ds(){}function $s(){return""}function Ms(e){return e?e.ownerDocument:window.document}var qs=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var js=function(t){var n=function(n){fr(i,e.Component);var r=yr(i);function i(t){var n,a;return ur(this,i),Xn(vr(n=r.call(this,t)),"popupRef",e.createRef()),Xn(vr(n),"triggerRef",e.createRef()),Xn(vr(n),"portalContainer",void 0),Xn(vr(n),"attachId",void 0),Xn(vr(n),"clickOutsideHandler",void 0),Xn(vr(n),"touchOutsideHandler",void 0),Xn(vr(n),"contextMenuOutsideHandler1",void 0),Xn(vr(n),"contextMenuOutsideHandler2",void 0),Xn(vr(n),"mouseDownTimeout",void 0),Xn(vr(n),"focusTime",void 0),Xn(vr(n),"preClickTime",void 0),Xn(vr(n),"preTouchTime",void 0),Xn(vr(n),"delayTimer",void 0),Xn(vr(n),"hasPopupMouseDown",void 0),Xn(vr(n),"onMouseEnter",(function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)})),Xn(vr(n),"onMouseMove",(function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)})),Xn(vr(n),"onMouseLeave",(function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Xn(vr(n),"onPopupMouseEnter",(function(){n.clearDelayTimer()})),Xn(vr(n),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&co(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),Xn(vr(n),"onFocus",(function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))})),Xn(vr(n),"onMouseDown",(function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()})),Xn(vr(n),"onTouchStart",(function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()})),Xn(vr(n),"onBlur",(function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)})),Xn(vr(n),"onContextMenu",(function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)})),Xn(vr(n),"onContextMenuClose",(function(){n.isContextMenuToShow()&&n.close()})),Xn(vr(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)})),Xn(vr(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)})),Xn(vr(n),"onDocumentClick",(function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),i=n.getPopupDomNode();co(r,t)&&!n.isContextMenuOnly()||co(i,t)||n.hasPopupMouseDown||n.close()}})),Xn(vr(n),"getRootDomNode",(function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=nr(n.triggerRef.current);if(t)return t}catch(e){}return Ft.findDOMNode(vr(n))})),Xn(vr(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(ho(e[o].points,i,r))return"".concat(t,"-placement-").concat(o)}return""}(a,l,e,o)),s&&t.push(s(e)),t.join(" ")})),Xn(vr(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,N=n.getPopupAlign(),T={};return n.isMouseEnterToShow()&&(T.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(T.onMouseLeave=n.onPopupMouseLeave),T.onMouseDown=n.onPopupMouseDown,T.onTouchStart=n.onPopupMouseDown,e.createElement(Hs,si({prefixCls:r,destroyPopupOnHide:i,visible:w,point:y&&C,className:a,align:N,onAlign:l,animation:s,getClassNameFromAlign:n.getPopupClassNameFromAlign},T,{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)})),Xn(vr(n),"attachParent",(function(e){ei.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=ei((function(){n.attachParent(e)}))})),Xn(vr(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})),Xn(vr(n),"setPoint",(function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Xn(vr(n),"handlePortalUpdate",(function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)})),Xn(vr(n),"triggerContextValue",{onPopupMouseDown:n.onPopupMouseDown}),a="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,n.state={prevPopupVisible:a,popupVisible:a},qs.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),n}return hr(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=uo(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=uo(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=uo(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=uo(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ei.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 Zn(Zn({},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=Pe(c&&c.props&&c.props.className,o);u&&(d.className=u);var p=Zn({},d);sr(c)&&(p.ref=or(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(Fs.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 Xn(n,"contextType",Fs),Xn(n,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:$s,getDocument:Ms,onPopupVisibleChange:Ds,afterPopupVisibleChange:Ds,onPopupAlign:Ds,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}(po);let Vs=class extends s{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Lt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>En(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Mn("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Mn("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=>En(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:On)(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(ve([...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;pe(n,r)||pe(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return En(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(Pn(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=de(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=Yt("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,S={visible:a,title:Yt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${io[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},w=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:ge({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),C=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},C.length?C.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Yt("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=Kn("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(Kl,{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(js,{popupVisible:!y&&l,popup:N,popupClassName:Pe(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:pl,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement(F,{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(F.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Ue,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(ua,S,t.createElement(ip,w)))}};Vs.contextType=pa,Vs=xn([so],Vs);class Ks extends s{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>En(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){$n("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 Mn("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>En(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ol(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Vs,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(l,n)}}))),p&&t.createElement(H,null,e.renderFormItemButton(l,p)),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Ks.contextType=pa;const{Search:zs}=O;class Ws extends s{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Lt((e=>Object.assign({},this.props.helperConfig,e))),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>En(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||Mn("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)||Mn("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&Mn("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=()=>En(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||Pn(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=de(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Sl(e,this.alias,c),d&&wl(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=El(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=El(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]:El(e,this.extras[n])})},this.openSearchHelper=e=>En(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:On)(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]:El(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:El(e,this.extras[n])});const r=El(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=Yt("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:Yt("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${io[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:ge({},c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return n.isOnlyShow?t.createElement(Kl,{value:a,bordered:p}):t.createElement(t.Fragment,null,t.createElement(zs,{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(ua,b,t.createElement(sp,x)))}}Ws.contextType=pa;class Bs extends s{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>En(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){$n("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 Mn("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>En(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ol(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.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)=>{f(t,n),e.setViewValue(l,t)}}))),p&&t.createElement(H,null,e.renderFormItemButton(l,p)),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Bs.contextType=pa;let Us=class extends s{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Lt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>En(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Mn("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Mn("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=>En(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:On)(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(ve([...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;pe(n,r)||pe(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return En(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(Pn(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=de(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=Yt("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,S={visible:a,title:Yt("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${io[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},w=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:ge({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),C=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},C.length?C.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},Yt("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=Kn("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(Kl,{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(js,{popupVisible:!y&&l,popup:N,popupClassName:Pe(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:pl,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement(F,{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(F.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Ue,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(ua,S,t.createElement(sp,w)))}};Us.contextType=pa,Us=xn([so],Us);class Gs extends s{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>En(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){$n("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 Mn("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>En(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ol(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Us,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(l,n)}}))),p&&t.createElement(H,null,e.renderFormItemButton(l,p)),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Gs.contextType=pa;const Ys=new Array(2).fill("");class Xs extends s{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Ys},this.getSearchHelper=Lt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>En(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Mn("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Mn("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(Ys),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=>En(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:On)(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]:Pn(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=On,formatter:i=(e=>e)}=t.fetch;return new Promise(((a,l)=>En(this,void 0,void 0,(function*(){var o;const s=ge({},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(Ln((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=de(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return a(n)}}catch(e){this.setState({loading:!1})}l()}))))},this.resetSearchHelperValue=(e=[])=>En(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;pe(t,n)||pe(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:i}=this.props.option;if(!pe(r[i],this._ceho_data)&&(this._ceho_data=r[i],this.setItemList(r[i]),n.length)){const e=Ys.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 En(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(Pn(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=de(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=Yt("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||s,m=a.every((e=>xl(e)))?"":a.join(" - "),f={visible:r,title:Yt("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${io[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},g=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:ge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(Kl,{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(ua,f,t.createElement(pp,g)))}}Xs.contextType=pa;class Qs extends s{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>En(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){$n("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 Mn("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>En(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ol(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(c),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Xs,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{m(t,r),e.setViewValue(l,n)}}))),u&&t.createElement(H,null,e.renderFormItemButton(l,u)),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Qs.contextType=pa;const Zs=e=>{const{$$form:n}=t.useContext(pa),{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=Pn(p)?i:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return n.isOnlyShow?t.createElement(Kl,{value:m(r),bordered:c}):t.createElement(D.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(D,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Js extends s{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;pe(r,i)||this.getItemList()}getItemList(){var e;return En(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=de(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Zs,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}Js.contextType=pa;const ec=e=>{const{$$form:n}=t.useContext(pa),{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(q,{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 tc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ec,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}tc.contextType=pa;const nc=e=>{const{$$form:n}=t.useContext(pa),{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=Pn(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(Kl,{value:m(r),bordered:c}):t.createElement(j.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(j,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class rc extends s{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>En(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=de(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;pe(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(nc,{option:this.props.option,items:n,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}rc.contextType=pa;const ic=e=>{const{$$form:n}=t.useContext(pa),{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=cl,trueValue:h=sl}=o,{t:m}=Sn();return t.createElement(t.Fragment,null,t.createElement(V,{checked:r===h,style:s,disabled:d||n.isOnlyShow,checkedChildren:t.createElement(Me,null),unCheckedChildren:t.createElement(Ge,null),onChange:e=>{(e=>{null==i||i(e),a(e,m(e===h?"am.form.trueText":"am.form.falseText"))})(e?h:p)}}),u?t.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},l):null)};class ac extends s{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=Rn}=this.props.option,{labelToSwitch:m}=o;return t.createElement(P.Item,{label:m?" ":e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ic,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ac.contextType=pa;const lc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{options:o={},style:s={},placeholder:c=l("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u,readOnly:p,disabled:h,onBlur:m,onEnter:f}=e.option,{showCount:g,maxLength:v,autoSize:y}=o,b=Object.assign({},{minRows:1,maxRows:3},y);return t.createElement(O.TextArea,{value:r,placeholder:c,style:s,maxLength:v,showCount:g,autoSize:b,bordered:d,allowClear:u,readOnly:p||n.isOnlyShow,disabled:h,onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),null==m||m(n,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==f||f(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==i||i(e),a(e)})(t)}})};class oc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(lc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}oc.contextType=pa;const sc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.datePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:f}=e.option,{dateType:g="date",format:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=s,S=t.createRef(),w=e=>{e&&"date"===g&&(e=e.slice(0,10)+" 00:00:00"),null==i||i(e),a(e,C(e))},C=e=>xl(e)?"":["date","exactdate"].includes(g)?e.slice(0,10):e,N=e=>{let t=bl(h().subtract(e,"day"),ml[g]);"date"===g&&(t=t.slice(0,10)),w(t),S.current.blur(),S.current.focus()};return n.isOnlyShow?t.createElement(Kl,{value:C(r),bordered:u}):t.createElement(pn,{ref:S,style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:hl[g],format:v,bordered:u,showToday:!1,showTime:"datetime"===g&&{defaultValue:h("00:00:00","HH:mm:ss")},allowClear:p,disabled:f,inputReadOnly:m,disabledDate:null!=y?y: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,[b,x]),renderExtraFooter:E&&g.includes("date")?()=>"function"==typeof E?E():t.createElement(t.Fragment,null,t.createElement(K,{color:"processing",onClick:()=>N(0)},l("qm.form.datePickers")[0]),t.createElement(K,{color:"processing",onClick:()=>N(1)},l("qm.form.datePickers")[1]),t.createElement(K,{color:"processing",onClick:()=>N(7)},l("qm.form.datePickers")[2]),t.createElement(K,{color:"processing",onClick:()=>N(30)},l("qm.form.datePickers")[3])):void 0,value:yl(r,ml[g]),onChange:(e,t)=>{w(bl(e,ml[g]))}})};class cc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(sc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}cc.contextType=pa;const dc=e=>[h().subtract(e,"day"),h()],uc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:f=n.isFormDisabled}=e.option,{dateType:g="date",format:v,disableds:y=[!1,!1],allowEmpty:b,disabledDate:x,minDateTime:E,maxDateTime:S,shortCuts:w=!0}=s,C={[l("qm.form.dateRangePickers")[0]]:dc(7),[l("qm.form.dateRangePickers")[1]]:dc(30),[l("qm.form.dateRangePickers")[2]]:dc(90),[l("qm.form.dateRangePickers")[3]]:dc(180)},N=e=>xl(e)?"":e.map((e=>["date","exactdate"].includes(g)?null==e?void 0:e.slice(0,10):e)).join(" - ");return n.isOnlyShow?t.createElement(Kl,{value:N(r),bordered:u}):t.createElement(pn.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:hl[g],format:v,bordered:u,showTime:"datetime"===g&&{defaultValue:[h("00:00:00","HH:mm:ss"),h("23:59:59","HH:mm:ss")]},allowClear:p,allowEmpty:b,disabled:f?[!0,!0]:y,inputReadOnly:m,disabledDate:null!=x?x: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,[E,S]),ranges:w&&g.includes("date")?C:void 0,value:Pn(r)?null:[yl(null==r?void 0:r[0],ml[g]),yl(null==r?void 0:r[1],ml[g])],onChange:(e,t)=>{(e=>{"date"===g&&(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,N(e))})([bl(null==e?void 0:e[0],ml[g]),bl(null==e?void 0:e[1],ml[g])])}})};class pc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(uc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}pc.contextType=pa;const hc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.timePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{timeType:f="hour-minute-second",hourStep:g=1,minuteStep:v=1,secondStep:y=1}=s;return n.isOnlyShow?t.createElement(Kl,{value:r,bordered:u}):t.createElement(mn,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!0,hourStep:g,minuteStep:v,secondStep:y,allowClear:p,disabled:m,inputReadOnly:h,format:fl[f],value:yl(r,fl[f]),onChange:(e,t)=>{(e=>{const t=bl(e,fl[f]);null==i||i(t),a(t)})(e)}})};class mc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.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,t)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}mc.contextType=pa;const fc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{t:l}=Sn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m=n.isFormDisabled}=e.option,{timeType:f="hour-minute-second",disableds:g=[!1,!1],allowEmpty:v,hourStep:y=1,minuteStep:b=1,secondStep:x=1}=s,E=e=>xl(e)?"":e.join(" - ");return n.isOnlyShow?t.createElement(Kl,{value:E(r),bordered:u}):t.createElement(mn.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!1,hourStep:y,minuteStep:b,secondStep:x,allowClear:p,allowEmpty:v,disabled:m?[!0,!0]:g,inputReadOnly:h,format:fl[f],value:Pn(r)?null:[yl(null==r?void 0:r[0],fl[f]),yl(null==r?void 0:r[1],fl[f])],onChange:(e,t)=>{(e=>{const t=[bl(null==e?void 0:e[0],fl[f]),bl(null==e?void 0:e[1],fl[f])];null==i||i(t),a(t,E(t))})(e)}})};class gc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(fc,{option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}gc.contextType=pa;class vc extends s{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=Lt(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.initialHandle=()=>En(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||Mn("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)||Mn("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),a&&!this.valueKey&&Mn("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&Mn("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=()=>En(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(Pn(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=de(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Sl(e,this.alias,c),d&&wl(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=u,l){const t=El(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=El(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]:El(e,this.extras[n])})},this.fetchHandle=ye(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]:El(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:El(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=El(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(pe(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 En(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=de(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=Yt("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{listHeight:f=dl}=s,{hideHeader:g,onlySelect:v=!0}=this.searchHelper||s,y=this.searchHelper.columns||[],b=Kn("form-immediate"),x=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,E=t.createElement(T,{spinning:r},i.length?t.createElement("table",{cellSpacing:0,cellPadding:0,className:Pe("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},de(e,n.dataIndex))))))))):t.createElement($i,null));return t.createElement(Wt.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(Kl,{value:l,bordered:u}):t.createElement(js,{action:m?[]:["click"],popupVisible:!m&&n,popup:E,popupClassName:Pe(s,`form-popper__${o}`),popupStyle:{minWidth:x,maxHeight:f},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:pl,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)}})))}))}}vc.contextType=pa;class yc extends s{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>En(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){$n("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 Mn("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:l}=this.props.option;this.promiseRef=new Promise(((e,t)=>En(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=Ol(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:a,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Fn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(vc,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="",n)=>{f(t,n),e.setViewValue(l,t)}}))),p&&t.createElement(H,null,e.renderFormItemButton(l,p)),u&&t.createElement(H,{flex:Fn(u.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:l},u)))))}}yc.contextType=pa;class bc extends s{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=Rn}=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(P.Item,{labelCol:{span:0},wrapperCol:{span:24}},t.createElement(zn,{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)}}))}}bc.contextType=pa;const xc=(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:xc(e.children,t,n,r)}):e)),Ec=e=>{const{$$form:n}=t.useContext(pa),{value:r,items:i,multiple:a,loading:l,onChange:o,onValuesChange:s}=e,{t:c}=Sn(),{fieldName:d,options:u={},style:p={},placeholder:h=c("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:f=!0,asyncLoad:g,readOnly:v,disabled:y}=e.option,{itemList:b,filterable:x=!0,listHeight:E=dl,checkStrictly:S,checkStrategy:w="SHOW_CHILD",collapseTags:C,defaultExpandAll:N=!g,defaultExpandedKeys:T,dropdownStyle:I,openPyt:R=!0}=u,[O,k]=t.useState(Pn(b)?i:b),L=t.useRef(O);Ei((()=>{const e=Pn(b)?i:b;g?pe(e,L.current)||(k(e),L.current=e):k(e)}),[b,i]);const A=e=>{var t;return(null===(t=Nl(O,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},P=e=>a?(null==e?void 0:e.map((e=>A(e))).join(","))||"":A(e);return n.isOnlyShow?t.createElement(Kl,{value:P(r),bordered:m}):t.createElement(z,hn({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:a,treeCheckable:a,treeCheckStrictly:S,showCheckedStrategy:z[w],popupClassName:`form-popper__${d}`,dropdownStyle:I,placeholder:h,listHeight:E,style:p,loading:l,bordered:m,allowClear:f,disabled:y,treeDefaultExpandAll:N,treeDefaultExpandedKeys:T,showSearch:x,maxTagCount:C?"responsive":void 0,loadData:g?({key:e,children:t})=>En(void 0,void 0,void 0,(function*(){var n;if(!g||t)return;const{fetchApi:r,params:i,dataKey:a,textKey:l="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=g;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=de(t.data,a))&&void 0!==n?n:[],i=xc(O,e,o,Cl(r,o,l));k(i),null==s||s(r)}}catch(e){}})):void 0,treeData:O},a?{title:P(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=jl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(R?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,P(e),O)})(e)}}))};class Sc extends s{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>En(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=de(t.data,i))&&void 0!==e?e:[],r=Cl(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;pe(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(a),className:Pe(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Fn(d)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(a)}},t.createElement(Ec,{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(H,{flex:Fn(p.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Sc.contextType=pa;const wc=e=>{const{$$form:n}=t.useContext(pa),{value:r,multiple:i,items:a}=e,{t:l}=Sn(),{fieldName:o,options:s={},style:c={},placeholder:d=l("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,asyncLoad:h,readOnly:m,disabled:f}=e.option,{itemList:g,changeOnSelect:v,checkStrictly:y,checkStrategy:b="SHOW_PARENT",filterable:x=!0,dropdownStyle:E,openPyt:S=!0}=s,[w,C]=t.useState(Pn(g)?a:g),N=t.useRef(w);Ei((()=>{const e=Pn(g)?a:g;h?pe(e,N.current)||(C(e),N.current=e):C(e)}),[g,a]);const T=e=>Tl(w,null!=e?e:"").map((e=>e.text)).join("/"),I=e=>i?(null==e?void 0:e.map((e=>T(e))).join(","))||"":T(e);return n.isOnlyShow?t.createElement(Kl,{value:I(r),bordered:u}):t.createElement(W,hn({value:(e=>Pn(e)?[]:i?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:w,multiple:i,maxTagCount:"responsive",changeOnSelect:v||y,showCheckedStrategy:W[b],popupClassName:`form-popper__${o}`,dropdownStyle:E,placeholder:d,style:c,bordered:u,allowClear:p,disabled:f,showSearch:x&&!h&&{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=jl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(S?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:h?e=>En(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!h||n.children)return;const{fetchApi:r,params:i,dataKey:a,textKey:l="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=h;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=de(e.data,a))&&void 0!==t?t:[],i=xc(w,n.value,o,Cl(r,o,l));C(i),null==s||s(r)}}catch(e){}})):void 0},i?{title:I(r)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:r}=e;null==n||n(t),r(t,I(t),w)})(((e=[])=>i?e.map((e=>e.join(","))):e.join(","))(t))}}))};class Cc extends s{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>En(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=de(t.data,i))&&void 0!==e?e:[],r=Cl(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;pe(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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(a),className:Pe(u),tooltip:l,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Fn(d)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(a)}},t.createElement(wc,{option:this.props.option,multiple:n,items:r,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(H,{flex:Fn(p.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Cc.contextType=pa;const Nc=["110000","120000","310000","500000"],Tc=["810000","820000"],Ic=[{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"}],Rc=[{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"}],Oc=e=>jl.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),kc=(e,t,n=1)=>{if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Nc,...Tc].includes(e))):Object.keys(e[t])).map((r=>({l:Oc(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:kc(e,r,n+1)})))},Lc=(e,t)=>t.map((t=>({l:Oc(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Ac extends s{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}),Ot(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:Lc(zt,Nc)},{l:"Z2",n:"港澳",c:"",p:"",children:Lc(zt,Tc)}]}createProvince(){var e;return(null!==(e=kc(zt,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Rc.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Nc,...Tc].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t.createElement(j.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(j.Button,{value:"0"},Yt("qm.form.citySelectType.0")),t.createElement(j.Button,{value:"1"},Yt("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:n}=this.state;return("0"===n?Ic:Rc).map((n=>t.createElement("li",{key:n.value,className:Pe({tag:!0,actived:n.value===e}),onClick:()=>this.scrollHandle(n.value.toString())},n.text)))}renderSelect(){const{value:e}=this.props;return t.createElement(F,{size:"small",placeholder:Yt("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(F.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:Pe({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=Yt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=Kn("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(Wt.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(Kl,{value:m,bordered:s}):t.createElement(js,{action:u?[]:["click"],popupVisible:!u&&n,popup:f,popupClassName:Pe(a,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:pl,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)}})))}))}}Ac.contextType=pa;class Pc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Ac,{option:this.props.option,onValuesChange:(t,n)=>{h(t,n),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Pc.contextType=pa;const _c=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:_c(e,n)})))};class Hc extends s{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=_c(zt,"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=Nl(e,t[r]);if(i&&Pn(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 En(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=de(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)||`${Yt("qm.form.selectPlaceholder").replace("...","")}(${Yt("qm.form.regionSelectLabel")[r]})`;return t.createElement(oa.TabPane,{key:r.toString(),tab:a},t.createElement("div",{className:"region-box"},n.map((n=>t.createElement("span",{key:n.value,className:Pe({"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(oa,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},n):t.createElement($i,null)}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:a={},style:l={},placeholder:o=Yt("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=Kn("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(Wt.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(Kl,{value:f,bordered:s}):t.createElement(js,{action:u?[]:["click"],popupVisible:!u&&n,popup:m,popupClassName:Pe(a,`form-popper__${i}`),popupStyle:{minWidth:h},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:pl,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&&Ln((()=>this.initial()))}})))}))}}Hc.contextType=pa;class Fc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.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,n),e.setViewValue(a,n)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Fc.contextType=pa;const Dc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:h,draggable:m,editable:f,batchDownload:g,fileDirection:v,onPreview:y,onRemove:b,onSortChange:x,onEditChange:E}=l,{action:S,headers:w,params:C,withCredentials:N=!1,dataKey:T="",downloadWithHeaders:I,fieldAliasMap:O,beforeUpload:k,button:L}=o,A="function"==typeof O?O():O||{},{t:P}=Sn();return t.createElement(ea,{name:"file",action:S,multiple:d,headers:w,data:C,withCredentials:N,downloadWithHeaders:I,beforeUpload:k,maxCount:u,fileTypes:p,fileSize:h,draggable:m,editable:f,batchDownload:g,fileDirection:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,button:L,showUploadList:{showDownloadIcon:!0,downloadIcon:t.createElement(je,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&&R.error(n.message||P("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(T?de(n.data,T):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 $c extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.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(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}$c.contextType=pa;const Mc=e=>{const{$$form:n}=t.useContext(pa),{value:r,onChange:i,onValuesChange:a}=e,{options:l={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,draggable:v,onRemove:y,onSortChange:b}=l,{action:x,headers:E,params:S,withCredentials:w=!1,dataKey:C="",popupClassName:N,fieldAliasMap:T,beforeUpload:I}=o,O="function"==typeof T?T():T||{},{t:k}=Sn();return t.createElement(cd,{name:"file",action:x,multiple:d,headers:E,data:S,withCredentials:w,popupClassName:N,beforeUpload:I,maxCount:u,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,draggable:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,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&&R.error(n.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(C?de(n.data,C):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onRemove:y,onSortChange:b})};class qc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.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,"")}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}qc.contextType=pa;const jc=e=>{const{$$form:n}=t.useContext(pa),{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(ld,{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 Vc extends s{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=Rn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":Fn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(H,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(jc,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),d&&t.createElement(H,{flex:Fn(d.labelWidth||ol)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Vc.contextType=pa;class Kc extends s{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=ye(this.resizeObserveHandler,10),this.getFormItems=Lt((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=Lt((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{ae(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(","),"]")})));B.error({message:Yt("qm.form.validatePrompt"),description:n,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&Ot(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(){Vi(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){Ki(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&&Mn("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=>ae(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=>ae(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,ul.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:cl),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=Hn(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),Ln((()=>{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(Il(e))return Rl(e);if(ae(e)){const{fieldName:l,label:o,options:s={}}=e;if(Il(o))return Rl(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(xl(i)&&(e[r]=""),Array.isArray(i)&&i.forEach(((t,n)=>{xl(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)Pn(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return En(this,void 0,void 0,(function*(){const{authConfig:r}=this.props;if(!r)return;let i=_n(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?de(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(Ql,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t.createElement(Jl,{option:e})}INPUT_NUMBER(e){return t.createElement(to,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t.createElement(ro,{option:e})}SEARCH_HELPER(e){return t.createElement(oo,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t.createElement(Ks,{option:e})}TREE_TABLE_HELPER(e){return t.createElement(Bs,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t.createElement(Gs,{option:e})}RANGE_SEARCH_HELPER(e){return t.createElement(Qs,{option:e})}CHECKBOX(e){return t.createElement(Gl,{option:e})}MULTIPLE_CHECKBOX(e){return t.createElement(Js,{option:e})}RATE(e){return t.createElement(tc,{option:e})}RADIO(e){return t.createElement(rc,{option:e})}SWITCH(e){return t.createElement(ac,{option:e})}TEXT_AREA(e){return t.createElement(oc,{option:e})}DATE(e){return t.createElement(cc,{option:e})}RANGE_DATE(e){return t.createElement(pc,{option:e})}TIME(e){return t.createElement(mc,{option:e})}RANGE_TIME(e){return t.createElement(gc,{option:e})}SELECT(e){return t.createElement(Bl,{option:e})}MULTIPLE_SELECT(e){return t.createElement(Bl,{option:e,multiple:!0})}IMMEDIATE(e){return t.createElement(yc,{option:e})}DIVIDER(e){return t.createElement(bc,{option:e})}TREE_SELECT(e){return t.createElement(Sc,{option:e})}MULTIPLE_TREE_SELECT(e){return t.createElement(Sc,{option:e,multiple:!0})}CASCADER(e){return t.createElement(Cc,{option:e})}MULTIPLE_CASCADER(e){return t.createElement(Cc,{option:e,multiple:!0})}CITY_SELECT(e){return t.createElement(Pc,{option:e})}REGION_SELECT(e){return t.createElement(Fc,{option:e})}UPLOAD_FILE(e){return t.createElement($c,{option:e})}UPLOAD_IMG(e){return t.createElement(qc,{option:e})}TINYMCE(e){return t.createElement(Vc,{option:e})}renderFormLabel(e){if(Il(e)||!ae(e))return e;const{type:n,fieldName:r,label:i,options:a={},onChange:l=Rn}=e,{itemList:o=[]}=a;return"SELECT"===n?t.createElement(P.Item,{name:r,noStyle:!0},t.createElement(Wl,{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(P.Item,{name:r,noStyle:!0},t.createElement(Ul,{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(S,{className:"extra-tooltip",title:l[n]},t.createElement(Ye,{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 Pn(this.state.formData)?null:t.createElement(P.Item,{label:this.renderFormLabel(n),name:r,rules:c,tooltip:a,hidden:i,className:Pe(l),style:Object.assign({width:"100%"},d),labelCol:{flex:this.verticalLayout?"initial":Fn(o)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(n)}},null==u?void 0:u(e,this))}createFormItem(e){return oe(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(Mn("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(H,{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(Hn(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(H,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t.createElement(C,{style:{marginBottom:12}},t.createElement(qn,{type:"primary",size:this.$size,icon:t.createElement(Ue,null),onClick:()=>this.SUBMIT_FORM()},Yt("qm.form.search")),t.createElement(qn,{size:this.$size,icon:t.createElement(Xe,null),onClick:()=>this.RESET_FORM()},Yt("qm.form.reset")),l?this.createFieldsDefine():null,this.showFilterCollapse&&t.createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t.createElement(_e,null):t.createElement(He,null)," ",Yt(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(_,{gutter:0},t.createElement(H,{key:"-",span:i},t.createElement(P.Item,null,t.createElement(C,{style:{marginBottom:12}},t.createElement(qn,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Yt("qm.form.save")),t.createElement(qn,{size:this.$size,onClick:()=>this.RESET_FORM()},Yt("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:n,fieldsChange:r}=this.props;return t.createElement(Yl,{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)=>En(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:[Yt("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 En(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 En(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 En(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){Mn("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 Mn("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!ae(t))return Mn("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(a.noAuth)return Mn("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||he(a,n,t[n]));n&&(i?i([...r]):Mn("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:n,layout:r,disabled:i,labelWidth:a,labelAlign:l,labelWrap:o,customClass:s}=this.props,c=Kn("form"),d={required:"${label}"+Yt("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:Pe(u,e),style:n},t.createElement(P,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:l,labelWrap:o,colon:!1,disabled:i,labelCol:{flex:this.verticalLayout?"initial":Fn(a)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t.createElement(pa.Provider,{value:this.provide},t.createElement(_,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}Kc.contextType=Wt,Kc.propTypes=gl,Kc.defaultProps=vl;const zc={onActivate:At.func,onAddUndo:At.func,onBeforeAddUndo:At.func,onBeforeExecCommand:At.func,onBeforeGetContent:At.func,onBeforeRenderUI:At.func,onBeforeSetContent:At.func,onBeforePaste:At.func,onBlur:At.func,onChange:At.func,onClearUndos:At.func,onClick:At.func,onContextMenu:At.func,onCommentChange:At.func,onCopy:At.func,onCut:At.func,onDblclick:At.func,onDeactivate:At.func,onDirty:At.func,onDrag:At.func,onDragDrop:At.func,onDragEnd:At.func,onDragGesture:At.func,onDragOver:At.func,onDrop:At.func,onExecCommand:At.func,onFocus:At.func,onFocusIn:At.func,onFocusOut:At.func,onGetContent:At.func,onHide:At.func,onInit:At.func,onKeyDown:At.func,onKeyPress:At.func,onKeyUp:At.func,onLoadContent:At.func,onMouseDown:At.func,onMouseEnter:At.func,onMouseLeave:At.func,onMouseMove:At.func,onMouseOut:At.func,onMouseOver:At.func,onMouseUp:At.func,onNodeChange:At.func,onObjectResizeStart:At.func,onObjectResized:At.func,onObjectSelected:At.func,onPaste:At.func,onPostProcess:At.func,onPostRender:At.func,onPreProcess:At.func,onProgressState:At.func,onRedo:At.func,onRemove:At.func,onReset:At.func,onSaveContent:At.func,onSelectionChange:At.func,onSetAttrib:At.func,onSetContent:At.func,onShow:At.func,onSubmit:At.func,onUndo:At.func,onVisualAid:At.func,onSkinLoadError:At.func,onThemeLoadError:At.func,onModelLoadError:At.func,onPluginLoadError:At.func,onIconsLoadError:At.func,onLanguageLoadError:At.func},Wc=Object.assign({apiKey:At.string,id:At.string,inline:At.bool,init:At.object,initialValue:At.string,onEditorChange:At.func,value:At.string,tagName:At.string,cloudChannel:At.string,plugins:At.oneOfType([At.string,At.array]),toolbar:At.oneOfType([At.string,At.array]),disabled:At.bool,textareaName:At.string,tinymceScriptSrc:At.string,rollback:At.oneOfType([At.number,At.oneOf([!1])]),scriptLoading:At.shape({async:At.bool,defer:At.bool,delay:At.number})},zc),Bc=e=>"function"==typeof e,Uc=e=>e in zc,Gc=e=>e.substr(2),Yc=(e,t,n,r,i)=>((e,t,n,r,i,a,l)=>{const o=Object.keys(i).filter(Uc),s=Object.keys(a).filter(Uc),c=o.filter((e=>void 0===a[e])),d=s.filter((e=>void 0===i[e]));c.forEach((e=>{const t=Gc(e),r=l[t];n(t,r),delete l[t]})),d.forEach((n=>{const i=r(e,n),a=Gc(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 Xc=0;const Qc=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return Xc++,e+"_"+n+Xc+String(t)},Zc=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Jc=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),ed=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},td=()=>({listeners:[],scriptId:Qc("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),nd=(()=>{let e=td();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=td()}}})(),rd=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class id 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=rd(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,Jc(o).concat(Jc(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&&!Zc(i)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&Bc(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;ed(this.editor,i?"readonly":"design"),this.props.init&&Bc(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(i.style.visibility=""),Zc(i)&&(i.value=this.getInitialValue()),a.init(l)},this.id=this.props.id||Qc("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;ed(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,r,i,a;null!==rd(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&nd.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=rd(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){Yc(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 ad;id.propTypes=Wc,id.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(ad||(ad={}));const ld=e=>{var n;const{className:r,style:i,tinymce:a={},upload:l={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:d,onResizeEditor:u,onChange:p}=e,{global:h}=t.useContext(Wt),{$size:m}=Cn(e),{$locale:f,t:g}=Sn(),v=400,y="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",b="file edit view insert format tools table help",x="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",E=Object.assign(Object.assign({height:a.height||v,plugins:a.plugins||y,toolbar:a.toolbar||x,menubar:a.menubar||b,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:ad[f],skin:"tinymce-5"},_n(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>En(void 0,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(g("qm.upload.uploadError"));const a=yield e.json();if(200===a.code){const e=i?de(a.data,i):a.data;t(e)}}catch(e){R.error(g("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)}))}}),S=Kn("tinymce"),w={[S]:!0,[`${S}--lg`]:"large"===m,[`${S}--sm`]:"small"===m},C={init:E,value:d,disabled:c,tinymceScriptSrc:s||(null===(n=null==h?void 0:h.tinymce)||void 0===n?void 0:n.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return t.createElement("div",{className:Pe(w,r),style:i},t.createElement(id,C))};ld.displayName="QmTinymce";class od extends s{constructor(){super(...arguments),this.imgRef=t.createRef()}componentDidMount(){const e=bn(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 _t(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={[Kn("cropper")]:!0};return t.createElement("div",{className:Pe(l,e),style:n},t.createElement("img",{ref:this.imgRef,src:r,alt:i,style:Object.assign({maxWidth:"100%"},a)}))}}od.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};const sd=e=>{const{fileTypes:n=[],fileSize:r,fixedSize:i,quality:a,beforeCrop:l,className:o}=e,{t:s}=Sn(),c=t.useRef(null),d=t.useRef(),u=t.useRef(),p=t.useRef(),h=t.useRef(),[m,f]=t.useState(""),g=e=>{c.current.relativeZoom(e,void 0)},v=e=>{c.current.rotate(e)},y=()=>{f("")},b=Kn("cropper-preview");return t.createElement(t.Fragment,null,(()=>{const n=Array.isArray(e.children)?e.children[0]:e.children;if(!n)return null;const r=n.props,{beforeUpload:i}=r,a=bn(r,["beforeUpload"]);return d.current=i,t.createElement(n.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((n,r)=>En(void 0,void 0,void 0,(function*(){const r=()=>n(I.LIST_IGNORE);if(l&&!(yield l(e,t)))return void r();u.current=e,p.current=n,h.current=r;const i=new FileReader;i.onload=()=>{f(i.result),i.onload=null},i.readAsDataURL(e)}))))}))})(),m&&t.createElement(A,{open:!0,wrapClassName:Pe(b,o),title:s("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{En(void 0,void 0,void 0,(function*(){const{type:e,name:t,uid:r}=u.current;c.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((i=>En(void 0,void 0,void 0,(function*(){let a=new File([i],t,{type:e});if(Object.assign(a,{uid:r}),n.length&&!n.includes(a.name.slice(a.name.lastIndexOf(".")+1).toLowerCase()))return R.warning(s("qm.upload.tooltip",{type:n.join(",")})),h.current("file type is error");if("function"!=typeof d.current)return p.current(a);const l=d.current(a,[a]);if("boolean"==typeof l||l){if(!0===l)return p.current(a);if(!1===l)return h.current("not upload");if(l&&"function"==typeof l.then)try{const e=yield l,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(a=e),p.current(a)}catch(e){h.current(e)}}else Mn("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,a),yield kn(100),y()}))},onCancel:y,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:i?`calc(380px * ${i[1]/i[0]})`:"auto"};return t.createElement("div",{className:"cropper-preview"},t.createElement("div",{className:"cropper-area"},t.createElement("div",{className:"img-cropper"},t.createElement(od,{ref:c,aspectRatio:i?i[0]/i[1]:i,src:m,dragMode:"move",preview:".preview"})),t.createElement("div",{className:"actions"},t.createElement(C,{size:"small"},t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Qe,null),onClick:()=>g(.2)},s("qm.uploadCropper.zoomIn")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Ze,null),onClick:()=>g(-.2)},s("qm.uploadCropper.zoomOut")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Je,null),onClick:()=>v(90)},s("qm.uploadCropper.rotatePlus")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(et,null),onClick:()=>v(-90)},s("qm.uploadCropper.rotateSubtract"))))),t.createElement("div",{className:"preview-area"},t.createElement("div",{className:"preview",style:e})))})()))},cd=e=>{const n=Xt({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:r=[],openCropper:i=!0,fixedSize:a,quality:l=1,fileTypes:o,fileSize:s,maxCount:c,draggable:d,disabled:u,readOnly:p,className:h,popupClassName:m,beforeCrop:f,onSortChange:g,onChange:v}=n,{t:y}=Sn(),{$size:b}=Cn(n),x=t.useRef(null),E=t.useRef(null),S=t.useRef(!1),[w,C]=t.useState(!1),[N,T]=t.useState(0),O=t.useMemo((()=>u||p),[u,p]),k=t.useMemo((()=>!c||r.length<c),[r,c]);t.useEffect((()=>(A(),document.addEventListener("paste",_),()=>{var e;null===(e=E.current)||void 0===e||e.destroy(),document.removeEventListener("paste",_)})),[]),Ei((()=>{k||(S.current=!1)}),[r]);const L=wn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...r],[i]=e.splice(t,1);e.splice(n,0,i),null==g||g(e),null==v||v({fileList:e})}})),A=()=>{d&&(E.current=It.create(ki(x.current,Kn("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:L}))},P=(e,t)=>new Promise(((r,i)=>En(void 0,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:l,beforeUpload:o}=n,s=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),c=!l||e.size/1024/1024<l,d=s&&c;if(s||R.warning(y("qm.upload.tooltip",{type:a.join(",")})),c||R.warning(y("qm.upload.sizeLimit",{size:l})),!d)return I.LIST_IGNORE;if(o){const n=o(e,t);if(!0===n)return r(e);if(!1===n)return i("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;r(e)}catch(e){i(e)}}else r(e)})))),_=wn((e=>En(void 0,void 0,void 0,(function*(){const{action:t,data:i,headers:a}=n;if(S.current&&k&&t)for(const n of e.clipboardData.items)if("file"===n.kind&&n.type.startsWith("image/")){const e=n.getAsFile(),l=Date.now(),o=new File([e],`screenshot-${l}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${l}`});try{yield P(o,[...r,o]);const e=new FormData;if(e.append("file",o),i)for(const t in i)e.append(t,i[t]);const n="string"==typeof t?t:yield t(o),l=yield fetch(n,{method:"POST",body:e,headers:a});if(!l.ok)throw new Error(y("qm.upload.uploadError"));const s=yield l.json();null==v||v({file:o,fileList:[...r,{uid:o.uid,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate,name:o.name,type:o.type,size:o.size,response:s,status:"done",percent:100,originFileObj:o}]})}catch(e){}}})))),H=Kn("upload-img"),F={[H]:!0,[`${H}--lg`]:"large"===b,[`${H}--sm`]:"small"===b},D=t.createElement(I,hn({className:Pe(F,h)},_n(n,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=r.findIndex((t=>t.url===e.url));t<0||(T(t),C(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,n,r,i)=>t.createElement("div",{className:Pe("upload-item",{handle:d})},e,!O&&t.createElement(Ge,{title:y("qm.upload.remove"),className:"icon",onClick:()=>i.remove()}))}),t.createElement("span",{className:"inner",ref:x},k&&!(p&&r.length)&&t.createElement(t.Fragment,null,t.createElement("p",{className:"ant-upload-drag-icon"},t.createElement(tt,null)),t.createElement("p",{className:"ant-upload-text"},y("qm.uploadCropper.dragableText")),t.createElement("button",{className:Pe("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{S.current=!0},onBlur:()=>{S.current=!1}},y("qm.uploadCropper.pasteText")))));return t.createElement(t.Fragment,null,i?t.createElement(sd,{className:m,fixedSize:a,quality:l,fileTypes:o,fileSize:s,beforeCrop:f},D):D,t.createElement("div",{style:{display:"none"}},t.createElement(U.PreviewGroup,{preview:{visible:w,current:N,rootClassName:m,onVisibleChange:e=>C(e)}},r.map(((e,n)=>{var r;return t.createElement(U,{key:null!==(r=e.uid)&&void 0!==r?r:n,src:e.url,alt:""})})))))};cd.displayName="QmUploadImg";const dd=(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=dd(a.children,t,n);e&&(r=e)}}return r},ud=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&ud(e.children,t),t(e)||e.children&&e.children.length))),pd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...pd(e.children,t)),t(e)&&n.push(e)})),n},hd=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=hd(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},md=(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:md(e.children,t,n,r)}):e)),fd=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...fd(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},gd=(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=gd(e[r].children,t,n);if(i)return[e[r][n],i].flat()}}},vd=(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(...vd(e,t)))),r},yd=t.forwardRef(((e,n)=>{const{className:r,style:i,filterable:a=!0,multiple:l,draggable:o,dataSource:s,fetch:c,autoFocus:d,asyncLoad:u,checkStrictly:p,checkStrategy:h="SHOW_CHILD",placeholder:m,fieldsDefine:f,value:g,height:v,defaultSelectedKeys:y=[],defaultExpandAll:b=!0,showSearchBar:x=!0,showCollapse:E=!0,onSelectChange:S,onCheckChange:w,onDragStart:C,onDragChange:N,onExpand:T}=e,{$size:I}=Cn(e),{t:R}=Sn(),k=(null==f?void 0:f.valueKey)||"value",L=(null==f?void 0:f.textKey)||"text";null==f||f.children;const A=t.useRef(null),P=t.useRef(null),_=zi(A),[H,F]=t.useState(v),[D,$]=t.useState(!1),M=Wi((()=>{F(A.current.offsetHeight-J.current.offsetHeight-10)}),5);Zt((()=>{v||M()}),[_.height]);const[q,j]=t.useState([]),[V,K]=t.useState({}),[z,W]=t.useState([]),[B,U]=t.useState([]),[Y,X]=t.useState(""),[Q,Z]=t.useState(b),J=t.useRef(null),ee=t.useRef([]),te=t.useRef([]);t.useEffect((()=>{Array.isArray(s)&&(ne(s),W(re(s)),K({}))}),[s]),t.useEffect((()=>{var e;le(),d&&(null===(e=P.current)||void 0===e||e.focus())}),[]),Ei((()=>{le()}),[null==c?void 0:c.params]),Ei((()=>{U(ae())}),[V]),t.useImperativeHandle(n,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],r=hd(q,(t=>e===t[k]));r&&(Array.isArray(r.children)?r.children.push(...n):r.children=[...n],ne([...q]))},REMOVE_RECORD:e=>{var t;const n=dd(q,e,k);if(void 0===n&&q.find((t=>t[k]===e)))ne(q.filter((t=>t[k]!==e)));else{const r=hd(q,(e=>n===e[k]));if(!r)return;const i=null===(t=r.children)||void 0===t?void 0:t.findIndex((t=>e===t[k]));i>=0&&(r.children.splice(i,1),ne([...q]))}},UPDATE_RECORD:(e,t)=>{const n=hd(q,(t=>e===t[k]));n&&(ge(n,t),ne([...q]))}})));const ne=e=>{j(e),ee.current=e,te.current=fd(e,k)},re=e=>{if(l)return y;const t=pd(e,(e=>y.includes(e[L])));return 1===t.length?[t[0][k]]:[]},ie=e=>{var t;return(null===(t=gd(q,e,k))||void 0===t?void 0:t.slice(0,-1))||[]},ae=()=>{if(b)return te.current;const e=[];return z.forEach((t=>{if(l){if("SHOW_ALL"===h&&!te.current.includes(t)&&e.push(...ie(t)),"SHOW_CHILD"===h&&e.push(...ie(t)),"SHOW_PARENT"===h){const n=Nl(q,t);if(n){const r=ie(t),i=vd(n,k);e.push(...r,...[t,...i].filter((e=>te.current.includes(e))))}}}else e.push(...ie(t))})),[...new Set(e)]},le=()=>En(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{$(!0);const l=yield t(n);if(200===l.code){let t=Array.isArray(l.data)?l.data:null!==(e=de(l.data,r))&&void 0!==e?e:[];t="function"==typeof i?yield i(t):t,ne(t),W(re(t)),K({}),null==a||a(t)}}catch(e){}$(!1)})),oe=e=>`${e}|${jl.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,se=Kn("search-tree"),ce={[se]:!0,[`${se}--lg`]:"large"===I,[`${se}--sm`]:"small"===I};return t.createElement("div",{ref:A,className:Pe(ce,r),style:i},t.createElement("div",{ref:J,className:"topper"},x&&t.createElement(O.Search,{ref:P,value:Y,size:I,placeholder:m||R("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=ud(ee.current,(t=>{if(!e)return!0;const n=t[L]||"";return-1!==oe(n).indexOf(e)}));X(e),j(t),b||e?U(fd(t,k)):K({})})(e.target.value)}),E&&t.createElement("a",{className:"trigger",onClick:()=>{Z(!Q),U(Q?[]:te.current)}},Q?t.createElement(_e,null):t.createElement(He,null)," ",R(Q?"qm.form.collect":"qm.form.spread"))),t.createElement(Mi,{spinning:D},t.createElement(G,{fieldNames:{title:L,key:k,children:"children"},multiple:l,draggable:o,blockNode:o,checkable:l,selectable:!l,height:H,disabled:e.disabled,checkStrictly:p,selectedKeys:null!=g?g:z,checkedKeys:null!=g?g:z,expandedKeys:B,treeData:q,loadData:u?({key:e,children:t})=>En(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),{[k]:e})));if(200===t.code){let r=Array.isArray(t.data)?t.data:null!==(n=de(t.data,a))&&void 0!==n?n:[];r="function"==typeof o?yield o(r):r;const i=md(ee.current,e,k,r);ne(i)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!Y)return!1;const t=e[L]||"";return-1!==oe(t).indexOf(Y)},onDragStart:C,onDragEnter:e=>{U(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][k]===t)return n(e[r],r,e);e[r].children&&a(e[r].children,t,n)}},l=[...q];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)}));ne(l)},onDragEnd:e=>{null==N||N(e,q)},onExpand:(e,t)=>{Pn(e)&&Z(!1),te.current.every((t=>e.includes(t)))&&Z(!0),U(e),null==T||T(e,t)},onSelect:e=>{W(e);const t=pd(ee.current,(t=>e.includes(de(t,k))));null==S||S(l?t:t[0])},onCheck:e=>{p&&(e=e.checked),W(e),"SHOW_CHILD"===h&&(e=e.filter((e=>!te.current.includes(e)))),"SHOW_PARENT"===h&&(e=e.filter(((e,t,n)=>!n.includes(dd(q,e,k)))));const t=pd(ee.current,(t=>e.includes(de(t,k))));null==w||w(l?t:t[0])}})))}));yd.displayName="QmSearchTree";const bd=n(void 0),xd={dataIndex:Pt.string.isRequired,title:Pt.string.isRequired,description:Pt.string,colSpan:Pt.number,width:Pt.number,minWidth:Pt.number,fixed:Pt.oneOf(["left","right"]),align:Pt.oneOf(["left","center","right"]),theadAlign:Pt.oneOf(["left","center","right"]),printFixed:Pt.bool,hidden:Pt.bool,noAuth:Pt.bool,noFixed:Pt.bool,ellipsis:Pt.bool,className:Pt.string,theadClassName:Pt.string,children:Pt.array,sorter:Pt.oneOfType([Pt.bool,Pt.func]),filter:Pt.shape({type:Pt.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:Pt.arrayOf(Pt.shape({text:Pt.string,value:Pt.oneOfType([Pt.string,Pt.number])})),style:Pt.object}),precision:Pt.number,displayPrecision:Pt.number,formatType:Pt.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:Pt.bool,canCopy:Pt.bool,editRender:Pt.func,dictItems:Pt.arrayOf(Pt.shape({text:Pt.string,value:Pt.oneOfType([Pt.string,Pt.number])})),summation:Pt.shape({sumBySelection:Pt.bool,displayWhenNotSelect:Pt.bool,dataKey:Pt.string,unit:Pt.string,render:Pt.func}),groupSummary:Pt.shape({dataKey:Pt.string,unit:Pt.string,render:Pt.func}),shouldCellUpdate:Pt.func,headRender:Pt.func,render:Pt.func};Pt.arrayOf(Pt.shape(xd)).isRequired,Pt.func,Pt.array,Pt.oneOfType([Pt.string,Pt.func]).isRequired,Pt.number,Pt.bool,Pt.bool,Pt.shape({api:Pt.func.isRequired,params:Pt.object.isRequired,formatter:Pt.func,beforeFetch:Pt.func,afterFetch:Pt.func,stopToFirst:Pt.bool,dataKey:Pt.string,callback:Pt.func}),Pt.bool,Pt.bool,Pt.string,Pt.string,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.oneOfType([Pt.object,Pt.func]),Pt.oneOfType([Pt.object,Pt.func]),Pt.array,Pt.func,Pt.bool,Pt.object,Pt.object,Pt.shape({type:Pt.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:Pt.array,selectedRowKeys:Pt.array,hideSelectAll:Pt.bool,checkStrictly:Pt.bool,filterable:Pt.bool,selectByClickRow:Pt.bool,selectFirstRowOnChange:Pt.bool,clearableAfterFetched:Pt.bool,selectAllOnCurrentPage:Pt.bool,fetchSelectedRows:Pt.shape({api:Pt.func.isRequired,params:Pt.object,dataKey:Pt.string}),fetchAllRowKeys:Pt.shape({api:Pt.func.isRequired,params:Pt.object,dataKey:Pt.string}),disabled:Pt.func,onChange:Pt.func,onSelect:Pt.func,onSelectAll:Pt.func}),Pt.shape({currentRowKey:Pt.oneOfType([Pt.number,Pt.string]),disabled:Pt.func,onChange:Pt.func}),Pt.shape({virtual:Pt.bool,doubleXScrollbar:Pt.bool}),Pt.shape({virtual:Pt.bool,expandIconColumn:Pt.string}),Pt.shape({defaultExpandAllRows:Pt.bool,defaultExpandedRowKeys:Pt.array,expandedRowKeys:Pt.array,hideExpandAll:Pt.bool,rowExpandable:Pt.func,expandedRowClassName:Pt.string,expandedRowRender:Pt.func,onExpand:Pt.func,onChange:Pt.func}),Pt.shape({cellMerge:Pt.bool,onCellMerge:Pt.func,onSelectChange:Pt.func}),Pt.shape({groupItems:Pt.arrayOf(Pt.shape({dataIndex:Pt.string.isRequired,titleIndex:Pt.string,color:Pt.string,backgroundColor:Pt.string})),fetch:Pt.shape({api:Pt.func.isRequired,params:Pt.object,dataKey:Pt.string}),onChange:Pt.func}),Pt.func,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.shape({current:Pt.number,pageSize:Pt.number,pageSizeOptions:Pt.array,showSizeChanger:Pt.bool,showQuickJumper:Pt.bool}),Pt.shape({fileName:Pt.string,fetch:Pt.shape({api:Pt.func.isRequired,params:Pt.object}),beforeExport:Pt.func,cellStyle:Pt.bool,hideIcon:Pt.bool}),Pt.shape({showLogo:Pt.bool}),Pt.shape({fetch:Pt.shape({api:Pt.func.isRequired,params:Pt.object,dataKey:Pt.string}),fieldList:Pt.arrayOf(Pt.object)}),Pt.shape({position:Pt.oneOf(["top","bottom"]),hideAlert:Pt.bool,hideClearButton:Pt.bool}),Pt.oneOf(["left","right"]),Pt.func,Pt.func,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.bool,Pt.func,Pt.func,Pt.func,Pt.func,Pt.func,Pt.func,Pt.func,Pt.func,Pt.func;const Ed={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},Sd=10,wd="1",Cd="0",Nd="YYYY-MM-DD",Td="YYYY-MM-DD HH:mm:ss",Id="YYYYMMDDHHmmss",Rd={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 Od;!function(e){e.left="flex-start",e.right="flex-end"}(Od||(Od={}));const kd=Object.assign({},e).useId;let Ld=0;var Ad=kd?function(e){const t=kd();return e||t}:function(t){const[n]=e.useState(`qm_unique_${Ld}`);return e.useEffect((()=>{Ld+=1}),[]),t||n};let Pd=[];const _d={_getInstance:function(e){var t;return null!==(t=Pd.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=Pd[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==Pd.findIndex((e=>e===t))&&(this.deregister(e),Pd=[t,...Pd])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),Pd=[{id:e,vm:t},...Pd])},deregister:function(e){e&&(Pd=Pd.filter((t=>t.id!==e)))}};class Hd{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 Fd={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 Dd(e){return void 0!==e}function $d(t,n){const{defaultValue:r,value:i,onChange:a,postState:l}=n||{},[o,s]=e.useState((()=>Dd(i)?i:Dd(r)?"function"==typeof r?r():r:"function"==typeof t?t():t)),c=Dd(i)?i:o,d=l?l(c):c,u=wn(a),[p,h]=e.useState([c]);Zt((()=>{const e=p[0];o!==e&&u(o,e)}),[p]),Zt((()=>{Dd(i)||s(i)}),[i]);return[d,wn((e=>{s(e),h([c])}))]}let Md;const qd=()=>{var e;if(Nn)return 0;if(void 0!==Md)return Md;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),Md=n-i,Md},jd=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=jd(t.children)),t})),Vd=(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:N,selectionKeys:T,sorter:I,filters:R,superFilters:O,pagination:k,mergedTdCells:L}=n,{selectionRows:A,summaries:P}=S.current,{expandIconColumn:_=""}=p||{},{t:H}=Sn(),F=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]})(jd(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Fd.selectionColumn,title:"radio"===t?H("qm.table.config.selectionText"):"",width:Fd.selectionColumnWidth,fixed:"left",type:t}})(c),r=(null==(i=u)?void 0:i.expandedRowRender)?{dataIndex:Fd.expandableColumn,title:"",width:Fd.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return n&&t.unshift(n),r&&t.unshift(r),Ra(t)},D=t.useMemo((()=>!!(null==r?void 0:r.api)),[null==r?void 0:r.api]),$=t.useMemo((()=>!D&&!!h),[D,h]),M=t.useMemo((()=>D&&!!m),[D,m]),q=t.useMemo((()=>(D||$)&&!M),[D,$,M]),j=t.useMemo((()=>!!(a||l||o)),[a,l,o]),V=t.useMemo((()=>F(i)),[i]),K=t.useMemo((()=>Ia(V)),[V]),z=t.useMemo((()=>K.filter((e=>"function"==typeof e.editRender))),[K]),W=t.useMemo((()=>K.filter((e=>!!e.summation))),[K]),B=t.useMemo((()=>K.filter((e=>"left"===e.fixed))),[K]),U=t.useMemo((()=>K.filter((e=>"right"===e.fixed))),[K]),G=t.useMemo((()=>(e=>{const t=[];return e.forEach((e=>{const n=C.find((t=>w(t,t.index)===e.rowKey)),r=K.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,K,C]),Y=t.useMemo((()=>{var e,t;const n=K.filter((e=>![Fd.expandableColumn,Fd.selectionColumn,Fd.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:""}),[K,_]),X=t.useMemo((()=>W.length>0),[W]),Q=t.useMemo((()=>!!E||X),[E,X]),Z=t.useMemo((()=>Da(V).length>1),[V]),J=t.useMemo((()=>s||Z),[s,Z]),ee=t.useMemo((()=>K.some((e=>e.sorter))),[K]),te=t.useMemo((()=>K.some((e=>e.filter))),[K]),ne=t.useMemo((()=>W.some((e=>!!e.summation.dataKey))),[W]),re=t.useMemo((()=>!D&&!!y),[D,y]),ie=t.useMemo((()=>!!b&&z.length>0),[b,z]),ae=t.useMemo((()=>!!x&&"checkbox"===(null==c?void 0:c.type)),[x,c]),le=t.useMemo((()=>!!f&&te),[f,te]),oe=t.useMemo((()=>!D&&!!g&&te),[D,g,te]),se=t.useMemo((()=>!!v&&K.some((e=>!!e.groupSummary))),[K]),ce=t.useMemo((()=>{var e;return!!(null===(e=null==d?void 0:d.groupItems)||void 0===e?void 0:e.length)}),[d]),de=t.useMemo((()=>C.some((e=>Array.isArray(e.children)))),[C]),ue=t.useMemo((()=>!N.length),[N]),pe=t.useMemo((()=>(()=>{const e={};return W.forEach((t=>{const{dataIndex:n,precision:r,displayPrecision:i,summation:a}=t,{sumBySelection:l,displayWhenNotSelect:o,unit:s}=a,c=ce?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[Fd.summaryIgnore])return e;const r=ja(t,n);return za(r)?e.plus(r):e}),new Ht(0));!Object.keys(P).includes(n)||l&&!d||(u=new Ht(ja(P,n))),Va(e,n,u.toNumber());let p=r>=0?u.toFixed(r):u.toString();i>=0&&""!==p&&(p=Ba(p,i)),p=Wa(p),Va(e,`${n}_text`,s?`${p} ${s}`:p)})),[e]})()),[N,T,P]),he=t.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(W)),[W]),me=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?{[Fd.sorterFieldName]:t}:null,a=n.length?{[Fd.filterFieldName]:n}:null,l=he?{[Fd.groupSummary.summaryFieldName]:he,usedJH:1}:null,o=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:null,s={[Fd.currentPageName]:k.current,[Fd.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,he]);return{isFetch:D,isWebPagination:$,isScrollPagination:M,showPagination:q,shouldUpdateHeight:j,tableColumns:V,flattenColumns:K,editableColumns:z,summationColumns:W,leftFixedColumns:B,rightFixedColumns:U,derivedMergeCells:G,treeExpandIndex:Y,showSummary:X,showFooter:Q,isHeadGroup:Z,bordered:J,isHeadSorter:ee,isHeadFilter:te,isServiceSummation:ne,isSelectCollection:ae,isTableImport:re,isTableClipboard:ie,isSuperSearch:le,isFastSearch:oe,isGroupSummary:se,isGroupSubtotal:ce,isTreeTable:de,isTableEmpty:ue,summationRows:pe,fetchParams:me}},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:N,$size:T,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:Q,setTableOriginData:Z,setTableFlatData:J,setAllTableData:ee,setDeriveRowKeys:te,setPagination:ne,setSpinning:re,setSorter:ie,setFilters:ae,setSuperFilters:le,setSelectionKeys:oe,setRowExpandedKeys:se,setHighlightKey:ce,setSelectionRows:ue,setScrollXLoad:pe,setScrollYLoad:he,setScrollXStore:me,setScrollYStore:fe,computeVirtualX:ge,computeVirtualY:ve,setFieldAuth:ye,setResizeState:xe,setSummaries:Ee,setPermission:Se,setRecordsMap:we,resetTableScroll:Ce,clearElementStore:Ne,clearRecordsMap:Te}=n,{t:Ie}=Sn(),{store:Re,scrollBarRef:Oe}=w.current,ke=Number.parseInt(t.version)>=18?Ft.flushSync:null,Le=t.useRef(Object.assign({},F)),Ae=t.useRef(new Map),Pe=t.useRef(!1),_e=zi(C);Zt((()=>{qe(),w.current.scrollXLoad?Ve(Oe.current.scrollLeft):Ke(),G()}),[I]),Zt((()=>{He()}),[_e,T,i,A.tableAutoHeight]),Ei((()=>{It(),Rt(),Ot(),V||(z&&gt(),dt(a)),s&&ie(s),c&&ae(c)}),[a,null==o?void 0:o.params]),Ei((()=>{const e=at(F,Le.current);e||V&&(null==d?void 0:d.clearableAfterFetched)&&kt(),!e&&F[Fd.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?gt():V&&st(),Le.current=F}),[F]),Ei((()=>{z&&wt(),W||Ce(),nt()}),[L.current,L.pageSize]),Ei((()=>{w.current.scrollYLoad&&Be(Oe.current.scrollTop),V||De(k.length),G()}),[k]),Ei((()=>{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(),xe(Object.assign({},n,{width:a,height:l}))},Fe=()=>{M&&N.current.setClickedValues([M,""]),"radio"===(null==d?void 0:d.type)&&D.length&&N.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=()=>{pe(R.length>Fd.virtualScrollX)},je=(e=[])=>{let t=e.length>Fd.virtualScrollY;(null==p?void 0:p.virtual)&&(t=!0),(null==h?void 0:h.virtual)&&(t=!0),he(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||(me(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 el(e,[i.dataIndex]).map((e=>{const n={children:Xe(e,t+1),_group:i.dataIndex};return"function"!=typeof r&&Va(n,r.toString(),Ya()),i.titleIndex&&Va(n,i.titleIndex,ja(e[0],i.titleIndex)),Va(n,i.dataIndex,ja(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[Fd.summaryIgnore])return e;const n=Number(ja(t,r));return Number.isNaN(n)?e:e+n}),0);Va(n,r,i)})),n}))},Qe=e=>{oe(e),ue((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))},Ze=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=Ha(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=nl(i,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Ha(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&&Mn("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];M&&e.unshift(M);let o=[];return e.forEach((e=>{const t=nl(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(qa(e,t));return 1===n.length&&(n.includes(Fd.currentPageName)||n.includes(Fd.pageSizeName))},lt=()=>En(void 0,void 0,void 0,(function*(){var t;if(!m)return;let n=_n(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?de(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;Se((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!r})))}if(Array.isArray(n.fieldList)){const{originColumns:t}=w.current,r=ka(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=La(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=()=>En(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:r=(e=>e),beforeFetch:i=On,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:Fd.dataKey;let l=null!==(n=de(e.data,r))&&void 0!==n?n:[];l="function"==typeof a?yield a(l):l;const c=de(e.data,r.replace(/[^.]+$/,Fd.totalKey))||l.length||0,d=Math.max(Math.ceil(c/L.pageSize),1);if(F[Fd.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),Nt(t),Qe(Ze()),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:Fd.summationKey,a=null!==(r=i?de(e,i):e)&&void 0!==r?r:{},o={};q.filter((e=>!!e.summation.dataKey)).forEach((e=>{Va(o,e.dataIndex,Number(ja(a,e.summation.dataKey)))})),Ee(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);Qe([t])}else Qe([])}},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=>{Q(e),ee(e),te(e),Tt(),vt(),wt()},Nt=e=>{Z(e)},Tt=()=>{Te(),w.current.allTableData.forEach((e=>we(S(e,e.index),e)))},It=()=>{ie({})},Rt=()=>{ae({})},Ot=()=>{le([])},kt=()=>{Qe([])};return{initialTable:()=>{lt(),Fe(),qe(),je(),V?ot():dt(a)},checkDataIndex:()=>{const e=R.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&Mn("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:Ct,getTableData:ot,handleTableData:Et,createWebPageData:bt,createTableData:dt,createGroupData:Ge,createSelectionKeys:Ze,createRowExpandedKeys:Je,setSelectionKeysEffect:Qe,findParentRowKeys:tt,getAllChildRowKeys:et,doFieldValidate:(e,t,n,r)=>{if(!Array.isArray(e))return Mn("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Re.removeFromRequired({x:n,y:r}),Re.removeFromValidate({x:n,y:r}),e.forEach((e=>{var i;e.required&&Pn(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=be(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=>![...be(r,n),...be(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;Ne(),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:N,setScrollY:T,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:`${Ma(i)}px`}),a&&Object.assign(n,{maxHeight:`${Ma(a)}px`}),w?Object.assign(Object.assign({},n),{maxHeight:"",minHeight:"",height:`${e}px`}):r?Object.assign(Object.assign({},n),{height:"auto"!==r?`${Ma(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+Sd:0,r=e.$pager?e.$pager.offsetHeight+Sd:0;u=n.winHeight-t-r-20}(t||l!==y.viewportHeight)&&F(l),L.current=c,T(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]):ae(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=Aa(La(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=Pa(La(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?io["small"!==h?"middle":h]+Sd:0)-Sd;C((e=>Object.assign({},e,{tableAutoHeight:n})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&$("",0),k(!0)},computeVirtualX:H,computeVirtualY:D,doLayout:()=>{l?P():Ln((()=>P())),(()=>{const{elementStore:e,scrollXLoad:t}=d.current,n=e.$table.clientWidth,r=L.current?y.gutterWidth:0,{defaultColumnWidth:i}=Fd,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){N(!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 N(!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),N(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=na(t,n),i=wn(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(bd),{infoBarConfig:h,rowSelection:m,rowHighlight:f}=r.current.props,{allTableData:g,invalidRowKeys:v}=r.current,{hideAlert:y,hideClearButton:b}=h||{},{t:x}=Sn(),E=t.useMemo((()=>!y),[y]),S=t.useMemo((()=>!b&&!!(a||l||m||f)),[b,a,l,m,f]),w={[`${Kn("table")}__alert`]:!0};return E?t.createElement("div",{className:Pe(w)},t.createElement("i",{className:"svgicon icon"},t.createElement(nt,null)),t.createElement("span",null,x("qm.table.alert.total",{total:o?g.length:n}),m?`,${x("qm.table.alert.selected",{total:Math.max(i.length-v.length,0)})}`:""),S&&t.createElement("em",{onClick:()=>{c(),d(),u(),p(),Ln((()=>s()))}},x("qm.table.alert.clear"))):null},Ud=t.forwardRef(((e,n)=>{const{isFullScreen:r,open:i=!0}=e,{setFullScreen:a}=t.useContext(bd),{t:l}=Sn(),o=()=>{a(!r)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=Kn("table");return i?t.createElement("span",{className:`${s}-full-screen`,title:l(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},r?t.createElement(Ke,null):t.createElement(ze,null))):null}));Ud.displayName="FullScreen";const Gd=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{getTableData:i}=t.useContext(bd),{t:a}=Sn(),l=()=>{i()};t.useImperativeHandle(n,(()=>({clickHandle:l})));const o=Kn("table");return r?t.createElement("span",{className:`${o}-reload`,title:a("qm.table.refresh.text"),onClick:()=>l()},t.createElement("i",{className:"svgicon icon"},t.createElement(Xe,null))):null}));Gd.displayName="Reload";const Yd=()=>{const e={dateFormat:e=>{const t=e?h(e).format(Nd):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?h(e).format(Td):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?h(e).format(Td.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>za(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>Wa(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=za(m)?new Ht(m).toFixed(c):m),d>=0&&""!==m&&(m=Ba(m,d)),u){const t=e[`${An(u)}Format`];t?m=t(m):Mn("Table","字段的格式化类型 `formatType` 配置不正确")}return m},n=e=>Tn(e)?Xa(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,r,i,a)=>{const l=ja(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(Wt),{tableRef:d,flattenColumns:u,summationRows:p,showSummary:h,getSpan:m}=t.useContext(bd),{tablePrint:f,showHeader:g}=d.current.props,{t:v}=Sn(),{getTitleFromCellValue:y}=Yd(),b=null!==(i=null===(r=null==c?void 0:c.print)||void 0===r?void 0:r.leftLogo)&&void 0!==i?i:"",x=null!==(l=null===(a=null==c?void 0:c.print)||void 0===a?void 0:a.rightLogo)&&void 0!==l?l:"",E=!(!b&&!x),S=t.useMemo((()=>Hn(_a(o,[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn]))),[o]),w=t.useMemo((()=>Hn(_a(u,[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn]))),[u]),C=t.useMemo((()=>Hn(o.filter((e=>e.printFixed)))),[o]),N=e=>{const t=Object.assign({},tl(S,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?N(t):t},T=(e,t)=>xe(Ee(Se(e),t),we(((...e)=>Ce(...e,((e,n)=>{if(Array.isArray(e))return T(e.concat(n),t)}))))),I=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(N(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(Da(n))})),t},R=()=>{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||Fd.defaultColumnWidth,r<=Fd.printWidth?(n.push(a),i===e.length-1&&t.push(n),i++):i>0?(e.splice(0,i),C.length&&e.unshift(...C),t.push(n),n=[],r=0,i=0):(a.width=Fd.printWidth,n.push(a),t.push(n),i++)}return t})([...w]),n=I(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+=O(n[i],t[i],e),r+='<div class="page-break"></div>';return r+"</body></html>"},O=(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||Fd.defaultColumnWidth}px">`)).join("")}</colgroup>`,g&&(i+=["<thead>",r&&E?`<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">',b?`<img src="${b}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',x?`<img src="${x}" 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}">${Qa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(i+=`<tbody>${Fa(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*Fd.treeTable.textIndent}px"></span>`:""}${y(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):ja(e,`${i}_text`);return`<td>${0===r&&""===l?v("qm.table.config.summaryText"):Tn(l)?Xa(l).join(""):l}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},k=()=>{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});Qi(e,a)}})({filename:"print",type:"html",isDownload:!1},R()))||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:k})));const L=Kn("table");return s?t.createElement("span",{className:`${L}-print`,title:v("qm.table.print.text"),onClick:()=>k()},t.createElement("i",{className:"svgicon icon"},t.createElement(rt,null))):null}));Xd.displayName="TablePrint";const Qd="606060",Zd="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:Zd,color:{argb:Jd}},left:{style:Zd,color:{argb:Jd}},bottom:{style:Zd,color:{argb:Jd}},right:{style:Zd,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(bd),{spanMethod:a,showHeader:l}=e.current.props,{t:o}=Sn(),s=(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,s,c,d)=>En(void 0,void 0,void 0,(function*(){const{columns:u,footSummation:p}=t,{scrollYStore:{rowHeight:h}}=e.current,m=Ia(u),f=Da(u),g=[],v=[],y=[],b=[];let x=0;const E={};m.forEach((e=>{const{dataIndex:t,width:n,minWidth:r,renderWidth:i}=e;E[t]=Qa(e.title),y.push({key:t,width:(n||i||r||Fd.defaultColumnWidth)/8})})),l&&(i?f.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:r,rowSpan:i}=e,a=ru(e),l=m.findIndex((({dataIndex:e})=>e===a.dataIndex));n[a.dataIndex]=Qa(e.title),0!==r&&(r>1||i>1)&&b.push({s:{r:t,c:l},e:{r:t+i-1,c:l+r-1}})})),g.push(n)})):(m.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;(n>1||r>1)&&b.push({s:{r:x,c:t},e:{r:x+r-1,c:t+n-1}})})),g.push(E)),x+=g.length);const S=Fa(s).map(((e,t)=>{const r={};return m.forEach(((i,l)=>{if("function"==typeof a){const{rowSpan:r,colSpan:a}=n(e,i,t,l,s);(a>1||r>1)&&b.push({s:{r:t+x,c:l},e:{r:t+x+r-1,c:l+a-1}})}const o=["percent","finance"].includes(i.formatType);r[i.dataIndex]=o?ja(e,i.dataIndex):d(e,t,i,l)})),r._level=e._level,r}));x+=S.length,r&&p&&c(m,s).forEach(((e,t)=>{const n={};m.forEach(((t,r)=>{const{dataIndex:i,summation:a}=t,l=(null==a?void 0:a.render)?a.render(s):ja(e,i);n[i]=0===r&&""===l?o("qm.table.config.summaryText"):Tn(l)?Xa(l).join(""):l})),v.push(n)}));const{sheetName:w,useStyle:C}=t,N=new Kt.Workbook,T=N.addWorksheet(w);T.columns=y,l&&T.addRows(g).forEach((e=>{C&&eu(e,h),e.eachCell((e=>{const t=T.getColumn(e.col),n=La(u,t.key),{align:r,theadAlign:i}=n;tu(e,i||r),C&&Object.assign(e,{font:{bold:!0,color:{argb:Qd}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:nu()})}))})),T.addRows(S).forEach(((e,t)=>{const{_level:n}=S[t];C&&eu(e,h),e.eachCell((e=>{const t=T.getColumn(e.col),r=La(u,t.key),{align:i}=r;tu(e,i),Object.assign(e,iu(r)),C&&Object.assign(e,{font:{color:{argb:Qd}},border:nu()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),r&&p&&T.addRows(v).forEach((e=>{C&&eu(e,h),e.eachCell((e=>{const t=T.getColumn(e.col),n=La(u,t.key),{align:r}=n;tu(e,r),Object.assign(e,iu(n)),C&&Object.assign(e,{font:{color:{argb:Qd}},border:nu()})}))})),b.forEach((({s:e,e:t})=>{T.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const I=yield N.xlsx.writeBuffer();return new Blob([I],{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=Ia(n),a=new FileReader;a.onerror=()=>{R.error(o("qm.table.import.error"))},a.onload=e=>{const n=i.map((e=>Qa(e.title))),r=new Kt.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],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,l);if(c){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("")),ae(i)&&"text"in i&&(i=i.text),Ne(i)&&(i=Ga(i,Td)),(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:o}=i[n];Array.isArray(o)&&((null===(a=t[e])||void 0===a?void 0:a.toString().includes(","))?t[e]=t[e].split(",").map((e=>s(o,e))).filter((e=>""!==e)):t[e]=s(o,t[e])),Va(r,l,t[e])})),r}));null==t||t(r)}else R.error(o("qm.table.import.error"))}else R.error(o("qm.table.import.error"))})):R.error(o("qm.table.import.error"))},a.readAsArrayBuffer(r)}}},lu=e=>{const{fileType:n,onChange:r}=e,{t:i}=Sn();let a,l;const o=Kn("table"),s=e=>{const t=e.name,n=t.lastIndexOf("."),r=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:r}},c=()=>En(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return a||(a=document.createElement("form"),l=document.createElement("input"),a.className=`${o}--file-form`,l.name="file",l.type="file",a.appendChild(l),document.body.appendChild(a)),new Promise(((e,n)=>{const r=!t.type;l.multiple=!!t.multiple,l.accept=r?"":`.${t.type}`,l.onchange=o=>{const{files:c}=o.target,d=c[0];let u="";if(!r)for(let e=0;e<c.length;e++){const{type:n}=s(c[e]);if(t.type!==n){u=n;break}}u?(R.warning(i("qm.upload.notType",{type:u})),n()):e(d),document.body.removeChild(a),a=null,l=null},a.reset(),l.click()}))})({type:n});null==r||r(e.name,e)}catch(e){}}));return t.createElement(qn,{onClick:()=>c()},i("qm.upload.text"))},ou=e=>{const{columns:n,onClose:r}=e,{tableRef:i,createTableData:a,dataChange:l}=t.useContext(bd),{beforeTableImport:o}=i.current.props,{t:s}=Sn(),{importXLSX:c}=au(),d=t.useRef(null),[u,p]=t.useState(!1),[h,m]=t.useState(!0),f=e=>e.filter((e=>![Fd.expandableColumn,Fd.selectionColumn,"index","pageIndex",Fd.operationColumn].includes(e.dataIndex))),g={posIndex:"条"},[v,y]=t.useState([{type:"INPUT",label:s("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&&m(!1)}}))}},{type:"SELECT",label:s("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:s("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:s("qm.table.import.fillText"),value:"fill"},{text:s("qm.table.import.addText"),value:"add"},{text:s("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{v.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&d.current.SET_FIELDS_EXTRA(g),y([...v])}},{type:"INPUT_NUMBER",label:s("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}}]),b=Kn("table");return t.createElement("div",{className:`${b}-import__setting`},t.createElement(Kc,{ref:d,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:g,items:v,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(qn,{onClick:()=>r(),style:{marginRight:8}},s("qm.table.export.closeButton")),t.createElement(qn,{type:"primary",loading:u,disabled:h,onClick:()=>En(void 0,void 0,void 0,(function*(){const[e,t]=yield d.current.GET_FORM_DATA();e||(p(!0),c({columns:f(n),file:t.file},(e=>En(void 0,void 0,void 0,(function*(){const{tableFullData:n,store:c}=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=>{c.addToInserted(e)})),l(),R.success(s("qm.table.import.success",{total:e.length})),p(!1),r()})))))}))},s("qm.table.import.text"))))},su=t.forwardRef(((e,n)=>{const{tableColumns:r,open:i=!0}=e,{t:a}=Sn(),[l,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={[`${Kn("table")}-import`]:!0},d={visible:l,title:a("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:Pe(c),title:a("qm.table.import.textNoSpace"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(it,null))),t.createElement(ua,d,t.createElement(ou,{columns:r,onClose:()=>o(!1)})))}));su.displayName="TableImport";const cu=e=>{const{columns:n,onChange:r}=e,{$size:i}=t.useContext(bd),{t:a}=Sn(),l=t.useRef([]),[o,s]=t.useState(!1),[c,d]=t.useState(n);Ei((()=>{p()}),[c]),t.useEffect((()=>{u()}),[n]);const u=()=>{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))})),l.current=e},p=()=>{const e=[];c.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((({dataIndex:e},n)=>{const r=c.find((t=>t.dataIndex===e));return n>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==r||r(e)},h=Kn("table"),m={[`${h}__popper`]:!0,"column-filter__popper":!0,[`${h}--lg`]:"large"===i,[`${h}--sm`]:"small"===i},f=[`${h}-column-filter`,{selected:o}];return t.createElement(js,{action:["click"],popupVisible:o,popup:t.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"main"},t.createElement(jt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:c,setList:e=>{const t=e.map((e=>e.dataIndex)),n=c.map((e=>e.dataIndex));pe(t,n)||d(al(e))}},c.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(D,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,d([...c])}}),t.createElement("i",{className:Pe(i),title:a("qm.table.columnFilter.draggable")},t.createElement(We,null)),t.createElement("span",{className:"text"},Qa(e.title)))})(e,"main")))))),popupClassName:Pe(m),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{s(e)},builtinPlacements:Rd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Pe(f),title:a("qm.table.columnFilter.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(at,null)),t.createElement("span",null,a("qm.table.columnFilter.text"))))},du=e=>{const{defaultValue:n,onClose:r,onOk:i}=e,{tableRef:a,selectionKeys:l,pagination:o,showSummary:s}=t.useContext(bd),{rowSelection:c}=a.current.props,{t:d}=Sn(),u=t.useRef(null),[p,m]=t.useState(!1),f=t.useMemo((()=>Object.assign({},{fileName:`${h().format(Id)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:l.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},n,{columns:Hn(n.columns||[])})),[]),[g,v]=t.useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:d("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:d("qm.table.export.all"),value:"all"},{text:d("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==c?void 0:c.type)},{text:d("qm.table.export.custom"),value:"custom"}]},onChange:e=>{g.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,v([...g])}},options:{min:1},disabled:!0},{type:"INPUT",label:d("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:d("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:d("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),y=Kn("table");return t.createElement("div",{className:`${y}-export__setting`},t.createElement(Kc,{ref:u,initialValues: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(qn,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t.createElement(qn,{type:"primary",loading:p,onClick:()=>En(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();if(!e){m(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);i(t),yield kn(1e3),m(!1),r()}}))},d("qm.table.export.text"))))},uu=t.forwardRef(((e,n)=>{var r;const{tableColumns:i,open:a=!0}=e,{global:l}=t.useContext(Wt),{tableRef:o,flattenColumns:s,pagination:c,fetchParams:d,isFetch:u,isGroupSubtotal:p,showSummary:m,getSpan:f}=t.useContext(bd),{exportExcel:g,fetch:v,showHeader:y}=o.current.props,{t:b}=Sn(),{getTitleFromCellValue:x}=Yd(),[E,S]=t.useState(!1),[w,C]=t.useState(!1),N=t.useMemo((()=>{var e;return!!(null===(e=null==g?void 0:g.fetch)||void 0===e?void 0:e.api)}),[g]),T=t.useMemo((()=>!c.total||w),[c.total,w]),I=t.useMemo((()=>_a(i,[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn])),[i]),O=t.useMemo((()=>_a(s,[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn])),[s]),k=(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=k(e.children,a,n+1)),O.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&Va(i,t,ja(i,t))})),i})),L=(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[Fd.summaryIgnore])return e;const n=Number(ja(t,r));return Number.isNaN(n)?e:e+n}),0);Va(n,r,i)})),[n]},A=(e,t,n,r)=>{const{precision:i,formatType:a}=n;let l=x(e,n,t,r);return i>=0&&!a&&""!==l&&(l=Number(l)),l},{exportXLSX:P,exportCSV:_}=au(),H=e=>En(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:r=(e=>e),afterFetch:i,dataKey:a}=v;let l=[];try{C(!0);const o=yield n(Object.assign(Object.assign({},r(d)),{[Fd.currentPageName]:1,[Fd.pageSizeName]:null!=e?e:c.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=de(o.data,a))&&void 0!==t?t:[];e="function"==typeof i?yield i(e):e,l=k(e)}}catch(e){}return C(!1),l})),F=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){}},D=(e,t)=>{const{columns:n,footSummation:r}=e,i=Da(n),a=Ia(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||Fd.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}">${Qa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(l+=`<tbody>${Fa(t).map((e=>`<tr>${a.map(((n,r)=>{const{rowSpan:i,colSpan:a}=f(e,n,e.index,r,t);return i&&a?`<td rowspan="${i}" colspan="${a}">${A(e,e.index,n,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),m&&r&&(l+=["<tfoot>",L(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):ja(e,i);return`<td>${0===r&&""===l?b("qm.table.config.summaryText"):Tn(l)?Xa(l).join(""):l}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),l+="</table>",l},$=null!==(r=null==g?void 0:g.fileName)&&void 0!==r?r:`${h().format(Id)}.xlsx`,M=$.slice($.lastIndexOf(".")+1).toLowerCase(),q=()=>{if(T)return R.warning(b("qm.table.export.warnText"));var e;N?(e=$,En(void 0,void 0,void 0,(function*(){C(!0);try{const{api:t,params:n}=g.fetch,r=yield t(Object.assign(Object.assign(Object.assign({columns:O.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,[Fd.currentPageName]:void 0,[Fd.pageSizeName]:void 0}));r.data&&(Qi(r.data,e),F(e))}catch(e){}C(!1)}))):S(!0)};t.useImperativeHandle(n,(()=>({clickHandle:q})));const j={[`${Kn("table")}-export`]:!0},V={visible:E,title:b("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},K={fileName:$.slice(0,$.lastIndexOf(".")),fileType:M,columns:I,useStyle:(null==g?void 0:g.cellStyle)?1:0};return t.createElement(t.Fragment,null,a&&t.createElement("span",{className:Pe(j),title:b("qm.table.export.textNoSpace"),onClick:()=>q()},t.createElement("i",{className:"svgicon icon"},t.createElement(je,null))),t.createElement(ua,V,t.createElement(du,{defaultValue:K,onClose:()=>S(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:Ra(e.columns)}),En(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 H()),"custom"===r&&(c=yield H(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==g?void 0:g.beforeExport))try{c=null==g?void 0:g.beforeExport(c)}catch(e){}if("xlsx"===n){const n=yield P(t,c,L,A);Qi(n,`${e}.xlsx`),F(`${e}.xlsx`)}if("csv"===n){const n=_(t,D(t,c));Qi(n,`${e}.csv`),F(`${e}.csv`)}}))}})))}));uu.displayName="TableExport";const pu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,tableBodyRef:a,dataChange:l}=t.useContext(bd),{beforeClipboard:o}=i.current.props,{t:s}=Sn(),c=t.useRef(null),[d,u]=t.useState([{type:"INPUT_NUMBER",label:s("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:s("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:n.map(((e,t)=>({value:t,text:Qa(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:s("qm.table.clipboard.content"),fieldName:"content",placeholder:s("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[p,h]=t.useState(!1),m=Kn("table");return t.createElement("div",{className:`${m}-clipboard__setting`},t.createElement("h3",{className:"info"},s("qm.table.clipboard.supportText")),t.createElement(Kc,{ref:c,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:d,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(qn,{onClick:()=>r(),style:{marginRight:8}},s("qm.table.export.closeButton")),t.createElement(qn,{type:"primary",loading:p,onClick:()=>En(void 0,void 0,void 0,(function*(){var e;const[t,d]=yield c.current.GET_FORM_DATA();if(t)return;const{tableFullData:u,store:p}=i.current;h(!0);const m=d.content.trim().replace(/(\r|\n)$/,"");let f=m.replace(/"[^"]+"/g,"^");((null===(e=m.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{f=f.replace(/\^/,e)}));let g=f.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{g=yield o(g,g[0].map(((e,t)=>n[d.colIndex+t].dataIndex)))}catch(t){}g.forEach(((e,t)=>{e.forEach(((e,r)=>{var a,l;const o=u[d.rowIndex-1+t],s=n[d.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&&(Va(o,s.dataIndex,e),p.addToUpdated(o))}}))})),a.current.forceUpdate(),l(),R.success(s("qm.table.clipboard.success",{total:g.length})),h(!1),r()}))},s("qm.table.clipboard.text"))))},hu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{flattenColumns:i}=t.useContext(bd),{t:a}=Sn(),[l,o]=t.useState(!1),s=t.useMemo((()=>(e=>e.filter((e=>![Fd.expandableColumn,Fd.selectionColumn,"index","pageIndex",Fd.operationColumn].includes(e.dataIndex))))(i)),[i]),c=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:c})));const d={[`${Kn("table")}-clipboard`]:!0},u={visible:l,title:a("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:Pe(d),title:a("qm.table.clipboard.textNoSpace"),onClick:()=>c()},t.createElement("i",{className:"svgicon icon"},t.createElement(lt,null))),t.createElement(ua,u,t.createElement(pu,{columns:s,onClose:()=>o(!1)})))}));hu.displayName="TableClipboard";const mu=e=>{const{columns:n,onClose:r}=e,{tableRef:i,$size:a,selectionKeys:l,setSelectionKeysEffect:o}=t.useContext(bd),{rowKey:s,rowSelection:c}=i.current.props,{t:d}=Sn(),u=t.useRef(null),p=zi(u),h=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=h(e.children)),n})),[m,f]=t.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...h(n.filter((e=>![Fd.expandableColumn,Fd.selectionColumn,"index","pageIndex",Fd.operationColumn].includes(e.dataIndex))))]),[g]=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})()),[v,y]=t.useState(300),b=Wi((()=>{const e=u.current;y(e.offsetHeight-2*io[a]-30)}),5);return Zt((()=>{b()}),[p.width]),t.createElement("div",{ref:u,style:{height:"100%"}},t.createElement(rp,{size:a,columns:m,dataSource:g,rowKey:s,height:v,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=>f(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(qn,{onClick:()=>r()},d("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(bd),{rowSelection:p}=a.current.props,{t:h}=Sn(),[m,f]=t.useState(!1),g=t.useRef(!1);Ei((()=>{!g.current&&v()}),[c]);const v=()=>En(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=de(r.data,t.dataKey))&&void 0!==e?e:[];i=i.filter((e=>!n(e))),d(i.map(((e,t)=>l(e,t)))),u(i),g.current=!0}}catch(e){}})),y=()=>{f(!0)};t.useImperativeHandle(n,(()=>({clickHandle:y})));const b=Kn("table"),x={visible:m,title:h("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>f(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:`${b}-select-collection`,title:h("qm.table.selectCollection.text"),onClick:()=>y()},t.createElement("i",{className:"svgicon icon"},t.createElement(ot,null))),t.createElement(ua,x,t.createElement(mu,{columns:r,onClose:()=>f(!1)})))}));fu.displayName="SelectCollection";const gu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Wt),{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(bd),{uniqueKey:g}=i.current.props,{t:v}=Sn(),y=t.useRef(null),b=t.useRef(null),x=t.useRef([]),E=t.useRef(""),S=t.useRef(-1),w=t.useRef("stop");Ei((()=>{const e=Fa(c()).findIndex((e=>a(e,e.index)===E.current));u("",e)}),[s.current]);const C=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},N=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>{var t;return{type:C(e.filter.type),fieldName:e.dataIndex,label:Qa(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:null!==(t=e.dictItems)&&void 0!==t?t:[]},onChange:()=>En(void 0,void 0,void 0,(function*(){const[e,t]=yield y.current.GET_FORM_DATA(),[n,r]=yield b.current.GET_FORM_DATA(),i=Te(Object.assign({},t,r),Pn);k(i)}))}})),T={case:0,fullchar:0},I=t.useMemo((()=>o.filter((e=>![Fd.expandableColumn,Fd.selectionColumn,"index","pageIndex",Fd.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[o]),[R,k]=t.useState({}),[L,P]=t.useState(T),[_]=t.useState(N([I[0]])),[H]=t.useState(N(I.slice(1))),[F,$]=t.useState(0),M=t.useMemo((()=>!Object.keys(R).length),[R]);Ei((()=>{w.current="ready"}),[R,L]);const q=e=>{P(Object.assign({},L,e))},j=(e,t,n)=>new Promise(((r,i)=>{A.confirm({title:v("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{n(),r()}})})),V=e=>En(void 0,void 0,void 0,(function*(){if(!Object.keys(R).length)return A.warning({title:v("qm.button.confirmPrompt"),content:v("qm.table.fastSearch.queryCondition")});if("ready"===w.current&&(w.current="stop",x.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}=I.find((e=>e.dataIndex===t)).filter;let i=ja(a,t),o=!0;if("text"===n||"textarea"===n?o=new RegExp(L.fullchar?`^${e[t]}$`:e[t],L.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})(R),$(x.current.length)),!x.current.length)return p(""),A.warning({title:v("qm.button.confirmPrompt"),content:v("qm.table.fastSearch.notMatch")});"next"===e&&(S.current=S.current<0?0:S.current+1,S.current>x.current.length-1&&(yield j(v("qm.table.fastSearch.toTheEnd"),(()=>S.current=0),(()=>S.current=x.current.length-1)))),"prev"===e&&(S.current=S.current<0?x.current.length-1:S.current-1,S.current<0&&(yield j(v("qm.table.fastSearch.toStart"),(()=>S.current=x.current.length-1),(()=>S.current=0))));const t=x.current[S.current],n=a(t,t.index);let r=t.index;if(m&&f){const e=nl(i.current.deriveRowKeys,n)[0];r=i.current.tableFullData.findIndex((t=>a(t,t.index)===e))}((e,t)=>{if(E.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)})),K=()=>{y.current.RESET_FORM(),b.current.RESET_FORM()},z=t.useMemo((()=>g?`fastSearch_${g}`:""),[g]),[W,B]=t.useState([]),[U,G]=t.useState(""),[Y,X]=t.useState("");Ei((()=>{if(Y){const{filters:e,config:t}=W.find((e=>e.value===Y)).list;y.current.SET_FIELDS_VALUE(_n(e,H.map((e=>e.fieldName)))),b.current.SET_FIELDS_VALUE(_n(e,_.map((e=>e.fieldName)))),k(e),P(t)}else K(),k({}),P(T)}),[Y]),t.useEffect((()=>{Q()}),[]);const Q=()=>En(void 0,void 0,void 0,(function*(){if(!z)return;let e=yield Vt.getItem(z);e||(e=yield Z(z),Array.isArray(e)&&(yield Vt.setItem(z,e))),Array.isArray(e)&&e.length&&(B(e),X(e[0].value))})),Z=e=>En(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){}})),J=(e,t)=>En(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),ee=Kn("table");return t.createElement("div",{className:`${ee}-fast-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"top"},t.createElement("div",{className:"container"},t.createElement(oa,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t.createElement("span",null,v("qm.table.alert.total",{total:F}))},t.createElement(oa.TabPane,{tab:v("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t.createElement(Kc,{ref:y,items:_,cols:1,labelWidth:110})),t.createElement(oa.TabPane,{tab:v("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t.createElement(Kc,{ref:b,items:H,cols:1,labelWidth:110})))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:l,value:U,placeholder:v("qm.table.highSearch.configText"),disabled:M,onChange:e=>{const{value:t}=e.target;G(t)}}),t.createElement(qn,{type:"primary",disabled:!U||M,style:{marginLeft:"10px"},onClick:()=>En(void 0,void 0,void 0,(function*(){if(!z)return Mn("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ya(),t=[...W,{text:U,value:e,list:{filters:R,config:L}}];B(t),X(e),G(""),yield Vt.setItem(z,t),yield J(z,t)}))},v("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Fd.rowHeightMaps[l]}px`}},t.createElement("span",null,v("qm.table.fastSearch.savedSetting"))),t.createElement("ul",null,W.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===Y}),title:e.text,onClick:()=>{return t=e.value,void X(t!==Y?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:v("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,En(void 0,void 0,void 0,(function*(){if(!n)return;const e=W.filter((e=>e.value!==n));B(e),n===Y&&X(""),yield Vt.setItem(z,e),yield J(z,e)}))}},t.createElement(st,null))))),!W.length&&t.createElement("div",{style:{padding:Sd}},t.createElement($i,null)))))),t.createElement("div",{className:"bottom"},t.createElement("div",null,t.createElement(D,{checked:!!L.case,onChange:e=>q({case:e.target.checked})},v("qm.table.fastSearch.matchCase")),t.createElement(D,{checked:!!L.fullchar,onChange:e=>q({fullchar:e.target.checked})},v("qm.table.fastSearch.matchFullchar"))),t.createElement("div",null,t.createElement(qn,{onClick:()=>K()},v("qm.table.fastSearch.clear"))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${io[l]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(qn,{onClick:()=>n(),style:{marginRight:8}},v("qm.table.fastSearch.closeButton")),t.createElement(qn,{type:"primary",style:{marginRight:8},onClick:()=>V("prev")},v("qm.table.fastSearch.queryPrev")),t.createElement(qn,{type:"primary",onClick:()=>V("next")},v("qm.table.fastSearch.queryNext"))))},vu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{$size:i}=t.useContext(bd),{t:a}=Sn(),[l,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c=Kn("table"),d={visible:l,title:a("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${io[i]+20}px`},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${c}-super-search`,title:a("qm.table.fastSearch.text"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(ct,null))),t.createElement(ua,d,t.createElement(gu,{onClose:()=>o(!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(bd),{fetch:d}=a.current.props,{t:u}=Sn(),p=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:[]}},m=r.map((e=>Object.assign({dataIndex:e.group},p(e.group)))),f=i.map((e=>e.summary===Fd.groupSummary.total.value?{dataIndex:e.summary,title:Fd.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},p(e.summary)),{formula:e.formula}))),g=t.useMemo((()=>Object.assign({},s,{[Fd.sorterFieldName]:void 0,[Fd.groupSummary.summaryFieldName]:i.map((e=>`${e.formula}|${e.summary}`)).join(","),[Fd.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[Fd.currentPageName]:1})),[s,r,i]),[v,y]=t.useState(((e,t)=>[{title:u("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===Fd.groupSummary.total.value&&(i={dataIndex:Fd.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?i:null)}))])(m,f)),[b]=t.useState(c?[]:(e=>{const t=el(e,r.map((e=>e.group))),n=[];return t.forEach((e=>{const t={};v.forEach((n=>{const{dataIndex:r}=n;"index"!==r&&Va(t,r,ja(e[0],r))})),i.forEach((n=>{const r=n.summary!==Fd.groupSummary.total.value?n.summary:Fd.groupSummary.recordTotalIndex,i=n.formula;"count"===i&&Va(t,r,e.length),"sum"===i&&Va(t,r,Ie(e,r)),"max"===i&&Va(t,r,Re(e,r)[r]),"min"===i&&Va(t,r,Oe(e,r)[r]),"avg"===i&&Va(t,r,(Ie(e,r)/e.length).toFixed(2))})),n.push(t)})),n})(a.current.tableFullData)),x=Object.assign(Object.assign({size:l,height:400},c?{fetch:{api:d.api,params:g,dataKey:null==d?void 0:d.dataKey}}:{dataSource:b}),{columns:v,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${h().format(Id)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>y(e)});return t.createElement(rp,x)},bu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Wt),{tableRef:i,$size:a,flattenColumns:l}=t.useContext(bd),{uniqueKey:o}=i.current.props,{t:s}=Sn(),c=t.useRef(null),d=t.useRef(null),[u,p]=t.useState(!1),[h,m]=t.useState([]),[f,g]=t.useState(""),[v,y]=t.useState("");Ei((()=>{if(v){const{group:e,summary:t}=h.find((e=>e.value===v)).list;N(e),k(t)}else{const e=H();N((null==e?void 0:e.group)||[]),k((null==e?void 0:e.summary)||[])}}),[v]),t.useEffect((()=>{F()}),[]);const b=t.useMemo((()=>o?`summary_${o}`:""),[o]),x=t.useMemo((()=>l.filter((e=>![Fd.expandableColumn,Fd.selectionColumn,"index","pageIndex",Fd.operationColumn].includes(e.dataIndex)))),[l]),E=x.filter((e=>!e.groupSummary)).map((e=>({text:Qa(e.title),value:e.dataIndex}))),S=[Fd.groupSummary.total,...x.filter((e=>!!e.groupSummary)).map((e=>({text:Qa(e.title),value:e.dataIndex})))],w=[{text:s("qm.table.groupSummary.sumText"),value:"sum"},{text:s("qm.table.groupSummary.maxText"),value:"max"},{text:s("qm.table.groupSummary.minText"),value:"min"},{text:s("qm.table.groupSummary.avgText"),value:"avg"},{text:s("qm.table.groupSummary.countText"),value:"count"}],[C,N]=t.useState([]),[T,I]=t.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(qn,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(n)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:s("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:E.map((e=>Object.assign(Object.assign({},e),{disabled:C.findIndex((t=>t.group===e.value))>-1})))})}]),[R,k]=t.useState([]),[L,A]=t.useState([{title:s("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(qn,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(n)}},s("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:s("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:S.map((e=>Object.assign(Object.assign({},e),{disabled:R.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:s("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Fd.groupSummary.total.value?w.slice(w.length-1):w})}]),P=t.useMemo((()=>{const e=C.length&&C.every((e=>Object.values(e).every((e=>""!==e)))),t=R.length&&R.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[C,R]),_=()=>{b&&sessionStorage.setItem(b,JSON.stringify({group:C.filter((e=>!!e.group)),summary:R.filter((e=>!!e.summary))}))},H=()=>{if(!b)return;const e=sessionStorage.getItem(b);return e?JSON.parse(e):null},F=()=>En(void 0,void 0,void 0,(function*(){if(!b)return;const e=H();if(e){const{group:t,summary:n}=e;N(t),k(n)}let t=yield Vt.getItem(b);t||(t=yield D(b),Array.isArray(t)&&(yield Vt.setItem(b,t))),Array.isArray(t)&&t.length&&(m(t),!e&&y(t[0].value))})),D=e=>En(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){}})),$=(e,t)=>En(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),M=Kn("table"),q={visible:u,title:s("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return t.createElement("div",{className:`${M}-group-summary__setting`},t.createElement("div",{className:"main"},t.createElement("div",{style:{width:"30%"}},t.createElement(rp,{ref:c,size:a,columns:T,dataSource:C,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>I(e),onDataChange:e=>{N(e)}},t.createElement(qn,{type:"primary",icon:t.createElement(dt,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"container line"},t.createElement(rp,{ref:d,size:a,columns:L,dataSource:R,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onDataChange:e=>{k(e)}},t.createElement(qn,{type:"primary",icon:t.createElement(dt,null),onClick:()=>{d.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:f,placeholder:s("qm.table.groupSummary.configText"),disabled:P,onChange:e=>{const{value:t}=e.target;g(t)}}),t.createElement(qn,{type:"primary",disabled:!f||P,style:{marginLeft:"10px"},onClick:()=>En(void 0,void 0,void 0,(function*(){if(!b)return Mn("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ya(),t=[...h,{text:f,value:e,list:{group:C.filter((e=>!!e.group)),summary:R.filter((e=>!!e.summary))}}];m(t),y(e),g(""),yield Vt.setItem(b,t),yield $(b,t)}))},s("qm.table.groupSummary.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Fd.rowHeightMaps[a]}px`}},t.createElement("span",null,s("qm.table.groupSummary.savedSetting"))),t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.value,className:Pe({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:s("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,En(void 0,void 0,void 0,(function*(){if(!n)return;const e=h.filter((e=>e.value!==n));m(e),n===v&&y(""),yield Vt.setItem(b,e),yield $(b,e)}))}},t.createElement(st,null))))),!h.length&&t.createElement("div",{style:{padding:Sd}},t.createElement($i,null)))))),t.createElement(ua,q,t.createElement(yu,{columns:x,group:C,summary:R})),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(qn,{onClick:()=>n(),style:{marginRight:8}},s("qm.table.groupSummary.closeButton")),t.createElement(qn,{type:"primary",disabled:P,onClick:()=>(_(),void p(!0))},s("qm.table.groupSummary.confirmButton"))))},xu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{t:i}=Sn(),[a,l]=t.useState(!1),o=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=Kn("table"),c={visible:a,title:i("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:`${s}-group-summary`,title:i("qm.table.groupSummary.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(ut,null))),t.createElement(ua,c,t.createElement(bu,{onClose:()=>l(!1)})))}));xu.displayName="GroupSummary";const Eu=e=>{const{onClose:n}=e,{global:r}=t.useContext(Wt),{tableRef:i,$size:a,flattenColumns:l,setSuperFilters:o,clearTableFilter:s}=t.useContext(bd),{uniqueKey:c}=i.current.props,{t:d}=Sn(),u=t.useRef(null),[p,h]=t.useState([]),[m,f]=t.useState([]),[g,v]=t.useState(""),[y,b]=t.useState("");Ei((()=>{h(y?m.find((e=>e.value===y)).list:H()||[])}),[y]),t.useEffect((()=>{F()}),[]);const x=t.useMemo((()=>c?`superSearch_${c}`:""),[c]),E=t.useMemo((()=>l.filter((e=>!!e.filter))),[l]),S=Ja(p),w=t.useMemo((()=>!(S&&Na(S))),[S]),C=t.useMemo((()=>!!p.length&&w),[p,w]),N=[{value:"and",text:d("qm.table.highSearch.andText")},{value:"or",text:d("qm.table.highSearch.orText")}],T=l.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:Qa(e.title)}))),I=e=>["in","nin"].includes(e),R=(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},k=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:d("qm.table.highSearch.gtText")},{value:"<",text:d("qm.table.highSearch.ltText")},{value:">=",text:d("qm.table.highSearch.gteText")},{value:"<=",text:d("qm.table.highSearch.lteText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:d("qm.table.highSearch.inText")},{value:"nin",text:d("qm.table.highSearch.ninText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:d("qm.table.highSearch.likeText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}]}return t},[L,A]=t.useState([{title:d("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(qn,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(n)}},d("qm.table.highSearch.removeText")))},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:T,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:d("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,r;const i=Object.values(t)[0],a=null===(n=E.find((e=>e.dataIndex===i)))||void 0===n?void 0:n.filter.type,l=k(a);e.fieldType=a,e.expression=i?null===(r=l[0])||void 0===r?void 0:r.value:"",e.condition=I(e.expression)?[]:"",i||(e.bracketLeft=e.bracketRight="")}})},{title:d("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:d("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=E.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:k(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=I(e.expression)?[]:""}}}},{title:d("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,r;const i=E.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:R(a,I(e.expression)),editable:!0,items:l,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:N,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),P=()=>{s(),o(p.map((e=>_n(e,["index","pageIndex"])))),_(),n()},_=()=>{x&&sessionStorage.setItem(x,JSON.stringify(p.filter((e=>!!e.fieldName))))},H=()=>{if(!x)return;const e=sessionStorage.getItem(x);return e?JSON.parse(e):null},F=()=>En(void 0,void 0,void 0,(function*(){if(!x)return;const e=H();e&&h(e);let t=yield Vt.getItem(x);t||(t=yield D(x),Array.isArray(t)&&(yield Vt.setItem(x,t))),Array.isArray(t)&&t.length&&(f(t),!e&&b(t[0].value))})),D=e=>En(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){}})),$=(e,t)=>En(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),M=Kn("table");return t.createElement("div",{className:`${M}-super-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement(rp,{ref:u,size:a,columns:L,dataSource:p,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(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]?"":")"),h([...p]))},onDataChange:e=>{h(e)}},t.createElement(qn,{type:"primary",icon:t.createElement(dt,null),onClick:()=>{u.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Fd.highSearch.showSQL&&S&&t.createElement("code",{className:"lang-js"},S)),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:g,placeholder:d("qm.table.highSearch.configText"),disabled:w,onChange:e=>{const{value:t}=e.target;v(t)}}),t.createElement(qn,{type:"primary",disabled:!g||w,style:{marginLeft:"10px"},onClick:()=>En(void 0,void 0,void 0,(function*(){if(!x)return Mn("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ya(),t=[...m,{text:g,value:e,list:p.filter((e=>!!e.fieldName))}];f(t),b(e),v(""),yield Vt.setItem(x,t),yield $(x,t)}))},d("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Fd.rowHeightMaps[a]}px`}},t.createElement("span",null,d("qm.table.highSearch.savedSetting"))),t.createElement("ul",null,m.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===y}),title:e.text,onClick:()=>{return t=e.value,void b(t!==y?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:d("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,En(void 0,void 0,void 0,(function*(){if(!n)return;const e=m.filter((e=>e.value!==n));f(e),n===y&&b(""),yield Vt.setItem(x,e),yield $(x,e)}))}},t.createElement(st,null))))),!m.length&&t.createElement("div",{style:{padding:Sd}},t.createElement($i,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(qn,{onClick:()=>n(),style:{marginRight:8}},d("qm.table.highSearch.closeButton")),t.createElement(qn,{type:"primary",disabled:C,onClick:()=>P()},d("qm.table.highSearch.searchButton"))))},Su=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{t:i}=Sn(),[a,l]=t.useState(!1),o=()=>{l(!0)};t.useImperativeHandle(n,(()=>({clickHandle:o})));const s=Kn("table"),c={visible:a,title:i("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:`${s}-super-search`,title:i("qm.table.highSearch.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(pt,null))),t.createElement(ua,c,t.createElement(Eu,{onClose:()=>l(!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(Wt),{tableRef:g,isFullScreen:v,$size:y}=t.useContext(bd),{uniqueKey:b,exportExcel:x}=g.current.props,{t:E}=Sn(),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),N=t.useRef(null),T=t.useRef(null),I=t.useRef(null),R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(!1),P=t.useMemo((()=>b?`toolBox_${b}`:""),[b]),[_,H]=t.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),F={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},[M,q]=t.useState(!1);Ei((()=>{A.current&&(V(),A.current=!1)}),[_]),t.useEffect((()=>{j()}),[]),t.useImperativeHandle(n,(()=>({exportHandle:()=>{if(!T.current)return Mn("Table","执行导出需要配置 `exportExcel` 参数");T.current.clickHandle()}})));const j=()=>{if(!P||!m)return;const e=JSON.parse(localStorage.getItem(P));e||K(P).then((e=>{e&&(H(Object.assign({},_,e)),localStorage.setItem(P,JSON.stringify(e)))})).catch((()=>{})),e&&H(Object.assign({},_,e))},V=()=>{if(!P||!m)return;const e={};for(const t in _)_[t]&&(e[t]=_[t]);localStorage.setItem(P,JSON.stringify(e)),z(P,e)},K=e=>En(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){}})),z=(e,t)=>En(void 0,void 0,void 0,(function*(){const n=null==f?void 0:f.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),W=e=>En(void 0,void 0,void 0,(function*(){q(!1),yield kn(100),e.current.clickHandle()})),B=(e,t)=>{A.current=!0,H(Object.assign({},_,{[t]:e}))},U=Kn("table"),G={"top-toolbox__popper":!0,[`${U}--lg`]:"large"===y,[`${U}--sm`]:"small"===y};return t.createElement(t.Fragment,null,i&&t.createElement(Ud,{ref:S,isFullScreen:v,open:!m||_.fullScreen}),a&&t.createElement(Gd,{ref:w,open:!m||_.reload}),l&&t.createElement(Xd,{ref:C,tableColumns:r,open:!m||_.print}),o&&t.createElement(su,{ref:N,tableColumns:r,open:!m||_.import}),s&&t.createElement(uu,{ref:T,tableColumns:r,open:(!m||_.export)&&!(null==x?void 0:x.hideIcon)}),c&&t.createElement(hu,{ref:I,open:!m||_.clipboard}),d&&t.createElement(fu,{ref:R,columns:r,open:!m||_.collection}),u&&t.createElement(vu,{ref:O,open:!m||_.fastSearch}),h&&t.createElement(xu,{ref:k,open:!m||_.groupSummary}),p&&t.createElement(Su,{ref:L,open:!m||_.superSearch}),m&&t.createElement($,{open:M,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.fullScreen,style:{marginRight:6},onChange:e=>B(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.screen.full"))),onClick:()=>W(S)},{key:"reload",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.reload,style:{marginRight:6},onChange:e=>B(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.refresh.text"))),onClick:()=>W(w)},{key:"print",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.print,style:{marginRight:6},onChange:e=>B(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.print.text"))),onClick:()=>W(C)},{key:"import",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.import,style:{marginRight:6},onChange:e=>B(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.import.textNoSpace"))),onClick:()=>W(N)},{key:"export",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.export,style:{marginRight:6},onChange:e=>B(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.export.textNoSpace"))),onClick:()=>W(T)},{key:"clipboard",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.clipboard,style:{marginRight:6},onChange:e=>B(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.clipboard.textNoSpace"))),onClick:()=>W(I)},{key:"collection",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.collection,style:{marginRight:6},onChange:e=>B(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.selectCollection.text"))),onClick:()=>W(R)},{key:"fastSearch",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.fastSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.fastSearch.text"))),onClick:()=>W(O)},{key:"groupSummary",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.groupSummary,style:{marginRight:6},onChange:e=>B(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.groupSummary.text"))),onClick:()=>W(k)},{key:"superSearch",label:t.createElement(t.Fragment,null,t.createElement(D,{checked:_.superSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,E("qm.table.highSearch.text"))),onClick:()=>W(L)}];return t.createElement(Y,{items:e.filter((e=>F[e.key]))})})(),overlayClassName:Pe(G),overlayStyle:{minWidth:120},onOpenChange:e=>{q(e)}},t.createElement("span",{className:`${U}-toolbox`,title:E("qm.table.toolbox.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(ht,null)))))}));wu.displayName="ToolBox";const Cu=(e,t)=>e.map((e=>(e.children&&(e.children=Cu(e.children,t)),t(e)))),Nu=t.forwardRef(((e,n)=>{const{columns:r}=e,{global:i}=t.useContext(Wt),{tableRef:a,$size:l}=t.useContext(bd),{showColumnDefine:o,uniqueKey:s,onlyShowIcon:c,columnsChange:d}=a.current.props,{t:u}=Sn(),p=t.useRef([]),[h,m]=t.useState(!1),f=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),g=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),v=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),y=t.useMemo((()=>s?`table_${s}`:""),[s]);Ei((()=>{E(r)}),[r]),t.useLayoutEffect((()=>{S()}),[]),t.useImperativeHandle(n,(()=>({initialHandler:S})));const b=()=>{if(!y)return;const e=JSON.parse(localStorage.getItem(y));var t;if(e||(t=y,En(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(y,JSON.stringify(e)),S()):(null==i?void 0:i.getComponentConfigApi)&&E(r)})).catch((()=>{})),!e)return;return me(Oa(e).map((e=>e.dataIndex)),Oa(r).map((e=>e.dataIndex))).length>0?Cu(r,(t=>{const n=La(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=La(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},x=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=x(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)})),E=e=>{if(!y)return;const t=x(e),n=JSON.parse(localStorage.getItem(y));var r,l;a.current.columnsDefined&&!pe(t,n)&&(localStorage.setItem(y,JSON.stringify(t)),r=y,l=t,En(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.saveComponentConfigApi;if(e)try{yield e({[r]:l})}catch(e){}})))},S=()=>{const e=b();var t;e&&(t=w(e),p.current=t,null==d||d(e))},w=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},C=()=>{const e=t=>t.map((t=>{const n=La(r,t.dataIndex)||Hn(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))},N=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=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===a)return t.push(n);t.push(...p.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,N(r))},I=(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=Qa(e.title),s=["svgicon","handle",`${n}-handle`],c=t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(D,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,N(r)}}),t.createElement("i",{className:Pe(s),title:u("qm.table.columnFilter.draggable")},t.createElement(We,null)),t.createElement("span",{className:"text",title:o},o),"main"===n?t.createElement("span",{className:Pe("fixed",l?"disabled":"")},t.createElement("i",{className:"svgicon",title:u("qm.table.columnFilter.fixedLeft"),onClick:()=>T(e,"left")},t.createElement(mt,null)),t.createElement("i",{className:"svgicon",title:u("qm.table.columnFilter.fixedRight"),onClick:()=>T(e,"right")},t.createElement(ft,null))):"sub"!==n?t.createElement("span",{className:Pe("fixed",l?"disabled":"")},t.createElement("i",{className:"svgicon",title:u("qm.table.columnFilter.cancelFixed"),onClick:()=>T(e)},t.createElement(st,null))):null);return!e.hidden&&(null===(i=e.children)||void 0===i?void 0:i.length)?t.createElement(X,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:R(e.children,e.dataIndex)},c):c},R=(e,n)=>t.createElement("div",{className:"column-filter--wrap"},t.createElement(jt,{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));pe(i,a)||((e,t)=>{La(r,t).children=e,null==d||d([...r])})(al(t),n)}},e.map((e=>I(e,"sub"))))),O=Kn("table"),k={[`${O}__popper`]:!0,"column-filter__popper":!0,[`${O}--lg`]:"large"===l,[`${O}--sm`]:"small"===l},L=[`${O}-column-filter`,{selected:h}];return o?t.createElement(js,{action:["click"],popupVisible:h,popup:t.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"reset"},t.createElement(qn,{type:"text",size:"small",onClick:C},u("qm.table.columnFilter.reset"))),t.createElement("div",{className:"left"},t.createElement(jt,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:f,setList:e=>{const t=e.map((e=>e.dataIndex)),n=f.map((e=>e.dataIndex));pe(t,n)||N([...al(e),...v,...g])}},f.map((e=>I(e,"left"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"main"},t.createElement(jt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:v,setList:e=>{const t=e.map((e=>e.dataIndex)),n=v.map((e=>e.dataIndex));pe(t,n)||N([...f,...al(e),...g])}},v.map((e=>I(e,"main"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"right"},t.createElement(jt,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),n=g.map((e=>e.dataIndex));pe(t,n)||N([...f,...v,...al(e)])}},g.map((e=>I(e,"right")))))),popupClassName:Pe(k),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{m(e)},builtinPlacements:Rd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Pe(L),title:c?u("qm.table.columnFilter.text"):void 0},t.createElement("i",{className:"svgicon icon"},t.createElement(at,null)),!c&&t.createElement("span",null,u("qm.table.columnFilter.text")))):null}));Nu.displayName="ColumnFilter";const Tu=()=>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(bd),{t:o}=Sn(),s=t.useRef(null),c=t.useRef(null),d=t.useRef(null),[u,p]=t.useState(!1),[h,m]=t.useState(!1),[f,g]=t.useState({}),v=t.useMemo((()=>{const{dataIndex:e,filter:t}=n;return`${e}|${t.type}`}),[n]),y=t.useMemo((()=>{let e=!1;for(const t in r[v])if(!Pn(r[v][t])||h){e=!0;break}return e}),[v,r,h]);t.useLayoutEffect((()=>{u&&setTimeout((()=>b()),20)}),[u]),t.useEffect((()=>{var e;pe(f[v],r[v])||g({[v]:r[v]||{}}),m(""===(null===(e=r[v])||void 0===e?void 0:e["=="]))}),[r]);const b=()=>{switch(n.filter.type){case"text":s.current.focus();break;case"number":c.current.focus();break;case"textarea":d.current.focus()}},x=e=>{e&&g(e),l(),a((e=>{for(const t in e){for(const n in e[t])if(Pn(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),f),e))),p(!1)},E={text:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O,{ref:s,size:i,placeholder:o("qm.table.filter.searchText",{text:Qa(e.title)}),style:{width:"180px"},value:null!==(r=null===(n=f[v])||void 0===n?void 0:n.like)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[v]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&x()}}),t.createElement("div",{style:{marginTop:8}},t.createElement(D,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;g((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),m(t)}},o("qm.table.filter.nullValue"))))},textarea:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O.TextArea,{ref:d,size:i,placeholder:o("qm.table.filter.searchAreaText",{text:Qa(e.title)}),style:{width:"220px"},value:null!==(r=null===(n=f[v])||void 0===n?void 0:n.likes)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[v]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),x())}}),t.createElement("div",{style:{marginTop:8}},t.createElement(D,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;g((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),m(t)}},o("qm.table.filter.nullValue"))))},number:e=>{const n=e=>{var t,n;return{value:null!==(n=null===(t=f[v])||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||g((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(M,hn({ref:c},n(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(M,hn({},n("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(M,hn({},n("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(M,hn({},n("!="),{placeholder:o("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const n=e=>{var t;return{value:Ua(null===(t=f[v])||void 0===t?void 0:t[e],Nd),format:Nd,size:i,onChange:t=>{g((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:Ga(t,Nd)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(pn,hn({},n(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(pn,hn({},n("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(pn,hn({},n("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(pn,hn({},n("!="),{placeholder:o("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(j.Group,{style:{width:"100%"},value:null===(n=f[v])||void 0===n?void 0:n["=="],onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[v]:{"==":t}})))}},a.map((e=>t.createElement("li",{key:e.value},t.createElement(j,{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(D.Group,{style:{width:"100%"},value:null===(n=f[v])||void 0===n?void 0:n.in,onChange:e=>{g((t=>Object.assign({},t,{[v]:{in:e}})))}},a.map((e=>t.createElement("li",{key:e.value},t.createElement(D,{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(yd,{multiple:!0,value:(null===(n=f[v])||void 0===n?void 0:n.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));g((e=>Object.assign({},e,{[v]:{in:t}})))}}))}},S=()=>t.createElement(C,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t.createElement(qn,{size:i,onClick:()=>(x({[v]:{}}),void m(!1))},o("qm.table.filter.reset")),t.createElement(qn,{type:"primary",size:i,onClick:()=>x()},o("qm.table.filter.search"))),w=Kn("table"),N={"head-filter__popper":!0,[`${w}--lg`]:"large"===i,[`${w}--sm`]:"small"===i},T=["cell--filter",{selected:u,actived:y}];return t.createElement(js,{action:["click"],popupVisible:u,popup:(()=>{const e=n.filter.type,r=E[e];return r?t.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t.createElement("div",null,r(n)),S()):(Mn("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:Pe(N),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{p(e)},builtinPlacements:Rd,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("div",{className:Pe(T),title:o("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t.createElement("span",{className:"svgicon icon"},t.createElement(Tu,null))))},Ru=e=>{const{column:n}=e,{tableRef:r,bordered:i}=t.useContext(bd),{columns:a,resizable:l,columnsChange:o=Rn}=r.current.props,s=t.useMemo((()=>Pa(n)),[n]),c={resizable:!0,"is--line":l&&!i};return t.createElement("div",{className:Pe(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n}=r.current,i=n.$resizableBar,l=t.offsetWidth/2,c=e.clientX,d=$a(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||Fd.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&&(La(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(bd),{rowSelection:p}=r.current.props,{fetchAllRowKeys:h,selectAllOnCurrentPage:m,filterable:f,onSelectAll:g}=p,{t:v}=Sn(),y=t.useRef([]),b=t.useMemo((()=>d&&!!h),[d,h]),x=t.useMemo((()=>!b&&!!m),[b,m]),E=t.useMemo((()=>(null==f||f)&&!x),[f,x]),w=()=>u?l():r.current.tableFullData,C=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>i(e,e.index)))},N=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:n}=p;if(b)return y.current.length?y.current:ke(t,C());if(!x)return n?t.filter((t=>!n(e.get(t)))):t;const a=n?w().filter((e=>!n(e))).map((e=>i(e,e.index))):w().map((e=>i(e,e.index)));return ke(a,C())})(),T=n.filter((e=>!N.includes(e))),I=n.length-T.length,R=I>0&&I<N.length,O=!!I&&I===N.length;s(T);const k=()=>En(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=de(r.data,t.dataKey))&&void 0!==e?e:[];const{disabled:a}=p;a&&(n=me(n,w().filter((e=>a(e))).map((e=>i(e,e.index))))),y.current=n}}catch(e){}return c(!1),n})),L=e=>En(void 0,void 0,void 0,(function*(){let t=[];t=b?e?yield k():[]:e?N.slice(0):[],t=[...new Set([...t,...T])],o(t),null==g||g(e,t)})),A=()=>{const e=[{key:1,label:v("qm.table.selection.all"),onClick:()=>{L(!0)}},{key:2,label:v("qm.table.selection.invert"),onClick:()=>En(void 0,void 0,void 0,(function*(){let e=[];e=me(n,b?yield k():N),e=[...new Set([...e,...T])],o(e)}))},{key:3,label:v("qm.table.selection.clear"),onClick:()=>{L(!1)}}];return t.createElement(Y,{items:e})};return t.createElement("div",{className:"cell--selection"},t.createElement(D,{checked:O,indeterminate:R,disabled:!N.length,onChange:e=>L(e.target.checked)}),E&&t.createElement($,{overlayClassName:"all-selection__popper",dropdownRender:()=>A()},t.createElement(He,{className:"svgicon icon"})),x&&t.createElement(S,{placement:"top",title:v("qm.table.selection.currentPage")},t.createElement(gt,{className:"info"})))},ku=e=>{const{style:n}=e,{tableRef:r,isTreeTable:i,setRowExpandedKeys:a}=t.useContext(bd),{expandable:l}=r.current.props,[o,s]=t.useState((null==l?void 0:l.defaultExpandAllRows)||!1);Ei((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;a(o?e.filter((e=>!(i&&t.includes(e)))):[])}),[o]);const c={[`${Kn("expand")}--icon`]:!0,expanded:o,collapsed:!o};return t.createElement("span",{className:Pe(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:w,createTableFullData:C}=t.useContext(bd),{ellipsis:N,resizable:T,multipleSort:I,rowSelection:R,expandable:O}=a.current.props,[k,L]=Fd.sortDirections,{tableOriginData:A}=a.current,{t:P}=Sn(),_=t.useRef(null),H=t.useMemo((()=>A.some((e=>Array.isArray(e.children)))),[A]),F=t.useMemo((()=>!h),[h]),D=t.useMemo((()=>!h),[h]),$=t.useMemo((()=>!(null==O?void 0:O.hideExpandAll)),[O]),M=t.useMemo((()=>!!R&&(h?!(!R.selectAllOnCurrentPage&&!R.fetchAllRowKeys):!R.hideSelectAll)),[h,R]);Ei((()=>{B(),g(),b()}),[r]),Ei((()=>{Y(),g(),b()}),[i]),Ei((()=>{Y(),g(),b()}),[c]),t.useEffect((()=>{!Pn(r)&&Ln((()=>B())),!Pn(i)&&Ln((()=>Y()))}),[]),t.useLayoutEffect((()=>{q()}),[]);const q=()=>{y("$header",_.current)},j=(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:C,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:N,"col--center":"center"===R,"col--right":"right"===R,"column--required":!!C,"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&&![Fd.expandableColumn,Fd.selectionColumn].includes(h);return t.createElement("th",{key:h,className:Pe(O),colSpan:m,rowSpan:f,style:Object.assign({},k),onClick:t=>W(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"},V(e)),w?z(e):null)),L&&t.createElement(Ru,{column:e}))},V=e=>{const{dataIndex:n,type:i,sorter:a,title:l,description:o}=e;if(n===Fd.selectionColumn&&"checkbox"===i){if("checkbox"===i)return t.createElement("div",{className:"cell"},M?t.createElement(Ou,{selectionKeys:d}):P("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:Qa(l)},m&&n===p&&$?t.createElement(ku,null):null,n===Fd.expandableColumn&&$?t.createElement(ku,null):l)),o&&s.push(t.createElement(S,{key:1,placement:"top",title:o},t.createElement(gt,{className:"tip"}))),a&&s.push(K(r[n])),s},K=e=>{const n=["svgicon cell--sorter__asc",{actived:e===k}],r=["svgicon cell--sorter__desc",{actived:e===L}];return t.createElement("div",{key:2,className:"cell--sorter",title:P("qm.table.sorter.text")},t.createElement("span",{className:Pe(n)},t.createElement(Lu,null)),t.createElement("span",{className:Pe(r)},t.createElement(Au,null)))},z=e=>t.createElement(Iu,{column:e,filters:i}),W=(e,t)=>{const{sorter:n,dataIndex:i}=t;if(n){const e=r[i],t=e?e===L?null:L:k;I?(delete r[i],v(Object.assign({},r,{[i]:t}))):v(Object.assign({},{[i]:t}))}},B=()=>{F&&U()},U=e=>{const t=Le(r,(e=>null!==e));for(const e in t){const n=s.find((t=>t.dataIndex===e));n?G(n,t[e]):delete t[e]}e||Object.keys(t).length||G({dataIndex:"index"},k)},G=(e,t)=>{const{tableFullData:n}=a.current,{dataIndex:r,sorter:i}=e,l=(e,n)=>{const i=ja(e,r),a=ja(n,r);return Number.isNaN(i-a)?t===k?i.toString().localeCompare(a.toString()):a.toString().localeCompare(i.toString()):t===k?i-a:a-i},o=f?w(Za(n).sort("function"==typeof i?i:l)):n.sort("function"==typeof i?i:l).slice(0);C(o)},Y=()=>{D&&X()},X=()=>{const e=c.length?Ja(c):Ja(i),t=""!==e?f?w(Ta(Za(A),e,H)):Ta(A,e,H):A;C(t),U(!0)},Q=Da(n),Z=Kn("table"),{tableBodyWidth:J}=l;return t.createElement("div",{ref:_,className:`${Z}--header-wrapper`},t.createElement("table",{className:`${Z}--header`,cellSpacing:"0",cellPadding:"0",style:{width:J?`${J}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)=>j(t,n,e))),o&&t.createElement("th",{className:Pe(r),style:Object.assign({},i)}))))})(Q))))},_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=wn(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(bd),{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=Ha(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(j,{checked:l,disabled:r})})():(()=>{const e=c.disabled,r=null==e?void 0:e(i),l=!!n.includes(a);return t.createElement(D,{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(bd),{expandable:s={}}=a.current.props,[c]=t.useState("function"==typeof s.rowExpandable&&!s.rowExpandable(n)),d=t.useMemo((()=>l.includes(r)),[l,r]);Ei((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,n)}),[d]);const u={[`${Kn("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t.createElement("span",{className:Pe(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 Ht(t).toFixed(p)),t},E=void 0!==a,[S,w]=t.useState(null!=i?i:""),C=v(E?a:S),N=y(C);Ei((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[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(N);null===(t=e.onBlur)||void 0===t||t.call(e,n,N)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(N),N))}})}));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(bd),x=t.useContext(_u),S="table-editable__popper",{t:w}=Sn(),C=Mu(),{store:N,fieldAuth:T}=h.current,I=(null===(r=c.editRender)||void 0===r?void 0:r.call(c,d,c))||{},R=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(null),_=t.useRef(!1),H=t.useRef({}),$=t.useRef({}),M=t.useRef([]),[q,j]=t.useState(!1),[K,z]=t.useState(!1),[W,B]=t.useState(I.items||[]),[U,G]=t.useState(),Y=(I.editable||pe(x,[u,p]))&&!I.disabled&&!(null===(i=T[p])||void 0===i?void 0:i.disabled),X=`${u}|${p}`,Q=2===x.length?`${x[0]}|${x[1]}`:"",Z=![...N.state.required,...N.state.validate].some((({x:e,y:t})=>e===u&&t===p)),J=(null===(a=N.state.required.find((({x:e,y:t})=>e===u&&t===p)))||void 0===a?void 0:a.text)||"",ee=(null===(l=N.state.validate.find((({x:e,y:t})=>e===u&&t===p)))||void 0===l?void 0:l.text)||"",te=N.state.edited.some((({x:e,y:t})=>e===u&&t===p)),ne=Y||!Z||q||K,re=!!(null===(o=I.helper)||void 0===o?void 0:o.combinedDataIndex)&&("search-helper"===I.type||"tree-helper"===I.type),ie=null===(s=I.type)||void 0===s?void 0:s.endsWith("multiple");t.useLayoutEffect((()=>{ne&&Q===X?ce():ue()}),[x]),t.useLayoutEffect((()=>{const{items:e}=I;ie&&e&&se(e.map((e=>({[$.current.valueKey]:e.value,[$.current.textKey]:e.text}))))}),[]);const le=()=>{v(),b()},oe=(e,t)=>{j(e),null==t||t()},se=e=>{M.current=e},ce=()=>{var e,t,n,r;const{type:i}=I;switch(i){case"text":null===(e=k.current)||void 0===e||e.focus();break;case"number":null===(t=L.current)||void 0===t||t.select();break;case"search-helper":null===(n=A.current)||void 0===n||n.focus();break;case"tree-helper":null===(r=P.current)||void 0===r||r.focus()}},ue=()=>{var e,t,n,r;const{type:i}=I;switch(i){case"text":null===(e=k.current)||void 0===e||e.blur();break;case"number":null===(t=L.current)||void 0===t||t.blur();break;case"search-helper":null===(n=A.current)||void 0===n||n.blur();break;case"tree-helper":null===(r=P.current)||void 0===r||r.blur()}};t.useImperativeHandle(n,(()=>({focus:ce,isEditable:()=>!I.disabled,isOpening:()=>q})));const he=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},me=(e,t,n)=>{const{cornerSign:r=!0}=I.extra||{};N.addToUpdated(e),r&&N.addToEdited({x:t,y:n})},fe=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",ye={text:(e,n,r)=>{const{dataIndex:i}=n,{type:a,extra:l={},rules:o=[],onInput:s,onChange:c,onEnter:d,onBlur:h}=I,m=ja(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,hn({ref:k,size:f,value:m,maxLength:l.maxLength,showCount:l.showCount},v,{autoComplete:l.password?"new-password":"off",placeholder:l.placeholder||w("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:"";Va(e,i,r),y(o,r,u,p),C(),null==s||s({[X]:r}),_.current=!0},onBlur:t=>{var n;const r=null!==(n=t.target.value)&&void 0!==n?n:"";_.current&&(_.current=!1,me(e,u,p),null==c||c({[X]:r},e),null==h||h({[X]: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({[X]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&d&&e.preventDefault()}}))},textarea:(e,t)=>ye.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}=I,v=ja(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 Ht(e).times(100).toNumber()}`,x=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new Ht(e).times(.01).toString()),t.createElement(Vu,{ref:L,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||w("qm.table.editable.inputPlaceholder"),maxLength:s.maxLength,allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,formatter:b,parser:x,onChange:t=>{Va(e,i,t),y(c,t,u,p),C(),null==d||d({[X]:t}),_.current=!0},onBlur:(t,n)=>{if(!_.current)return;_.current=!1;let r=s.stringMode?t:fe(t);"percent"===l&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),Va(e,i,r),me(e,u,p),null==h||h({[X]:r},e),null==g||g({[X]:r},e),le()},onEnter:(t,n)=>{let r=s.stringMode?t:fe(t);"percent"===l&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),null==m||m({[X]: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}=I,g=d||l,v=ja(e,a);let b=v;return t.createElement(F,{mode:r?"multiple":void 0,size:f,popupClassName:S,value:v||void 0,placeholder:s.placeholder||w("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}|${jl.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onDropdownVisibleChange:e=>j(e),onChange:t=>{Va(e,a,t),y(c,t,u,p),me(e,u,p),null==h||h({[X]:t},e),le()},onSelect:e=>{b=e},onInputKeyDown:t=>{13===t.keyCode&&Ln((()=>null==m?void 0:m({[X]:b},e)))}},g.map((e=>t.createElement(F.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ye.select(e,t,!0),date:(e,n,r)=>{var i;const{dataIndex:a}=n,{type:l,extra:o={},rules:s=[],onChange:c}=I,d=r||"exactdate",h=ja(e,a);return t.createElement(pn,{size:f,popupClassName:S,value:null!==(i=Ua(h,ml[d]))&&void 0!==i?i:void 0,picker:hl[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=Ga(t,ml[d]);Va(e,a,n),y(s,n,u,p),me(e,u,p),null==c||c({[X]:n},e),le()}})},datetime:(e,t)=>ye.date(e,t,"datetime"),month:(e,t)=>ye.date(e,t,"month"),year:(e,t)=>ye.date(e,t,"year"),time:(e,n)=>{var r;const{dataIndex:i}=n,{type:a,extra:l={},rules:o=[],onChange:s}=I,c="HH:mm:ss",d=ja(e,i);return t.createElement(mn,{size:f,popupClassName:S,value:null!==(r=Ua(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=Ga(t,c);Va(e,i,n),y(o,n,u,p),me(e,u,p),null==s||s({[X]:n},e),le()}})},checkbox:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],onChange:o}=I,{trueValue:s=wd,falseValue:c=Cd,disabled:d}=a,h=ja(e,r);return t.createElement(D,{checked:h===s,disabled:d,onChange:t=>{const n=t.target.checked?s:c;Va(e,r,n),y(l,n,u,p),me(e,u,p),null==o||o({[X]:n},e),le()}})},switch:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],onChange:o}=I,{trueValue:s=wd,falseValue:c=Cd,disabled:d}=a,h=ja(e,r);return t.createElement(V,{checked:h===s,disabled:d,onChange:t=>{const n=t?s:c;Va(e,r,n),y(l,n,u,p),me(e,u,p),null==o||o({[X]: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}=I,v=Ka(e,re?c.combinedDataIndex:i),b=c.fieldAliasMap;b||Mn("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(i)||Mn("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),re&&(c.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||Mn("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[i].includes("|")&&Mn("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const E=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(ae(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a},C=e=>{const{autoQueryAssign:t=!0}=c;t&&(H.current=E(e)),j(!0)},N=(t,r)=>{const{beforeOpen:i}=c,a=(null!=i?i:On)({[X]:v},e,n);(null==a?void 0:a.then)?a.then((()=>{C(t),null==r||r()})).catch((()=>{})):!1!==a&&(C(t),null==r||r())},T=e=>{const t={};for(const n in x){const r=x[n];n!==i&&(t[n]=Ka(e,r))}const n=x[i]?Ka(e,x[i]):"";k(n,t);const{closed:r}=c;oe(!1,(()=>he(R.current))),ce(),null==r||r(e)},O=()=>{const{onlySelect:e=!0}=c;_.current&&k(e?"":v),oe(!1,(()=>he(R.current)))},k=(t="",n)=>{var r;if(ae(n)&&Object.keys(n).length)for(const t in n){const i=n[t],a=g.find((e=>e.dataIndex===t));if(a){Va(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 Va(e,t,i)}re&&!t&&((e,t,n,r)=>{if(!t.includes("|"))return Va(e,t,n,r);const i=n.split("|")||[];t.split("|").forEach(((t,n)=>{var r;t&&Va(e,t,null===(r=i[n])||void 0===r?void 0:r.trim())}))})(e,c.combinedDataIndex,""),Va(e,i,t,a),y(s,t,u,p),me(e,u,p),null==h||h({[X]:t},e),le(),H.current={},_.current=!1,G(void 0)},L={visible:q,title:w("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:S,bodyStyle:{paddingBottom:`${io[f]+20}px`},onClose:()=>{O()}},P=Object.assign(Object.assign({},c),{size:f,initialValue:Object.assign({},H.current,c.initialValue),onClose:e=>{e?T(e):O()}});return t.createElement(t.Fragment,null,t.createElement(Ku,{ref:A,value:null!=U?U:v,placeholder:o.placeholder||w("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(_.current&&!q)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=On}=t.fetch;return new Promise(((i,a)=>En(void 0,void 0,void 0,(function*(){var l;const o=ge({},t.fetch.params,Object.assign(Object.assign({},n),E(e)),{currentPage:1,pageSize:500});if(!r(o))return a();z(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(l=de(e.data,t.fetch.dataKey))&&void 0!==l?l:[];i(n)}else a()}catch(e){a(e)}finally{Ln((()=>z(!1)))}}))))})(n).then((e=>((e=[],t)=>{const n=e.filter((e=>Ka(e,x[i]).toString().includes(t)));if(1===n.length)return T(n[0]);N(t)})(e,n))).catch((()=>k(""))):void k(n)},onChange:e=>{const{value:t}=e.target;null==d||d({[X]:t}),_.current=!0,G(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const n=null!==(t=e.target.value)&&void 0!==t?t:"";!q&&N(n)}},onDoubleClick:e=>{const{value:t}=e.target;N(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&N(e)}}),t.createElement(ua,L,t.createElement(ip,P)))},"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}=I,g=ja(e,i),v=c.fieldAliasMap;v||Mn("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||Mn("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),$.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:On)({[X]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{j(!0),null==t||t()})).catch((()=>{})):!1!==i&&(j(!0),null==t||t())},C=()=>{oe(!1,(()=>he(R.current)))},N=t=>{Va(e,i,t),y(s,t,u,p),me(e,u,p),null==h||h({[X]:t},e,M.current),le()},T={visible:q,title:w("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:S,bodyStyle:{paddingBottom:`${io[f]+20}px`},onClose:()=>{C()}},O=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:ge({},c.initialValue),defaultSelectedKeys:g,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:r}=b;se(ve([...M.current.filter((e=>t.includes(e[r]))),...e],r));const i=M.current.map((e=>({text:e[n],value:e[r]}))),a=ve([...i,...l],"value").filter((e=>t.includes(e.value)));B(a),N(a.map((e=>e.value)));const{closed:o}=c;oe(!1,(()=>he(R.current))),null==o||o(M.current)})(e,t):C()}});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(F,{mode:"multiple",open:!1,value:g,placeholder:o.placeholder||w("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!q&&x()},onDoubleClick:()=>{o.disabled||x()},onChange:e=>{const{valueKey:t}=b;se(M.current.filter((n=>e.includes(n[t])))),N(e)}},W.map((e=>t.createElement(F.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:o.disabled,icon:t.createElement(Ue,null),onClick:()=>{x()}})))),t.createElement(ua,T,t.createElement(ip,O)))},"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}=I,v=Ka(e,re?d.combinedDataIndex:a),b=d.fieldAliasMap;b||Mn("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes(a)||Mn("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),re&&(d.combinedDataIndex.split("|").every((e=>Object.keys(x).includes(e)))||Mn("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),x[a].includes("|")&&Mn("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const E=t=>{const{beforeOpen:r}=d,i=(null!=r?r:On)({[X]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{j(!0),null==t||t()})).catch((()=>{})):!1!==i&&(j(!0),null==t||t())},C=()=>{oe(!1,(()=>he(R.current)))},N=(t="",n)=>{var r;if(ae(n)&&Object.keys(n).length)for(const t in n){const i=n[t],a=g.find((e=>e.dataIndex===t));if(a){Va(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 Va(e,t,i)}Va(e,a,t,l),y(c,t,u,p),me(e,u,p),null==h||h({[X]:t},e),le()},T={visible:q,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:S,bodyStyle:{paddingBottom:`${io[f]+20}px`},onClose:()=>{C()}},O=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]=Ka(e,r))}const n=x[a]?Ka(e,x[a]):"";N(n,t);const{closed:r}=d;oe(!1,(()=>he(R.current))),ce(),null==r||r(e)})(e):C()}});return t.createElement(t.Fragment,null,t.createElement(Ku,{ref:P,value:v,allowClear:null===(i=s.allowClear)||void 0===i||i,readOnly:s.readOnly,disabled:s.disabled,placeholder:s.placeholder||w("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!q&&E())},onDoubleClick:()=>{E()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?E():N(""))}}),t.createElement(ua,T,t.createElement(cp,O)))},"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}=I,g=ja(e,i),v=c.fieldAliasMap;v||Mn("Table","helper 需要配置 `fieldAliasMap` 选项");const b="function"==typeof v?v():v||{};Object.keys(b).includes("valueKey")&&Object.keys(b).includes("textKey")||Mn("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),$.current=b;const x=t=>{const{beforeOpen:r}=c,i=(null!=r?r:On)({[X]:g},e,n);(null==i?void 0:i.then)?i.then((()=>{j(!0),null==t||t()})).catch((()=>{})):!1!==i&&(j(!0),null==t||t())},C=()=>{oe(!1,(()=>he(R.current)))},N=t=>{Va(e,i,t),y(s,t,u,p),me(e,u,p),null==h||h({[X]:t},e,M.current),le()},T={visible:q,title:w("qm.searchHelper.text"),width:null!==(r=c.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:S,bodyStyle:{paddingBottom:`${io[f]+20}px`},onClose:()=>{C()}},O=Object.assign(Object.assign({},c),{size:f,multiple:!0,initialValue:ge({},c.initialValue),defaultSelectedKeys:g,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=b;se(e);const r=M.current.map((e=>({text:e[t],value:e[n]})));B(r),N(r.map((e=>e.value)));const{closed:i}=c;oe(!1,(()=>he(R.current))),null==i||i(M.current)})(e):C()}});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(F,{mode:"multiple",open:!1,value:g,placeholder:l.placeholder||w("qm.table.editable.selectPlaceholder"),allowClear:l.allowClear,maxTagCount:l.collapseTags?"responsive":void 0,maxTagTextLength:l.maxTagTextLength,disabled:l.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!q&&x()},onDoubleClick:()=>{l.disabled||x()},onChange:e=>{const{valueKey:t}=b;se(M.current.filter((n=>e.includes(n[t])))),N(e)}},W.map((e=>t.createElement(F.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:l.disabled,icon:t.createElement(Ue,null),onClick:()=>{x()}})))),t.createElement(ua,T,t.createElement(cp,O)))},custom:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:a={},rules:l=[],render:o,onChange:s}=I;if(!o)return Mn("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const c=ja(e,r),d=t=>{Va(e,r,t),y(l,t,u,p),me(e,u,p),null==s||s({[X]:t},e),le()},h=o(e,n,d);return t.isValidElement(h)?t.cloneElement(h,{value:c,disabled:a.disabled,readOnly:a.readOnly,popupClassName:S,onChange:d}):null}};return t.createElement(t.Fragment,null,ne?(()=>{const{type:e}=I,n=ye[e];if(!n)return Mn("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!Z}];return t.createElement("div",{ref:R,className:Pe(r)},n(d,c),!Z&&t.createElement("div",{className:"cell-error"},J||ee))})():(()=>{const{disabled:n,extra:r={}}=I,{disabledColor:i,disabledBgColor:a}=r,l=["cell--show",{"is-cell-bg":n&&a}];return t.createElement(t.Fragment,null,t.createElement("span",{className:Pe(l),style:{color:n?i:""}},e.children),n&&a&&t.createElement("i",{className:"cell--bg",style:{background:a}}))})(),te&&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,{t:l}=Sn();return Wu(e.children,{onClick:o=>{const s=t.Children.only(e.children),c=Dt(n,r);null==a||a(n,c),c&&i&&R.success(l("qm.clipboard.success")),s&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(o)}})};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(bd),{dataIndex:m,canCopy:f,render:g,editRender:v,shouldCellUpdate:y}=i,{t:b}=Sn(),{renderText:x,getTitleFromCellNode:E}=Yd(),S=t.useRef(null),w=ja(a,m),[C,N]=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([Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn].includes(m))return;const e=S.current.parentNode;c?e.title=E(C):e.removeAttribute("title")}),[c,C]);const T=e=>Array.isArray(e.children);return t.createElement("div",{ref:S,className:"cell"},(()=>{if(m===Fd.expandableColumn)return t.createElement(ju,{record:a,rowKey:s});if(m===Fd.selectionColumn)return t.createElement(qu,{selectionKeys:d,column:i,record:a,rowKey:s});if(N)return N;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*Fd.treeTable.textIndent+"px"}}):null,t.createElement(ju,{key:"expand",record:a,rowKey:s,style:T(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(lt,{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(bd),{areaSelection:s={}}=r.current.props,{elementStore:c,tableFlatData:d}=r.current,{t:u}=Sn(),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=Rt(c.$tableBody,"mousedown",L),t=Rt(c.$tableBody,"contextmenu",O),n=Rt(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,N=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}},T=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(N(n))}),5),I=wn((()=>{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:ja(t,r)})}})),e})),R=e=>{var t;o(e),null===(t=s.onCellMerge)||void 0===t||t.call(s,e),Ln((()=>w()))},O=wn((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=wn((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(N(t)),y(N(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;T(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=Kn("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(js,{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 Qu=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:N,setElementStore:T,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(bd),{height:z,minHeight:W,maxHeight:B,rowHeight:U,rowSelection:G,rowHighlight:Y,expandable:X,stripe:Q,summation:Z,rowStyle:J,cellStyle:ee,spanMethod:te,tableConfig:ne,areaSelection:re,nativeScrollBar:ie,ellipsis:le,showHeader:oe,rowDraggable:se,onRowClick:ce,onRowDblclick:de,onRowContextmenu:ue,onRowEnter:he}=l.current.props,me=t.useRef(null),fe=t.useRef({}),ge=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:Ma(W)-e-n+"px"}),B&&Object.assign(a,{maxHeight:Ma(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([]),Ne=Mu();$u({ref:me,omitClassNames:[".table-editable__popper"],handler:()=>{var e;Ae([]),null===(e=ye.current)||void 0===e||e.blur()}}),t.useImperativeHandle(n,(()=>({setClickedValues:Ae,createFocus:Re,forceUpdate:Ne}))),Ei((()=>{we.length&&l.current.tableManager.focus(l.current.uid)}),[we]),t.useLayoutEffect((()=>{Ie();const e=Rt(document,"keydown",Te);return()=>e.remove()}),[]);const Te=wn((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&&(Ae([]),O(""),$(!1)),we.length&&(Li(document.activeElement,me.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==he||he(n,e))}if(!ke(we[0],we[1])){if(38===p||40===p){Ci(e);const{allTableData:t}=l.current,n=N?Fa(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),m=Oe(h,we[1]);"radio"!==(null==G?void 0:G.type)||(null===(d=G.disabled)||void 0===d?void 0:d.call(G,c))||m||R([h]),!Y||(null===(u=Y.disabled)||void 0===u?void 0:u.call(Y,c))||m||O(h),_(s)||(38===p&&P(h,s),40===p&&P(h,Se>s+1?0:s+1-Se)),Ae([h,we[1]])}if(9===p||e.shiftKey&&9===p){if(Ci(e),!s.length)return Ae([]);const t=s.length;let n=s.findIndex((e=>e.dataIndex===we[1]));const r=e.shiftKey&&9===p?(--n+t)%t:++n%t,i=s[r].dataIndex;Ae([we[0],i]),A(i)}}}})),Ie=()=>{T("$tableBody",me.current),T("$tableXspace",ge.current),T("$tableYspace",ve.current)},Re=(e,t)=>{var n;null===(n=fe.current[`${e}-${t}`])||void 0===n||n.focus()},Oe=(e,t)=>{var n,r;return null!==(r=null===(n=fe.current[`${e}-${t}`])||void 0===n?void 0:n.isEditable())&&void 0!==r&&r},ke=(e,t)=>{var n,r;return null!==(r=null===(n=fe.current[`${e}-${t}`])||void 0===n?void 0:n.isOpening())&&void 0!==r&&r},Le=(e,t,n)=>{var r;const{dataIndex:i}=n;if([Fd.expandableColumn,Fd.operationColumn].includes(i))return;const l=a(t,t.index);Ae([l,i]);const o=Oe(l,i),{type:s,selectByClickRow:c=!0,disabled:d=Rn}=G||{};!s||d(t)||o||(c||i===Fd.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?He(e,v,n):_e(e,v,n);R(a),null==i||i(n,t,a)}})(l,t),[Fd.selectionColumn].includes(i)||(!Y||(null===(r=Y.disabled)||void 0===r?void 0:r.call(Y,t))||o||O(l),null==ce||ce(t,n,e))},Ae=e=>{pe(e,we)||Ce(e)},_e=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),He=(e,t,n)=>{var r;const{disabled:i}=G||{},{deriveRowKeys:a,recordsMap:o}=l.current,s=Ha(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=nl(a,e))||void 0===r?void 0:r.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Ha(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},Fe=(e,n=0)=>{const r=[];return e.forEach((e=>{const i=e.index,o=a(e,e.index);if(r.push(De(e,i,o,n)),null==X?void 0:X.expandedRowRender){const{expandedRowClassName:n,rowExpandable:a=On}=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*Fd.selectionColumnWidth:Fd.selectionColumnWidth}},t.createElement("div",{className:Pe("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(...Fe(e.children,n+1))}})),r},De=(e,n,r,i=0)=>{const{disabled:a}=G||{},l=["body--row",Object.assign({"body--row-striped":Q&&n%2!=0,"body--row-selected":v.includes(r)&&!(null==a?void 0:a(e)),"body--row-current":b===r},C?je(e._group):null)];return t.createElement("tr",{key:r,"data-row-key":r,className:Pe(l)},xe.map(((t,a)=>$e(t,a,e,n,r,i))))},$e=(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}=Me(r,e,i,n);if(!x||!E)return null;const S=null!==(u=e.ellipsis)&&void 0!==u?u:le,w=!f&&"left"===v,N=!f&&"right"===v,T=["body--column",{"col--ellipsis":S,"col--center":"center"===y,"col--right":"right"===y,"column--sort":!!p[g],"cell-fix-left":w,"cell-fix-right":N,"cell-fix-left-last":w&&(null===(h=c[c.length-E])||void 0===h?void 0:h.dataIndex)===g,"cell-fix-right-first":N&&(null===(m=d[0])||void 0===m?void 0:m.dataIndex)===g,[b]:!!b}],I=N&&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:N?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?qe(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:Pe(T),style:_,onClick:t=>Le(t,r,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:r}=n;[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn].includes(r)||null==de||de(t,n,e)})(t,r,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:r}=n;[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn].includes(r)||null==ue||ue(t,n,e)})(t,r,e)},t.createElement(Uu,{ref:e=>fe.current[`${a}-${g}`]=e,row:r,column:e,rowIndex:i,columnIndex:n,rowKey:a,depth:s,showTitle:S}))},Me=(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]):ae(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}=Me(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}},qe=e=>{var t;const{backgroundColor:n,color:r}=null!==(t=Z.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:r}},je=e=>{const t=Z.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ve=Kn("table");return t.createElement(t.Fragment,null,t.createElement(Xi,{ref:l.current.scrollBarRef,wrapClassName:`${Ve}--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){oe&&(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:Rn,stopPropagation:Rn})}be.current.prevST=s,be.current.prevSL=c}},t.createElement("div",{ref:ve,className:"body--y-space"}),t.createElement("div",{ref:ge,className:"body--x-space",style:{width:g?h.tableBodyWidth-h.gutterWidth:h.tableBodyWidth}}),t.createElement(_u.Provider,{value:we},t.createElement("table",{ref:me,className:`${Ve}--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`}})}))),se?t.createElement(jt,{itemKey:e=>a(e,e.index),tag:"tbody",filter:".cell--edit input",preventOnFilter:!1,animation:200,list:i,setList:e=>{const t=e.map((e=>a(e,e.index))),n=i.map((e=>a(e,e.index)));if(pe(t,n))return;const r=al(e),o=[];l.current.tableFullData.forEach((e=>{i.includes(e)?o.push(r.shift()):o.push(e)})),I(o),H()}},i.map((e=>De(e,e.index,a(e,e.index))))):t.createElement("tbody",null,Fe(i)))),!!re&&t.createElement(Xu,{ref:ye})))}));Qu.displayName="TableBody";const Zu=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(bd),{footRender:h}=r.current.props,{t:m}=Sn(),f=t.useRef(null);t.useLayoutEffect((()=>{g()}),[]);const g=()=>{d("$footer",f.current)},v=(e,n,o)=>{var d,h;const{isIE:f}=r.current,{gutterWidth:g}=a,{dataIndex:v,fixed:y,align:b,summation:x}=e,E=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!i[v],"cell-fix-left":!f&&"left"===y,"cell-fix-right":!f&&"right"===y,"cell-fix-left-last":!f&&"left"===y&&(null===(d=s[s.length-1])||void 0===d?void 0:d.dataIndex)===v,"cell-fix-right-first":!f&&"right"===y&&(null===(h=c[0])||void 0===h?void 0:h.dataIndex)===v}],S=f?null:{left:"left"===y?`${u(v)}px`:"",right:"right"===y?`${p(v)+(l?g:0)}px`:""},w=(null==x?void 0:x.render)?x.render(r.current.tableFullData):ja(n,`${v}_text`),C=0===o&&""===w?m("qm.table.config.summaryText"):w;return t.createElement("td",{key:v,title:C,className:Pe(E),style:Object.assign({},S)},t.createElement("div",{className:"cell"},C))},y=Kn("table"),{tableBodyWidth:b}=a;return t.createElement("div",{ref:f,className:`${y}--footer-wrapper`},h?h(o,r.current.tableFullData):t.createElement("table",{className:`${y}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:b?`${b}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)=>v(t,e,n))),l&&t.createElement("td",{className:Pe(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(Wt),{tableRef:u,$size:p,setElementStore:h}=t.useContext(bd),{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:Fd.pagination.showSizeChanger,E=null!==(r=null==f?void 0:f.showQuickJumper)&&void 0!==r?r:Fd.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)||Fd.pagination.pageSizeOptions,w=()=>En(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=>En(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){}})),N=(e,t)=>En(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),T={[`${Kn("table")}-pager`]:!0};return t.createElement("div",{ref:v,className:Pe(T)},t.createElement("div",{className:"pager-alert"},"bottom"===(null==g?void 0:g.position)&&t.createElement(Bd,{total:s})),t.createElement(Q,{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&&(N(y,t),localStorage.setItem(y,`${t}`))}}))},tp=()=>{const{layout:e}=t.useContext(bd),n=t.useMemo((()=>{const{headerHeight:t,viewportHeight:n}=e;return{top:`${t}px`,height:`${n}px`}}),[e]),r=Kn("table");return t.createElement("div",{className:`${r}--empty`,style:n},t.createElement($i,null))},np=()=>{const{setElementStore:e}=t.useContext(bd),n=t.useRef(null);t.useLayoutEffect((()=>{r()}),[]);const r=()=>{e("$resizableBar",n.current)},i=Kn("table");return t.createElement("div",{ref:n,className:`${i}--resizable-bar`})},rp=t.forwardRef(((e,n)=>{const r=Xt(Ed,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}=Cn(r),x=t.useRef(null),E=t.useRef(null),S=t.useRef(null),w=t.useRef(null),C=t.useRef(null),N=wn(((e,t)=>{const n="function"==typeof i?i(e,t):null==e?void 0:e[i];return void 0===n?(Mn("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),{tableRef:T,tableFullData:I,setElementStore:R,setOriginColumns:O,setTableFullData:k,setTableOriginData:L,setTableFlatData:A,setAllTableData:P,setDeriveRowKeys:_,setInvalidRowKeys:H,setFieldAuth:F,setColumnsDefined:D,setScrollXStore:$,setScrollYStore:M,setScrollXLoad:q,setScrollYLoad:j,setResizeState:V,setHandleState:K,setSummaries:z,setSelectionRows:W,setShouldToTop:B,setRecordsMap:U,setUnMounted:G,clearElementStore:Y,clearRecordsMap:X}=((e,{getRowKey:n,$size:r})=>{const{rowHeight:i,dynamicThead:a}=e,l=t.useRef({props:e,uid:Ad(),tableManager:_d,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||Fd.rowHeightMaps[r]},store:new Hd,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=Fa(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:b}),{tableData:Q,setTableData:Z,tableFlatColumns:J,setTableFlatColumns:ee,filters:te,setFilters:ne,sorter:re,setSorter:ie,superFilters:le,setSuperFilters:oe,pagination:se,setPagination:ce,selectionKeys:de,setSelectionKeys:ue,rowExpandedKeys:me,setRowExpandedKeys:fe,highlightKey:ge,setHighlightKey:ve,updateMark:ye,forceUpdate:be,mergedTdCells:xe,setMergedCells:Ee,layout:Se,setLayout:we,permission:Ce,setPermission:Ne,spinning:Te,setSpinning:Ie,scrollX:Re,setScrollX:Oe,scrollY:ke,setScrollY:Le,isPingLeft:Ae,setPingLeft:_e,isPingRight:He,setPingRight:Fe,isFullScreen:De,setFullScreen:$e,updateTableData:Me}=(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(Wt),w={current:null!==(n=null==v?void 0:v.current)&&void 0!==n?n:Fd.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:Fd.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:[],N=null!==(u=null!==(d=null==b?void 0:b.expandedRowKeys)&&void 0!==d?d:null==b?void 0:b.defaultExpandedRowKeys)&&void 0!==u?u:[],[T,I]=t.useState([]),[R,O]=t.useState([]),[k,L]=t.useReducer(((e,t)=>pe(e,t)?e:t),g),[A,P]=t.useReducer(((e,t)=>pe(e,t)?e:t),f),[_,H]=t.useReducer(((e,t)=>pe(e,t)?e:t),[]),[F,D]=t.useState(w),[$,M]=t.useReducer(((e,t)=>pe(e,t)?e:t),C),[q,j]=t.useReducer(((e,t)=>pe(e,t)?e:t),N),[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]=$d([],{value:E}),[G,Y]=t.useState({gutterWidth:m?qd():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[X,Q]=t.useState({export:!0,import:!0,print:!0}),[Z,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:T,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:Q,setLayout:Y,spinning:Z,setSpinning:J,scrollX:ee,setScrollX:te,scrollY:ne,setScrollY:re,isPingLeft:ie,setPingLeft:ae,isPingRight:le,setPingRight:oe,isFullScreen:se,setFullScreen:ce,updateTableData:()=>I([...T])}})(r),{isFetch:qe,isWebPagination:je,isScrollPagination:Ve,showPagination:Ke,shouldUpdateHeight:ze,tableColumns:We,flattenColumns:Be,editableColumns:Ue,summationColumns:Ge,leftFixedColumns:Ye,rightFixedColumns:Xe,derivedMergeCells:Qe,treeExpandIndex:Ze,showSummary:Je,showFooter:et,isHeadGroup:tt,bordered:nt,isHeadSorter:rt,isHeadFilter:it,isServiceSummation:at,isSelectCollection:lt,isTableImport:ot,isTableClipboard:st,isSuperSearch:ct,isFastSearch:dt,isGroupSummary:ut,isGroupSubtotal:pt,isTreeTable:ht,isTableEmpty:mt,summationRows:ft,fetchParams:gt}=Vd(r,{getRowKey:N,tableRef:T,tableFullData:I,tableData:Q,sorter:re,filters:te,superFilters:le,selectionKeys:de,pagination:se,mergedTdCells:xe}),{createElementStore:vt,tableStyles:yt,getSpan:bt,getStickyLeft:xt,getStickyRight:Et,scrollXToColumn:St,scrollYToRecord:wt,rowInViewport:Ct,calcTableHeight:Nt,resetTableScroll:Tt,computeVirtualX:It,computeVirtualY:Rt,doLayout:Ot}=zd(r,{getRowKey:N,tableRef:T,topElementRef:x,tableElementRef:E,$size:b,tableColumns:We,flattenColumns:Be,leftFixedColumns:Ye,derivedMergeCells:Qe,layout:Se,scrollX:Re,scrollY:ke,showFooter:et,showPagination:Ke,isFullScreen:De,setLayout:we,setScrollX:Oe,setScrollY:Le,setElementStore:R,setScrollXStore:$,setScrollYStore:M,setShouldToTop:B}),{initialTable:kt,checkDataIndex:Lt,createTableFullData:At,getTableData:Pt,handleTableData:_t,createWebPageData:Ht,createTableData:Ft,createGroupData:Dt,createSelectionKeys:$t,createRowExpandedKeys:Mt,setSelectionKeysEffect:qt,findParentRowKeys:jt,getAllChildRowKeys:Vt,doFieldValidate:Kt,getTableLog:zt,dataChange:Bt,tableChange:Ut,toLastPage:Gt,toFirstPage:Yt,getPageCount:Qt,pagerChangeHandle:Zt,triggerScrollXEvent:Jt,triggerScrollYEvent:en,scrollBottomDebouncer:tn,clearTableSorter:nn,clearTableFilter:rn,clearSuperFilters:an,clearRowSelection:ln,clearRowHighlight:on,clearTableLog:sn,destroy:cn}=Kd(r,{getRowKey:N,tableRef:T,tableElementRef:E,tableBodyRef:S,$size:b,tableColumns:We,flattenColumns:Be,editableColumns:Ue,tableFullData:I,pagination:se,layout:Se,filters:te,sorter:re,superFilters:le,fetchParams:gt,selectionKeys:de,rowExpandedKeys:me,highlightKey:ge,summationColumns:Ge,shouldUpdateHeight:ze,isFetch:qe,isTreeTable:ht,isWebPagination:je,isScrollPagination:Ve,isServiceSummation:at,isGroupSubtotal:pt,doLayout:Ot,setTableData:Z,setTableFlatColumns:ee,setTableFullData:k,setTableOriginData:L,setTableFlatData:A,setAllTableData:P,setDeriveRowKeys:_,setPagination:ce,setSpinning:Ie,setSorter:ie,setFilters:ne,setSuperFilters:oe,setSelectionKeys:ue,setRowExpandedKeys:fe,setHighlightKey:ve,setSelectionRows:W,setScrollXLoad:q,setScrollYLoad:j,setScrollXStore:$,setScrollYStore:M,computeVirtualX:It,computeVirtualY:Rt,setFieldAuth:F,setResizeState:V,setSummaries:z,setPermission:Ne,setRecordsMap:U,resetTableScroll:Tt,clearElementStore:Y,clearRecordsMap:X});((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:N,scrollYToRecord:T,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);Ei((()=>{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]),Ei((()=>{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]),Ei((()=>{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]),Ei((()=>{var e;pe(g,M.current)||(M.current=g,v&&i&&(null===(e=i.onChange)||void 0===e||e.call(i,g)))}),[g]),Ei((()=>{const e=H(a.selectedRowKeys);pe(e,h)||(e.__prevent__=!0,I(e),x&&O(F()))}),[null==a?void 0:a.selectedRowKeys]),Ei((()=>{const e=F(l.expandedRowKeys);pe(e,m)||(e.__prevent__=!0,O(e))}),[null==l?void 0:l.expandedRowKeys]),Ei((()=>{const{currentRowKey:e}=o;e!==f&&k(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),Ei((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(y&&("after"===e?S():w()),T("","after"===e?1e5:0)),t&&p.current>C()&&S(),(e||t)&&N({insert:null,remove:!1})}),[p.total]),Ei((()=>{A(u)}),[u]),Ei((()=>{_()}),[d]),Ei((()=>{s.current.scrollYLoad&&(e.height||e.maxHeight||Mn("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||Mn("Table","必须设置组件参数 `ellipsis`")),b&&(e.height||e.maxHeight||Mn("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(Hn(r)),D(),E(),Ln((()=>_())),()=>{$(),P(!0)})),[])})(r,{tableRef:T,tableBodyRef:S,$size:b,scrollX:Re,pagination:se,selectionKeys:de,rowExpandedKeys:me,highlightKey:ge,showSummary:Je,summationRows:ft,isWebPagination:je,isScrollPagination:Ve,isTreeTable:ht,checkDataIndex:Lt,toLastPage:Gt,toFirstPage:Yt,getPageCount:Qt,setHandleState:K,scrollYToRecord:wt,setOriginColumns:O,setSelectionKeysEffect:qt,setRowExpandedKeys:fe,setHighlightKey:ve,setResizeState:V,setPingRight:Fe,setUnMounted:G,calcTableHeight:Nt,createSelectionKeys:$t,createRowExpandedKeys:Mt,initialTable:kt,destroy:cn});const dn=t.useMemo((()=>({getRowKey:N,tableRef:T,tableBodyRef:S,$size:b,flattenColumns:Be,editableColumns:Ue,leftFixedColumns:Ye,rightFixedColumns:Xe,treeExpandIndex:Ze,sorter:re,filters:te,superFilters:le,layout:Se,bordered:nt,showFooter:et,showSummary:Je,summationRows:ft,scrollX:Re,scrollY:ke,pagination:se,fetchParams:gt,selectionKeys:de,rowExpandedKeys:me,highlightKey:ge,mergedTdCells:xe,derivedMergeCells:Qe,updateMark:ye,isFetch:qe,isPingLeft:Ae,isPingRight:He,isHeadSorter:rt,isHeadFilter:it,isFullScreen:De,isTableEmpty:mt,isHeadGroup:tt,isTreeTable:ht,isGroupSubtotal:pt,isWebPagination:je,dataChange:Bt,tableChange:Ut,getTableData:Pt,setElementStore:R,createWebPageData:Ht,createTableFullData:At,updateTableData:Me,setSorter:ie,setFilters:ne,setSuperFilters:oe,setHighlightKey:ve,setRowExpandedKeys:fe,setSelectionRows:W,setSelectionKeysEffect:qt,setInvalidRowKeys:H,setMergedCells:Ee,getSpan:bt,getStickyLeft:xt,getStickyRight:Et,scrollXToColumn:St,scrollYToRecord:wt,rowInViewport:Ct,setPagination:ce,setPingLeft:_e,setPingRight:Fe,setSpinning:Ie,setFullScreen:$e,setShouldToTop:B,doFieldValidate:Kt,createTableData:Ft,createGroupData:Dt,findParentRowKeys:jt,getAllChildRowKeys:Vt,triggerScrollXEvent:Jt,triggerScrollYEvent:en,scrollBottomDebouncer:tn,resetTableScroll:Tt,clearTableSorter:nn,clearTableFilter:rn,clearSuperFilters:an,clearRowSelection:ln,clearRowHighlight:on})),[b,Be,Ue,Ye,Xe,Ze,re,te,le,Se,nt,et,Je,ft,Re,ke,se,gt,de,me,ge,Qe,ye,qe,Ae,He,rt,it,De,mt,tt,ht,pt,je]);((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:N,setHandleState:T,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=>En(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=La(j,e);if(!r)return Mn("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!ae(t))return Mn("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(r.noAuth)return Mn("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&he(r,e,t[e]);n&&(V?V([...j]):Mn("Table","需要设置 `columnsChange` 参数"),P())},INSERT_RECORDS:(e,t)=>{const{store:n,tableFullData:a}=i.current,l=(Array.isArray(e)?e:[e]).filter((e=>ae(e)));if(!l.length)return;l.forEach((e=>{s.forEach((t=>{const{dataIndex:n}=t;[Fd.expandableColumn,Fd.selectionColumn,Fd.operationColumn].includes(n)||Va(e,n,ja(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=rl(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&&T(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=>ae(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&&(T(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(),Ln((()=>{N(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,ja(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:T,toolBoxRef:w,tableBodyRef:S,columnFilterRef:C,flattenColumns:Be,editableColumns:Ue,pagination:se,fetchParams:gt,selectionKeys:de,rowExpandedKeys:me,highlightKey:ge,isFetch:qe,dataChange:Bt,getTableData:Pt,handleTableData:_t,createTableData:Ft,createTableFullData:At,calcTableHeight:Nt,scrollXToColumn:St,scrollYToRecord:wt,doFieldValidate:Kt,setTableOriginData:L,setHandleState:K,setColumnsDefined:D,setSelectionKeysEffect:qt,setRowExpandedKeys:fe,setHighlightKey:ve,setSelectionRows:W,setOriginColumns:O,forceUpdate:be,getTableLog:zt,clearRowSelection:ln,clearRowHighlight:on,clearTableSorter:nn,clearTableFilter:rn,clearSuperFilters:an,clearTableLog:sn}),t.useLayoutEffect((()=>{vt(),T.current.tableManager.register(T.current.uid,null!=n?n:{current:null})}),[]);const un=Kn("table"),pn={[`${un}--wrapper`]:!0,[`${un}--lg`]:"large"===b,[`${un}--sm`]:"small"===b,[`${un}--maximize`]:De,[s]:!!s},mn={[un]:!0,"is--border":nt,"is--fixed":Ye.length||Xe.length,"is--sortable":rt,"is--filterable":it,"is--head-group":tt,"is--area-select":!!c,"is--ping-left":Ae,"is--ping-right":He};return t.createElement(bd.Provider,{value:dn},t.createElement("div",{className:Pe(pn)},m&&t.createElement("div",{ref:x,className:`${un}-top`},t.createElement("div",{className:`${un}-top__space`},"bottom"!==(null==p?void 0:p.position)&&t.createElement(Bd,{total:se.total}),t.createElement("div",{className:`${un}-top__space-slot`,style:{justifyContent:Od[h]}},r.children)),t.createElement("div",{className:`${un}-top__actions`},t.createElement(wu,{ref:w,showFullScreen:f,showReload:g&&qe,showPrint:Ce.print&&!!d,showImport:Ce.import&&ot,showExport:Ce.export&&!!u,showClipboard:st,showCollection:lt,showFastSearch:dt,showSuperSearch:ct,showGroupSummary:ut,showToolBox:v,tableColumns:We}),t.createElement(Nu,{ref:C,columns:a}))),t.createElement(Mi,{spinning:null!=l?l:Te},t.createElement("div",{ref:E,className:Pe(mn),style:yt},t.createElement("div",{className:`${un}--main-wrapper`},y&&t.createElement(Pu,{tableColumns:We,sorter:re,filters:te}),t.createElement(Qu,{ref:S,tableFlatColumns:J,tableData:Q}),et&&t.createElement(Zu,{summationRows:ft})),nt&&t.createElement("div",{className:`${un}--border-line`}),mt&&t.createElement(tp,null),o&&t.createElement(np,null))),Ke&&t.createElement(ep,hn({},se,{onChange:(e,t)=>Zt({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}=Cn(e),{t:m}=Sn(),f=t.useRef(null),g=t.useRef(null),v=t.useRef(null),y=zi(f),[b,x]=t.useState(c),[E,S]=t.useState(),[w,C]=t.useState(o),[N,T]=t.useState(!1),[I,R]=t.useState(300),[O,k]=t.useState(s),[L,A]=t.useState((e=>[{title:m("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[P,_]=t.useState(ge({},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*io[h]-30)},$=Wi(D,5);Zt((()=>{$()}),[y.width]),Ei((()=>{pe(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=()=>En(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=On}=n;if(l(P)){T(!0);try{const t=yield r(P);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=de(t.data,a))&&void 0!==e?e:[];i||(C([]),yield kn(0)),F(n)}}catch(e){}T(!1)}})),q=e=>{i||(S(e),p(e))},j=e=>{_(Object.assign({},P,e))},V={[`${Kn("search-helper")}--wrapper`]:!0},K=b.webPagination?{dataSource:H,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:P})};return t.createElement("div",{ref:f,className:Pe(V,d),style:u},t.createElement("div",{className:"form-wrap"},O.length?t.createElement(Kc,{ref:g,items:O,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>D(),onFinish:e=>j(e),onReset:()=>En(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,hn({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:`${io[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(qn,{onClick:()=>p(null),style:{marginRight:8}},m("qm.dialog.cancel")),t.createElement(qn,{type:"primary",disabled:!E,onClick:()=>p(E,i?w:void 0)},m("qm.dialog.confirm"))))};ip.displayName="QmSearchHelper";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}=Cn(e),{t:f}=Sn(),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=zi(g),[x,E]=t.useState(c),[S,w]=t.useState(),[C,N]=t.useState(o),[T,I]=t.useState(!1),[R,k]=t.useState(300),[L,A]=t.useState(300),[P,_]=t.useState(s),[H,F]=t.useState((e=>[{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[D,$]=t.useState(ge({},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*io[m]-30)},V=Wi(j,5);Zt((()=>{V()}),[b.width]),Ei((()=>{pe(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=()=>En(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=On}=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=de(t.data,a))&&void 0!==e?e:[];i||(N([]),yield kn(0)),q(n)}}catch(e){}I(!1)}})),z=e=>{i||(w(e),h(e))},W=e=>{$(Object.assign({},D,e))},[B,U]=t.useState([]),[Y,X]=t.useState([]),[Q,Z]=t.useState(""),J=t.useRef(B),ee=t.useRef([]);Ei((()=>{X(ap(B))}),[B]);const te=()=>En(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=de(l.data,r))&&void 0!==e?e:[],n=Cl(t,i,a);U(n),J.current=n,ee.current=t}}catch(e){}})),ne=e=>`${e}|${jl.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${Kn("tree-table-helper")}--wrapper`]:!0},ie=x.webPagination?{dataSource:M,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},x.fetch),{params:D})};return t.createElement("div",{ref:g,className:Pe(re,u),style:p},t.createElement(Fi,{defaultValue:200,style:{height:"100%"}},t.createElement(Fi.Pane,{min:100,style:{overflowY:"auto"}},t.createElement(O.Search,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:f("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)}));Z(e),U(t)})(e.target.value)}),t.createElement(G,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:Y,treeData:B,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==ne(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return Mn("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const r in t)n[r]=de(e,t[r]);W(n)})(lp(ee.current,(n=>de(n,t)===e[0]))||{})}})),t.createElement(Fi.Pane,{className:"split-pane"},t.createElement("div",{className:"form-wrap"},P.length?t.createElement(Kc,{ref:v,items:P,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>j(),onFinish:e=>W(e),onReset:()=>En(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,hn({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)=>{N(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:`${io[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(qn,{onClick:()=>h(null),style:{marginRight:8}},f("qm.dialog.cancel")),t.createElement(qn,{type:"primary",disabled:!S,onClick:()=>h(S,i?C:void 0)},f("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}=Cn(e),{t:p}=Sn(),[h,m]=t.useState(),[f]=t.useState(null===(n=l.fetch)||void 0===n?void 0:n.params),g={[`${Kn("tree-helper")}--wrapper`]:!0},v=l.fetch?Object.assign(Object.assign({},_n(l.fetch,["params","valueKey","textKey"])),{params:f}):void 0;return t.createElement("div",{className:Pe(g,s),style:c},t.createElement(yd,{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},autoFocus:!0,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:`${io[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(qn,{onClick:()=>d(null),style:{marginRight:8}},p("qm.dialog.cancel")),t.createElement(qn,{type:"primary",disabled:!h,onClick:()=>d(h)},p("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}=Cn(e),{t:c}=Sn(),d=t.useRef(null),u=t.useRef(null),p=t.useRef(null),h=zi(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,N]=t.useState((e=>[{title:c("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},{title:c("qm.form.rangeSearchHelper")[0],dataIndex:dp,width:80,align:"right",render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)},...e||(l.columns||[]),{title:c("qm.form.rangeSearchHelper")[1],dataIndex:up,fixed:"right",width:80,render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)}])()),[T,I]=t.useState(ge({},null===(n=l.fetch)||void 0===n?void 0:n.params,i)),[O,k]=t.useState([]),L=t.useMemo((()=>y.map((e=>null==e?void 0:e.pageIndex))),[y]),A=t.useMemo((()=>2===L.length&&L.every((e=>void 0!==e))),[L]),P=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");E(e.offsetHeight-t.offsetHeight-2*io[s]-30)},_=Wi(P,5);Zt((()=>{_()}),[h.width]),Ei((()=>{pe(a,S)||w(a)}),[a]),t.useEffect((()=>{H()}),[T]);const H=()=>En(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=On}=n;if(a(T)){v(!0);try{const t=yield r(T);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=de(t.data,i))&&void 0!==e?e:[];k(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({},T,e))},M=Kn("range-helper"),q=m.webPagination?{dataSource:O,loading:g,webPagination:!0}:{fetch:Object.assign(Object.assign({},m.fetch),{params:T})};return t.createElement("div",{ref:d,className:`${M}--wrapper`},t.createElement("div",{className:"form-wrap"},S.length?t.createElement(Kc,{ref:u,items:S,initialValues:i,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>w(e),onCollapse:()=>P(),onFinish:e=>$(e),onReset:()=>En(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,hn({ref:p,height:x,columns:C,rowKey:m.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=L[0]&&e.pageIndex<=L[1]?{backgroundColor:"#f5f5f5"}:{}},q,{columnsChange:e=>N(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>L[1]?R.warning(c("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<L[0]?R.warning(c("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===L[0]&&(e[dp]="["),e.pageIndex===L[1]&&(e[up]="]")}))}}),t.createElement(qn,{type:"primary",icon:t.createElement(vt,null),title:c("qm.table.alert.clear"),onClick:()=>D()}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${io[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(qn,{onClick:()=>o(null),style:{marginRight:8}},c("qm.dialog.cancel")),t.createElement(qn,{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))))},c("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-${Ad()}`,p="object"==typeof c?null==c?void 0:c.placeholder:c;return t.createElement($t,{open:s,autoLock:!0},t.createElement("div",{className:Pe(`${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",hn({},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",hn({},xp,{x:"0",y:"0",width:"100%",height:`${i.top}px`})),t.createElement("rect",hn({},xp,{x:"0",y:"0",width:i.left,height:"100%"})),t.createElement("rect",hn({},xp,{x:"0",y:i.top+i.height,width:"100%",height:`calc(100vh - ${i.top+i.height}px)`})),t.createElement("rect",hn({},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]=$d(void 0,{value:i,postState:e=>null==e||e}),c=t.useRef(null),d=t.useRef(!1),u=wn((e=>{p(e),e.shiftKey&&32===e.keyCode&&h()}));t.useEffect((()=>{const e=Rt(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-Oi(t).x,o=e.clientY-Oi(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),Ti(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(yt,null):t.createElement(bt,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}=Sn(),y="primary"!==c?"primary":"default",b=wn((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=Rt(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:Pe(i===r&&`${n}-indicator-active`,`${n}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return t.createElement("div",{className:Pe(`${n}-content`,f)},t.createElement("div",{className:`${n}-inner`},t.createElement(Ge,{className:`${n}-close`,onClick:u}),s.content&&t.createElement(X,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},t.createElement(xt,{className:Pe(`${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(Vn,{className:`${n}-buttons`},0!==r?t.createElement(qn,{className:`${n}-prev-btn`,size:"small",onMouseDown:w,onClick:p},v("qm.tour.prevStep")):null,r===i-1?t.createElement(qn,{className:`${n}-finish-btn`,type:y,size:"small",onClick:m},v("qm.tour.finish")):t.createElement(qn,{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))},Np={left:"50%",top:"50%",width:1,height:1},Tp=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=bn(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),N=t.useRef(),[T,I]=$d(0,{value:a,defaultValue:i}),[R,O]=$d(void 0,{value:c,postState:e=>!(T<0||T>=r.length)&&(null!=e&&e)}),[k,L]=$d(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[T]||{},U=W||k,G=F||d,Y=R&&(null!=K?K:u),X=null!=z?z:w,[Q,Z]=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"})(Z,g,D),ee=!!Z&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;t.useLayoutEffect((()=>{var e;null===(e=N.current)||void 0===e||e.forceAlign()}),[te,T]),Ei((()=>{R&&(ie(),null==B||B(Z,T))}),[R,Z]);const ne=e=>{I(e),null==l||l(e)},re=()=>{O(!1),null==o||o(T)},ie=()=>{if(!Z)return;const e=[];!function t(n){if(1===n.nodeType){var r;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===Ni(r=n,"display")||"hidden"===Ni(r,"visibility")||"0"===Ni(r,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ae=()=>En(void 0,void 0,void 0,(function*(){if(!$||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),n=Z.offsetWidth,r=Z.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 kn(null!=M?M:320))})),le="boolean"==typeof Y?Y:!!Y,oe="boolean"==typeof Y?void 0:Y,se=Object.assign({},f,q),ce=Kn("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:Q,showMask:le,style:null==oe?void 0:oe.style,fill:null==oe?void 0:oe.color,open:A,animated:S,rootClassName:m}),t.createElement($t,{open:A,autoLock:!0},t.createElement(Mt,hn({ref:N},C,{zIndex:U,builtinPlacements:ue,popupStyle:se,popupPlacement:J,popupVisible:A,popupClassName:Pe(de),prefixCls:ce,popup:()=>t.createElement(Cp,hn({key:"content",arrow:ee,prefixCls:ce,total:r.length,helper:v,renderPanel:b,indicatorsRender:x,onPrev:()=>En(void 0,void 0,void 0,(function*(){yield ae(),ne(T-1)})),onNext:()=>En(void 0,void 0,void 0,(function*(){yield ae(),ne(T+1)})),onClose:re,current:T,onFinish:()=>{re(),null==s||s()}},Object.assign({},r[T],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),t.createElement("div",{className:Pe(m,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Q||Np),{position:"fixed",pointerEvents:"none"})}))),h&&t.createElement($t,{open:R},t.createElement(Sp,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));Tp.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:l,initialEntered:s,mountOnEnter:c,unmountOnExit:d,onStateChange:h}=e||{},[m,f]=u((()=>Rp(s?2:Op(c)))),g=a(m),v=a(),[y,b]=(e=>ae(e)?[e.enter,e.exit]:[e,e])(l),x=p((()=>{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,h)}),[h,d]),E=p((e=>{const a=e=>{switch(kp(e,f,g,v,h),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,h,t,n,r,i,y,b,d]);return o((()=>()=>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 Zt((()=>{s()}),[r]),t.createElement(t.Fragment,null,t.Children.map(e.children,(e=>t.isValidElement(e)?Wu(e,{className:Pe(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 R.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){R.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(Wt),{$$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}))),Ei((()=>{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("")},N=()=>{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},T=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().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([N(),C(),...p.current]);const r=t.fixedLogo?x-Pp.logoHeight:x;let a=[];if(m.current=[],"stylus"===n)m.current.push([N(),...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([N(),...t.fixedLogo?[C()]:[],...a]),a=[],e=0,n-=1),n===i-1&&a.length&&m.current.push([N(),...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()+N()+e.join("")+"</table>"},A=()=>En(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||(T(),yield kn(0),I(),R(),g(!1))})),P=()=>En(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();T(),yield kn(0),I(),R(),g(!1),l.doPrint(k()),yield kn(0),l.doClose()})),_=()=>{Mn("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},H={[Kn("print-container")]:!0,"no-visible":i};return t.createElement("div",{ref:d,className:Pe(H)},t.createElement(Mi,{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 s{constructor(){super(...arguments),this.formRef=t.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Yt("qm.print.setPanel.printParameter")},{type:"SELECT",label:Yt("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:Yt("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Yt("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Yt("qm.print.setPanel.vertical"),value:"vertical"},{text:Yt("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Yt("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Yt("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:Yt("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Yt("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Yt("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:Pp.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Yt("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:Yt("qm.print.setPanel.sizeUnit"),disright:Yt("qm.print.setPanel.sizeUnit"),distop:Yt("qm.print.setPanel.sizeUnit"),disbottom:Yt("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>En(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(Kc,{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(qn,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Yt("qm.dialog.close")),t.createElement(qn,{type:"primary",onClick:()=>this.confirmHandle()},Yt("qm.dialog.confirm"))))}}qp.contextType=Wt;class jp extends s{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=()=>En(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 Vt.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=>En(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)=>En(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():R.error(Yt("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():R.error(Yt("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(`${h().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Yt("qm.print.laserPrinter"),value:"laser"},{text:Yt("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Dp(),t=[{text:Yt("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){Mn("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 En(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield Vt.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),ae(n)&&(yield Vt.setItem(this.printerKey,n))),ae(n)&&Object.keys(n).length&&ge(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=Kn("print-preview"),c={visible:r,title:Yt("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:Pe(d)},t.createElement("div",{className:"outer"},t.createElement("div",{className:"header"},t.createElement("span",null,Yt("qm.print.printer"),":",t.createElement(F,{value:i.printerName,onChange:e=>{this.setState((t=>ge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t.createElement(F.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,Yt("qm.print.type"),":",t.createElement(F,{value:i.printerType,onChange:e=>{this.setState((t=>ge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t.createElement(F.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,Yt("qm.print.copies"),":",t.createElement(M,{value:i.copies,min:1,precision:0,onChange:e=>{this.setState((t=>ge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),t.createElement("span",null,Yt("qm.print.printPage.0"),t.createElement(M,{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"}}),Yt("qm.print.printPage.1")),t.createElement("span",null,t.createElement(Q,{size:"small",current:a,pageSize:1,total:l,onChange:this.pageChangeHandle})),t.createElement("span",null,t.createElement(qn,{type:"text",icon:t.createElement(at,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Yt("qm.print.setting"))),t.createElement("span",null,t.createElement(qn,{type:"text",icon:t.createElement(je,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Yt("qm.print.export"))),t.createElement("span",null,t.createElement(qn,{icon:t.createElement(rt,null),type:"primary",onClick:this.printClickHandle},Yt("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,Yt("qm.print.scale"),":",t.createElement(Z,{value:i.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>ge({},t,{form:{scale:e}})))}}),t.createElement("em",{className:"scale-text"},`${Math.floor(100*i.scale)}%`)),t.createElement("span",null,Yt("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t.createElement("span",null,Yt("qm.print.pageNumber"),":",Yt("qm.print.pagination",{currentPage:a,totalPage:l}))))),t.createElement(ua,c,t.createElement(qp,{setting:i.setting,onChange:e=>{this.setState((t=>ge({},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=Wt;class Vp extends s{constructor(){super(...arguments),this.previewRef=t.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>En(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:Yt("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(ua,o,t.createElement(jp,s)):e?t.createElement(jp,s):null},this.DO_PRINT=()=>En(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield kn(0),this.setState({visible:!0}),yield kn(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(qn,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(!ll(e[t]||""))return $n("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:Pt.elementType},Vp.defaultProps={preview:!0,type:"primary",icon:t.createElement(rt,null)},Vp.contextType=Wt;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 Qp{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 Zp{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 Qp(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=>Li(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 Zp),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=Ae((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}=Sn();return t.createElement(t.Fragment,null,t.createElement("div",{style:{height:100}},l("qm.table.config.emptyText")),t.createElement(Vn,{style:{width:"100%",justifyContent:"flex-end"}},t.createElement(qn,{size:"small",onClick:()=>null==i?void 0:i()},l("qm.guideTracker.closeButton")),t.createElement(qn,{size:"small",onClick:()=>null==r?void 0:r()},l("add"===n?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),t.createElement(qn,{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}=Sn(),E=t.useRef(),S=t.useRef(l.length),[C,N]=$d(0,{value:i,defaultValue:a}),[T,I]=$d(void 0,{value:r,postState:e=>null!=e&&e}),[R,O]=$d(1051,{value:h,defaultValue:h}),[k,L]=t.useState({}),[A,P]=t.useState(!1),[_,H]=t.useState(T),[F,D]=t.useState(!1),[M,q]=mp(k.node,!!r),[j,V]=t.useState(22),K=t.useRef(!1),z=t.useMemo((()=>C>=l.length?"add":"edit"),[C,l]),W=t.useMemo((()=>`${C+1} / ${l.length}`),[C,l]);t.useLayoutEffect((()=>{E.current=new ih({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),L({id:Ya(),node:e,path:t}),N(S.current),P(!0),U(),null==g||g(t,e)}})}),[]),t.useEffect((()=>(T?B():U(),T?setTimeout((()=>H(!0)),16):H(!1),()=>{U()})),[T]),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:C,selector:k.path})})));const Y=Kn("guide-tracker"),Q=[{[`${Y}-primary`]:!0}],Z=bp({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement($t,{open:T&&A,autoLock:!0},t.createElement(Mt,{zIndex:R,builtinPlacements:Z,popupPlacement:o,popupVisible:T&&A,popupClassName:Pe(Q,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(Ge,{className:`${Y}-close`,onClick:()=>{null==y||y(C),e()}}),t.createElement($,{open:F,trigger:["click"],dropdownRender:()=>l.length?t.createElement("div",{className:"ant-dropdown-menu step-list"},t.createElement(jt,{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(pe(t,n))return;const r=t.findIndex((e=>e===k.id)),i=-1!==r?r:C;N(i),null==v||v(al(e),i)}},l.map(((e,n)=>t.createElement("li",{key:n,className:Pe("item",{actived:e.id===k.id})},t.createElement(We,{className:"handle",title:x("qm.form.draggable")}),t.createElement("span",{className:"box"},t.createElement("span",{className:"title",title:e.title,onClick:()=>{n!==C&&(L({id:e.id,node:ah(e.selector),path:e.selector}),N(n),V(22===j?j+1:j-1),null==v||v(l,n))}},e.title),t.createElement(w,{title:x("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const t=l.filter((t=>t.id!==e.id)),r=n===C;let i=n<=C?C-1:C;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})}N(i),null==v||v(t,i)}},t.createElement(Ge,{className:"close-icon"})))))))):t.createElement(t.Fragment,null),overlayClassName:`${Y}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>D(e)},t.createElement(Et,{className:Pe(`${Y}-close`,"menu-icon"),style:{width:j}})),m.content&&t.createElement(X,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:m.content,title:m.title},t.createElement(xt,{className:Pe(`${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},C):t.createElement(lh,{action:z,onConfirm:()=>{null==v||v("add"===z?[...l,{id:k.id,selector:k.path,title:"Guide Title"}]:[...l],C),e()},onCancel:()=>{null==y||y(C),e()},onFinish:()=>{e(),null==y||y(C),null==b||b()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},t.createElement("div",{className:Pe(`${Y}-target-placeholder`),style:Object.assign(Object.assign({},M||oh),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:G,onClick:G}))),s&&t.createElement($t,{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,N=t.useRef(null),T=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(N.current){const r=T.current.get(N.current);r&&(N.current.contains(r)&&N.current.removeChild(r),T.current.delete(N.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=N.current)||void 0===n||n.append(i),T.current.set(N.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(T.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])}(N,(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=Kn("watermark");return t.createElement("div",{ref:N,className:Pe(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||Mn("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[Kn("lazy-load")]:!0};return t.createElement("div",{ref:s,className:Pe(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"})),Nh=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:m,onCancel:f}=e,{t:g}=Sn(),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,N]=$d(void 0,{value:r,postState:e=>null!=e&&e}),T=t.useMemo((()=>!!e.children),[e.children]),[I,R]=t.useState(T?"square":"line"),[O,k]=t.useState(E[0]),[L,A]=t.useState(T?w[0]:w[4]),[P,_]=t.useState(S[1]),[H,D]=t.useState("bottomLeft"),[M,q]=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:!T};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()};Ei((()=>{T&&C&&K()}),[C,T]),Ei((()=>{v.current.setDrawMode(I)}),[I]),Ei((()=>{v.current.setLineWidth(O)}),[O]),Ei((()=>{v.current.setPenColor(L)}),[L]),Ei((()=>{v.current.setFontSize(P)}),[P]);const z=()=>En(void 0,void 0,void 0,(function*(){const e=T?b.current.parentNode:y.current;if(e)try{const t=yield qt(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===x.current||e.classList.contains("spinning")});return bh.canvasToDataURL(t)}catch(e){Mn("Signature","生成合成图片失败!")}})),W=()=>{v.current.clear(),null==f||f()};t.useImperativeHandle(n,(()=>({OPEN:()=>N(!0),CLOSE:()=>N(!1),CLEAR:()=>v.current.clear(),UNDO:()=>v.current.undo(),IS_EMPTY:()=>v.current.isEmpty(),UPDATE:K,GET_DATE_URL:z})));const B=e=>{e&&D((()=>{const e=x.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},U=e=>t.createElement("div",{className:Pe("ant-dropdown-menu","content")},"text"!==e?t.createElement("div",{className:"lineWidth"},E.map((e=>t.createElement("span",{key:e,className:Pe("dot",`s${e}`,{active:e===O}),onClick:()=>k(e)})))):t.createElement("div",{className:"fontSize"},t.createElement(F,{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:Pe("dot",{active:e===L}),style:{backgroundColor:e},onClick:()=>A(e)},t.createElement(Me,{className:"icon"})))))),G=Kn("signature"),Y={[G]:!0,"is-annotation":T},X=i?Object.assign(Object.assign({},p),{width:i}):p;return t.createElement("div",{className:Pe(Y,u),style:X},T&&t.createElement(t.Fragment,null,t.createElement("div",{ref:b,className:"content"},e.children),j&&t.createElement(Mi,{spinning:!0,className:"spinning"})),t.createElement("div",{className:Pe("signature",{show:C})},t.createElement("canvas",{ref:y,className:I}),T&&t.createElement("div",{ref:x,className:"signature__tool-bar"},t.createElement("div",{className:"wrapper"},t.createElement("div",{className:Pe("actions",{hidden:M})},t.createElement($,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("square")},t.createElement(St,null))),t.createElement($,{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($,{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($,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:H,trigger:["click"],onOpenChange:B},t.createElement("button",{className:"btn",onClick:()=>R("line")},t.createElement($e,null))),t.createElement($,{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:()=>En(void 0,void 0,void 0,(function*(){yield En(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):h().format(Id);Qi(bh.dataURLToBlob(e),`${t}.png`)}V(!1)})),W()}))},t.createElement(je,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(vt,null)),t.createElement("span",{className:"divider"}),t.createElement("button",{className:"btn",onClick:()=>null==f?void 0:f()},t.createElement(Ge,null)),t.createElement("button",{className:"btn",onClick:()=>En(void 0,void 0,void 0,(function*(){V(!0),yield kn(10);const e=yield z();V(!1),W(),null==m||m(e)}))},t.createElement(Me,null))),t.createElement("button",{className:"btn btn-fold",title:g(M?"qm.divider.spread":"qm.divider.collect"),onClick:()=>q(!M)},M?t.createElement(Ct,null):t.createElement(wt,null))))))}));Nh.displayName="QmSignature";const Th="1.10.10";export{un as Calendar,pn as DatePicker,aa as DcpAnchor,qn as DcpButton,bi as DcpCollapse,yn as DcpConfigProvider,Bu as DcpCopyToClipboard,Di as DcpCountup,od as DcpCropper,zn as DcpDivider,ta as DcpDownload,sa as DcpDrawer,$i as DcpEmpty,Kc as DcpForm,sh as DcpGuideTracker,gh as DcpLazyLoad,ua as DcpModal,Vp as DcpPrint,pp as DcpRangeTableHelper,Xi as DcpScrollbar,ip as DcpSearchHelper,yd as DcpSearchTree,Nh as DcpSignature,Vn as DcpSpace,Mi as DcpSpin,Fi as DcpSplit,rp as DcpTable,oa as DcpTabs,ld as DcpTinymce,Tp as DcpTour,Ap as DcpTransition,cp as DcpTreeHelper,sp as DcpTreeTableHelper,ea as DcpUploadFile,cd as DcpUploadImg,ch as DcpWatermark,aa as QmAnchor,qn as QmButton,bi as QmCollapse,yn as QmConfigProvider,Bu as QmCopyToClipboard,Di as QmCountup,od as QmCropper,zn as QmDivider,ta as QmDownload,sa as QmDrawer,$i as QmEmpty,Kc as QmForm,sh as QmGuideTracker,gh as QmLazyLoad,ua as QmModal,Vp as QmPrint,pp as QmRangeTableHelper,Xi as QmScrollbar,ip as QmSearchHelper,yd as QmSearchTree,Nh as QmSignature,Vn as QmSpace,Mi as QmSpin,Fi as QmSplit,rp as QmTable,oa as QmTabs,ld as QmTinymce,Tp as QmTour,Ap as QmTransition,cp as QmTreeHelper,sp as QmTreeTableHelper,ea as QmUploadFile,cd as QmUploadImg,ch as QmWatermark,mn as TimePicker,jl as pinyin,Th as version};