@flatbiz/pro-layout 4.1.8 → 4.1.9
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/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/package.json +1 -1
package/esm/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
require('./index.css');
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/pro-layout */
|
|
4
4
|
import{extend as e}from"@dimjs/utils/cjs/extend";import{isArray as r}from"@dimjs/lang/cjs/is-array";import"@dimjs/utils/cjs/date";import{isNumber as t}from"@dimjs/lang/cjs/is-number";import"@dimjs/utils/cjs/price";import{isString as n}from"@dimjs/lang/cjs/is-string";import{cache as i}from"@dimjs/utils/cjs/cache";import{uri as a}from"@dimjs/utils/cjs/uri";import o from"@ant-design/icons/es/icons/MoreOutlined";import{isUndefined as u}from"@dimjs/lang/cjs/is-undefined";import{classNames as s}from"@dimjs/utils/cjs/class-names";import{isPlainObject as l}from"@dimjs/lang/cjs/is-plain-object";import{isPromise as c}from"@dimjs/lang/cjs/is-promise";import{hooks as f}from"@wove/react/cjs/hooks";import{Cascader as d,Button as v,Input as h,Form as m,Spin as p,Tree as g,Popconfirm as y,Dropdown as b,Empty as w,message as C,ConfigProvider as S,theme as k,Modal as M,Result as T,App as x,Breadcrumb as D,Space as O,Menu as $,Layout as _,Tabs as L,Typography as I,FloatButton as N}from"antd";import{forwardRef as Y,useState as A,useImperativeHandle as R,createContext as q,useMemo as P,useRef as j,Fragment as B,isValidElement as H,useEffect as z,createElement as E,useContext as W,Suspense as F,Component as K,Children as U,cloneElement as V}from"react";import{jsx as J,jsxs as Q}from"react/jsx-runtime";import G from"antd/es/locale/en_US";import Z from"antd/es/locale/zh_CN";import X from"@ant-design/icons/es/icons/RedoOutlined";import{cloneState as ee}from"@dimjs/model";import{Model as re}from"@dimjs/model-react";import{createCtx as te}from"@wove/react/cjs/create-ctx";import{createRoot as ne}from"react-dom/client";import"@ant-design/icons/es/icons/SaveOutlined";import ie from"@ant-design/icons/es/icons/CloseOutlined";import"@ant-design/icons/es/icons/CheckOutlined";import"@ant-design/icons/es/icons/EditOutlined";import"@ant-design/icons/es/icons/PlusOutlined";import{json as ae}from"@dimjs/utils/cjs/json";import{isObject as oe}from"@dimjs/lang/cjs/is-object";import"@dimjs/lang/cjs/is-boolean";import"react-dom";import"@ant-design/icons/es/icons/DeleteOutlined";import"@wove/react/cjs/editor";import"@dimjs/utils/cjs/get";import"@dimjs/lang/cjs/is-empty";import"@ant-design/icons/es/icons/QuestionCircleOutlined";import ue from"@ant-design/icons/es/icons/CaretDownFilled";import{useParams as se,useLocation as le,useSearchParams as ce,matchPath as fe,Link as de,useNavigate as ve,Routes as he,Route as me,Navigate as pe,BrowserRouter as ge}from"react-router-dom";import{pick as ye}from"@dimjs/utils/cjs/pick";import{tree as be}from"@dimjs/utils/cjs/tree";import{env as we}from"@dimjs/utils/cjs/env";import Ce from"@ant-design/icons/es/icons/MenuFoldOutlined";import Se from"@ant-design/icons/es/icons/MenuUnfoldOutlined";import ke from"@ant-design/icons/es/icons/UserOutlined";import Me from"@ant-design/icons/es/icons/LogoutOutlined";import{useNavigate as Te}from"react-router";import xe from"@ant-design/icons/es/icons/CaretDownOutlined";import{exception as De}from"@wove/react/cjs/exception";import{isFragment as Oe}from"react-is";function $e(){$e=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t){if(Object.prototype.hasOwnProperty.call(t,n)){e[n]=t[n]}}}return e};return $e.apply(this,arguments)}function _e(e,r){e.prototype=Object.create(r.prototype);e.prototype.constructor=e;Le(e,r)}function Le(e,r){Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function e(r,t){r.__proto__=t;return r};return Le(e,r)}function Ie(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var i,a;for(a=0;a<n.length;a++){i=n[a];if(r.indexOf(i)>=0)continue;t[i]=e[i]}return t}
|
|
5
|
-
/*! @flatjs/forge MIT @flatbiz/utils */const Ne=e=>e===undefined||e===null;const Ye=(e,r,t)=>{const n=e||[];if(!t){return n.find((e=>e===r))}return n.find((e=>e[t]===r))};const Ae=(e,r,t)=>{const n=e||[];if(!t){return n.find((e=>e==r))}return n.find((e=>e[t]==r))};const Re=(e,r,t)=>{const n=e||[];if(!t){return n.findIndex((e=>e===r))}return n.findIndex((e=>e[t]===r))};if(!Array.prototype.at){Object.defineProperty(Array.prototype,"at",{enumerable:false,configurable:false,writable:false,value:function e(r){r=Math.trunc(r)||0;if(r<0)r+=this.length;if(r<0||r>=this.length)return undefined;return this[r]}})}if(!Object.is){Object.is=function(e,r){if(e===r){return e!==0||1/e===1/r}else{return e!==e&&r!==r}}}const qe=i(`uuid-${Date.now()}-`,100);const Pe=()=>qe();const je=(e,t)=>{const n=!Ne(e)?String(e):null;if(r(t)){const e=t.map((e=>!Ne(e)?String(e):null));return e.findIndex((e=>n===e))>=0}else{const e=!Ne(t)?String(t):null;return n===e}};const Be="flatbiz";const He={set:(e,r)=>{sessionStorage.setItem(`${Be}_${e}`,JSON.stringify(r))},get:e=>{try{const r=sessionStorage.getItem(`${Be}_${e}`);if(r){return JSON.parse(r)}}catch(e){}return{}},remove:e=>{sessionStorage.removeItem(`${Be}_${e}`)}};const ze=()=>{const e=a.getQueryString("env");return e==="me"};const Ee=()=>/windows|win32|win64/i.test(navigator.userAgent);const We=()=>window["GLOBAL"]||{};const Fe=e=>window[e];const Ke=(e,r,t=false,n)=>{const i={value:"value",parentValue:"parentValue",...n};const a=[];function o(e){const t=r.find((r=>r[i.value]===e));if(t){a.push(t);const e=t[i.parentValue];if(!Ne(e)){o(e)}}}o(e);if(!t){if(a.length>1){return a.splice(1,a.length-1)}return[]}return a.reverse()};const Ue=(e,r)=>{const t=[];function n(e){t.push(e);if(e[r]){e[r].map((e=>{n(e)}))}}e.forEach((e=>{n(e)}));return t};const Ve=(r,t)=>{const n=e({},{label:"label",value:"value",children:"children"},t);const i=n.label;const a=n.value;const o=n.children;const u=[];function s(e,r){u.push({label:e[i],value:e[a],parentValue:r});if(e[o]){e[o].map((r=>{s(r,e[a])}))}}r.forEach((e=>{s(e,undefined)}));return u};const Je=()=>navigator.userAgent.toLowerCase();const Qe=()=>new RegExp("fabric@","i").test(Je());const Ge=(e,t={})=>{const n={...t,ntv_indicator:"1"};const i=a.getQueryString("env");if(i&&i!=="prod"){n.env=i}const o=a.getQueryString("media");if(o){n.media=o}if(window["ntv_indicator"]===false||!Qe()){n.ntv_indicator=undefined}const u=Fe("bizProcessUrlParam");if(r(u)&&u.length>0){u.forEach((e=>{const r=a.getQueryString(e);if(r){n[e]=r}}))}const s=a.getQueryString("fabric-callback-key")||"";if(s){n["fabric-callback-key"]=s}const l=a.getQueryString("accessToken")||"";if(l&&ze()){n.accessToken=l}const c={};Object.keys(n).filter((e=>{if(n[e]!==undefined&&n[e]!==null){c[e]=n[e]}}));return a.modifyQueryString(e,c)};const Ze=(e,r)=>(e||"").replace(/\/$/,"")+"/"+(r||"").replace(/^\//,"");const Xe=(e,...r)=>{let t=e;r.forEach((e=>{t=Ze(t,e)}));return t};const er=e=>!e?false:e.startsWith("//")||new RegExp("(https|http)?://").test(e);const rr=(e,r)=>{if(!n(e)||Ne(e))return"";if(r==="before"||r==="before-after"){if(e.startsWith("/")){e=e.substring(1)}}if(r==="after"||r==="before-after"){if(e.endsWith("/")){e=e.substring(0,e.length-1)}}return e};const tr=(e,r={})=>a.modifyQueryString(e,Object.assign(a.paramStrToJson(window.location.href),r));var nr=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var ar={};var or={get exports(){return ar},set exports(e){ar=e}};var ur;function sr(){if(ur)return ar;ur=1;(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e=1e3,r=6e4,t=36e5,n="millisecond",i="second",a="minute",o="hour",u="day",s="week",l="month",c="quarter",f="year",d="date",v="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}},g=function(e,r,t){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(t)+e},y={s:g,z:function(e){var r=-e.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),i=t%60;return(r<=0?"+":"-")+g(n,2,"0")+":"+g(i,2,"0")},m:function e(r,t){if(r.date()<t.date())return-e(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),i=r.clone().add(n,l),a=t-i<0,o=r.clone().add(n+(a?-1:1),l);return+(-(n+(t-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:f,w:s,d:u,D:d,h:o,m:a,s:i,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=p;var C=function(e){return e instanceof T},S=function e(r,t,n){var i;if(!r)return b;if("string"==typeof r){var a=r.toLowerCase();w[a]&&(i=a),t&&(w[a]=t,i=a);var o=r.split("-");if(!i&&o.length>1)return e(o[0])}else{var u=r.name;w[u]=r,i=u}return!n&&i&&(b=i),i||!n&&b},k=function(e,r){if(C(e))return e.clone();var t="object"==typeof r?r:{};return t.date=e,t.args=arguments,new T(t)},M=y;M.l=S,M.i=C,M.w=function(e,r){return k(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var T=function(){function p(e){this.$L=S(e.locale,null,!0),this.parse(e)}var g=p.prototype;return g.parse=function(e){this.$d=function(e){var r=e.date,t=e.utc;if(null===r)return new Date(NaN);if(M.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(h);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return t?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(r)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return M},g.isValid=function(){return!(this.$d.toString()===v)},g.isSame=function(e,r){var t=k(e);return this.startOf(r)<=t&&t<=this.endOf(r)},g.isAfter=function(e,r){return k(e)<this.startOf(r)},g.isBefore=function(e,r){return this.endOf(r)<k(e)},g.$g=function(e,r,t){return M.u(e)?this[r]:this.set(t,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,r){var t=this,n=!!M.u(r)||r,c=M.p(e),v=function(e,r){var i=M.w(t.$u?Date.UTC(t.$y,r,e):new Date(t.$y,r,e),t);return n?i:i.endOf(u)},h=function(e,r){return M.w(t.toDate()[e].apply(t.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(r)),t)},m=this.$W,p=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case f:return n?v(1,0):v(31,11);case l:return n?v(1,p):v(0,p+1);case s:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return v(n?g-w:g+(6-w),p);case u:case d:return h(y+"Hours",0);case o:return h(y+"Minutes",1);case a:return h(y+"Seconds",2);case i:return h(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,r){var t,s=M.p(e),c="set"+(this.$u?"UTC":""),v=(t={},t[u]=c+"Date",t[d]=c+"Date",t[l]=c+"Month",t[f]=c+"FullYear",t[o]=c+"Hours",t[a]=c+"Minutes",t[i]=c+"Seconds",t[n]=c+"Milliseconds",t)[s],h=s===u?this.$D+(r-this.$W):r;if(s===l||s===f){var m=this.clone().set(d,1);m.$d[v](h),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else v&&this.$d[v](h);return this.init(),this},g.set=function(e,r){return this.clone().$set(e,r)},g.get=function(e){return this[M.p(e)]()},g.add=function(n,c){var d,v=this;n=Number(n);var h=M.p(c),m=function(e){var r=k(v);return M.w(r.date(r.date()+Math.round(e*n)),v)};if(h===l)return this.set(l,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===u)return m(1);if(h===s)return m(7);var p=(d={},d[a]=r,d[o]=t,d[i]=e,d)[h]||1,g=this.$d.getTime()+n*p;return M.w(g,this)},g.subtract=function(e,r){return this.add(-1*e,r)},g.format=function(e){var r=this,t=this.$locale();if(!this.isValid())return t.invalidDate||v;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=M.z(this),a=this.$H,o=this.$m,u=this.$M,s=t.weekdays,l=t.months,c=function(e,t,i,a){return e&&(e[t]||e(r,n))||i[t].slice(0,a)},f=function(e){return M.s(a%12||12,e,"0")},d=t.meridiem||function(e,r,t){var n=e<12?"AM":"PM";return t?n.toLowerCase():n},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:M.s(u+1,2,"0"),MMM:c(t.monthsShort,u,l,3),MMMM:c(l,u),D:this.$D,DD:M.s(this.$D,2,"0"),d:String(this.$W),dd:c(t.weekdaysMin,this.$W,s,2),ddd:c(t.weekdaysShort,this.$W,s,3),dddd:s[this.$W],H:String(a),HH:M.s(a,2,"0"),h:f(1),hh:f(2),a:d(a,o,!0),A:d(a,o,!1),m:String(o),mm:M.s(o,2,"0"),s:String(this.$s),ss:M.s(this.$s,2,"0"),SSS:M.s(this.$ms,3,"0"),Z:i};return n.replace(m,(function(e,r){return r||h[e]||i.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,v){var h,m=M.p(d),p=k(n),g=(p.utcOffset()-this.utcOffset())*r,y=this-p,b=M.m(this,p);return b=(h={},h[f]=b/12,h[l]=b,h[c]=b/3,h[s]=(y-g)/6048e5,h[u]=(y-g)/864e5,h[o]=y/t,h[a]=y/r,h[i]=y/e,h)[m]||y,v?b:M.a(b)},g.daysInMonth=function(){return this.endOf(l).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,r){if(!e)return this.$L;var t=this.clone(),n=S(e,r,!0);return n&&(t.$L=n),t},g.clone=function(){return M.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},p}(),x=T.prototype;return k.prototype=x,[["$ms",n],["$s",i],["$m",a],["$H",o],["$W",u],["$M",l],["$y",f],["$D",d]].forEach((function(e){x[e[1]]=function(r){return this.$g(r,e[0],e[1])}})),k.extend=function(e,r){return e.$i||(e(r,T,k),e.$i=!0),k},k.locale=S,k.isDayjs=C,k.unix=function(e){return k(1e3*e)},k.en=w[b],k.Ls=w,k.p={},k}))})(or);return ar}var lr=sr();var cr=ir(lr);var fr={};var dr={get exports(){return fr},set exports(e){fr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}}}))})(dr);var vr={};var hr={get exports(){return vr},set exports(e){vr=e}};(function(e,r){!function(r,t){e.exports=t(sr())}(nr,(function(e){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(e),n={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,r){return"W"===r?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,r){var t=100*e+r;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(n,null,!0),n}))})(hr);var mr={};var pr={get exports(){return mr},set exports(e){mr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){var t=r.prototype,n=t.format;t.format=function(e){var r=this,t=this.$locale();if(!this.isValid())return n.bind(this)(e);var i=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((r.$M+1)/3);case"Do":return t.ordinal(r.$D);case"gggg":return r.weekYear();case"GGGG":return r.isoWeekYear();case"wo":return t.ordinal(r.week(),"W");case"w":case"ww":return i.s(r.week(),"w"===e?1:2,"0");case"W":case"WW":return i.s(r.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return i.s(String(0===r.$H?24:r.$H),"k"===e?1:2,"0");case"X":return Math.floor(r.$d.getTime()/1e3);case"x":return r.$d.getTime();case"z":return"["+r.offsetName()+"]";case"zzz":return"["+r.offsetName("long")+"]";default:return e}}));return n.bind(this)(a)}}}))})(pr);var gr=mr;var yr={};var br={get exports(){return yr},set exports(e){yr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,t=/\d\d/,n=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},o=function(e){return(e=+e)+(e>68?1900:2e3)};var u=function(e){return function(r){this[e]=+r}},s=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var r=e.match(/([+-]|\d\d)/g),t=60*r[1]+(+r[2]||0);return 0===t?0:"+"===r[0]?-t:t}(e)}],l=function(e){var r=a[e];return r&&(r.indexOf?r:r.s.concat(r.f))},c=function(e,r){var t,n=a.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,r))>-1){t=i>12;break}}else t=e===(r?"pm":"PM");return t},f={A:[i,function(e){this.afternoon=c(e,!1)}],a:[i,function(e){this.afternoon=c(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[t,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,u("seconds")],ss:[n,u("seconds")],m:[n,u("minutes")],mm:[n,u("minutes")],H:[n,u("hours")],h:[n,u("hours")],HH:[n,u("hours")],hh:[n,u("hours")],D:[n,u("day")],DD:[t,u("day")],Do:[i,function(e){var r=a.ordinal,t=e.match(/\d+/);if(this.day=t[0],r)for(var n=1;n<=31;n+=1)r(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,u("month")],MM:[t,u("month")],MMM:[i,function(e){var r=l("months"),t=(l("monthsShort")||r.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],MMMM:[i,function(e){var r=l("months").indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],Y:[/[+-]?\d+/,u("year")],YY:[t,function(e){this.year=o(e)}],YYYY:[/\d{4}/,u("year")],Z:s,ZZ:s};function d(t){var n,i;n=t,i=a&&a.formats;for(var o=(t=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(r,t,n){var a=n&&n.toUpperCase();return t||i[n]||e[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,r,t){return r||t.slice(1)}))}))).match(r),u=o.length,s=0;s<u;s+=1){var l=o[s],c=f[l],d=c&&c[0],v=c&&c[1];o[s]=v?{regex:d,parser:v}:l.replace(/^\[|\]$/g,"")}return function(e){for(var r={},t=0,n=0;t<u;t+=1){var i=o[t];if("string"==typeof i)n+=i.length;else{var a=i.regex,s=i.parser,l=e.slice(n),c=a.exec(l)[0];s.call(r,c),e=e.replace(c,"")}}return function(e){var r=e.afternoon;if(void 0!==r){var t=e.hours;r?t<12&&(e.hours+=12):12===t&&(e.hours=0),delete e.afternoon}}(r),r}}return function(e,r,t){t.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(o=e.parseTwoDigitYear);var n=r.prototype,i=n.parse;n.parse=function(e){var r=e.date,n=e.utc,o=e.args;this.$u=n;var u=o[1];if("string"==typeof u){var s=!0===o[2],l=!0===o[3],c=s||l,f=o[2];l&&(f=o[2]),a=this.$locale(),!s&&f&&(a=t.Ls[f]),this.$d=function(e,r,t){try{if(["x","X"].indexOf(r)>-1)return new Date(("X"===r?1e3:1)*e);var n=d(r)(e),i=n.year,a=n.month,o=n.day,u=n.hours,s=n.minutes,l=n.seconds,c=n.milliseconds,f=n.zone,v=new Date,h=o||(i||a?1:v.getDate()),m=i||v.getFullYear(),p=0;i&&!a||(p=a>0?a-1:v.getMonth());var g=u||0,y=s||0,b=l||0,w=c||0;return f?new Date(Date.UTC(m,p,h,g,y,b,w+60*f.offset*1e3)):t?new Date(Date.UTC(m,p,h,g,y,b,w)):new Date(m,p,h,g,y,b,w)}catch(e){return new Date("")}}(r,u,n),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),c&&r!=this.format(u)&&(this.$d=new Date("")),a={}}else if(u instanceof Array)for(var v=u.length,h=1;h<=v;h+=1){o[1]=u[h-1];var m=t.apply(this,o);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}h===v&&(this.$d=new Date(""))}else i.call(this,e)}}}))})(br);var wr=yr;var Cr={};var Sr={get exports(){return Cr},set exports(e){Cr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r,t){var n=r.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,r,t,n,a){var o=e.name?e:e.$locale(),u=i(o[r]),s=i(o[t]),l=u||s.map((function(e){return e.slice(0,n)}));if(!a)return l;var c=o.weekStart;return l.map((function(e,r){return l[(r+(c||0))%7]}))},o=function(){return t.Ls[t.locale()]},u=function(e,r){return e.formats[r]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,r,t){return r||t.slice(1)}))}(e.formats[r.toUpperCase()])},s=function(){var e=this;return{months:function(r){return r?r.format("MMMM"):a(e,"months")},monthsShort:function(r){return r?r.format("MMM"):a(e,"monthsShort","months",3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(r){return r?r.format("dddd"):a(e,"weekdays")},weekdaysMin:function(r){return r?r.format("dd"):a(e,"weekdaysMin","weekdays",2)},weekdaysShort:function(r){return r?r.format("ddd"):a(e,"weekdaysShort","weekdays",3)},longDateFormat:function(r){return u(e.$locale(),r)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};n.localeData=function(){return s.bind(this)()},t.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(r){return u(e,r)},meridiem:e.meridiem,ordinal:e.ordinal}},t.months=function(){return a(o(),"months")},t.monthsShort=function(){return a(o(),"monthsShort","months",3)},t.weekdays=function(e){return a(o(),"weekdays",null,null,e)},t.weekdaysShort=function(e){return a(o(),"weekdaysShort","weekdays",3,e)},t.weekdaysMin=function(e){return a(o(),"weekdaysMin","weekdays",2,e)}}}))})(Sr);var kr=Cr;var Mr={};var Tr={get exports(){return Mr},set exports(e){Mr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e="minute",r=/[+-]\d\d(?::?\d\d)?/g,t=/([+-]|\d\d)/g;return function(n,i,a){var o=i.prototype;a.utc=function(e){var r={date:e,utc:!0,args:arguments};return new i(r)},o.utc=function(r){var t=a(this.toDate(),{locale:this.$L,utc:!0});return r?t.add(this.utcOffset(),e):t},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),u.call(this,e)};var s=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var l=o.utcOffset;o.utcOffset=function(n,i){var a=this.$utils().u;if(a(n))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(r);if(!n)return null;var i=(""+n[0]).match(t)||["-",0,0],a=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===a?o:-o}(n),null===n))return this;var o=Math.abs(n)<=16?60*n:n,u=this;if(i)return u.$offset=o,u.$u=0===n,u;if(0!==n){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(o+s,e)).$offset=o,u.$x.$localOffset=s}else u=this.utc();return u};var c=o.format;o.format=function(e){var r=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,r)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var f=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=o.diff;o.diff=function(e,r,t){if(e&&this.$u===e.$u)return d.call(this,e,r,t);var n=this.local(),i=a(e).local();return d.call(n,i,r,t)}}}))})(Tr);var xr=Mr;var Dr={};var Or={get exports(){return Dr},set exports(e){Dr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.weekday=function(e){var r=this.$locale().weekStart||0,t=this.$W,n=(t<r?t+7:t)-r;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")}}}))})(Or);var $r=Dr;var _r={};var Lr={get exports(){return _r},set exports(e){_r=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e="week",r="year";return function(t,n,i){var a=n.prototype;a.week=function(t){if(void 0===t&&(t=null),null!==t)return this.add(7*(t-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var a=i(this).startOf(r).add(1,r).date(n),o=i(this).endOf(e);if(a.isBefore(o))return 1}var u=i(this).startOf(r).date(n).startOf(e).subtract(1,"millisecond"),s=this.diff(u,e,!0);return s<0?i(this).startOf("week").week():Math.ceil(s)},a.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}))})(Lr);var Ir=_r;var Nr={};var Yr={get exports(){return Nr},set exports(e){Nr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.weekYear=function(){var e=this.month(),r=this.week(),t=this.year();return 1===r&&11===e?t+1:0===e&&r>=52?t-1:t}}}))})(Yr);var Ar=Nr;var Rr={};var qr={get exports(){return Rr},set exports(e){Rr=e}};(function(e,r){(function(t,n){var i={};if(t.PubSub){i=t.PubSub;console.warn("PubSub already loaded, using existing version")}else{t.PubSub=i;n(i)}{if(e!==undefined&&e.exports){r=e.exports=i}r.PubSub=i;e.exports=r=i}})(typeof window==="object"&&window||nr,(function(e){var r={},t=-1,n="*";function i(e){var r;for(r in e){if(Object.prototype.hasOwnProperty.call(e,r)){return true}}return false}function a(e){return function r(){throw e}}function o(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function u(e,r,t){e(r,t)}function s(e,t,n,i){var a=r[t],s=i?u:o,l;if(!Object.prototype.hasOwnProperty.call(r,t)){return}for(l in a){if(Object.prototype.hasOwnProperty.call(a,l)){s(a[l],e,n)}}}function l(e,r,t){return function i(){var a=String(e),o=a.lastIndexOf(".");s(e,e,r,t);while(o!==-1){a=a.substr(0,o);o=a.lastIndexOf(".");s(e,a,r,t)}s(e,n,r,t)}}function c(e){var t=String(e),n=Boolean(Object.prototype.hasOwnProperty.call(r,t)&&i(r[t]));return n}function f(e){var r=String(e),t=c(r)||c(n),i=r.lastIndexOf(".");while(!t&&i!==-1){r=r.substr(0,i);i=r.lastIndexOf(".");t=c(r)}return t}function d(e,r,t,n){e=typeof e==="symbol"?e.toString():e;var i=l(e,r,n),a=f(e);if(!a){return false}if(t===true){i()}else{setTimeout(i,0)}return true}e.publish=function(r,t){return d(r,t,false,e.immediateExceptions)};e.publishSync=function(r,t){return d(r,t,true,e.immediateExceptions)};e.subscribe=function(e,n){if(typeof n!=="function"){return false}e=typeof e==="symbol"?e.toString():e;if(!Object.prototype.hasOwnProperty.call(r,e)){r[e]={}}var i="uid_"+String(++t);r[e][i]=n;return i};e.subscribeAll=function(r){return e.subscribe(n,r)};e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n);t.apply(this,arguments)}));return e};e.clearAllSubscriptions=function e(){r={}};e.clearSubscriptions=function e(t){var n;for(n in r){if(Object.prototype.hasOwnProperty.call(r,n)&&n.indexOf(t)===0){delete r[n]}}};e.countSubscriptions=function e(t){var n;var i;var a=0;for(n in r){if(Object.prototype.hasOwnProperty.call(r,n)&&n.indexOf(t)===0){for(i in r[n]){a++}break}}return a};e.getSubscriptions=function e(t){var n;var i=[];for(n in r){if(Object.prototype.hasOwnProperty.call(r,n)&&n.indexOf(t)===0){i.push(n)}}return i};e.unsubscribe=function(t){var n=function(e){var t;for(t in r){if(Object.prototype.hasOwnProperty.call(r,t)&&t.indexOf(e)===0){return true}}return false},i=typeof t==="string"&&(Object.prototype.hasOwnProperty.call(r,t)||n(t)),a=!i&&typeof t==="string",o=typeof t==="function",u=false,s,l,c;if(i){e.clearSubscriptions(t);return}for(s in r){if(Object.prototype.hasOwnProperty.call(r,s)){l=r[s];if(a&&l[t]){delete l[t];u=t;break}if(o){for(c in l){if(Object.prototype.hasOwnProperty.call(l,c)&&l[c]===t){delete l[c];u=true}}}}}return u}}))})(qr,Rr);var Pr={};var jr={get exports(){return Pr},set exports(e){Pr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.isSameOrAfter=function(e,r){return this.isSame(e,r)||this.isAfter(e,r)}}}))})(jr);var Br=Pr;var Hr={};var zr={get exports(){return Hr},set exports(e){Hr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.isSameOrBefore=function(e,r){return this.isSame(e,r)||this.isBefore(e,r)}}}))})(zr);var Er=Hr;var Wr=Object.prototype.hasOwnProperty;function Fr(e,r,t){for(t of e.keys()){if(Kr(t,r))return t}}function Kr(e,r){var t,n,i;if(e===r)return true;if(e&&r&&(t=e.constructor)===r.constructor){if(t===Date)return e.getTime()===r.getTime();if(t===RegExp)return e.toString()===r.toString();if(t===Array){if((n=e.length)===r.length){while(n--&&Kr(e[n],r[n]));}return n===-1}if(t===Set){if(e.size!==r.size){return false}for(n of e){i=n;if(i&&typeof i==="object"){i=Fr(r,i);if(!i)return false}if(!r.has(i))return false}return true}if(t===Map){if(e.size!==r.size){return false}for(n of e){i=n[0];if(i&&typeof i==="object"){i=Fr(r,i);if(!i)return false}if(!Kr(n[1],r.get(i))){return false}}return true}if(t===ArrayBuffer){e=new Uint8Array(e);r=new Uint8Array(r)}else if(t===DataView){if((n=e.byteLength)===r.byteLength){while(n--&&e.getInt8(n)===r.getInt8(n));}return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===r.byteLength){while(n--&&e[n]===r[n]);}return n===-1}if(!t||typeof e==="object"){n=0;for(t in e){if(Wr.call(e,t)&&++n&&!Wr.call(r,t))return false;if(!(t in r)||!Kr(e[t],r[t]))return false}return Object.keys(r).length===n}}return e!==e&&r!==r}require("./index.css");function Ur(){Ur=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t){if(Object.prototype.hasOwnProperty.call(t,n)){e[n]=t[n]}}}return e};return Ur.apply(this,arguments)}function Vr(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var i,a;for(a=0;a<n.length;a++){i=n[a];if(r.indexOf(i)>=0)continue;t[i]=e[i]}return t}var Jr=function e(){var t=We(),n=t.elemAclLimits;var i=r(n)?n:[];return i};var Qr=function e(r){if(!r)return true;var t=Jr();if(t.includes(r)){return true}return false};var Gr=function e(r){var t=A(false),n=t[0],i=t[1];var a=Ne(r.debounceDuration)?500:r.debounceDuration;var o=f.useDebounceClick((function(e){var t=r.onClick;if(!t){return}var n=t(e);if(n&&c(n)){i(true);n.catch((function(e){console.error(e)})).finally((function(){i(false)}))}}),a);if(!Qr(r.permission)){return null}if(r.hidden){return null}return J(v,Ur({},r,{onClick:o,loading:n,children:r.children}))};var Zr=function e(r,t){return z(r,t)};var Xr=function e(r,t){z((function(){function e(){return new Promise((function(e,t){return Promise.resolve(r()).then((function(r){try{return e()}catch(e){return t(e)}}),t)}))}void e()}),t)};var et=function e(r){var t=A(r),n=t[0],i=t[1];var a=f.useIsMounted();return[n,function(e){if(a.current){return i(e)}}]};var rt=["locale"];cr.extend(wr);cr.extend(gr);cr.extend($r);cr.extend(kr);cr.extend(Ir);cr.extend(Ar);cr.extend(xr);var tt=function e(r){var t=r.locale,n=Vr(r,rt);Zr((function(){cr.locale(r.locale||"zh-cn")}),[]);return J(S,Ur({componentSize:"middle",space:{size:"middle"}},n,{locale:t==="en"?G:Z,children:r.children}))};var nt=["menuList"],it=["text","color","permission","needConfirm","confirmMessage","hidden","type","style","popconfirmProps"];var at=function e(r){var t=r.menuList,n=Vr(r,nt);var i=A([]),a=i[0],o=i[1];var u=A({}),s=u[0],l=u[1];var d=f.useCallbackRef((function(e,r){var t;r.stopPropagation();l((t={},t[e]={open:true},t))}));var h=f.useCallbackRef((function(e,r,t){t.stopPropagation();var n=e.onClick==null?void 0:e.onClick(t);if(n&&c(n)){s[r]={loading:true,open:true};l(Ur({},s));n.finally((function(){s[r]={loading:false,open:false};l(Ur({},s))}));return}s[r]={loading:false,open:false};l(Ur({},s))}));var m=f.useCallbackRef((function(e,r){r.stopPropagation();return e.onClick==null?void 0:e.onClick(r)}));Zr((function(){var e=[];t.filter(Boolean).forEach((function(r,t){var n,i;if(!r)return;var a=r.text,o=r.color,u=r.permission,c=r.needConfirm,f=r.confirmMessage,p=r.hidden,g=r.type,b=r.style,w=r.popconfirmProps,C=Vr(r,it);if(p)return;if(u&&!Qr(u))return;var S=o?Ur({color:o},b):b;var k=g||"link";var M={key:t,label:E(Gr,Ur({size:"small"},C,{type:k,style:S,key:t,onClick:m.bind(null,r)}),a)};var T={key:t,label:E(y,Ur({okText:"确定",cancelText:"取消",trigger:["click"],destroyTooltipOnHide:true},w,{title:f,onConfirm:h.bind(null,r,t),onCancel:function e(r){r==null?void 0:r.stopPropagation();l({})},overlayClassName:"dmw-popconfirm",arrowPointAtCenter:true,key:t,overlayStyle:{zIndex:10},open:((n=s[t])==null?void 0:n.open)||false,okButtonProps:{loading:(i=s[t])==null?void 0:i.loading}}),J(v,Ur({size:"small",danger:true},C,{onClick:d.bind(null,t),type:k,style:S,children:a})))};if(c&&!C.disabled){e.push(T)}else{e.push(M)}}));o(e)}),[t,s]);return J(b,Ur({trigger:(n==null?void 0:n.trigger)||["hover"],arrow:{pointAtCenter:true}},n,{overlayStyle:Ur({zIndex:9},n.overlayStyle),menu:{items:a},onOpenChange:function e(r){if(!r){l({})}},children:r.children}))};var ot=function r(t){var n=e({"request-success":"暂无数据","request-progress":"数据查询中","request-error":"数据查询异常","request-init":"暂无数据","no-dependencies-params":"未获取到依赖查询条件"},t.messageConfig);var i=P((function(){if(t.status&&je(t.status,["request-success","request-progress","request-error","no-dependencies-params"])){return n[t.status]}return n["request-init"]}),[n,t.status]);return Q(w,{image:w.PRESENTED_IMAGE_SIMPLE,description:i,className:"v-request-status",children:[J(p,{spinning:t.loading||false}),t.status==="request-error"&&t.errorButton]})};var ut={selectorList:[],queryIsEmpty:false,requestStatus:"request-init"};var st={actions:{setSelectBoxList:function e(r){return function(e){e.selectorList=r.selectorList||[];e.requestStatus="request-success"}},changeRequestStatus:function e(r){return function(e){e.requestStatus=r}}},state:ut};var lt={};var ct=function e(r){if(!lt[r]){lt[r]=re(st)}return lt[r]};var ft=["serviceConfig","modelKey","fieldNames","isDynamicLoad","requestMessageConfig","onSelectorListChange"];Y((function(r,t){var n=r.serviceConfig,i=r.modelKey,a=r.fieldNames,o=r.isDynamicLoad,u=r.requestMessageConfig,l=r.onSelectorListChange,c=Vr(r,ft);var h=A([]),m=h[0],p=h[1];var g=n||{};var y=et(false),b=y[0],w=y[1];var S=ct(i).useStore(),k=S[0],M=S[1];var T="request-progress-"+r.modelKey;var x=e(true,{label:"label",value:"value",children:"children"},a);var D=A(),O=D[0],$=D[1];var _=function e(r){var t=g.onRequestResultAdapter?g.onRequestResultAdapter(r):r;return t||[]};var L=f.useCallbackRef((function(){return new Promise((function(e,r){var t,n;if(!g.onRequest){return r(new Error("onRequest 调用接口服务不能为空"))}var i=function(){try{return e()}catch(e){return r(e)}};var a=function(e){try{w(false);window[T]=false;void M.changeRequestStatus("request-error");void C.error(e.message||"获取数据异常");return i()}catch(e){return r(e)}};try{w(true);window[T]=true;void M.changeRequestStatus("request-progress");return Promise.resolve(g.onRequest==null?void 0:g.onRequest(g.params)).then((function(e){try{t=e;n=_(t);if(o){n.map((function(e){e.isLeaf=e.isLeaf||false}))}w(false);window[T]=false;void M.setSelectBoxList({selectorList:n||[]});l==null?void 0:l(n||[]);return i()}catch(e){return a(e)}}),a)}catch(e){a(e)}}))}));Zr((function(){if(window[T])return;if(k.requestStatus==="request-success"){p(ee(k.selectorList))}else{void L()}}),[]);Zr((function(){var e=ee(k.selectorList);if(r.value){var t=Ke(r.value,Ve(e,x),true);if(t.length===0){$([r.value])}else{$(t.map((function(e){return e.value})))}}else{$(undefined)}p(e)}),[k.selectorList,r.value]);R(t,(function(){return{getCascaderList:function e(){return k.selectorList}}}));var I=f.useCallbackRef((function(){void L()}));var N=function e(r){return new Promise((function(e,t){var n,i,a,o;i=r[r.length-1];i.loading=true;return Promise.resolve(g.onRequest==null?void 0:g.onRequest(Ur({},g.params,(n={},n[x.value]=i[x.value],n)))).then((function(r){try{a=r;o=_(a);if(!o||o.length===0){i.isLeaf=true}else{o.map((function(e){e.isLeaf=e.isLeaf||false}));i.children=o}i.loading=false;void M.setSelectBoxList({selectorList:m||[]});l==null?void 0:l(m||[]);p([].concat(m));return e()}catch(e){return t(e)}}),t)}))};var Y=f.useCallbackRef((function(e,t){void(r.onChange==null?void 0:r.onChange(e==null?void 0:e[e.length-1],t))}));var q=f.useCallbackRef((function(){void(r.onChange==null?void 0:r.onChange(undefined))}));return J(d,Ur({showSearch:true,allowClear:true},c,{popupClassName:s("cascader-wrapper-popup",c.popupClassName),notFoundContent:J(ot,{status:k.requestStatus,loading:b,messageConfig:u,errorButton:J(v,{type:"primary",onClick:I,children:"重新获取数据"})}),loading:b,loadData:o?N:undefined,fieldNames:x,suffixIcon:k.requestStatus==="request-error"?J(X,{spin:b,onClick:I}):undefined,options:m,value:O,multiple:false,onChange:Y,onClear:q}))}));var dt=te();dt[0];dt[1];var vt;(function(e){e["YMDHms"]="YYYY-MM-DD HH:mm:ss";e["YMDHm"]="YYYY-MM-DD HH:mm";e["YMDH"]="YYYY-MM-DD HH";e["YMD"]="YYYY-MM-DD"})(vt||(vt={}));var ht;(function(e){e["Hms"]="HH:mm:ss";e["Hm"]="HH:mm";e["H"]="HH";e["ms"]="mm:ss";e["m"]="mm";e["s"]="ss"})(ht||(ht={}));Y((function(e,r){R(r,(function(){return{onChange:function r(t){e.onChange==null?void 0:e.onChange(t)}}}));return J(h,{value:e.value})}));var mt=function e(){var r=document.createElement("div");var t="id_"+Date.now();r.setAttribute("id",t);document.body.append(r);return{divElement:r,elementId:t}};var pt=function e(r){try{document.body.removeChild(document.querySelector(r))}catch(e){}};var gt=function e(r){var t=r.elementId;var n=k.useToken(),i=n.token;var a=i.colorPrimary;var o=A(true),u=o[0],l=o[1];var c=f.useCallbackRef((function(){try{delete window[t]}catch(e){}l(false)}));Zr((function(){window[t]=c}),[c]);var d=f.useCallbackRef((function(){pt("#"+t)}));return J(M,{maskClosable:false,centered:true,destroyOnClose:true,className:s("v-dialog-loading",r.className),open:u,afterClose:d,getContainer:r.divElement,footer:null,closable:false,style:{"--v-loading-color":a},children:J("div",{className:s("v-dialog-loading-content"),children:Q("div",{className:"loader-wrapper",children:[J("div",{className:"loader-inner"}),J("div",{className:"loader-text",children:r.message||"处理中"})]})})})};var yt={open:function e(r){var t=mt(),n=t.divElement,i=t.elementId;window["__dialog_loading_elementId"]=i;var a=ne(n);a.render(J(gt,Ur({},r,{divElement:n,elementId:i})));return{close:function e(){var r,t;(r=(t=window)[i])==null?void 0:r.call(t)}}},close:function e(){try{var r,t;var i=window["__dialog_loading_elementId"];if(n(i))(r=(t=window)[i])==null?void 0:r.call(t)}catch(e){}}};var bt=te();bt[0];var wt=bt[1];var Ct={queryCondition:{},isInit:true};var St={actions:{updateFilterCondition:function e(r){return function(e){e.queryCondition=Ur({},e.queryCondition,r)}},resetFilterCondition:function e(){return function(e){e.queryCondition=Ct.queryCondition}},updateInitStatus:function e(){return function(e){e.isInit=false}}},state:Ct};var kt={};var Mt=function e(r){if(!kt[r]){kt[r]=re(St)}return kt[r]};Y((function(e,t){var n;var i=A([]),a=i[0],o=i[1];var u=A(0),s=u[0],l=u[1];var c=A(false),d=c[0],v=c[1];var h=Mt(e.modelKey).useStore(),p=h[0],g=h[1];var y=e.pageSize||((n=e.initialPaginationParams)==null?void 0:n.pageSize)||10;var b=e.initRequest===undefined?true:e.initRequest;var w=A(false),S=w[0],k=w[1];var M=Ur({list:"list",total:"tatal",pageNo:"pageNo",pageSize:"pageSize"},e.fieldNames);var T=m.useForm(),x=T[0];var D=f.useCallbackRef((function(t){return new Promise((function(n,i){var a,u,s,c,f,d,h,m,p,y;var b=function(){try{return n()}catch(e){return i(e)}};var w=function(e){try{v(false);void C.error(e.message);return b()}catch(e){return i(e)}};try{v(true);return Promise.resolve(g.updateFilterCondition(t)).then((function(t){try{a=t;u=ee(a.queryCondition||{});s=e.serviceConfig,c=s.requestParamsAdapter,f=s.onRequest,d=s.requestResultAdapter;h=c?c(u):u;return Promise.resolve(f(h)).then((function(t){try{m=t||{};e.onDataSourceChange==null?void 0:e.onDataSourceChange(m);p=d?d(m):m;y=p[M.list];o(r(y)?y:[]);l(p[M.total]);v(false);return b()}catch(e){return w(e)}}),w)}catch(e){return w(e)}}),w)}catch(e){w(e)}}))}));var O=f.useCallbackRef((function(e){return new Promise((function(r,t){return Promise.resolve(g.resetFilterCondition()).then((function(n){try{x.resetFields();if(e){void g.updateFilterCondition(e);x.setFieldsValue(e)}return r()}catch(e){return t(e)}}),t)}))}));var $=f.useCallbackRef((function(r){return new Promise((function(t,n){var i;return Promise.resolve(g.resetFilterCondition()).then((function(a){try{x.resetFields();if(S){void D(Ur((i={},i[M.pageNo]=1,i[M.pageSize]=y,i),e.initialValues,r))}else{void D(Ur({},e.initialValues,r))}return t()}catch(e){return n(e)}}),n)}))}));var _=function e(){return Ur({},p.queryCondition,x.getFieldsValue())};R(t,(function(){return{onRequest:D,clearQueryCondition:O,getRequestParams:_,onResetRequest:$,form:x}}));var L=function e(r){k(r)};return J(wt,{value:{modelKey:e.modelKey,onRequest:D,tableList:a,tableTotal:s,loading:d,fieldNames:M,pageSize:y,initRequest:b,initialValues:e.initialValues||{},onSetPaginationStatus:L,paginationStatus:S},children:J(m,{form:x,initialValues:Ur({},e.initialValues,p.queryCondition),children:e.children})})}));q({editable:false,showEditableIcon:false,isCtx:false});var Tt=["value"];var xt=function e(r){var t=r.value,n=Vr(r,Tt);var i=j();var a=j(true);var o=A(0),u=o[0],s=o[1];Zr((function(){if(Ne(t)&&a.current)return;a.current=false;if(t===i.current&&!Ne(t))return;s(Date.now())}),[t]);var l=f.useCallbackRef((function(e){if(e.nativeEvent["inputType"]==="insertCompositionText"){return}i.current=e.target.value;r.onChange==null?void 0:r.onChange(e)}));var c=f.useCallbackRef((function(e){l(e)}));return E(h.Search,Ur({},n,{key:u,onCompositionEnd:c,onChange:l,defaultValue:t}))};cr.extend(Er);cr.extend(Br);Y((function(e,r){R(r,(function(){return{onChange:function r(t){e.onChange==null?void 0:e.onChange(t)}}}));return J(h,{value:e.value})}));var Dt={treeList:[],treeTiledArray:[],queryIsEmpty:false};var Ot={actions:{setTreeList:function e(r){return function(e){e.treeList=r.treeList||[];e.treeTiledArray=Ue(e.treeList,r.childrenName);e.requestStatus="request-success"}},resetTreeList:function e(){return function(e){e.treeList=[]}},changeRequestStatus:function e(r){return function(e){e.requestStatus=r;if(r==="request-error"){e.treeList=[]}}},treeListAppendChildren:function e(t){return function(e){var n=Ue(e.treeList,t.childrenName);var i=n.find((function(e){return e[t.valueName]===t.value}));if(i){if(r(t.appendList)&&t.appendList.length>0){i[t.childrenName]=t.appendList}else{i.isLeaf=true}}e.treeTiledArray=Ue(e.treeList,t.childrenName)}}},state:Dt};var $t={};var _t=function e(r){if(!$t[r]){$t[r]=re(Ot)}return $t[r]};var Lt=function e(r,t,n){var i=Ve(t,n);return Ke(r,i,true,{value:"value",parentValue:"parentValue"})};var It=function e(t,n){var i=Ne(t)?[]:t;i=r(i)?i:[i];i=i.map((function(e){if(oe(e))return e[n.value];return e}));return i};var Nt=function e(r,t){var n=It(r,t);var i={};n.forEach((function(e){i[e]=true}));return i};var Yt=function e(r,t,n){if(Ne(r)&&Ne(t))return true;var i=Nt(r,n);var a=Nt(t,n);var o=Kr(i,a);return o};var At=["serviceConfig","effectDependencyList","selectorTreeList","value","onChange","modelKey","checkableResponseParentNode","checkable","onSelectorTreeListChange","treeItemDataAdapter","searchValue","showSearch","searchPlaceholder","requestMessageConfig","labelInValueFieldNames","labelInValue","disabledCanUse"];var Rt=Y((function(t,n){var i=t.serviceConfig,a=t.effectDependencyList,u=t.selectorTreeList,l=t.value,c=t.onChange,d=t.modelKey,h=t.checkableResponseParentNode,m=h===void 0?true:h,y=t.checkable,b=t.onSelectorTreeListChange,w=t.treeItemDataAdapter,S=t.searchValue,k=t.showSearch,M=t.searchPlaceholder,T=t.requestMessageConfig,x=t.labelInValueFieldNames,D=t.labelInValue,O=t.disabledCanUse,$=Vr(t,At);var _=t.hasOwnProperty("selectorTreeList");var L=i||{};var I=a||[];var N=A(),Y=N[0],q=N[1];var z=_t(d).useStore(),E=z[0],W=z[1];var F=et(false),K=F[0],U=F[1];var V="request-progress-"+t.modelKey;var G=P((function(){return Ur({label:"label",value:"value",children:"children"},t.fieldNames)}),[t.fieldNames]);var Z=j();var X=y===true;var re=P((function(){return Ur({label:"label",value:"value"},x)}),[x]);var te=A(),ne=te[0],ie=te[1];var ae=j(true);var oe=A(0),se=oe[0],le=oe[1];var ce=j();var fe=P((function(){var e=It(l,re);return e}),[re,l]);Zr((function(){if(Ne(l)&&ae.current||E.treeList.length==0)return;ae.current=false;if(!Yt(l,ce.current,re)){console.log("modelKey:"+d+" TreeWrapper key refresh",l,ce.current);ce.current=X?fe:fe[0];var e=pe(fe,true);q(Array.from(new Set(e)));Z.current=fe;le(Date.now())}}),[l,E.treeList]);var de=function e(r){return r===""||Ne(r)};var ve=function e(r){var t=L.onRequestResultAdapter?L.onRequestResultAdapter(r):r;return t};Zr((function(){ie(S)}),[S]);var he=f.useCallbackRef((function(){return new Promise((function(r,t){var n,i,a,o,u;var s=function(){try{return r()}catch(e){return t(e)}};var l=function(e){try{U(false);void C.error(e.message||"数据查询异常...");return s()}catch(e){return t(e)}};try{if(!L.onRequest){throw new Error("onRequest 调用接口服务不能为空")}n=L.requiredParamsKeys;i=e({},L.params);if(n){a=n.find((function(e){return de(i[e])}));if(a){console.warn("TreeWrapper组件:参数:"+n.join("、")+"不能为空");return r()}}var c=function(){try{return s()}catch(e){return l(e)}};var f=function(e){try{window[V]=false;U(false);void W.changeRequestStatus("request-error");return c()}catch(e){return l(e)}};try{U(true);void W.changeRequestStatus("request-progress");window[V]=true;return Promise.resolve(L.onRequest==null?void 0:L.onRequest(i)).then((function(e){try{o=e;u=ve(o);me(u||[]);U(false);window[V]=false;return c()}catch(e){return f(e)}}),f)}catch(r){f(r)}}catch(r){l(r)}}))}));Zr((function(){if(_)return;if(Boolean(I.length)){void he();return}var e=_t(d).getState();if(e.requestStatus==="request-success"){return}if(!window[V]){void he();return}}),I);Zr((function(){if(_){me(u||[])}}),[u]);var me=f.useCallbackRef((function(e){if((e==null?void 0:e.length)===0&&E.treeList.length===0){return}void W.setTreeList({treeList:e||[],childrenName:G.children});b==null?void 0:b(e)}));var pe=f.useCallbackRef((function(e,r){var t=[];e.forEach((function(e){if(!r&&Y!=null&&Y.includes(e))return;var n=Lt(e,E.treeList,G);t=t.concat(n.map((function(e){return e.value})))}));return t}));f.useUpdateEffect((function(){if(ne){var e=Ve(E.treeList||[],G);var r=e.filter((function(e){var r;return(r=e.label)==null?void 0:r.includes(ne||"")}));q((function(e){var t=pe(r.map((function(e){return e.value}))).concat(e||[]);return Array.from(new Set(t))}))}else{q([])}}),[ne]);R(n,(function(){return{onClearSelectorList:function e(){void W.resetTreeList()},getTreeDataList:function e(){return E.treeList}}}));var ge=f.useCallbackRef((function(e){q(e)}));var ye=f.useCallbackRef((function(e,t,n){ce.current=e;var i=Ne(t)?[]:r(t)?t:[t];if(Ne(e)){c==null?void 0:c(e,t,n);return}if(D){var a=re.label;var o=re.value;var u=i.map((function(e){var r;return r={},r[a]=e[G.label],r[o]=e[G.value],r}));if(r(e)){c==null?void 0:c(u,i,n)}else{c==null?void 0:c(u[0],i[0],n)}}else{if(r(e)){c==null?void 0:c(e,i,n)}else{c==null?void 0:c(e,i[0],n)}}}));var be=f.useCallbackRef((function(e,n){var i=t.checkStrictly?e.checked:e;i=Ne(e)?[]:e;i=r(i)?i:[i];var a=[];var o=[];var u=[];var s=[];i.forEach((function(e){var t=E.treeTiledArray.find((function(r){return r[G.value]===e}));if(!t)return;var n=t==null?void 0:t[G.children];if(!r(n)||n.length===0){a.push(t);o.push(t[G.value])}u.push(t);s.push(t[G.value])}));if(y){q((function(e){var r=pe(o).concat(e||[]);return Array.from(new Set(r))}));if(!m&&!t.checkStrictly){ye(o,a,u)}else{ye(s,u,u)}}else{if(i[0]){var l=u.find((function(e){return e[G.value]===i[0]}));ye(i[0],l,[l])}else{var c=n.node[G.value];var f=E.treeTiledArray.find((function(e){return e[G.value]===c}));ye(undefined,f,[f])}}}));var we=f.useCallbackRef((function(e){return w==null?void 0:w(e)}));var Ce=P((function(){var e=function e(t){return t==null?void 0:t.map((function(t){var n;var i=(we==null?void 0:we(t))||t;var a=O?undefined:i.disabled;var o=i[G.label];var u;if(ne){var l=o.indexOf(ne);var c=o.substring(0,l);var f=o.slice(l+ne.length);u=l>-1?Q("span",{className:s({"v-tree-item-disabled":i.disabled}),children:[c,J("span",{className:"site-tree-search-value",children:ne}),f]}):null}if(!u){u=J("span",{className:s({"v-tree-item-disabled":i.disabled}),children:o})}var d=i[G.children];return Ur({},i,(n={disabled:a},n[G.label]=u,n._treeItemName=o,n._disabled=i.disabled,n[G.children]=r(d)&&d.length>0?e(d):undefined,n))}))};var t=ee(E.treeList||[]);return e(t)}),[E.treeList,we,O,G.label,G.children,ne]);var Se=f.useCallbackRef((function(e){return new Promise((function(r,n){return new Promise((function(i,a){var o,u,s,l;if(e[G.children]){r();return i()}var c=function(){try{return i()}catch(e){return a(e)}};var f=function(e){try{void C.error(e.message||"数据加载异常...");n();return c()}catch(e){return a(e)}};try{return Promise.resolve((o=t.loadDataServiceConfig)==null?void 0:o.onRequest==null?void 0:o.onRequest((u=t.loadDataServiceConfig)==null?void 0:u.getParams==null?void 0:u.getParams(e))).then((function(t){try{s=t;l=L.onRequestResultAdapter?L.onRequestResultAdapter(s):s;void W.treeListAppendChildren({value:e[G.value],appendList:l,childrenName:G.children,valueName:G.value}).then((function(e){me(e.treeList);r()}));return c()}catch(t){return f(t)}}),f)}catch(e){f(e)}}))}))}));var ke=f.useCallbackRef((function(e){var r=e==null?void 0:e[G.children];var n=t.loadDataFlag;var i=n?!e.isLeaf:false;var a=r&&r.length>0||i;return!a}));var Me=f.useCallbackRef((function(e){var r;var n=e._treeItemName||e[G.label];var i=t.getMenuOptions==null?void 0:t.getMenuOptions(Ur({},e,(r={},r[G.label]=n,r)));if(!i||i.length===0){return J("span",{className:"tree-item-title",children:e==null?void 0:e[G.label]})}return Q(B,{children:[J("span",{className:"tree-item-title",children:e==null?void 0:e[G.label]}),J(at,{menuList:i,children:J(o,{})})]})}));var Te=f.useDebounceCallback((function(e){ie(e);t.onSearchValueChange==null?void 0:t.onSearchValueChange(e)}),300);var xe=f.useCallbackRef((function(e){Te(e.target.value)}));var De=f.useCallbackRef((function(e){if(!t.icon)return null;if(H(t.icon))return t.icon;var r=ke(e.data);return t.icon(Ur({},e,{isParent:!r,isLeaf:r}))}));var Oe=P((function(){return{title:G.label,key:G.value,children:G.children}}),[G]);if(E.treeList.length>0&&E.requestStatus!=="request-error"){var $e=Ur({showLine:{showLeafIcon:false},titleRender:Me,blockNode:true,switcherIcon:J(ue,{})},$,{fieldNames:Oe,expandedKeys:Y,treeData:Ce,onExpand:ge,loadData:t.loadDataFlag?Se:undefined,style:Ur({width:"100%"},$.style),icon:De});var _e={onCheck:be,checkable:y,defaultCheckedKeys:Z.current};var Le={onSelect:be,multiple:false,defaultSelectedKeys:Z.current};var Ie=y?_e:Le;return Q("div",{className:"v-tree-wrapper",children:[J(p,{spinning:K,className:"v-tree-wrapper-loading"}),k?J(xt,{className:"v-tree-wrapper-search",style:{marginBottom:12},placeholder:M,onChange:xe,value:S,allowClear:true}):null,J(g,Ur({},Ie,$e,{className:"v-tree-wrapper-tree"}),se)]})}return J(ot,{status:E.requestStatus,loading:K,messageConfig:T,errorButton:J(v,{type:"primary",onClick:he,children:"重新获取数据"})})}));Rt.defaultProps={disabledCanUse:true};var qt=function e(){return J(T,{status:"404",title:"404",subTitle:"Sorry, 您访问的地址不存在"})};var Pt;var jt;var Bt;var Ht=function(){var e=x.useApp();Pt=e.message;Bt=e.modal;jt=e.notification;return null};function zt(){var e=q(undefined);function r(){var r=W(e);if(r===undefined)throw new Error("useCtx must be inside a Provider with a value");return r}return[r,e.Provider]}var Et=zt(),Wt=Et[0],Ft=Et[1];var Kt=function e(r,t){if(t===void 0){t=false}r=r.replace(/\/$/,"");return t?r+"/":r};var Ut=function e(r){if(r===void 0){r=[]}return r.slice(0).sort((function(e,r){return(r.path||"").length-(e.path||"").length}))};var Vt=function e(r,t){return Kt(r,true).startsWith(Kt(t,true))};var Jt=function e(r,t){var n=se();var i=le();var o=ce(),u=o[0];var s=typeof r==="function"?r({params:n,search:u}):r||{};t=Kt(t,false);var l=i.pathname.replace(t,"");var c=l.replace(/^\//,"").substring(l.replace(/^\//,"").indexOf("/"));var f=[];var d=Object.keys(s);var v=[];var h="";var m="";for(var p=0;p<d.length;p++){var g=d[p];if(Kt(c,true).startsWith(Kt(g,true))){v=s[g];m=Ze(Kt(l,true).split(Kt(g,true))[0],""+g);h=c.replace(Kt(g,true),"/");break}}v=v.sort((function(e,r){var t,n;return((t=e.path)==null?void 0:t.length)-((n=r.path)==null?void 0:n.length)}));for(var y=0;y<v.length;y++){var b=v[y];if(fe(b.path,h)||Kt(h,true).includes(Kt(b.path,true))){f.push(Object.assign({},b))}}var w=f.map((function(e){var r=e.to||e.path;var t=typeof r==="function"?r({params:n,search:u}):r;var i=e.query||[];var o=a.paramStrToJson(window.location.href);var s=ye(o,["env"].concat(i));var l=typeof e.name==="function"?e.name():e.name;return{path:t?Ze(m,t):m,name:l,query:s}}));return w};var Qt=function e(r){var t=Wt();var n=We();var i=Jt(t.breads,n.routeBaseName);var a=f.useCallbackRef((function(e){return e.map((function(r,t){var n=r&&J(B,{children:r.name});return r?J(D.Item,{children:e.length-1!==t?J(de,{to:Ge(r.path,r.query),children:n}):n},t):null}))}));if(!i.length){return null}return Q("div",{className:"bread-wrapper",children:[Q(D,{className:"bread",children:[t.breadTitle&&J(D.Item,{children:t.breadTitle}),a(i.sort((function(e,r){return e.path.length-r.path.length})))]}),J("div",{className:"bread-extend",children:r.children})]})};var Gt=We();var Zt=function e(r){return r.filter((function(e){return!e.children||e.children.length===0}))[0]};var Xt=function e(r){var t=We(),n=t.routeBaseName;return Ze("/",r).replace(Ze("/",n),"").split("?")[0]};var en=function e(r){var t=er(r)?a.uriParse(r).pathname:r;var n=We(),i=n.routeBaseName;var o=Ze("/",t).replace(Xe("/",i,"/"),"").split("?")[0];o=Xe("/",o,"/");if(o.startsWith("/main/")){o=o.replace("/main/","/")}return rr(o,"after")};var rn=function e(r){var t=en(r);return Ze("/main",t)};var tn=function e(r){var t=rn(r);var n=a.uriParse(r);var i=n.search;return{path:t,search:i,pathSearch:""+t+i}};var nn=function e(r){var t=en(r);var n=a.uriParse(r);var i=n.search;return{path:t,search:i,pathSearch:""+t+i}};var an=function e(r){var t=We(),n=t.routeBaseName,i=t.hostUrl;var a="";if(er(r)){a=nn(r).pathSearch}else{var o=en(r);var u=r.split("?")[1]||"";a=u?o+"?"+u:o}return Xe(i,n,a)};var on=function e(r){var t=We(),n=t.routeBaseName,i=t.hostUrl;var a=r;if(!er(r)){a=Xe(i,n,r)}return a};var un=function e(r){var t=We(),n=t.routeBaseName,i=t.hostUrl;var a="";if(er(r)){a=tn(r).pathSearch}else{var o=rn(r);var u=r.split("?")[1]||"";a=u?o+"?"+u:o}return Xe(i,n,a)};var sn=Gt.appName||"flatbiz-layout";var ln=function e(){var r=Gt.menus;Ue(r,"children").forEach((function(e){var r,t;e.link=l(e.link)?((r=e.link)==null?void 0:r[we.getEnvName()])||((t=e.link)==null?void 0:t["prod"]):e.link}));return r};var cn=function e(r,t){var n=a.modifyQueryString(r,{env:undefined});var i=a.modifyQueryString(t,{env:undefined});return n===i};var fn=function e(t,n){n=en(n);var i=Ut(t);var a=i.find((function(e){return Vt(n,en(e.path))}));if(a!=null&&a.children&&r(a==null?void 0:a.children)&&a.children.length>0){if(en(a.path)!==n)return undefined;var o=function e(t){if(r(t[0].children)&&t[0].children.length>0){return e(t[0].children)}return t[0]};return o(a.children)}return a};var dn=function e(r,t){var n=be.findAncestors(t,(function(e){return e.id===r.id}));var i=[];n.forEach((function(e){return i.push(""+e.id)}));return i};var vn=function e(t){var n=r(t)?t:[];window[sn]=n;He.set(sn,{menuList:n})};var hn=function e(){try{if(window[sn])return[].concat(window[sn]);var t=He.get(sn)||{},n=t.menuList;var i=r(n)?n:[];window[sn]=i;return i}catch(e){return[]}};var mn=function e(r){window[sn+"-iframeActiveItem"]=r;He.set(sn+"-iframeActiveItem",$e({},r))};var pn=function e(){try{if(window[sn+"-iframeActiveItem"])return window[sn+"-iframeActiveItem"];var r=He.get(sn+"-iframeActiveItem");var t=r&&r.id?r:undefined;window[sn+"-iframeActiveItem"]=t;return t}catch(e){return undefined}};var gn=function e(r,t){var n=r.link;var i=t.find((function(e){return cn(e.link,n)}));if(i){return{iframeTabListNew:t,iframeTabActiveItem:i}}return yn(t,r)};var yn=function e(r,t){var n={id:Pe(),link:an(Ge(t.link)),name:t.name,metaTitle:t.metaTitle,iframeKey:""+Date.now(),menuId:t.id?""+t.id:undefined};var i=r.concat(n);return{iframeTabListNew:i,iframeTabActiveItem:n}};var bn=function e(){He.remove(sn)};var wn=function e(r){var t=hn();var n=an(location.href);var i=pn();if(!i||!Ae(t,i.id,"id")){var a=t.find((function(e){return cn(an(e.link),n)}));if(a)return a;if(r){a={link:n,name:r.name,metaTitle:r.metaTitle,id:Pe(),iframeKey:""+Date.now(),menuId:""+r.id}}else{var o;a={id:Pe(),link:n,name:((o=Tn(location.pathname))==null?void 0:o.name)||"未知页面",iframeKey:""+Date.now(),menuId:undefined}}vn(t.concat(a));return a}var u=an(i.link);if(cn(n,u)){return i}var s=en(location.href);var l=en(i.link);if(s===l){Mn(i.id,{link:n});return i}if(r){var c={id:i.id,iframeKey:i.iframeKey,link:n,name:r.name,metaTitle:r.metaTitle,menuId:r.id};Mn(i.id,c);return c}else{var f;var d={id:Pe(),iframeKey:""+Date.now(),link:n,name:((f=Tn(location.pathname))==null?void 0:f.name)||"未知页面",menuId:undefined,metaTitle:undefined};Mn(i.id,d);return d}};var Cn=function e(r,t){var n=t.find((function(e){return cn(an(r),an(e.link))}));return n};var Sn=function e(r,t,n){var i=n.findIndex((function(e){return e.id===r}));if(i>=0){n[i]=$e({},n[i],t,{iframeKey:""+Date.now()})}return{iframeTabList:n,target:n[i]}};var kn=function e(r){var t=hn();var n=t.find((function(e){return e.id===r}));if(n){n.iframeKey=""+Date.now()}return t};var Mn=function e(r,t){var n=hn();var i=n.findIndex((function(e){return je(e.id,r)}));if(i>=0){n[i]=$e({},n[i],t);mn(n[i])}vn(n)};var Tn=function e(r){var t=nn(r),n=t.path;var i=window["_iframeTabConfig"]||{};var a=Object.keys(i).find((function(e){return Ze("/",e)===n}));return a&&l(i[a])?i[a]:undefined};window["_iframeTabConfig"]={"/intro/xyz":{name:"xyz"}};var xn=function e(r){var t=Wt();var n=f.useCallbackRef((function(){if(t.collapsed){t.onChangeCollapsed(false)}else{setTimeout((function(){t.onChangeCollapsed(true)}),100)}}));if(t.siderBarMenus.length>0&&!t.hideSidebarMenu){return J("div",{className:s("layout-shrink",r.className),onClick:n,children:t.collapsed?J(Se,{}):J(Ce,{})})}return J("div",{className:s("layout-shrink",r.className)})};var Dn=function e(){var r=f.useGlobal(),t=r.user,n=r.hostUrl;var i=Wt();var a=f.useCallbackRef((function(){i.onSignOut==null?void 0:i.onSignOut(t,n)}));var o=[{label:"退出登录",key:"0",onClick:a,icon:J(Me,{})}];return J("div",{className:"header-account",children:J(b,{menu:{items:i.accountOperateMenuItems?i.accountOperateMenuItems:o},arrow:true,trigger:["click","hover"],overlayClassName:"account-dropdown-overlay",getPopupContainer:function e(){return document.querySelector(".header-account")},children:J("div",{className:"header-account-wraper",children:Q(O,{size:[8,0],children:[J(v,{size:"small",shape:"circle",icon:J(ke,{})},"user"),J("div",{style:{maxWidth:68},children:(t==null?void 0:t.userName)||"..."})]})})})})};var On=function e(){var r=f.useGlobal(),t=r.defaultPage;var n=Wt();var i=f.useCallbackRef((function(){if(t){window.location.href=t}}));var a=n.sidebarWidth;return J("div",{className:"layout-brand",onClick:i,style:{width:a},children:n.HeaderBrand?n.HeaderBrand():Q(B,{children:[J("div",{className:"brand-logo",style:{backgroundImage:"url("+n.logoPath+")"}}),J("div",{className:"brand-name",children:n.brandName})]})})};var $n=function e(){var r,t,n,i,a;var o=Wt();var u=o.menus,l=o.topMenuActiveItem,c=o.siderBarMenus;var d=P((function(){return o.disableTopbarMenu?[]:u.map((function(e){return{key:""+e.id,label:e.name}}))}),[o.disableTopbarMenu,u]);var v=f.useCallbackRef((function(e){var r=u.filter((function(r){return je(e.key,r.id)}))[0];if(!je(r==null?void 0:r.id,l==null?void 0:l.id)){bn()}if(r.target==="_blank"){window.open(r.link)}if(o.layoutMode==="normal"){window.location.href=Ge(on(r.link||r.path))}else{var t=Zt(Ue(r.children||[],"children"));if(t){window.location.href=Ge(un(t.link||t.path));return}window.location.href=Ge(un(r.link||r.path))}}));var h=s("flatbiz-layout-main-header",{"flatbiz-layout-main-header-has-menu":d.length>0});return Q("div",{className:h,children:[c.length===0||o.hideSidebarMenu?J(On,{}):null,o.showTopMenuShrink?J(xn,{className:"header-shrink"}):null,o.systemName?J("div",{className:"flatbiz-layout-system-name",children:o.systemName}):null,Q("div",{className:"flatbiz-layout-header-fill",children:[J(tt,$e({theme:{token:{fontSize:(r=o.headerThemeConfig)==null?void 0:r.menuTextFontSize},components:{Menu:{colorItemText:(t=o.headerThemeConfig)==null?void 0:t.menuColor,colorItemTextHover:(n=o.headerThemeConfig)==null?void 0:n.menuActiveTextColor,colorItemBgSelectedHorizontal:(i=o.headerThemeConfig)==null?void 0:i.menuSelectedBgColor,colorItemTextSelectedHorizontal:(a=o.headerThemeConfig)==null?void 0:a.menuSelectedTextColor}}}},o.topMenuConfigProviderProps,{children:d.length>0?J($,{className:"flatbiz-layout-topmenu",mode:"horizontal",defaultSelectedKeys:l!=null&&l.id?[""+l.id]:undefined,items:d,onClick:v,theme:"light",getPopupContainer:function e(){return document.querySelector(".flatbiz-layout-topmenu-overflowed-modal")}}):null})),o.Header?J(o.Header,{}):null,J("div",{className:"flatbiz-layout-topmenu-overflowed-modal"})]}),J(Dn,{})]})};var _n=function e(r){var t=r.spinning,n=t===void 0?false:t,i=r.fullScreen,a=i===void 0?false:i,o=r.style,u=o===void 0?{}:o;return J("div",{style:u,className:s("loader",{hidden:!n,fullScreen:a}),children:Q("div",{className:"loader-wrapper",children:[J("div",{className:"loader-inner"}),J("div",{className:"loader-text",children:"LOADING"})]})})};var Ln;(function(e){e["messageReceived"]="messageReceived"})(Ln||(Ln={}));var In="FLATBIZ-LAYOUT";var Nn=function(){function e(){this.events={}}var r=e.prototype;r.on=function e(r,t){if(!this.events[r]){this.events[r]=[]}this.events[r].push(t);return this};r.off=function e(r,t){if(this.events[r]){this.events[r]=this.events[r].filter((function(e){return e!==t}))}return this};r.emit=function e(r,t){var n=this.events[r]||[];if(n.length){console.log("IframeEventEmitter.emit(), name: ",r,"handlers:",n);for(var i=0;i<n.length;i++){var a=n[i];if(a){a(t)}}}return this};return e}();var Yn=function e(){var r=document.querySelectorAll('[id^="iframe_"]');return r};var An={broadcastMessages:function e(r){var t=Yn();for(var n=0;n<t.length;n++){var i;var a=t[n];(i=a.contentWindow)==null?void 0:i.postMessage(JSON.stringify({type:In,data:r}),"*")}return An},postMessage:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:r}),"*");return An},openNewTabItem:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"redirect_to_frame_layout_menu_item",data:r}}),"*");return An},openBrowserWindow:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"open_browser_window",data:{url:r}}}),"*");return An},locationHref:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"browser_location_href",data:{url:r}}}),"*");return An},tabItemHistoryChange:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"history_change",data:{link:r}}}),"*");return An},openNewTabItemByMenuId:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"open_iframe_tabitem_by_menu_id",data:r}}),"*");return An}};var Rn=new Nn;window.addEventListener("message",(function(e){try{var r=ae.parse(e.data),t=r.type,n=r.data;if(t===In){Rn.emit(Ln.messageReceived,n)}}catch(e){}}));var qn=function e(r){if(r===void 0){r=function e(){}}var t=f.useCallbackRef(r);z((function(){Rn.off(Ln.messageReceived,t).on(Ln.messageReceived,t);return function(){Rn.off(Ln.messageReceived,t)}}),[t]);return An};var Pn=function e(){var r=qn();var t=le(),n=t.pathname,i=t.search;var a=f.useDebounceCallback((function(){r.tabItemHistoryChange(location.href)}),100);f.useUpdateEffect((function(){a()}),[n,i]);return J(B,{})};var jn=_.Sider;var Bn=function e(r){if(r.iconImg&&r.iconImgActive){return Q(B,{children:[J("div",{className:"menu-icon-img",style:{backgroundImage:"url("+r.iconImg+")"}}),J("div",{className:"menu-icon-img-active",style:{backgroundImage:"url("+r.iconImgActive+")"}})]})}return J("div",{className:"menu-icon-placeholder"})};var Hn=function e(){var r,t,n,i,a,o,u,s,l,c;var d=Wt();var v=Te();var h=d.siderBarTileMenus;var m=P((function(){var e=function e(r,t){return r.map((function(r){if(r.children&&r.children.length>0){return{key:String(r.id),icon:J(Bn,{iconImg:r.iconImg,iconImgActive:r.iconImgActive}),label:r.name,children:e(r.children,t+1),popupClassName:"flatbiz-layout-sider-submenu-popup",className:t===0&&!r.iconImg&&!r.iconImgActive?"flatbiz-layout-menu-item-no-icon":undefined}}return{key:String(r.id),icon:J(Bn,{iconImg:r.iconImg,iconImgActive:r.iconImgActive}),label:r.name}}))};return e(d.siderBarMenus,0)}),[d.siderBarMenus]);var p=f.useCallbackRef((function(e){d.onChangeSelectedKeys(e.keyPath);var r=h.filter((function(r){return je(e.key,r.id)}))[0];if(r.target==="_blank"){window.open(r.link);return}if(d.layoutMode==="iframe-main"){d.onIframChange(e.key,"menuClick");return}if(r.link){window.location.href=Ge(r.link);return}if(r.path){v(Ge(r.path));document.title=r.metaTitle||r.name}}));var g=f.useCallbackRef((function(e){d.onChangeOpendKeys(e)}));var y=A(0),b=y[0],w=y[1];z((function(){w(Date.now())}),[d.collapsed]);var C={mode:!d.collapsed?"inline":"vertical",items:m,inlineIndent:(r=d.sidebarThemeConfig)==null?void 0:r.inlineIndent,onClick:p,selectedKeys:d.selectedKeys,onOpenChange:g};if(!d.collapsed){C.openKeys=d.opendKeys}return Q(jn,{theme:"light",className:"flatbiz-layout-sider",collapsed:d.collapsed,width:d.sidebarWidth,children:[J(On,{}),J(tt,$e({theme:{token:{controlHeight:(t=d.sidebarThemeConfig)==null?void 0:t.menuItemHeight,fontSize:(n=d.sidebarThemeConfig)==null?void 0:n.menuTextFontSize},components:{Menu:{colorItemBg:(i=d.sidebarThemeConfig)==null?void 0:i.bgColor,colorItemText:(a=d.sidebarThemeConfig)==null?void 0:a.menuColor,colorItemTextHover:(o=d.sidebarThemeConfig)==null?void 0:o.menuActiveTextColor,colorItemBgHover:(u=d.sidebarThemeConfig)==null?void 0:u.menuActiveBgColor,colorItemTextSelected:(s=d.sidebarThemeConfig)==null?void 0:s.menuSelectedTextColor,colorItemBgSelected:(l=d.sidebarThemeConfig)==null?void 0:l.menuSelectedBgColor,colorSubItemBg:(c=d.sidebarThemeConfig)==null?void 0:c.menuSubMenuBgColor}}}},d.sidebarMenuConfigProviderProps,{children:J($,$e({},C),b)})),!d.hideSidebarShrink&&J(xn,{className:"sider-bar-shrink"})]})};var zn=function e(){var r=Wt(),t=r.iframeTabList,n=r.hideHeader,i=r.iframeTabBarExtra,a=r.iframeTabActiveItem,o=r.onIframChange,u=r.onDeleteIframeTabItem;var s=A([]),l=s[0],c=s[1];var d=f.useDebounceClick((function(e){o(e,"iframTabClick")}),200);var v=f.useCallbackRef((function(e){u("me",e)}));var h=f.useCallbackRef((function(e){if(e.key==="1"){o(a.id,"iframTabClick")}else if(e.key==="2"){u("other")}else if(e.key==="3"){u("all")}}));var m=[{label:"刷新当前",key:"1",onClick:h.bind(null,{key:"1"}),icon:J(X,{})},{label:"关闭其他",key:"2",onClick:h.bind(null,{key:"2"}),icon:J(ie,{})},{label:"关闭所有",key:"3",onClick:h.bind(null,{key:"3"}),icon:J(Me,{})}];var p=t.map((function(e){var r=!Ye(l,e.iframeKey);return{label:e.name,key:""+e.id,style:{height:n?"calc(100vh - 38px)":"calc(100vh - 102px)",position:"relative"},closable:true,closeIcon:J("span",{className:"tab-icon"}),children:Q(B,{children:[J(_n,{spinning:r}),J("iframe",{id:"iframe_"+String(e.id),src:e.link,width:"100%",height:"100%",style:{border:"none"},onLoad:function r(){c((function(r){return r.concat(e.iframeKey)}))}},e.iframeKey)]})}}));return J(L,{hideAdd:true,items:p,activeKey:a==null?void 0:a.id,onTabClick:d,style:{height:"100%"},className:"iframe-tabs",type:t.length===1?"card":"editable-card",onEdit:v,tabBarExtraContent:{right:i?i:J(b,{menu:{items:m},arrow:true,className:"menu-tabs-operate",placement:"bottomRight",overlayClassName:"menu-tabs-operate-dropdown",trigger:["hover"],children:J(xe,{})})}})};var En=function e(){var r=Wt();var t=r.iframeTabActiveItem;var n=A([]),i=n[0],a=n[1];var o=!Ye(i,t==null?void 0:t.iframeKey);return Q("div",{style:{flex:1,position:"relative"},children:[J(_n,{spinning:o}),J("iframe",{id:"iframe_"+String(t==null?void 0:t.id),src:t==null?void 0:t.link,width:"100%",height:"100%",style:{border:"none"},onLoad:function e(){a((function(e){return e.concat(t==null?void 0:t.iframeKey)}))}},t==null?void 0:t.iframeKey)]})};var Wn=function e(){var r=Wt();return J(B,{children:r.multiFrameTabs?J(zn,{}):J(En,{})})};var Fn=function e(){var r=ve();var t=Wt();var n=f.useGlobal(),i=n.user,a=n.hostUrl;qn((function(e){if(e.type==="redirect_to_frame_layout_menu_item"){var n=e.data;t.onIframChangeByHttpUrl(un(n.link),{name:n.name,metaTitle:n.metaTitle})}else if(e.type==="open_browser_window"){var i;var a=(i=e.data)==null?void 0:i["url"];if(a){window.open(a)}}else if(e.type==="browser_location_href"){var o;var u=(o=e.data)==null?void 0:o["url"];if(u){window.location.href=un(u)}}else if(e.type==="history_change"){var s;var l=(s=e.data)==null?void 0:s["link"];var c=tn(l),f=c.pathSearch;r(f);var d=fn(t.siderBarTileMenus,l);Mn(t.iframeTabActiveItem.id,{link:l,name:d.name,metaTitle:d.metaTitle})}else if(e.type==="open_iframe_tabitem_by_menu_id"){var v=e.data;var h=t.siderBarTileMenus.find((function(e){return je(e.id,v)}));if(h){if((h==null?void 0:h.target)==="_blank"){window.open(h.link);return}t.onIframChange(h.id,"menuClick")}}}));qn((function(e){if(e.type==="session_expired"){t.onSessionExpired(i,a)}}));return J(B,{})};var Kn=function e(r){var t=Wt();var n=Ee();var i=s("layout-page-wrapper",{"layout-page-noheader":t.hideHeader,"layout-page-windows":n});return J(B,{children:J("div",{className:i,children:J("div",{className:"layout-page",children:r.children})})})};var Un=function e(){var r=Wt();var t=r.routeList;var i=t.filter((function(e){return je(e.path,["*","/*","/*/"])}));return J(B,{children:Q(he,{children:[t.map((function(e,t){var i=e.path,a=e.caseSensitive,o=e.element,u=e.redirect;var s=je(i,["*","/*","/*/"]);if(n(u)){return J(me,{path:i,element:J(pe,{to:tr(u)})},t)}if(o){var l=null;if(o){l=H(o)?o:J(F,{fallback:J(_n,{spinning:true}),children:J(o,{})})}var c=s?"*":i.endsWith("/*")?i:Xe(i,"*");return J(me,{path:c,caseSensitive:a,element:Q(B,{children:[r.breads&&r.hideDefaultBread!==true?J(Qt,{children:r.breadExtendRender}):null,l]})},t)}return null})),i.length===0?J(me,{path:"*",element:J(qt,{})}):null]})})};var Vn=function e(){var r=Wt();var t=r.layoutMode==="iframe-main";Ht();var n=r.LayoutComponent||Kn;if(r.layoutMode==="iframe-tab"||r.layoutMode==="no-layout"){return Q(B,{children:[r.layoutMode==="iframe-tab"?J(Pn,{}):null,J(n,{children:J(Un,{})})]})}if(r.menus.length===0){return J(T,{status:"error",title:"无菜单数据",subTitle:"请联系运营人员确定菜单数据配置"})}var i=Ee();return Q(B,{children:[J(Fn,{}),Q(_,{hasSider:true,className:s("flatbiz-layout",{"flatbiz-layout-windows":i}),children:[r.siderBarMenus.length===0||r.hideSidebarMenu?null:J(Hn,{}),Q(_,{className:"flatbiz-layout-main",hasSider:false,children:[!r.hideHeader?J($n,{}):null,t?J(Wn,{}):J(n,{children:J(Un,{})})]})]})]})};var Jn=function e(){var r=qn();var t=De.useException(),n=t[0],i=t[1];var a=Wt();f.useUpdateEffect((function(){if(n&&n.message){i();if(a.verifySessionExpired(n)){r.postMessage({type:"session_expired"});return}void C.error(n.message)}}),[n]);return null};var Qn=["sidebarWidth","componentSize","locale","logoPath","headerThemeConfig","sidebarThemeConfig"];var Gn=function r(t){var n=ve();var i=t.sidebarWidth,a=t.componentSize,o=t.locale,u=t.logoPath,s=t.headerThemeConfig,l=t.sidebarThemeConfig,c=Ie(t,Qn);var f=c.layoutMode==="iframe-main";var d=A(false),v=d[0],h=d[1];var m=A([]),p=m[0],g=m[1];var y=A([]),b=y[0],w=y[1];var C=A(),S=C[0],k=C[1];var M=A(),T=M[0],x=M[1];var D=j();var O=c.ErrorHandling||Jn;var $=P((function(){var e=ln();var r=Ue(e,"children");var t=[];var n=undefined;if(c.hideSidebarMenu){if(!c.disableTopbarMenu){var i=e.find((function(e){return Vt(Xt(location.pathname),e.path)}));if(i){x(i)}}}else{n=fn(r,location.pathname);if(n){var a=dn(n,e);if(!c.disableTopbarMenu){if(a.length>0){var o=a[a.length-1];var u=e.find((function(e){return je(e.id,o)}));x(u);t=(u==null?void 0:u.children)||[]}}else{t=e}w(a);g(a);k(n);document.title=n.metaTitle||n.name}else{if(c.disableTopbarMenu){t=e;w([]);g([]);k(undefined)}}if(f){var s=wn(n);mn(s)}}return{menus:e,siderBarMenus:t,siderBarTileMenus:Ue(t,"children"),siderbarTargetMenu:n}}),[f,c.disableTopbarMenu,c.hideSidebarMenu]),_=$.menus,L=$.siderBarMenus,I=$.siderBarTileMenus;var N=A(pn()),Y=N[0],R=N[1];var q=A(hn()),B=q[0],H=q[1];Zr((function(){vn(B)}),[B]);Zr((function(){if(Y!=null&&Y.id){document.title=Y.metaTitle||Y.name;mn(Y)}}),[Y]);var z=function e(r){if(r){D.current=p}else{g(D.current||[])}h(r)};var E=function e(r){w(r)};var W=function e(r){g(r)};var F=function e(r){var t=gn(r,hn()),n=t.iframeTabActiveItem,i=t.iframeTabListNew;H([].concat(i));R(n);k(r)};var K=function e(r){if(r){var t=I.find((function(e){return je(e.id,r)}));if(t){k(t);var n=dn(t,L);w(n);g(n);return}}w([]);g([]);k(undefined)};var U=function r(t,i){if(i==="iframTabClick"){if(je(t,Y.id)){if(!c.iframeTabClickRefresh)return;var a=kn(Y==null?void 0:Y.id);H([].concat(a))}else{var o=hn().find((function(e){return je(e.id,t)}));R(o);K(o==null?void 0:o.menuId);var u=tn(o==null?void 0:o.link),s=u.pathSearch;n(Ge(s))}}if(i==="menuClick"){if(je(t,S==null?void 0:S.id)){var l=Sn(Y==null?void 0:Y.id,{link:Ge(S==null?void 0:S.link),name:S==null?void 0:S.name,metaTitle:S==null?void 0:S.metaTitle},hn());n(Ge((S==null?void 0:S.path)||""));H([].concat(l.iframeTabList));R(e({},l.target));return}else{var f=I.find((function(e){return je(e.id,t)}));var d=gn(f,hn()),v=d.iframeTabActiveItem,h=d.iframeTabListNew;H([].concat(h));R(v);k(f);n(Ge(f.path))}}};var V=function e(r,t){if(r==="other"){H([Y]);return}var i=hn();var a;var o;if(r==="all"){a=[i[0]];o=i[0]}else if(r==="me"){var u=Re(i,t,"id");var s=i[u-1];i.splice(u,1);a=i;o=s}H([].concat(a));R(o);var l=tn(o.link),c=l.pathSearch;n(c);K(o.menuId)};var G=function e(r,t){var i=hn();var a=nn(r),o=a.path,u=a.pathSearch;var s=an(r);var l=fn(I,o);if(l){var c=dn(l,L);w(c);g(c);var f=gn($e({},l,{link:s,name:t.name,metaTitle:t.metaTitle}),i),d=f.iframeTabActiveItem,v=f.iframeTabListNew;H([].concat(v));R(d);k(l)}else{w([]);g([]);k(undefined);var h=Cn(s,i);if(h){R(h)}else{var m=yn(i,{link:s,name:(t==null?void 0:t.name)||"未知页面",metaTitle:t==null?void 0:t.metaTitle,path:u}),p=m.iframeTabListNew,y=m.iframeTabActiveItem;H([].concat(p));R(y)}}var b=tn(r);n(Ge(b.pathSearch))};var Z=function e(r){var t=hn().find((function(e){return e.id===Y.id}));if(t){t.name=r;H(hn())}};var X=$e({},c,{menus:_,siderBarMenus:L,siderBarTileMenus:I,sidebarWidth:i,componentSize:a,locale:o,routeList:c.routeList,breads:c.breads||{},logoPath:u,headerThemeConfig:s,sidebarThemeConfig:l,collapsed:v,onChangeCollapsed:z,opendKeys:p,selectedKeys:b,onChangeOpendKeys:W,onChangeSelectedKeys:E,iframeTabList:B,addOrUpdateIframeTab:F,iframeTabActiveItem:Y,siderBarMenuActiveItem:S,onIframChange:U,onDeleteIframeTabItem:V,onIframChangeByHttpUrl:G,topMenuActiveItem:T,onUpdateIframeTabName:Z,onChangeSiderBarMenuActiveItem:K});return Q(Ft,{value:X,children:[c.disableErrorHandling?null:J(O,{}),J(Vn,{})]})};var Zn=function e(r,t){if(r===void 0){r=[]}if(t===void 0){t=[]}return r.length!==t.length||r.some((function(e,r){return!Object.is(e,t[r])}))};var Xn={error:null};var ei=function(e){_e(r,e);function r(){var r;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}r=e.call.apply(e,[this].concat(n))||this;r.state=Xn;r.updatedWithError=false;r.resetErrorBoundary=function(){var e;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}r.props.onReset==null?void 0:(e=r.props).onReset.apply(e,n);r.reset()};return r}r.getDerivedStateFromError=function e(r){return{error:r}};var t=r.prototype;t.reset=function e(){this.updatedWithError=false;this.setState(Xn)};t.componentDidCatch=function e(r,t){var n,i;(n=(i=this.props).onError)==null?void 0:n.call(i,r,t)};t.componentDidMount=function e(){var r=this.state.error;if(r!==null){this.updatedWithError=true}};t.componentDidUpdate=function e(r){var t=this.state.error;var n=this.props.resetKeys;if(t!==null&&!this.updatedWithError){this.updatedWithError=true;return}if(t!==null&&Zn(r.resetKeys,n)){var i,a;(i=(a=this.props).onResetKeysChange)==null?void 0:i.call(a,r.resetKeys,n);this.reset()}};t.render=function e(){var r=this.state.error;var t=this.props,n=t.fallbackRender,i=t.FallbackComponent,a=t.fallback;if(r!==null){var o={error:r,resetErrorBoundary:this.resetErrorBoundary};if(H(a)){return a}else if(typeof n==="function"){return n(o)}else if(i){return J(i,$e({},o))}else{throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}}return this.props.children};return r}(K);function ri(e){var r=e.error;return J("div",{style:{height:"100%",padding:"8px"},children:Q("div",{style:{backgroundColor:"#fff",height:"100%",padding:"0 8px 8px 8px",overflow:"hidden"},children:[J(I.Title,{level:2,children:"Something went wrong"}),J(I.Paragraph,{children:r.message}),J(v,{onClick:function e(){window.location.reload()},children:"Try again"})]})})}var ti=function r(t){var n=We();var i=t.sidebarWidth||220;var a=t.componentSize||"middle";var o=t.locale;var u=t.logoPath||"";var s={bgColor:"#1890ff",textColor:"#fff",menuColor:"#fff",menuActiveTextColor:"#FFF",menuSelectedBgColor:"#0080e3",menuSelectedTextColor:"#FFF",menuTextFontSize:14};var l={bgColor:"#fff",menuActiveBgColor:"rgba(0,0,0,0.06)",menuActiveTextColor:"#1890ff",menuSelectedBgColor:"#bae0ff",menuColor:"rgba(0,0,0,.88)",menuSelectedTextColor:"#1890ff",menuSubMenuBgColor:"rgba(0, 0, 0, 0.02)",inlineIndent:16,menuItemHeight:28,menuTextFontSize:13};var c=e({},s,t.headerThemeConfig);var f=e({},l,t.sidebarThemeConfig);var d=Ne(t.iframeTabClickRefresh)?true:t.iframeTabClickRefresh;var v=$e({},t,{sidebarWidth:i,componentSize:a,locale:o,routeList:t.routeList,breads:t.breads||{},logoPath:u,headerThemeConfig:c,sidebarThemeConfig:f,iframeTabClickRefresh:d});var h=[{"--header-bgColor":c==null?void 0:c.bgColor},{"--header-textColor":c==null?void 0:c.textColor},{"--header-menuColor":c==null?void 0:c.menuColor},{"--header-menuActiveTextColor":c==null?void 0:c.menuActiveTextColor},{"--header-menuActiveBgColor":c==null?void 0:c.menuActiveBgColor},{"--header-menuSelectedBgColor":c==null?void 0:c.menuSelectedBgColor},{"--header-menuSelectedTextColor":c==null?void 0:c.menuSelectedTextColor},{"--sidebar-bgColor":f==null?void 0:f.bgColor},{"--sidebar-menuActiveBgColor":f==null?void 0:f.menuActiveBgColor},{"--sidebar-menuActiveTextColor":f==null?void 0:f.menuActiveTextColor},{"--sidebar-menuSelectedBgColor":f==null?void 0:f.menuSelectedBgColor},{"--sidebar-menuSelectedTextColor":f==null?void 0:f.menuSelectedTextColor},{"--sidebar-menuSubMenuBgColor":f==null?void 0:f.menuSubMenuBgColor},{"--sidebar-menuColor":f==null?void 0:f.menuColor}];var m="";h.forEach((function(e){var r=Object.keys(e)[0];if(e[r]){m=m+(r+":"+e[r]+";")}}));document.body.style.cssText=document.body.style.cssText+";"+m;var p=ne(document.getElementById("app"));p.render(J(ge,{basename:n.routeBaseName,children:J(tt,$e({locale:o,componentSize:a,space:{size:a}},t.configProviderProps,{children:J(x,{children:J(ei,{onError:t.onError,onReset:t.onErrorReset,FallbackComponent:t.ErrorFallback||ri,children:J(Gn,$e({},v))})})}))}))};var ni=["breads","level"];var ii=function e(r){var n=r.breads,i=r.level,a=Ie(r,ni);var o=We(),u=o.routeBaseName;var s=Jt(n,u);var l="";if(s.length>=2){var c=i!==undefined&&t(i)?Math.abs(i):1;var f=s[s.length-1-c]||s[s.length-2];if(!!f){l=Ge(f.path,f.query)}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}return J(de,{to:l,children:Q(v,$e({},a,{children:[r.children||"返回"," "]}))})};var ai=function e(r){var n=r.breads,i=r.level;var a=We(),o=a.routeBaseName;var u=Jt(n,o);var s="";if(u.length>=2){var l=i!==undefined&&t(i)?Math.abs(i):1;var c=u[u.length-1-l]||u[u.length-2];if(!!c){s=Ge(c.path,c.query)}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}return{path:s}};var oi=function e(r){var t=r.loading;var n=Ee();var i=s("page",{"page:loading":t,"page-flex":!u(r.fullIndex),"page-windows":n},r.className);var a=f.useCallbackRef((function(){if(!u(r.fullIndex)){return document.querySelector(".page-full")}return document.querySelector(".page")}));return Q(B,{children:[r.bread,Q("div",{style:r.style,className:i,children:[U.map(r.children,(function(e,t){if(t===r.fullIndex){var n;return J(B,{children:V(e,{className:s("page-full",e==null?void 0:(n=e["props"])==null?void 0:n.className)})},t)}return J(B,{children:e},t)})),J(N.BackTop,{target:a}),t&&J(_n,{spinning:true})]})]})};var ui=["respData"],si=["serviceConfig","isAsync","errorRender"];var li=function e(r){var t=r.respData,n=Ie(r,ui);var i=r.children==null?void 0:r.children(t);var a=[];if(Oe(i)){var o=U.toArray(i.props.children);a=o}else if(H(i)){a=[i]}return J(oi,$e({},n,{children:a}))};var ci=Y((function(e,r){var t=e.serviceConfig,n=e.isAsync,i=e.errorRender,a=Ie(e,si);var o=A({status:"loading"}),u=o[0],s=o[1];var l=function e(){return new Promise((function(e,r){var n,i;var a=function(){try{return e()}catch(e){return r(e)}};var o=function(e){try{s({status:"error",respData:e});return a()}catch(e){return r(e)}};try{n=typeof t.params==="function"?t.params():t.params;return Promise.resolve(t.onRequest(n)).then((function(e){try{i=e;s({status:"success",respData:i});return a()}catch(e){return o(e)}}),o)}catch(e){o(e)}}))};Xr(l,[]);var c=f.useCallbackRef((function(){window.location.reload()}));R(r,(function(){return{onRefresh:function e(r){var t=r===undefined?true:r;t&&yt.open();l().finally((function(){t&&yt.close()}))}}}));if(u.status==="error"){var d;if(i){return i(u.respData)}return J(oi,{fullIndex:0,style:{backgroundColor:"#fff"},children:J(T,{status:"error",title:"数据获取异常",subTitle:((d=u.respData)==null?void 0:d.message)||"数据请求异常",extra:[J(v,{type:"primary",onClick:c,children:"重新获取"},"console")]})})}if(u.status==="loading"&&!n){return J(oi,$e({loading:true},a,{children:J(B,{})}))}return J(li,$e({loading:u.status==="loading",respData:u.respData},a))}));export{Qt as Bread,ii as HistoryBackButton,Kn as LayoutPage,oi as Page,ci as PageWrapper,ti as bootstrap,Pt as message,Bt as modal,jt as notification,ai as useHistoryBack,qn as useIframe};
|
|
5
|
+
/*! @flatjs/forge MIT @flatbiz/utils */const Ne=e=>e===undefined||e===null;const Ye=(e,r,t)=>{const n=e||[];if(!t){return n.find((e=>e===r))}return n.find((e=>e[t]===r))};const Ae=(e,r,t)=>{const n=e||[];if(!t){return n.find((e=>e==r))}return n.find((e=>e[t]==r))};const Re=(e,r,t)=>{const n=e||[];if(!t){return n.findIndex((e=>e===r))}return n.findIndex((e=>e[t]===r))};if(!Array.prototype.at){Object.defineProperty(Array.prototype,"at",{enumerable:false,configurable:false,writable:false,value:function e(r){r=Math.trunc(r)||0;if(r<0)r+=this.length;if(r<0||r>=this.length)return undefined;return this[r]}})}if(!Object.is){Object.is=function(e,r){if(e===r){return e!==0||1/e===1/r}else{return e!==e&&r!==r}}}const qe=i(`uuid-${Date.now()}-`,100);const Pe=()=>qe();const je=(e,t)=>{const n=!Ne(e)?String(e):null;if(r(t)){const e=t.map((e=>!Ne(e)?String(e):null));return e.findIndex((e=>n===e))>=0}else{const e=!Ne(t)?String(t):null;return n===e}};const Be="flatbiz";const He={set:(e,r)=>{sessionStorage.setItem(`${Be}_${e}`,JSON.stringify(r))},get:e=>{try{const r=sessionStorage.getItem(`${Be}_${e}`);if(r){return JSON.parse(r)}}catch(e){}return{}},remove:e=>{sessionStorage.removeItem(`${Be}_${e}`)}};const ze=()=>{const e=a.getQueryString("env");return e==="me"};const Ee=()=>/windows|win32|win64/i.test(navigator.userAgent);const We=()=>window["GLOBAL"]||{};const Fe=e=>window[e];const Ke=(e,r,t=false,n)=>{const i={value:"value",parentValue:"parentValue",...n};const a=[];function o(e){const t=r.find((r=>r[i.value]===e));if(t){a.push(t);const e=t[i.parentValue];if(!Ne(e)){o(e)}}}o(e);if(!t){if(a.length>1){return a.splice(1,a.length-1)}return[]}return a.reverse()};const Ue=(e,r)=>{const t=[];function n(e){t.push(e);if(e[r]){e[r].map((e=>{n(e)}))}}e.forEach((e=>{n(e)}));return t};const Ve=(r,t)=>{const n=e({},{label:"label",value:"value",children:"children"},t);const i=n.label;const a=n.value;const o=n.children;const u=[];function s(e,r){u.push({label:e[i],value:e[a],parentValue:r});if(e[o]){e[o].map((r=>{s(r,e[a])}))}}r.forEach((e=>{s(e,undefined)}));return u};const Je=()=>navigator.userAgent.toLowerCase();const Qe=()=>new RegExp("fabric@","i").test(Je());const Ge=(e,t={})=>{const n={...t,ntv_indicator:"1"};const i=a.getQueryString("env");if(i&&i!=="prod"){n.env=i}const o=a.getQueryString("media");if(o){n.media=o}if(window["ntv_indicator"]===false||!Qe()){n.ntv_indicator=undefined}const u=Fe("bizProcessUrlParam");if(r(u)&&u.length>0){u.forEach((e=>{const r=a.getQueryString(e);if(r){n[e]=r}}))}const s=a.getQueryString("fabric-callback-key")||"";if(s){n["fabric-callback-key"]=s}const l=a.getQueryString("accessToken")||"";if(l&&ze()){n.accessToken=l}const c={};Object.keys(n).filter((e=>{if(n[e]!==undefined&&n[e]!==null){c[e]=n[e]}}));return a.modifyQueryString(e,c)};const Ze=(e,r)=>(e||"").replace(/\/$/,"")+"/"+(r||"").replace(/^\//,"");const Xe=(e,...r)=>{let t=e;r.forEach((e=>{t=Ze(t,e)}));return t};const er=e=>!e?false:e.startsWith("//")||new RegExp("(https|http)?://").test(e);const rr=(e,r)=>{if(!n(e)||Ne(e))return"";if(r==="before"||r==="before-after"){if(e.startsWith("/")){e=e.substring(1)}}if(r==="after"||r==="before-after"){if(e.endsWith("/")){e=e.substring(0,e.length-1)}}return e};const tr=(e,r={})=>a.modifyQueryString(e,Object.assign(a.paramStrToJson(window.location.href),r));var nr=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var ar={};var or={get exports(){return ar},set exports(e){ar=e}};var ur;function sr(){if(ur)return ar;ur=1;(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e=1e3,r=6e4,t=36e5,n="millisecond",i="second",a="minute",o="hour",u="day",s="week",l="month",c="quarter",f="year",d="date",v="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}},g=function(e,r,t){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(t)+e},y={s:g,z:function(e){var r=-e.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),i=t%60;return(r<=0?"+":"-")+g(n,2,"0")+":"+g(i,2,"0")},m:function e(r,t){if(r.date()<t.date())return-e(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),i=r.clone().add(n,l),a=t-i<0,o=r.clone().add(n+(a?-1:1),l);return+(-(n+(t-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:f,w:s,d:u,D:d,h:o,m:a,s:i,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=p;var C=function(e){return e instanceof T},S=function e(r,t,n){var i;if(!r)return b;if("string"==typeof r){var a=r.toLowerCase();w[a]&&(i=a),t&&(w[a]=t,i=a);var o=r.split("-");if(!i&&o.length>1)return e(o[0])}else{var u=r.name;w[u]=r,i=u}return!n&&i&&(b=i),i||!n&&b},k=function(e,r){if(C(e))return e.clone();var t="object"==typeof r?r:{};return t.date=e,t.args=arguments,new T(t)},M=y;M.l=S,M.i=C,M.w=function(e,r){return k(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var T=function(){function p(e){this.$L=S(e.locale,null,!0),this.parse(e)}var g=p.prototype;return g.parse=function(e){this.$d=function(e){var r=e.date,t=e.utc;if(null===r)return new Date(NaN);if(M.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(h);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return t?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(r)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return M},g.isValid=function(){return!(this.$d.toString()===v)},g.isSame=function(e,r){var t=k(e);return this.startOf(r)<=t&&t<=this.endOf(r)},g.isAfter=function(e,r){return k(e)<this.startOf(r)},g.isBefore=function(e,r){return this.endOf(r)<k(e)},g.$g=function(e,r,t){return M.u(e)?this[r]:this.set(t,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,r){var t=this,n=!!M.u(r)||r,c=M.p(e),v=function(e,r){var i=M.w(t.$u?Date.UTC(t.$y,r,e):new Date(t.$y,r,e),t);return n?i:i.endOf(u)},h=function(e,r){return M.w(t.toDate()[e].apply(t.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(r)),t)},m=this.$W,p=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case f:return n?v(1,0):v(31,11);case l:return n?v(1,p):v(0,p+1);case s:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return v(n?g-w:g+(6-w),p);case u:case d:return h(y+"Hours",0);case o:return h(y+"Minutes",1);case a:return h(y+"Seconds",2);case i:return h(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,r){var t,s=M.p(e),c="set"+(this.$u?"UTC":""),v=(t={},t[u]=c+"Date",t[d]=c+"Date",t[l]=c+"Month",t[f]=c+"FullYear",t[o]=c+"Hours",t[a]=c+"Minutes",t[i]=c+"Seconds",t[n]=c+"Milliseconds",t)[s],h=s===u?this.$D+(r-this.$W):r;if(s===l||s===f){var m=this.clone().set(d,1);m.$d[v](h),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else v&&this.$d[v](h);return this.init(),this},g.set=function(e,r){return this.clone().$set(e,r)},g.get=function(e){return this[M.p(e)]()},g.add=function(n,c){var d,v=this;n=Number(n);var h=M.p(c),m=function(e){var r=k(v);return M.w(r.date(r.date()+Math.round(e*n)),v)};if(h===l)return this.set(l,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===u)return m(1);if(h===s)return m(7);var p=(d={},d[a]=r,d[o]=t,d[i]=e,d)[h]||1,g=this.$d.getTime()+n*p;return M.w(g,this)},g.subtract=function(e,r){return this.add(-1*e,r)},g.format=function(e){var r=this,t=this.$locale();if(!this.isValid())return t.invalidDate||v;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=M.z(this),a=this.$H,o=this.$m,u=this.$M,s=t.weekdays,l=t.months,c=function(e,t,i,a){return e&&(e[t]||e(r,n))||i[t].slice(0,a)},f=function(e){return M.s(a%12||12,e,"0")},d=t.meridiem||function(e,r,t){var n=e<12?"AM":"PM";return t?n.toLowerCase():n},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:M.s(u+1,2,"0"),MMM:c(t.monthsShort,u,l,3),MMMM:c(l,u),D:this.$D,DD:M.s(this.$D,2,"0"),d:String(this.$W),dd:c(t.weekdaysMin,this.$W,s,2),ddd:c(t.weekdaysShort,this.$W,s,3),dddd:s[this.$W],H:String(a),HH:M.s(a,2,"0"),h:f(1),hh:f(2),a:d(a,o,!0),A:d(a,o,!1),m:String(o),mm:M.s(o,2,"0"),s:String(this.$s),ss:M.s(this.$s,2,"0"),SSS:M.s(this.$ms,3,"0"),Z:i};return n.replace(m,(function(e,r){return r||h[e]||i.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,v){var h,m=M.p(d),p=k(n),g=(p.utcOffset()-this.utcOffset())*r,y=this-p,b=M.m(this,p);return b=(h={},h[f]=b/12,h[l]=b,h[c]=b/3,h[s]=(y-g)/6048e5,h[u]=(y-g)/864e5,h[o]=y/t,h[a]=y/r,h[i]=y/e,h)[m]||y,v?b:M.a(b)},g.daysInMonth=function(){return this.endOf(l).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,r){if(!e)return this.$L;var t=this.clone(),n=S(e,r,!0);return n&&(t.$L=n),t},g.clone=function(){return M.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},p}(),x=T.prototype;return k.prototype=x,[["$ms",n],["$s",i],["$m",a],["$H",o],["$W",u],["$M",l],["$y",f],["$D",d]].forEach((function(e){x[e[1]]=function(r){return this.$g(r,e[0],e[1])}})),k.extend=function(e,r){return e.$i||(e(r,T,k),e.$i=!0),k},k.locale=S,k.isDayjs=C,k.unix=function(e){return k(1e3*e)},k.en=w[b],k.Ls=w,k.p={},k}))})(or);return ar}var lr=sr();var cr=ir(lr);var fr={};var dr={get exports(){return fr},set exports(e){fr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}}}))})(dr);var vr={};var hr={get exports(){return vr},set exports(e){vr=e}};(function(e,r){!function(r,t){e.exports=t(sr())}(nr,(function(e){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(e),n={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,r){return"W"===r?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,r){var t=100*e+r;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(n,null,!0),n}))})(hr);var mr={};var pr={get exports(){return mr},set exports(e){mr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){var t=r.prototype,n=t.format;t.format=function(e){var r=this,t=this.$locale();if(!this.isValid())return n.bind(this)(e);var i=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((r.$M+1)/3);case"Do":return t.ordinal(r.$D);case"gggg":return r.weekYear();case"GGGG":return r.isoWeekYear();case"wo":return t.ordinal(r.week(),"W");case"w":case"ww":return i.s(r.week(),"w"===e?1:2,"0");case"W":case"WW":return i.s(r.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return i.s(String(0===r.$H?24:r.$H),"k"===e?1:2,"0");case"X":return Math.floor(r.$d.getTime()/1e3);case"x":return r.$d.getTime();case"z":return"["+r.offsetName()+"]";case"zzz":return"["+r.offsetName("long")+"]";default:return e}}));return n.bind(this)(a)}}}))})(pr);var gr=mr;var yr={};var br={get exports(){return yr},set exports(e){yr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,t=/\d\d/,n=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},o=function(e){return(e=+e)+(e>68?1900:2e3)};var u=function(e){return function(r){this[e]=+r}},s=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var r=e.match(/([+-]|\d\d)/g),t=60*r[1]+(+r[2]||0);return 0===t?0:"+"===r[0]?-t:t}(e)}],l=function(e){var r=a[e];return r&&(r.indexOf?r:r.s.concat(r.f))},c=function(e,r){var t,n=a.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,r))>-1){t=i>12;break}}else t=e===(r?"pm":"PM");return t},f={A:[i,function(e){this.afternoon=c(e,!1)}],a:[i,function(e){this.afternoon=c(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[t,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,u("seconds")],ss:[n,u("seconds")],m:[n,u("minutes")],mm:[n,u("minutes")],H:[n,u("hours")],h:[n,u("hours")],HH:[n,u("hours")],hh:[n,u("hours")],D:[n,u("day")],DD:[t,u("day")],Do:[i,function(e){var r=a.ordinal,t=e.match(/\d+/);if(this.day=t[0],r)for(var n=1;n<=31;n+=1)r(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,u("month")],MM:[t,u("month")],MMM:[i,function(e){var r=l("months"),t=(l("monthsShort")||r.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],MMMM:[i,function(e){var r=l("months").indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],Y:[/[+-]?\d+/,u("year")],YY:[t,function(e){this.year=o(e)}],YYYY:[/\d{4}/,u("year")],Z:s,ZZ:s};function d(t){var n,i;n=t,i=a&&a.formats;for(var o=(t=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(r,t,n){var a=n&&n.toUpperCase();return t||i[n]||e[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,r,t){return r||t.slice(1)}))}))).match(r),u=o.length,s=0;s<u;s+=1){var l=o[s],c=f[l],d=c&&c[0],v=c&&c[1];o[s]=v?{regex:d,parser:v}:l.replace(/^\[|\]$/g,"")}return function(e){for(var r={},t=0,n=0;t<u;t+=1){var i=o[t];if("string"==typeof i)n+=i.length;else{var a=i.regex,s=i.parser,l=e.slice(n),c=a.exec(l)[0];s.call(r,c),e=e.replace(c,"")}}return function(e){var r=e.afternoon;if(void 0!==r){var t=e.hours;r?t<12&&(e.hours+=12):12===t&&(e.hours=0),delete e.afternoon}}(r),r}}return function(e,r,t){t.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(o=e.parseTwoDigitYear);var n=r.prototype,i=n.parse;n.parse=function(e){var r=e.date,n=e.utc,o=e.args;this.$u=n;var u=o[1];if("string"==typeof u){var s=!0===o[2],l=!0===o[3],c=s||l,f=o[2];l&&(f=o[2]),a=this.$locale(),!s&&f&&(a=t.Ls[f]),this.$d=function(e,r,t){try{if(["x","X"].indexOf(r)>-1)return new Date(("X"===r?1e3:1)*e);var n=d(r)(e),i=n.year,a=n.month,o=n.day,u=n.hours,s=n.minutes,l=n.seconds,c=n.milliseconds,f=n.zone,v=new Date,h=o||(i||a?1:v.getDate()),m=i||v.getFullYear(),p=0;i&&!a||(p=a>0?a-1:v.getMonth());var g=u||0,y=s||0,b=l||0,w=c||0;return f?new Date(Date.UTC(m,p,h,g,y,b,w+60*f.offset*1e3)):t?new Date(Date.UTC(m,p,h,g,y,b,w)):new Date(m,p,h,g,y,b,w)}catch(e){return new Date("")}}(r,u,n),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),c&&r!=this.format(u)&&(this.$d=new Date("")),a={}}else if(u instanceof Array)for(var v=u.length,h=1;h<=v;h+=1){o[1]=u[h-1];var m=t.apply(this,o);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}h===v&&(this.$d=new Date(""))}else i.call(this,e)}}}))})(br);var wr=yr;var Cr={};var Sr={get exports(){return Cr},set exports(e){Cr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r,t){var n=r.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,r,t,n,a){var o=e.name?e:e.$locale(),u=i(o[r]),s=i(o[t]),l=u||s.map((function(e){return e.slice(0,n)}));if(!a)return l;var c=o.weekStart;return l.map((function(e,r){return l[(r+(c||0))%7]}))},o=function(){return t.Ls[t.locale()]},u=function(e,r){return e.formats[r]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,r,t){return r||t.slice(1)}))}(e.formats[r.toUpperCase()])},s=function(){var e=this;return{months:function(r){return r?r.format("MMMM"):a(e,"months")},monthsShort:function(r){return r?r.format("MMM"):a(e,"monthsShort","months",3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(r){return r?r.format("dddd"):a(e,"weekdays")},weekdaysMin:function(r){return r?r.format("dd"):a(e,"weekdaysMin","weekdays",2)},weekdaysShort:function(r){return r?r.format("ddd"):a(e,"weekdaysShort","weekdays",3)},longDateFormat:function(r){return u(e.$locale(),r)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};n.localeData=function(){return s.bind(this)()},t.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(r){return u(e,r)},meridiem:e.meridiem,ordinal:e.ordinal}},t.months=function(){return a(o(),"months")},t.monthsShort=function(){return a(o(),"monthsShort","months",3)},t.weekdays=function(e){return a(o(),"weekdays",null,null,e)},t.weekdaysShort=function(e){return a(o(),"weekdaysShort","weekdays",3,e)},t.weekdaysMin=function(e){return a(o(),"weekdaysMin","weekdays",2,e)}}}))})(Sr);var kr=Cr;var Mr={};var Tr={get exports(){return Mr},set exports(e){Mr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e="minute",r=/[+-]\d\d(?::?\d\d)?/g,t=/([+-]|\d\d)/g;return function(n,i,a){var o=i.prototype;a.utc=function(e){var r={date:e,utc:!0,args:arguments};return new i(r)},o.utc=function(r){var t=a(this.toDate(),{locale:this.$L,utc:!0});return r?t.add(this.utcOffset(),e):t},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),u.call(this,e)};var s=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var l=o.utcOffset;o.utcOffset=function(n,i){var a=this.$utils().u;if(a(n))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(r);if(!n)return null;var i=(""+n[0]).match(t)||["-",0,0],a=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===a?o:-o}(n),null===n))return this;var o=Math.abs(n)<=16?60*n:n,u=this;if(i)return u.$offset=o,u.$u=0===n,u;if(0!==n){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(o+s,e)).$offset=o,u.$x.$localOffset=s}else u=this.utc();return u};var c=o.format;o.format=function(e){var r=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,r)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var f=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=o.diff;o.diff=function(e,r,t){if(e&&this.$u===e.$u)return d.call(this,e,r,t);var n=this.local(),i=a(e).local();return d.call(n,i,r,t)}}}))})(Tr);var xr=Mr;var Dr={};var Or={get exports(){return Dr},set exports(e){Dr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.weekday=function(e){var r=this.$locale().weekStart||0,t=this.$W,n=(t<r?t+7:t)-r;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")}}}))})(Or);var $r=Dr;var _r={};var Lr={get exports(){return _r},set exports(e){_r=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){var e="week",r="year";return function(t,n,i){var a=n.prototype;a.week=function(t){if(void 0===t&&(t=null),null!==t)return this.add(7*(t-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var a=i(this).startOf(r).add(1,r).date(n),o=i(this).endOf(e);if(a.isBefore(o))return 1}var u=i(this).startOf(r).date(n).startOf(e).subtract(1,"millisecond"),s=this.diff(u,e,!0);return s<0?i(this).startOf("week").week():Math.ceil(s)},a.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}))})(Lr);var Ir=_r;var Nr={};var Yr={get exports(){return Nr},set exports(e){Nr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.weekYear=function(){var e=this.month(),r=this.week(),t=this.year();return 1===r&&11===e?t+1:0===e&&r>=52?t-1:t}}}))})(Yr);var Ar=Nr;var Rr={};var qr={get exports(){return Rr},set exports(e){Rr=e}};(function(e,r){(function(t,n){var i={};if(t.PubSub){i=t.PubSub;console.warn("PubSub already loaded, using existing version")}else{t.PubSub=i;n(i)}{if(e!==undefined&&e.exports){r=e.exports=i}r.PubSub=i;e.exports=r=i}})(typeof window==="object"&&window||nr,(function(e){var r={},t=-1,n="*";function i(e){var r;for(r in e){if(Object.prototype.hasOwnProperty.call(e,r)){return true}}return false}function a(e){return function r(){throw e}}function o(e,r,t){try{e(r,t)}catch(e){setTimeout(a(e),0)}}function u(e,r,t){e(r,t)}function s(e,t,n,i){var a=r[t],s=i?u:o,l;if(!Object.prototype.hasOwnProperty.call(r,t)){return}for(l in a){if(Object.prototype.hasOwnProperty.call(a,l)){s(a[l],e,n)}}}function l(e,r,t){return function i(){var a=String(e),o=a.lastIndexOf(".");s(e,e,r,t);while(o!==-1){a=a.substr(0,o);o=a.lastIndexOf(".");s(e,a,r,t)}s(e,n,r,t)}}function c(e){var t=String(e),n=Boolean(Object.prototype.hasOwnProperty.call(r,t)&&i(r[t]));return n}function f(e){var r=String(e),t=c(r)||c(n),i=r.lastIndexOf(".");while(!t&&i!==-1){r=r.substr(0,i);i=r.lastIndexOf(".");t=c(r)}return t}function d(e,r,t,n){e=typeof e==="symbol"?e.toString():e;var i=l(e,r,n),a=f(e);if(!a){return false}if(t===true){i()}else{setTimeout(i,0)}return true}e.publish=function(r,t){return d(r,t,false,e.immediateExceptions)};e.publishSync=function(r,t){return d(r,t,true,e.immediateExceptions)};e.subscribe=function(e,n){if(typeof n!=="function"){return false}e=typeof e==="symbol"?e.toString():e;if(!Object.prototype.hasOwnProperty.call(r,e)){r[e]={}}var i="uid_"+String(++t);r[e][i]=n;return i};e.subscribeAll=function(r){return e.subscribe(n,r)};e.subscribeOnce=function(r,t){var n=e.subscribe(r,(function(){e.unsubscribe(n);t.apply(this,arguments)}));return e};e.clearAllSubscriptions=function e(){r={}};e.clearSubscriptions=function e(t){var n;for(n in r){if(Object.prototype.hasOwnProperty.call(r,n)&&n.indexOf(t)===0){delete r[n]}}};e.countSubscriptions=function e(t){var n;var i;var a=0;for(n in r){if(Object.prototype.hasOwnProperty.call(r,n)&&n.indexOf(t)===0){for(i in r[n]){a++}break}}return a};e.getSubscriptions=function e(t){var n;var i=[];for(n in r){if(Object.prototype.hasOwnProperty.call(r,n)&&n.indexOf(t)===0){i.push(n)}}return i};e.unsubscribe=function(t){var n=function(e){var t;for(t in r){if(Object.prototype.hasOwnProperty.call(r,t)&&t.indexOf(e)===0){return true}}return false},i=typeof t==="string"&&(Object.prototype.hasOwnProperty.call(r,t)||n(t)),a=!i&&typeof t==="string",o=typeof t==="function",u=false,s,l,c;if(i){e.clearSubscriptions(t);return}for(s in r){if(Object.prototype.hasOwnProperty.call(r,s)){l=r[s];if(a&&l[t]){delete l[t];u=t;break}if(o){for(c in l){if(Object.prototype.hasOwnProperty.call(l,c)&&l[c]===t){delete l[c];u=true}}}}}return u}}))})(qr,Rr);var Pr={};var jr={get exports(){return Pr},set exports(e){Pr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.isSameOrAfter=function(e,r){return this.isSame(e,r)||this.isAfter(e,r)}}}))})(jr);var Br=Pr;var Hr={};var zr={get exports(){return Hr},set exports(e){Hr=e}};(function(e,r){!function(r,t){e.exports=t()}(nr,(function(){return function(e,r){r.prototype.isSameOrBefore=function(e,r){return this.isSame(e,r)||this.isBefore(e,r)}}}))})(zr);var Er=Hr;var Wr=Object.prototype.hasOwnProperty;function Fr(e,r,t){for(t of e.keys()){if(Kr(t,r))return t}}function Kr(e,r){var t,n,i;if(e===r)return true;if(e&&r&&(t=e.constructor)===r.constructor){if(t===Date)return e.getTime()===r.getTime();if(t===RegExp)return e.toString()===r.toString();if(t===Array){if((n=e.length)===r.length){while(n--&&Kr(e[n],r[n]));}return n===-1}if(t===Set){if(e.size!==r.size){return false}for(n of e){i=n;if(i&&typeof i==="object"){i=Fr(r,i);if(!i)return false}if(!r.has(i))return false}return true}if(t===Map){if(e.size!==r.size){return false}for(n of e){i=n[0];if(i&&typeof i==="object"){i=Fr(r,i);if(!i)return false}if(!Kr(n[1],r.get(i))){return false}}return true}if(t===ArrayBuffer){e=new Uint8Array(e);r=new Uint8Array(r)}else if(t===DataView){if((n=e.byteLength)===r.byteLength){while(n--&&e.getInt8(n)===r.getInt8(n));}return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===r.byteLength){while(n--&&e[n]===r[n]);}return n===-1}if(!t||typeof e==="object"){n=0;for(t in e){if(Wr.call(e,t)&&++n&&!Wr.call(r,t))return false;if(!(t in r)||!Kr(e[t],r[t]))return false}return Object.keys(r).length===n}}return e!==e&&r!==r}require("./index.css");function Ur(){Ur=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t){if(Object.prototype.hasOwnProperty.call(t,n)){e[n]=t[n]}}}return e};return Ur.apply(this,arguments)}function Vr(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var i,a;for(a=0;a<n.length;a++){i=n[a];if(r.indexOf(i)>=0)continue;t[i]=e[i]}return t}var Jr=function e(){var t=We(),n=t.elemAclLimits;var i=r(n)?n:[];return i};var Qr=function e(r){if(!r)return true;var t=Jr();if(t.includes(r)){return true}return false};var Gr=function e(r){var t=A(false),n=t[0],i=t[1];var a=Ne(r.debounceDuration)?500:r.debounceDuration;var o=f.useDebounceClick((function(e){var t=r.onClick;if(!t){return}var n=t(e);if(n&&c(n)){i(true);n.catch((function(e){console.error(e)})).finally((function(){i(false)}))}}),a);if(!Qr(r.permission)){return null}if(r.hidden){return null}return J(v,Ur({},r,{onClick:o,loading:n,children:r.children}))};var Zr=function e(r,t){return z(r,t)};var Xr=function e(r,t){z((function(){function e(){return new Promise((function(e,t){return Promise.resolve(r()).then((function(r){try{return e()}catch(e){return t(e)}}),t)}))}void e()}),t)};var et=function e(r){var t=A(r),n=t[0],i=t[1];var a=f.useIsMounted();return[n,function(e){if(a.current){return i(e)}}]};var rt=["locale"];cr.extend(wr);cr.extend(gr);cr.extend($r);cr.extend(kr);cr.extend(Ir);cr.extend(Ar);cr.extend(xr);var tt=function e(r){var t=r.locale,n=Vr(r,rt);Zr((function(){cr.locale(r.locale||"zh-cn")}),[]);return J(S,Ur({componentSize:"middle",space:{size:"middle"}},n,{locale:t==="en"?G:Z,children:r.children}))};var nt=["menuList"],it=["text","color","permission","needConfirm","confirmMessage","hidden","type","style","popconfirmProps"];var at=function e(r){var t=r.menuList,n=Vr(r,nt);var i=A([]),a=i[0],o=i[1];var u=A({}),s=u[0],l=u[1];var d=f.useCallbackRef((function(e,r){var t;r.stopPropagation();l((t={},t[e]={open:true},t))}));var h=f.useCallbackRef((function(e,r,t){t.stopPropagation();var n=e.onClick==null?void 0:e.onClick(t);if(n&&c(n)){s[r]={loading:true,open:true};l(Ur({},s));n.finally((function(){s[r]={loading:false,open:false};l(Ur({},s))}));return}s[r]={loading:false,open:false};l(Ur({},s))}));var m=f.useCallbackRef((function(e,r){r.stopPropagation();return e.onClick==null?void 0:e.onClick(r)}));Zr((function(){var e=[];t.filter(Boolean).forEach((function(r,t){var n,i;if(!r)return;var a=r.text,o=r.color,u=r.permission,c=r.needConfirm,f=r.confirmMessage,p=r.hidden,g=r.type,b=r.style,w=r.popconfirmProps,C=Vr(r,it);if(p)return;if(u&&!Qr(u))return;var S=o?Ur({color:o},b):b;var k=g||"link";var M={key:t,label:E(Gr,Ur({size:"small"},C,{type:k,style:S,key:t,onClick:m.bind(null,r)}),a)};var T={key:t,label:E(y,Ur({okText:"确定",cancelText:"取消",trigger:["click"],destroyTooltipOnHide:true},w,{title:f,onConfirm:h.bind(null,r,t),onCancel:function e(r){r==null?void 0:r.stopPropagation();l({})},overlayClassName:"dmw-popconfirm",arrowPointAtCenter:true,key:t,overlayStyle:{zIndex:10},open:((n=s[t])==null?void 0:n.open)||false,okButtonProps:{loading:(i=s[t])==null?void 0:i.loading}}),J(v,Ur({size:"small",danger:true},C,{onClick:d.bind(null,t),type:k,style:S,children:a})))};if(c&&!C.disabled){e.push(T)}else{e.push(M)}}));o(e)}),[t,s]);return J(b,Ur({trigger:(n==null?void 0:n.trigger)||["hover"],arrow:{pointAtCenter:true}},n,{overlayStyle:Ur({zIndex:9},n.overlayStyle),menu:{items:a},onOpenChange:function e(r){if(!r){l({})}},children:r.children}))};var ot=function r(t){var n=e({"request-success":"暂无数据","request-progress":"数据查询中","request-error":"数据查询异常","request-init":"暂无数据","no-dependencies-params":"未获取到依赖查询条件"},t.messageConfig);var i=P((function(){if(t.status&&je(t.status,["request-success","request-progress","request-error","no-dependencies-params"])){return n[t.status]}return n["request-init"]}),[n,t.status]);return Q(w,{image:w.PRESENTED_IMAGE_SIMPLE,description:i,className:"v-request-status",children:[J(p,{spinning:t.loading||false}),t.status==="request-error"&&t.errorButton]})};var ut={selectorList:[],queryIsEmpty:false,requestStatus:"request-init"};var st={actions:{setSelectBoxList:function e(r){return function(e){e.selectorList=r.selectorList||[];e.requestStatus="request-success"}},changeRequestStatus:function e(r){return function(e){e.requestStatus=r}}},state:ut};var lt={};var ct=function e(r){if(!lt[r]){lt[r]=re(st)}return lt[r]};var ft=["serviceConfig","modelKey","fieldNames","isDynamicLoad","requestMessageConfig","onSelectorListChange"];Y((function(r,t){var n=r.serviceConfig,i=r.modelKey,a=r.fieldNames,o=r.isDynamicLoad,u=r.requestMessageConfig,l=r.onSelectorListChange,c=Vr(r,ft);var h=A([]),m=h[0],p=h[1];var g=n||{};var y=et(false),b=y[0],w=y[1];var S=ct(i).useStore(),k=S[0],M=S[1];var T="request-progress-"+r.modelKey;var x=e(true,{label:"label",value:"value",children:"children"},a);var D=A(),O=D[0],$=D[1];var _=function e(r){var t=g.onRequestResultAdapter?g.onRequestResultAdapter(r):r;return t||[]};var L=f.useCallbackRef((function(){return new Promise((function(e,r){var t,n;if(!g.onRequest){return r(new Error("onRequest 调用接口服务不能为空"))}var i=function(){try{return e()}catch(e){return r(e)}};var a=function(e){try{w(false);window[T]=false;void M.changeRequestStatus("request-error");void C.error(e.message||"获取数据异常");return i()}catch(e){return r(e)}};try{w(true);window[T]=true;void M.changeRequestStatus("request-progress");return Promise.resolve(g.onRequest==null?void 0:g.onRequest(g.params)).then((function(e){try{t=e;n=_(t);if(o){n.map((function(e){e.isLeaf=e.isLeaf||false}))}w(false);window[T]=false;void M.setSelectBoxList({selectorList:n||[]});l==null?void 0:l(n||[]);return i()}catch(e){return a(e)}}),a)}catch(e){a(e)}}))}));Zr((function(){if(window[T])return;if(k.requestStatus==="request-success"){p(ee(k.selectorList))}else{void L()}}),[]);Zr((function(){var e=ee(k.selectorList);if(r.value){var t=Ke(r.value,Ve(e,x),true);if(t.length===0){$([r.value])}else{$(t.map((function(e){return e.value})))}}else{$(undefined)}p(e)}),[k.selectorList,r.value]);R(t,(function(){return{getCascaderList:function e(){return k.selectorList}}}));var I=f.useCallbackRef((function(){void L()}));var N=function e(r){return new Promise((function(e,t){var n,i,a,o;i=r[r.length-1];i.loading=true;return Promise.resolve(g.onRequest==null?void 0:g.onRequest(Ur({},g.params,(n={},n[x.value]=i[x.value],n)))).then((function(r){try{a=r;o=_(a);if(!o||o.length===0){i.isLeaf=true}else{o.map((function(e){e.isLeaf=e.isLeaf||false}));i.children=o}i.loading=false;void M.setSelectBoxList({selectorList:m||[]});l==null?void 0:l(m||[]);p([].concat(m));return e()}catch(e){return t(e)}}),t)}))};var Y=f.useCallbackRef((function(e,t){void(r.onChange==null?void 0:r.onChange(e==null?void 0:e[e.length-1],t))}));var q=f.useCallbackRef((function(){void(r.onChange==null?void 0:r.onChange(undefined))}));return J(d,Ur({showSearch:true,allowClear:true},c,{popupClassName:s("cascader-wrapper-popup",c.popupClassName),notFoundContent:J(ot,{status:k.requestStatus,loading:b,messageConfig:u,errorButton:J(v,{type:"primary",onClick:I,children:"重新获取数据"})}),loading:b,loadData:o?N:undefined,fieldNames:x,suffixIcon:k.requestStatus==="request-error"?J(X,{spin:b,onClick:I}):undefined,options:m,value:O,multiple:false,onChange:Y,onClear:q}))}));var dt=te();dt[0];dt[1];var vt;(function(e){e["YMDHms"]="YYYY-MM-DD HH:mm:ss";e["YMDHm"]="YYYY-MM-DD HH:mm";e["YMDH"]="YYYY-MM-DD HH";e["YMD"]="YYYY-MM-DD"})(vt||(vt={}));var ht;(function(e){e["Hms"]="HH:mm:ss";e["Hm"]="HH:mm";e["H"]="HH";e["ms"]="mm:ss";e["m"]="mm";e["s"]="ss"})(ht||(ht={}));Y((function(e,r){R(r,(function(){return{onChange:function r(t){e.onChange==null?void 0:e.onChange(t)}}}));return J(h,{value:e.value})}));var mt=function e(){var r=document.createElement("div");var t="id_"+Date.now();r.setAttribute("id",t);document.body.append(r);return{divElement:r,elementId:t}};var pt=function e(r){try{document.body.removeChild(document.querySelector(r))}catch(e){}};var gt=function e(r){var t=r.elementId;var n=k.useToken(),i=n.token;var a=i.colorPrimary;var o=A(true),u=o[0],l=o[1];var c=f.useCallbackRef((function(){try{delete window[t]}catch(e){}l(false)}));Zr((function(){window[t]=c}),[c]);var d=f.useCallbackRef((function(){pt("#"+t)}));return J(M,{maskClosable:false,centered:true,destroyOnClose:true,className:s("v-dialog-loading",r.className),open:u,afterClose:d,getContainer:r.divElement,footer:null,closable:false,style:{"--v-loading-color":a},children:J("div",{className:s("v-dialog-loading-content"),children:Q("div",{className:"loader-wrapper",children:[J("div",{className:"loader-inner"}),J("div",{className:"loader-text",children:r.message||"处理中"})]})})})};var yt={open:function e(r){var t=mt(),n=t.divElement,i=t.elementId;window["__dialog_loading_elementId"]=i;var a=ne(n);a.render(J(gt,Ur({},r,{divElement:n,elementId:i})));return{close:function e(){var r,t;(r=(t=window)[i])==null?void 0:r.call(t)}}},close:function e(){try{var r,t;var i=window["__dialog_loading_elementId"];if(n(i))(r=(t=window)[i])==null?void 0:r.call(t)}catch(e){}}};var bt=te();bt[0];var wt=bt[1];var Ct={queryCondition:{},isInit:true};var St={actions:{updateFilterCondition:function e(r){return function(e){e.queryCondition=Ur({},e.queryCondition,r)}},resetFilterCondition:function e(){return function(e){e.queryCondition=Ct.queryCondition}},updateInitStatus:function e(){return function(e){e.isInit=false}}},state:Ct};var kt={};var Mt=function e(r){if(!kt[r]){kt[r]=re(St)}return kt[r]};Y((function(e,t){var n;var i=A([]),a=i[0],o=i[1];var u=A(0),s=u[0],l=u[1];var c=A(false),d=c[0],v=c[1];var h=Mt(e.modelKey).useStore(),p=h[0],g=h[1];var y=e.pageSize||((n=e.initialPaginationParams)==null?void 0:n.pageSize)||10;var b=e.initRequest===undefined?true:e.initRequest;var w=A(false),S=w[0],k=w[1];var M=Ur({list:"list",total:"tatal",pageNo:"pageNo",pageSize:"pageSize"},e.fieldNames);var T=m.useForm(),x=T[0];var D=f.useCallbackRef((function(t){return new Promise((function(n,i){var a,u,s,c,f,d,h,m,p,y;var b=function(){try{return n()}catch(e){return i(e)}};var w=function(e){try{v(false);void C.error(e.message);return b()}catch(e){return i(e)}};try{v(true);return Promise.resolve(g.updateFilterCondition(t)).then((function(t){try{a=t;u=ee(a.queryCondition||{});s=e.serviceConfig,c=s.requestParamsAdapter,f=s.onRequest,d=s.requestResultAdapter;h=c?c(u):u;return Promise.resolve(f(h)).then((function(t){try{m=t||{};e.onDataSourceChange==null?void 0:e.onDataSourceChange(m);p=d?d(m):m;y=p[M.list];o(r(y)?y:[]);l(p[M.total]);v(false);return b()}catch(e){return w(e)}}),w)}catch(e){return w(e)}}),w)}catch(e){w(e)}}))}));var O=f.useCallbackRef((function(e){return new Promise((function(r,t){return Promise.resolve(g.resetFilterCondition()).then((function(n){try{x.resetFields();if(e){void g.updateFilterCondition(e);x.setFieldsValue(e)}return r()}catch(e){return t(e)}}),t)}))}));var $=f.useCallbackRef((function(r){return new Promise((function(t,n){var i;return Promise.resolve(g.resetFilterCondition()).then((function(a){try{x.resetFields();if(S){void D(Ur((i={},i[M.pageNo]=1,i[M.pageSize]=y,i),e.initialValues,r))}else{void D(Ur({},e.initialValues,r))}return t()}catch(e){return n(e)}}),n)}))}));var _=function e(){return Ur({},p.queryCondition,x.getFieldsValue())};R(t,(function(){return{onRequest:D,clearQueryCondition:O,getRequestParams:_,onResetRequest:$,form:x}}));var L=function e(r){k(r)};return J(wt,{value:{modelKey:e.modelKey,onRequest:D,tableList:a,tableTotal:s,loading:d,fieldNames:M,pageSize:y,initRequest:b,initialValues:e.initialValues||{},onSetPaginationStatus:L,paginationStatus:S},children:J(m,{form:x,initialValues:Ur({},e.initialValues,p.queryCondition),children:e.children})})}));q({editable:false,showEditableIcon:false,isCtx:false});var Tt=["value"];var xt=function e(r){var t=r.value,n=Vr(r,Tt);var i=j();var a=j(true);var o=A(0),u=o[0],s=o[1];Zr((function(){if(Ne(t)&&a.current)return;a.current=false;if(t===i.current&&!Ne(t))return;s(Date.now())}),[t]);var l=f.useCallbackRef((function(e){if(e.nativeEvent["inputType"]==="insertCompositionText"){return}i.current=e.target.value;r.onChange==null?void 0:r.onChange(e)}));var c=f.useCallbackRef((function(e){l(e)}));return E(h.Search,Ur({},n,{key:u,onCompositionEnd:c,onChange:l,defaultValue:t}))};cr.extend(Er);cr.extend(Br);Y((function(e,r){R(r,(function(){return{onChange:function r(t){e.onChange==null?void 0:e.onChange(t)}}}));return J(h,{value:e.value})}));var Dt={treeList:[],treeTiledArray:[],queryIsEmpty:false};var Ot={actions:{setTreeList:function e(r){return function(e){e.treeList=r.treeList||[];e.treeTiledArray=Ue(e.treeList,r.childrenName);e.requestStatus="request-success"}},resetTreeList:function e(){return function(e){e.treeList=[]}},changeRequestStatus:function e(r){return function(e){e.requestStatus=r;if(r==="request-error"){e.treeList=[]}}},treeListAppendChildren:function e(t){return function(e){var n=Ue(e.treeList,t.childrenName);var i=n.find((function(e){return e[t.valueName]===t.value}));if(i){if(r(t.appendList)&&t.appendList.length>0){i[t.childrenName]=t.appendList}else{i.isLeaf=true}}e.treeTiledArray=Ue(e.treeList,t.childrenName)}}},state:Dt};var $t={};var _t=function e(r){if(!$t[r]){$t[r]=re(Ot)}return $t[r]};var Lt=function e(r,t,n){var i=Ve(t,n);return Ke(r,i,true,{value:"value",parentValue:"parentValue"})};var It=function e(t,n){var i=Ne(t)?[]:t;i=r(i)?i:[i];i=i.map((function(e){if(oe(e))return e[n.value];return e}));return i};var Nt=function e(r,t){var n=It(r,t);var i={};n.forEach((function(e){i[e]=true}));return i};var Yt=function e(r,t,n){if(Ne(r)&&Ne(t))return true;var i=Nt(r,n);var a=Nt(t,n);var o=Kr(i,a);return o};var At=["serviceConfig","effectDependencyList","selectorTreeList","value","onChange","modelKey","checkableResponseParentNode","checkable","onSelectorTreeListChange","treeItemDataAdapter","searchValue","showSearch","searchPlaceholder","requestMessageConfig","labelInValueFieldNames","labelInValue","disabledCanUse"];var Rt=Y((function(t,n){var i=t.serviceConfig,a=t.effectDependencyList,u=t.selectorTreeList,l=t.value,c=t.onChange,d=t.modelKey,h=t.checkableResponseParentNode,m=h===void 0?true:h,y=t.checkable,b=t.onSelectorTreeListChange,w=t.treeItemDataAdapter,S=t.searchValue,k=t.showSearch,M=t.searchPlaceholder,T=t.requestMessageConfig,x=t.labelInValueFieldNames,D=t.labelInValue,O=t.disabledCanUse,$=Vr(t,At);var _=t.hasOwnProperty("selectorTreeList");var L=i||{};var I=a||[];var N=A(),Y=N[0],q=N[1];var z=_t(d).useStore(),E=z[0],W=z[1];var F=et(false),K=F[0],U=F[1];var V="request-progress-"+t.modelKey;var G=P((function(){return Ur({label:"label",value:"value",children:"children"},t.fieldNames)}),[t.fieldNames]);var Z=j();var X=y===true;var re=P((function(){return Ur({label:"label",value:"value"},x)}),[x]);var te=A(),ne=te[0],ie=te[1];var ae=j(true);var oe=A(0),se=oe[0],le=oe[1];var ce=j();var fe=P((function(){var e=It(l,re);return e}),[re,l]);Zr((function(){if(Ne(l)&&ae.current||E.treeList.length==0)return;ae.current=false;if(!Yt(l,ce.current,re)){console.log("modelKey:"+d+" TreeWrapper key refresh",l,ce.current);ce.current=X?fe:fe[0];var e=pe(fe,true);q(Array.from(new Set(e)));Z.current=fe;le(Date.now())}}),[l,E.treeList]);var de=function e(r){return r===""||Ne(r)};var ve=function e(r){var t=L.onRequestResultAdapter?L.onRequestResultAdapter(r):r;return t};Zr((function(){ie(S)}),[S]);var he=f.useCallbackRef((function(){return new Promise((function(r,t){var n,i,a,o,u;var s=function(){try{return r()}catch(e){return t(e)}};var l=function(e){try{U(false);void C.error(e.message||"数据查询异常...");return s()}catch(e){return t(e)}};try{if(!L.onRequest){throw new Error("onRequest 调用接口服务不能为空")}n=L.requiredParamsKeys;i=e({},L.params);if(n){a=n.find((function(e){return de(i[e])}));if(a){console.warn("TreeWrapper组件:参数:"+n.join("、")+"不能为空");return r()}}var c=function(){try{return s()}catch(e){return l(e)}};var f=function(e){try{window[V]=false;U(false);void W.changeRequestStatus("request-error");return c()}catch(e){return l(e)}};try{U(true);void W.changeRequestStatus("request-progress");window[V]=true;return Promise.resolve(L.onRequest==null?void 0:L.onRequest(i)).then((function(e){try{o=e;u=ve(o);me(u||[]);U(false);window[V]=false;return c()}catch(e){return f(e)}}),f)}catch(r){f(r)}}catch(r){l(r)}}))}));Zr((function(){if(_)return;if(Boolean(I.length)){void he();return}var e=_t(d).getState();if(e.requestStatus==="request-success"){return}if(!window[V]){void he();return}}),I);Zr((function(){if(_){me(u||[])}}),[u]);var me=f.useCallbackRef((function(e){if((e==null?void 0:e.length)===0&&E.treeList.length===0){return}void W.setTreeList({treeList:e||[],childrenName:G.children});b==null?void 0:b(e)}));var pe=f.useCallbackRef((function(e,r){var t=[];e.forEach((function(e){if(!r&&Y!=null&&Y.includes(e))return;var n=Lt(e,E.treeList,G);t=t.concat(n.map((function(e){return e.value})))}));return t}));f.useUpdateEffect((function(){if(ne){var e=Ve(E.treeList||[],G);var r=e.filter((function(e){var r;return(r=e.label)==null?void 0:r.includes(ne||"")}));q((function(e){var t=pe(r.map((function(e){return e.value}))).concat(e||[]);return Array.from(new Set(t))}))}else{q([])}}),[ne]);R(n,(function(){return{onClearSelectorList:function e(){void W.resetTreeList()},getTreeDataList:function e(){return E.treeList}}}));var ge=f.useCallbackRef((function(e){q(e)}));var ye=f.useCallbackRef((function(e,t,n){ce.current=e;var i=Ne(t)?[]:r(t)?t:[t];if(Ne(e)){c==null?void 0:c(e,t,n);return}if(D){var a=re.label;var o=re.value;var u=i.map((function(e){var r;return r={},r[a]=e[G.label],r[o]=e[G.value],r}));if(r(e)){c==null?void 0:c(u,i,n)}else{c==null?void 0:c(u[0],i[0],n)}}else{if(r(e)){c==null?void 0:c(e,i,n)}else{c==null?void 0:c(e,i[0],n)}}}));var be=f.useCallbackRef((function(e,n){var i=t.checkStrictly?e.checked:e;i=Ne(e)?[]:e;i=r(i)?i:[i];var a=[];var o=[];var u=[];var s=[];i.forEach((function(e){var t=E.treeTiledArray.find((function(r){return r[G.value]===e}));if(!t)return;var n=t==null?void 0:t[G.children];if(!r(n)||n.length===0){a.push(t);o.push(t[G.value])}u.push(t);s.push(t[G.value])}));if(y){q((function(e){var r=pe(o).concat(e||[]);return Array.from(new Set(r))}));if(!m&&!t.checkStrictly){ye(o,a,u)}else{ye(s,u,u)}}else{if(i[0]){var l=u.find((function(e){return e[G.value]===i[0]}));ye(i[0],l,[l])}else{var c=n.node[G.value];var f=E.treeTiledArray.find((function(e){return e[G.value]===c}));ye(undefined,f,[f])}}}));var we=f.useCallbackRef((function(e){return w==null?void 0:w(e)}));var Ce=P((function(){var e=function e(t){return t==null?void 0:t.map((function(t){var n;var i=(we==null?void 0:we(t))||t;var a=O?undefined:i.disabled;var o=i[G.label];var u;if(ne){var l=o.indexOf(ne);var c=o.substring(0,l);var f=o.slice(l+ne.length);u=l>-1?Q("span",{className:s({"v-tree-item-disabled":i.disabled}),children:[c,J("span",{className:"site-tree-search-value",children:ne}),f]}):null}if(!u){u=J("span",{className:s({"v-tree-item-disabled":i.disabled}),children:o})}var d=i[G.children];return Ur({},i,(n={disabled:a},n[G.label]=u,n._treeItemName=o,n._disabled=i.disabled,n[G.children]=r(d)&&d.length>0?e(d):undefined,n))}))};var t=ee(E.treeList||[]);return e(t)}),[E.treeList,we,O,G.label,G.children,ne]);var Se=f.useCallbackRef((function(e){return new Promise((function(r,n){return new Promise((function(i,a){var o,u,s,l;if(e[G.children]){r();return i()}var c=function(){try{return i()}catch(e){return a(e)}};var f=function(e){try{void C.error(e.message||"数据加载异常...");n();return c()}catch(e){return a(e)}};try{return Promise.resolve((o=t.loadDataServiceConfig)==null?void 0:o.onRequest==null?void 0:o.onRequest((u=t.loadDataServiceConfig)==null?void 0:u.getParams==null?void 0:u.getParams(e))).then((function(t){try{s=t;l=L.onRequestResultAdapter?L.onRequestResultAdapter(s):s;void W.treeListAppendChildren({value:e[G.value],appendList:l,childrenName:G.children,valueName:G.value}).then((function(e){me(e.treeList);r()}));return c()}catch(t){return f(t)}}),f)}catch(e){f(e)}}))}))}));var ke=f.useCallbackRef((function(e){var r=e==null?void 0:e[G.children];var n=t.loadDataFlag;var i=n?!e.isLeaf:false;var a=r&&r.length>0||i;return!a}));var Me=f.useCallbackRef((function(e){var r;var n=e._treeItemName||e[G.label];var i=t.getMenuOptions==null?void 0:t.getMenuOptions(Ur({},e,(r={},r[G.label]=n,r)));if(!i||i.length===0){return J("span",{className:"tree-item-title",children:e==null?void 0:e[G.label]})}return Q(B,{children:[J("span",{className:"tree-item-title",children:e==null?void 0:e[G.label]}),J(at,{menuList:i,children:J(o,{})})]})}));var Te=f.useDebounceCallback((function(e){ie(e);t.onSearchValueChange==null?void 0:t.onSearchValueChange(e)}),300);var xe=f.useCallbackRef((function(e){Te(e.target.value)}));var De=f.useCallbackRef((function(e){if(!t.icon)return null;if(H(t.icon))return t.icon;var r=ke(e.data);return t.icon(Ur({},e,{isParent:!r,isLeaf:r}))}));var Oe=P((function(){return{title:G.label,key:G.value,children:G.children}}),[G]);if(E.treeList.length>0&&E.requestStatus!=="request-error"){var $e=Ur({showLine:{showLeafIcon:false},titleRender:Me,blockNode:true,switcherIcon:J(ue,{})},$,{fieldNames:Oe,expandedKeys:Y,treeData:Ce,onExpand:ge,loadData:t.loadDataFlag?Se:undefined,style:Ur({width:"100%"},$.style),icon:De});var _e={onCheck:be,checkable:y,defaultCheckedKeys:Z.current};var Le={onSelect:be,multiple:false,defaultSelectedKeys:Z.current};var Ie=y?_e:Le;return Q("div",{className:"v-tree-wrapper",children:[J(p,{spinning:K,className:"v-tree-wrapper-loading"}),k?J(xt,{className:"v-tree-wrapper-search",style:{marginBottom:12},placeholder:M,onChange:xe,value:S,allowClear:true}):null,J(g,Ur({},Ie,$e,{className:"v-tree-wrapper-tree"}),se)]})}return J(ot,{status:E.requestStatus,loading:K,messageConfig:T,errorButton:J(v,{type:"primary",onClick:he,children:"重新获取数据"})})}));Rt.defaultProps={disabledCanUse:true};var qt=function e(){return J(T,{status:"404",title:"404",subTitle:"Sorry, 您访问的地址不存在"})};var Pt;var jt;var Bt;var Ht=function(){var e=x.useApp();Pt=e.message;Bt=e.modal;jt=e.notification;return null};function zt(){var e=q(undefined);function r(){var r=W(e);if(r===undefined)throw new Error("useCtx must be inside a Provider with a value");return r}return[r,e.Provider]}var Et=zt(),Wt=Et[0],Ft=Et[1];var Kt=function e(r,t){if(t===void 0){t=false}r=r.replace(/\/$/,"");return t?r+"/":r};var Ut=function e(r){if(r===void 0){r=[]}return r.slice(0).sort((function(e,r){return(r.path||"").length-(e.path||"").length}))};var Vt=function e(r,t){return Kt(r,true).startsWith(Kt(t,true))};var Jt=function e(r,t){var n=se();var i=le();var o=ce(),u=o[0];var s=typeof r==="function"?r({params:n,search:u}):r||{};t=Kt(t,false);var l=i.pathname.replace(t,"");var c=l.replace(/^\//,"").substring(l.replace(/^\//,"").indexOf("/"));var f=[];var d=Object.keys(s);var v=[];var h="";var m="";for(var p=0;p<d.length;p++){var g=d[p];if(Kt(c,true).startsWith(Kt(g,true))){v=s[g];m=Ze(Kt(l,true).split(Kt(g,true))[0],""+g);h=c.replace(Kt(g,true),"/");break}}v=v.sort((function(e,r){var t,n;return((t=e.path)==null?void 0:t.length)-((n=r.path)==null?void 0:n.length)}));for(var y=0;y<v.length;y++){var b=v[y];if(fe(b.path,h)||Kt(h,true).includes(Kt(b.path,true))){f.push(Object.assign({},b))}}var w=f.map((function(e){var r=e.to||e.path;var t=typeof r==="function"?r({params:n,search:u}):r;var i=e.query||[];var o=a.paramStrToJson(window.location.href);var s=ye(o,["env"].concat(i));var l=typeof e.name==="function"?e.name():e.name;return{path:t?Ze(m,t):m,name:l,query:s}}));return w};var Qt=function e(r){var t=Wt();var n=We();var i=Jt(t.breads,n.routeBaseName);var a=f.useCallbackRef((function(e){return e.map((function(r,t){var n=r&&J(B,{children:r.name});return r?J(D.Item,{children:e.length-1!==t?J(de,{to:Ge(r.path,r.query),children:n}):n},t):null}))}));if(!i.length){return null}return Q("div",{className:"bread-wrapper",children:[Q(D,{className:"bread",children:[t.breadTitle&&J(D.Item,{children:t.breadTitle}),a(i.sort((function(e,r){return e.path.length-r.path.length})))]}),J("div",{className:"bread-extend",children:r.children})]})};var Gt=We();var Zt=function e(r){return r.filter((function(e){return!e.children||e.children.length===0}))[0]};var Xt=function e(r){var t=We(),n=t.routeBaseName;return Ze("/",r).replace(Ze("/",n),"").split("?")[0]};var en=function e(r){var t=er(r)?a.uriParse(r).pathname:r;var n=We(),i=n.routeBaseName;var o=Ze("/",t).replace(Xe("/",i,"/"),"").split("?")[0];o=Xe("/",o,"/");if(o.startsWith("/main/")){o=o.replace("/main/","/")}return rr(o,"after")};var rn=function e(r){var t=en(r);return Ze("/main",t)};var tn=function e(r){var t=rn(r);var n=a.uriParse(r);var i=n.search;return{path:t,search:i,pathSearch:""+t+i}};var nn=function e(r){var t=en(r);var n=a.uriParse(r);var i=n.search;return{path:t,search:i,pathSearch:""+t+i}};var an=function e(r){var t=We(),n=t.routeBaseName,i=t.hostUrl;var a="";if(er(r)){a=nn(r).pathSearch}else{var o=en(r);var u=r.split("?")[1]||"";a=u?o+"?"+u:o}return Xe(i,n,a)};var on=function e(r){var t=We(),n=t.routeBaseName,i=t.hostUrl;var a=r;if(!er(r)){a=Xe(i,n,r)}return a};var un=function e(r){var t=We(),n=t.routeBaseName,i=t.hostUrl;var a="";if(er(r)){a=tn(r).pathSearch}else{var o=rn(r);var u=r.split("?")[1]||"";a=u?o+"?"+u:o}return Xe(i,n,a)};var sn=Gt.appName||"flatbiz-layout";var ln=function e(){var r=Gt.menus;Ue(r,"children").forEach((function(e){var r,t;e.link=l(e.link)?((r=e.link)==null?void 0:r[we.getEnvName()])||((t=e.link)==null?void 0:t["prod"]):e.link}));return r};var cn=function e(r,t){var n=a.modifyQueryString(r,{env:undefined});var i=a.modifyQueryString(t,{env:undefined});return n===i};var fn=function e(t,n){n=en(n);var i=Ut(t);var a=i.find((function(e){return Vt(n,en(e.path))}));if(a!=null&&a.children&&r(a==null?void 0:a.children)&&a.children.length>0){if(en(a.path)!==n)return undefined;var o=function e(t){if(r(t[0].children)&&t[0].children.length>0){return e(t[0].children)}return t[0]};return o(a.children)}return a};var dn=function e(r,t){var n=be.findAncestors(t,(function(e){return e.id===r.id}));var i=[];n.forEach((function(e){return i.push(""+e.id)}));return i};var vn=function e(t){var n=r(t)?t:[];window[sn]=n;He.set(sn,{menuList:n})};var hn=function e(){try{if(window[sn])return[].concat(window[sn]);var t=He.get(sn)||{},n=t.menuList;var i=r(n)?n:[];window[sn]=i;return i}catch(e){return[]}};var mn=function e(r){window[sn+"-iframeActiveItem"]=r;He.set(sn+"-iframeActiveItem",$e({},r))};var pn=function e(){try{if(window[sn+"-iframeActiveItem"])return window[sn+"-iframeActiveItem"];var r=He.get(sn+"-iframeActiveItem");var t=r&&r.id?r:undefined;window[sn+"-iframeActiveItem"]=t;return t}catch(e){return undefined}};var gn=function e(r,t){var n=r.link;var i=t.find((function(e){return cn(e.link,n)}));if(i){return{iframeTabListNew:t,iframeTabActiveItem:i}}return yn(t,r)};var yn=function e(r,t){var n={id:Pe(),link:an(Ge(t.link)),name:t.name,metaTitle:t.metaTitle,iframeKey:""+Date.now(),menuId:t.id?""+t.id:undefined};var i=r.concat(n);return{iframeTabListNew:i,iframeTabActiveItem:n}};var bn=function e(){He.remove(sn)};var wn=function e(r){var t=hn();var n=an(location.href);var i=pn();if(!i||!Ae(t,i.id,"id")){var a=t.find((function(e){return cn(an(e.link),n)}));if(a)return a;if(r){a={link:n,name:r.name,metaTitle:r.metaTitle,id:Pe(),iframeKey:""+Date.now(),menuId:""+r.id}}else{var o;a={id:Pe(),link:n,name:((o=Tn(location.pathname))==null?void 0:o.name)||"未知页面",iframeKey:""+Date.now(),menuId:undefined}}vn(t.concat(a));return a}var u=an(i.link);if(cn(n,u)){return i}var s=en(location.href);var l=en(i.link);if(s===l){Mn(i.id,{link:n});return i}if(r){var c={id:i.id,iframeKey:i.iframeKey,link:n,name:r.name,metaTitle:r.metaTitle,menuId:r.id};Mn(i.id,c);return c}else{var f;var d={id:Pe(),iframeKey:""+Date.now(),link:n,name:((f=Tn(location.pathname))==null?void 0:f.name)||"未知页面",menuId:undefined,metaTitle:undefined};Mn(i.id,d);return d}};var Cn=function e(r,t){var n=t.find((function(e){return cn(an(r),an(e.link))}));return n};var Sn=function e(r,t,n){var i=n.findIndex((function(e){return e.id===r}));if(i>=0){n[i]=$e({},n[i],t,{iframeKey:""+Date.now()})}return{iframeTabList:n,target:n[i]}};var kn=function e(r){var t=hn();var n=t.find((function(e){return e.id===r}));if(n){n.iframeKey=""+Date.now()}return t};var Mn=function e(r,t){var n=hn();var i=n.findIndex((function(e){return je(e.id,r)}));if(i>=0){n[i]=$e({},n[i],t);mn(n[i])}vn(n)};var Tn=function e(r){var t=nn(r),n=t.path;var i=window["_iframeTabConfig"]||{};var a=Object.keys(i).find((function(e){return Ze("/",e)===n}));return a&&l(i[a])?i[a]:undefined};window["_iframeTabConfig"]={"/intro/xyz":{name:"xyz"}};var xn=function e(r){var t=Wt();var n=f.useCallbackRef((function(){if(t.collapsed){t.onChangeCollapsed(false)}else{setTimeout((function(){t.onChangeCollapsed(true)}),100)}}));if(t.siderBarMenus.length>0&&!t.hideSidebarMenu){return J("div",{className:s("layout-shrink",r.className),onClick:n,children:t.collapsed?J(Se,{}):J(Ce,{})})}return J("div",{className:s("layout-shrink",r.className)})};var Dn=function e(){var r=f.useGlobal(),t=r.user,n=r.hostUrl;var i=Wt();var a=f.useCallbackRef((function(){i.onSignOut==null?void 0:i.onSignOut(t,n)}));var o=[{label:"退出登录",key:"0",onClick:a,icon:J(Me,{})}];return J("div",{className:"header-account",children:J(b,{menu:{items:i.accountOperateMenuItems?i.accountOperateMenuItems:o},arrow:true,trigger:["click","hover"],overlayClassName:"account-dropdown-overlay",getPopupContainer:function e(){return document.querySelector(".header-account")},children:J("div",{className:"header-account-wraper",children:Q(O,{size:[8,0],children:[J(v,{size:"small",shape:"circle",icon:J(ke,{})},"user"),J("div",{style:{maxWidth:68},children:(t==null?void 0:t.userName)||"..."})]})})})})};var On=function e(){var r=f.useGlobal(),t=r.defaultPage;var n=Wt();var i=f.useCallbackRef((function(){if(t){window.location.href=t}}));var a=n.sidebarWidth;return J("div",{className:"layout-brand",onClick:i,style:{width:a},children:n.HeaderBrand?n.HeaderBrand():Q(B,{children:[J("div",{className:"brand-logo",style:{backgroundImage:"url("+n.logoPath+")"}}),J("div",{className:"brand-name",children:n.brandName})]})})};var $n=function e(){var r,t,n,i,a;var o=Wt();var u=o.menus,l=o.topMenuActiveItem,c=o.siderBarMenus;var d=P((function(){return o.disableTopbarMenu?[]:u.map((function(e){return{key:""+e.id,label:e.name}}))}),[o.disableTopbarMenu,u]);var v=f.useCallbackRef((function(e){var r=u.filter((function(r){return je(e.key,r.id)}))[0];if(!je(r==null?void 0:r.id,l==null?void 0:l.id)){bn()}if(r.target==="_blank"){window.open(r.link)}if(o.layoutMode==="normal"){window.location.href=Ge(on(r.link||r.path))}else{var t=Zt(Ue(r.children||[],"children"));if(t){if(t.link){window.location.href=Ge(t.link)}else{window.location.href=Ge(un(t.path))}return}if(r.link){window.location.href=Ge(r.link)}else{window.location.href=Ge(un(r.path))}}}));var h=s("flatbiz-layout-main-header",{"flatbiz-layout-main-header-has-menu":d.length>0});return Q("div",{className:h,children:[c.length===0||o.hideSidebarMenu?J(On,{}):null,o.showTopMenuShrink?J(xn,{className:"header-shrink"}):null,o.systemName?J("div",{className:"flatbiz-layout-system-name",children:o.systemName}):null,Q("div",{className:"flatbiz-layout-header-fill",children:[J(tt,$e({theme:{token:{fontSize:(r=o.headerThemeConfig)==null?void 0:r.menuTextFontSize},components:{Menu:{colorItemText:(t=o.headerThemeConfig)==null?void 0:t.menuColor,colorItemTextHover:(n=o.headerThemeConfig)==null?void 0:n.menuActiveTextColor,colorItemBgSelectedHorizontal:(i=o.headerThemeConfig)==null?void 0:i.menuSelectedBgColor,colorItemTextSelectedHorizontal:(a=o.headerThemeConfig)==null?void 0:a.menuSelectedTextColor}}}},o.topMenuConfigProviderProps,{children:d.length>0?J($,{className:"flatbiz-layout-topmenu",mode:"horizontal",defaultSelectedKeys:l!=null&&l.id?[""+l.id]:undefined,items:d,onClick:v,theme:"light",getPopupContainer:function e(){return document.querySelector(".flatbiz-layout-topmenu-overflowed-modal")}}):null})),o.Header?J(o.Header,{}):null,J("div",{className:"flatbiz-layout-topmenu-overflowed-modal"})]}),J(Dn,{})]})};var _n=function e(r){var t=r.spinning,n=t===void 0?false:t,i=r.fullScreen,a=i===void 0?false:i,o=r.style,u=o===void 0?{}:o;return J("div",{style:u,className:s("loader",{hidden:!n,fullScreen:a}),children:Q("div",{className:"loader-wrapper",children:[J("div",{className:"loader-inner"}),J("div",{className:"loader-text",children:"LOADING"})]})})};var Ln;(function(e){e["messageReceived"]="messageReceived"})(Ln||(Ln={}));var In="FLATBIZ-LAYOUT";var Nn=function(){function e(){this.events={}}var r=e.prototype;r.on=function e(r,t){if(!this.events[r]){this.events[r]=[]}this.events[r].push(t);return this};r.off=function e(r,t){if(this.events[r]){this.events[r]=this.events[r].filter((function(e){return e!==t}))}return this};r.emit=function e(r,t){var n=this.events[r]||[];if(n.length){console.log("IframeEventEmitter.emit(), name: ",r,"handlers:",n);for(var i=0;i<n.length;i++){var a=n[i];if(a){a(t)}}}return this};return e}();var Yn=function e(){var r=document.querySelectorAll('[id^="iframe_"]');return r};var An={broadcastMessages:function e(r){var t=Yn();for(var n=0;n<t.length;n++){var i;var a=t[n];(i=a.contentWindow)==null?void 0:i.postMessage(JSON.stringify({type:In,data:r}),"*")}return An},postMessage:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:r}),"*");return An},openNewTabItem:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"redirect_to_frame_layout_menu_item",data:r}}),"*");return An},openBrowserWindow:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"open_browser_window",data:{url:r}}}),"*");return An},locationHref:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"browser_location_href",data:{url:r}}}),"*");return An},tabItemHistoryChange:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"history_change",data:{link:r}}}),"*");return An},openNewTabItemByMenuId:function e(r){window.parent.postMessage(JSON.stringify({type:In,data:{type:"open_iframe_tabitem_by_menu_id",data:r}}),"*");return An}};var Rn=new Nn;window.addEventListener("message",(function(e){try{var r=ae.parse(e.data),t=r.type,n=r.data;if(t===In){Rn.emit(Ln.messageReceived,n)}}catch(e){}}));var qn=function e(r){if(r===void 0){r=function e(){}}var t=f.useCallbackRef(r);z((function(){Rn.off(Ln.messageReceived,t).on(Ln.messageReceived,t);return function(){Rn.off(Ln.messageReceived,t)}}),[t]);return An};var Pn=function e(){var r=qn();var t=le(),n=t.pathname,i=t.search;var a=f.useDebounceCallback((function(){r.tabItemHistoryChange(location.href)}),100);f.useUpdateEffect((function(){a()}),[n,i]);return J(B,{})};var jn=_.Sider;var Bn=function e(r){if(r.iconImg&&r.iconImgActive){return Q(B,{children:[J("div",{className:"menu-icon-img",style:{backgroundImage:"url("+r.iconImg+")"}}),J("div",{className:"menu-icon-img-active",style:{backgroundImage:"url("+r.iconImgActive+")"}})]})}return J("div",{className:"menu-icon-placeholder"})};var Hn=function e(){var r,t,n,i,a,o,u,s,l,c;var d=Wt();var v=Te();var h=d.siderBarTileMenus;var m=P((function(){var e=function e(r,t){return r.map((function(r){if(r.children&&r.children.length>0){return{key:String(r.id),icon:J(Bn,{iconImg:r.iconImg,iconImgActive:r.iconImgActive}),label:r.name,children:e(r.children,t+1),popupClassName:"flatbiz-layout-sider-submenu-popup",className:t===0&&!r.iconImg&&!r.iconImgActive?"flatbiz-layout-menu-item-no-icon":undefined}}return{key:String(r.id),icon:J(Bn,{iconImg:r.iconImg,iconImgActive:r.iconImgActive}),label:r.name}}))};return e(d.siderBarMenus,0)}),[d.siderBarMenus]);var p=f.useCallbackRef((function(e){d.onChangeSelectedKeys(e.keyPath);var r=h.filter((function(r){return je(e.key,r.id)}))[0];if(r.target==="_blank"){window.open(r.link);return}if(d.layoutMode==="iframe-main"){d.onIframChange(e.key,"menuClick");return}if(r.link){window.location.href=Ge(r.link);return}if(r.path){v(Ge(r.path));document.title=r.metaTitle||r.name}}));var g=f.useCallbackRef((function(e){d.onChangeOpendKeys(e)}));var y=A(0),b=y[0],w=y[1];z((function(){w(Date.now())}),[d.collapsed]);var C={mode:!d.collapsed?"inline":"vertical",items:m,inlineIndent:(r=d.sidebarThemeConfig)==null?void 0:r.inlineIndent,onClick:p,selectedKeys:d.selectedKeys,onOpenChange:g};if(!d.collapsed){C.openKeys=d.opendKeys}return Q(jn,{theme:"light",className:"flatbiz-layout-sider",collapsed:d.collapsed,width:d.sidebarWidth,children:[J(On,{}),J(tt,$e({theme:{token:{controlHeight:(t=d.sidebarThemeConfig)==null?void 0:t.menuItemHeight,fontSize:(n=d.sidebarThemeConfig)==null?void 0:n.menuTextFontSize},components:{Menu:{colorItemBg:(i=d.sidebarThemeConfig)==null?void 0:i.bgColor,colorItemText:(a=d.sidebarThemeConfig)==null?void 0:a.menuColor,colorItemTextHover:(o=d.sidebarThemeConfig)==null?void 0:o.menuActiveTextColor,colorItemBgHover:(u=d.sidebarThemeConfig)==null?void 0:u.menuActiveBgColor,colorItemTextSelected:(s=d.sidebarThemeConfig)==null?void 0:s.menuSelectedTextColor,colorItemBgSelected:(l=d.sidebarThemeConfig)==null?void 0:l.menuSelectedBgColor,colorSubItemBg:(c=d.sidebarThemeConfig)==null?void 0:c.menuSubMenuBgColor}}}},d.sidebarMenuConfigProviderProps,{children:J($,$e({},C),b)})),!d.hideSidebarShrink&&J(xn,{className:"sider-bar-shrink"})]})};var zn=function e(){var r=Wt(),t=r.iframeTabList,n=r.hideHeader,i=r.iframeTabBarExtra,a=r.iframeTabActiveItem,o=r.onIframChange,u=r.onDeleteIframeTabItem;var s=A([]),l=s[0],c=s[1];var d=f.useDebounceClick((function(e){o(e,"iframTabClick")}),200);var v=f.useCallbackRef((function(e){u("me",e)}));var h=f.useCallbackRef((function(e){if(e.key==="1"){o(a.id,"iframTabClick")}else if(e.key==="2"){u("other")}else if(e.key==="3"){u("all")}}));var m=[{label:"刷新当前",key:"1",onClick:h.bind(null,{key:"1"}),icon:J(X,{})},{label:"关闭其他",key:"2",onClick:h.bind(null,{key:"2"}),icon:J(ie,{})},{label:"关闭所有",key:"3",onClick:h.bind(null,{key:"3"}),icon:J(Me,{})}];var p=t.map((function(e){var r=!Ye(l,e.iframeKey);return{label:e.name,key:""+e.id,style:{height:n?"calc(100vh - 38px)":"calc(100vh - 102px)",position:"relative"},closable:true,closeIcon:J("span",{className:"tab-icon"}),children:Q(B,{children:[J(_n,{spinning:r}),J("iframe",{id:"iframe_"+String(e.id),src:e.link,width:"100%",height:"100%",style:{border:"none"},onLoad:function r(){c((function(r){return r.concat(e.iframeKey)}))}},e.iframeKey)]})}}));return J(L,{hideAdd:true,items:p,activeKey:a==null?void 0:a.id,onTabClick:d,style:{height:"100%"},className:"iframe-tabs",type:t.length===1?"card":"editable-card",onEdit:v,tabBarExtraContent:{right:i?i:J(b,{menu:{items:m},arrow:true,className:"menu-tabs-operate",placement:"bottomRight",overlayClassName:"menu-tabs-operate-dropdown",trigger:["hover"],children:J(xe,{})})}})};var En=function e(){var r=Wt();var t=r.iframeTabActiveItem;var n=A([]),i=n[0],a=n[1];var o=!Ye(i,t==null?void 0:t.iframeKey);return Q("div",{style:{flex:1,position:"relative"},children:[J(_n,{spinning:o}),J("iframe",{id:"iframe_"+String(t==null?void 0:t.id),src:t==null?void 0:t.link,width:"100%",height:"100%",style:{border:"none"},onLoad:function e(){a((function(e){return e.concat(t==null?void 0:t.iframeKey)}))}},t==null?void 0:t.iframeKey)]})};var Wn=function e(){var r=Wt();return J(B,{children:r.multiFrameTabs?J(zn,{}):J(En,{})})};var Fn=function e(){var r=ve();var t=Wt();var n=f.useGlobal(),i=n.user,a=n.hostUrl;qn((function(e){if(e.type==="redirect_to_frame_layout_menu_item"){var n=e.data;t.onIframChangeByHttpUrl(un(n.link),{name:n.name,metaTitle:n.metaTitle})}else if(e.type==="open_browser_window"){var i;var a=(i=e.data)==null?void 0:i["url"];if(a){window.open(a)}}else if(e.type==="browser_location_href"){var o;var u=(o=e.data)==null?void 0:o["url"];if(u){window.location.href=un(u)}}else if(e.type==="history_change"){var s;var l=(s=e.data)==null?void 0:s["link"];var c=tn(l),f=c.pathSearch;r(f);var d=fn(t.siderBarTileMenus,l);Mn(t.iframeTabActiveItem.id,{link:l,name:d.name,metaTitle:d.metaTitle})}else if(e.type==="open_iframe_tabitem_by_menu_id"){var v=e.data;var h=t.siderBarTileMenus.find((function(e){return je(e.id,v)}));if(h){if((h==null?void 0:h.target)==="_blank"){window.open(h.link);return}t.onIframChange(h.id,"menuClick")}}}));qn((function(e){if(e.type==="session_expired"){t.onSessionExpired(i,a)}}));return J(B,{})};var Kn=function e(r){var t=Wt();var n=Ee();var i=s("layout-page-wrapper",{"layout-page-noheader":t.hideHeader,"layout-page-windows":n});return J(B,{children:J("div",{className:i,children:J("div",{className:"layout-page",children:r.children})})})};var Un=function e(){var r=Wt();var t=r.routeList;var i=t.filter((function(e){return je(e.path,["*","/*","/*/"])}));return J(B,{children:Q(he,{children:[t.map((function(e,t){var i=e.path,a=e.caseSensitive,o=e.element,u=e.redirect;var s=je(i,["*","/*","/*/"]);if(n(u)){return J(me,{path:i,element:J(pe,{to:tr(u)})},t)}if(o){var l=null;if(o){l=H(o)?o:J(F,{fallback:J(_n,{spinning:true}),children:J(o,{})})}var c=s?"*":i.endsWith("/*")?i:Xe(i,"*");return J(me,{path:c,caseSensitive:a,element:Q(B,{children:[r.breads&&r.hideDefaultBread!==true?J(Qt,{children:r.breadExtendRender}):null,l]})},t)}return null})),i.length===0?J(me,{path:"*",element:J(qt,{})}):null]})})};var Vn=function e(){var r=Wt();var t=r.layoutMode==="iframe-main";Ht();var n=r.LayoutComponent||Kn;if(r.layoutMode==="iframe-tab"||r.layoutMode==="no-layout"){return Q(B,{children:[r.layoutMode==="iframe-tab"?J(Pn,{}):null,J(n,{children:J(Un,{})})]})}if(r.menus.length===0){return J(T,{status:"error",title:"无菜单数据",subTitle:"请联系运营人员确定菜单数据配置"})}var i=Ee();return Q(B,{children:[J(Fn,{}),Q(_,{hasSider:true,className:s("flatbiz-layout",{"flatbiz-layout-windows":i}),children:[r.siderBarMenus.length===0||r.hideSidebarMenu?null:J(Hn,{}),Q(_,{className:"flatbiz-layout-main",hasSider:false,children:[!r.hideHeader?J($n,{}):null,t?J(Wn,{}):J(n,{children:J(Un,{})})]})]})]})};var Jn=function e(){var r=qn();var t=De.useException(),n=t[0],i=t[1];var a=Wt();f.useUpdateEffect((function(){if(n&&n.message){i();if(a.verifySessionExpired(n)){r.postMessage({type:"session_expired"});return}void C.error(n.message)}}),[n]);return null};var Qn=["sidebarWidth","componentSize","locale","logoPath","headerThemeConfig","sidebarThemeConfig"];var Gn=function r(t){var n=ve();var i=t.sidebarWidth,a=t.componentSize,o=t.locale,u=t.logoPath,s=t.headerThemeConfig,l=t.sidebarThemeConfig,c=Ie(t,Qn);var f=c.layoutMode==="iframe-main";var d=A(false),v=d[0],h=d[1];var m=A([]),p=m[0],g=m[1];var y=A([]),b=y[0],w=y[1];var C=A(),S=C[0],k=C[1];var M=A(),T=M[0],x=M[1];var D=j();var O=c.ErrorHandling||Jn;var $=P((function(){var e=ln();var r=Ue(e,"children");var t=[];var n=undefined;if(c.hideSidebarMenu){if(!c.disableTopbarMenu){var i=e.find((function(e){return Vt(Xt(location.pathname),e.path)}));if(i){x(i)}}}else{n=fn(r,location.pathname);if(n){var a=dn(n,e);if(!c.disableTopbarMenu){if(a.length>0){var o=a[a.length-1];var u=e.find((function(e){return je(e.id,o)}));x(u);t=(u==null?void 0:u.children)||[]}}else{t=e}w(a);g(a);k(n);document.title=n.metaTitle||n.name}else{if(c.disableTopbarMenu){t=e;w([]);g([]);k(undefined)}}if(f){var s=wn(n);mn(s)}}return{menus:e,siderBarMenus:t,siderBarTileMenus:Ue(t,"children"),siderbarTargetMenu:n}}),[f,c.disableTopbarMenu,c.hideSidebarMenu]),_=$.menus,L=$.siderBarMenus,I=$.siderBarTileMenus;var N=A(pn()),Y=N[0],R=N[1];var q=A(hn()),B=q[0],H=q[1];Zr((function(){vn(B)}),[B]);Zr((function(){if(Y!=null&&Y.id){document.title=Y.metaTitle||Y.name;mn(Y)}}),[Y]);var z=function e(r){if(r){D.current=p}else{g(D.current||[])}h(r)};var E=function e(r){w(r)};var W=function e(r){g(r)};var F=function e(r){var t=gn(r,hn()),n=t.iframeTabActiveItem,i=t.iframeTabListNew;H([].concat(i));R(n);k(r)};var K=function e(r){if(r){var t=I.find((function(e){return je(e.id,r)}));if(t){k(t);var n=dn(t,L);w(n);g(n);return}}w([]);g([]);k(undefined)};var U=function r(t,i){if(i==="iframTabClick"){if(je(t,Y.id)){if(!c.iframeTabClickRefresh)return;var a=kn(Y==null?void 0:Y.id);H([].concat(a))}else{var o=hn().find((function(e){return je(e.id,t)}));R(o);K(o==null?void 0:o.menuId);var u=tn(o==null?void 0:o.link),s=u.pathSearch;n(Ge(s))}}if(i==="menuClick"){if(je(t,S==null?void 0:S.id)){var l=Sn(Y==null?void 0:Y.id,{link:Ge(S==null?void 0:S.link),name:S==null?void 0:S.name,metaTitle:S==null?void 0:S.metaTitle},hn());n(Ge((S==null?void 0:S.path)||""));H([].concat(l.iframeTabList));R(e({},l.target));return}else{var f=I.find((function(e){return je(e.id,t)}));var d=gn(f,hn()),v=d.iframeTabActiveItem,h=d.iframeTabListNew;H([].concat(h));R(v);k(f);n(Ge(f.path))}}};var V=function e(r,t){if(r==="other"){H([Y]);return}var i=hn();var a;var o;if(r==="all"){a=[i[0]];o=i[0]}else if(r==="me"){var u=Re(i,t,"id");var s=i[u-1];i.splice(u,1);a=i;o=s}H([].concat(a));R(o);var l=tn(o.link),c=l.pathSearch;n(c);K(o.menuId)};var G=function e(r,t){var i=hn();var a=nn(r),o=a.path,u=a.pathSearch;var s=an(r);var l=fn(I,o);if(l){var c=dn(l,L);w(c);g(c);var f=gn($e({},l,{link:s,name:t.name,metaTitle:t.metaTitle}),i),d=f.iframeTabActiveItem,v=f.iframeTabListNew;H([].concat(v));R(d);k(l)}else{w([]);g([]);k(undefined);var h=Cn(s,i);if(h){R(h)}else{var m=yn(i,{link:s,name:(t==null?void 0:t.name)||"未知页面",metaTitle:t==null?void 0:t.metaTitle,path:u}),p=m.iframeTabListNew,y=m.iframeTabActiveItem;H([].concat(p));R(y)}}var b=tn(r);n(Ge(b.pathSearch))};var Z=function e(r){var t=hn().find((function(e){return e.id===Y.id}));if(t){t.name=r;H(hn())}};var X=$e({},c,{menus:_,siderBarMenus:L,siderBarTileMenus:I,sidebarWidth:i,componentSize:a,locale:o,routeList:c.routeList,breads:c.breads||{},logoPath:u,headerThemeConfig:s,sidebarThemeConfig:l,collapsed:v,onChangeCollapsed:z,opendKeys:p,selectedKeys:b,onChangeOpendKeys:W,onChangeSelectedKeys:E,iframeTabList:B,addOrUpdateIframeTab:F,iframeTabActiveItem:Y,siderBarMenuActiveItem:S,onIframChange:U,onDeleteIframeTabItem:V,onIframChangeByHttpUrl:G,topMenuActiveItem:T,onUpdateIframeTabName:Z,onChangeSiderBarMenuActiveItem:K});return Q(Ft,{value:X,children:[c.disableErrorHandling?null:J(O,{}),J(Vn,{})]})};var Zn=function e(r,t){if(r===void 0){r=[]}if(t===void 0){t=[]}return r.length!==t.length||r.some((function(e,r){return!Object.is(e,t[r])}))};var Xn={error:null};var ei=function(e){_e(r,e);function r(){var r;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}r=e.call.apply(e,[this].concat(n))||this;r.state=Xn;r.updatedWithError=false;r.resetErrorBoundary=function(){var e;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++){n[i]=arguments[i]}r.props.onReset==null?void 0:(e=r.props).onReset.apply(e,n);r.reset()};return r}r.getDerivedStateFromError=function e(r){return{error:r}};var t=r.prototype;t.reset=function e(){this.updatedWithError=false;this.setState(Xn)};t.componentDidCatch=function e(r,t){var n,i;(n=(i=this.props).onError)==null?void 0:n.call(i,r,t)};t.componentDidMount=function e(){var r=this.state.error;if(r!==null){this.updatedWithError=true}};t.componentDidUpdate=function e(r){var t=this.state.error;var n=this.props.resetKeys;if(t!==null&&!this.updatedWithError){this.updatedWithError=true;return}if(t!==null&&Zn(r.resetKeys,n)){var i,a;(i=(a=this.props).onResetKeysChange)==null?void 0:i.call(a,r.resetKeys,n);this.reset()}};t.render=function e(){var r=this.state.error;var t=this.props,n=t.fallbackRender,i=t.FallbackComponent,a=t.fallback;if(r!==null){var o={error:r,resetErrorBoundary:this.resetErrorBoundary};if(H(a)){return a}else if(typeof n==="function"){return n(o)}else if(i){return J(i,$e({},o))}else{throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}}return this.props.children};return r}(K);function ri(e){var r=e.error;return J("div",{style:{height:"100%",padding:"8px"},children:Q("div",{style:{backgroundColor:"#fff",height:"100%",padding:"0 8px 8px 8px",overflow:"hidden"},children:[J(I.Title,{level:2,children:"Something went wrong"}),J(I.Paragraph,{children:r.message}),J(v,{onClick:function e(){window.location.reload()},children:"Try again"})]})})}var ti=function r(t){var n=We();var i=t.sidebarWidth||220;var a=t.componentSize||"middle";var o=t.locale;var u=t.logoPath||"";var s={bgColor:"#1890ff",textColor:"#fff",menuColor:"#fff",menuActiveTextColor:"#FFF",menuSelectedBgColor:"#0080e3",menuSelectedTextColor:"#FFF",menuTextFontSize:14};var l={bgColor:"#fff",menuActiveBgColor:"rgba(0,0,0,0.06)",menuActiveTextColor:"#1890ff",menuSelectedBgColor:"#bae0ff",menuColor:"rgba(0,0,0,.88)",menuSelectedTextColor:"#1890ff",menuSubMenuBgColor:"rgba(0, 0, 0, 0.02)",inlineIndent:16,menuItemHeight:28,menuTextFontSize:13};var c=e({},s,t.headerThemeConfig);var f=e({},l,t.sidebarThemeConfig);var d=Ne(t.iframeTabClickRefresh)?true:t.iframeTabClickRefresh;var v=$e({},t,{sidebarWidth:i,componentSize:a,locale:o,routeList:t.routeList,breads:t.breads||{},logoPath:u,headerThemeConfig:c,sidebarThemeConfig:f,iframeTabClickRefresh:d});var h=[{"--header-bgColor":c==null?void 0:c.bgColor},{"--header-textColor":c==null?void 0:c.textColor},{"--header-menuColor":c==null?void 0:c.menuColor},{"--header-menuActiveTextColor":c==null?void 0:c.menuActiveTextColor},{"--header-menuActiveBgColor":c==null?void 0:c.menuActiveBgColor},{"--header-menuSelectedBgColor":c==null?void 0:c.menuSelectedBgColor},{"--header-menuSelectedTextColor":c==null?void 0:c.menuSelectedTextColor},{"--sidebar-bgColor":f==null?void 0:f.bgColor},{"--sidebar-menuActiveBgColor":f==null?void 0:f.menuActiveBgColor},{"--sidebar-menuActiveTextColor":f==null?void 0:f.menuActiveTextColor},{"--sidebar-menuSelectedBgColor":f==null?void 0:f.menuSelectedBgColor},{"--sidebar-menuSelectedTextColor":f==null?void 0:f.menuSelectedTextColor},{"--sidebar-menuSubMenuBgColor":f==null?void 0:f.menuSubMenuBgColor},{"--sidebar-menuColor":f==null?void 0:f.menuColor}];var m="";h.forEach((function(e){var r=Object.keys(e)[0];if(e[r]){m=m+(r+":"+e[r]+";")}}));document.body.style.cssText=document.body.style.cssText+";"+m;var p=ne(document.getElementById("app"));p.render(J(ge,{basename:n.routeBaseName,children:J(tt,$e({locale:o,componentSize:a,space:{size:a}},t.configProviderProps,{children:J(x,{children:J(ei,{onError:t.onError,onReset:t.onErrorReset,FallbackComponent:t.ErrorFallback||ri,children:J(Gn,$e({},v))})})}))}))};var ni=["breads","level"];var ii=function e(r){var n=r.breads,i=r.level,a=Ie(r,ni);var o=We(),u=o.routeBaseName;var s=Jt(n,u);var l="";if(s.length>=2){var c=i!==undefined&&t(i)?Math.abs(i):1;var f=s[s.length-1-c]||s[s.length-2];if(!!f){l=Ge(f.path,f.query)}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}return J(de,{to:l,children:Q(v,$e({},a,{children:[r.children||"返回"," "]}))})};var ai=function e(r){var n=r.breads,i=r.level;var a=We(),o=a.routeBaseName;var u=Jt(n,o);var s="";if(u.length>=2){var l=i!==undefined&&t(i)?Math.abs(i):1;var c=u[u.length-1-l]||u[u.length-2];if(!!c){s=Ge(c.path,c.query)}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}}else{console.warn("获取上一级路由数据异常,请检查模块面包屑配置数据")}return{path:s}};var oi=function e(r){var t=r.loading;var n=Ee();var i=s("page",{"page:loading":t,"page-flex":!u(r.fullIndex),"page-windows":n},r.className);var a=f.useCallbackRef((function(){if(!u(r.fullIndex)){return document.querySelector(".page-full")}return document.querySelector(".page")}));return Q(B,{children:[r.bread,Q("div",{style:r.style,className:i,children:[U.map(r.children,(function(e,t){if(t===r.fullIndex){var n;return J(B,{children:V(e,{className:s("page-full",e==null?void 0:(n=e["props"])==null?void 0:n.className)})},t)}return J(B,{children:e},t)})),J(N.BackTop,{target:a}),t&&J(_n,{spinning:true})]})]})};var ui=["respData"],si=["serviceConfig","isAsync","errorRender"];var li=function e(r){var t=r.respData,n=Ie(r,ui);var i=r.children==null?void 0:r.children(t);var a=[];if(Oe(i)){var o=U.toArray(i.props.children);a=o}else if(H(i)){a=[i]}return J(oi,$e({},n,{children:a}))};var ci=Y((function(e,r){var t=e.serviceConfig,n=e.isAsync,i=e.errorRender,a=Ie(e,si);var o=A({status:"loading"}),u=o[0],s=o[1];var l=function e(){return new Promise((function(e,r){var n,i;var a=function(){try{return e()}catch(e){return r(e)}};var o=function(e){try{s({status:"error",respData:e});return a()}catch(e){return r(e)}};try{n=typeof t.params==="function"?t.params():t.params;return Promise.resolve(t.onRequest(n)).then((function(e){try{i=e;s({status:"success",respData:i});return a()}catch(e){return o(e)}}),o)}catch(e){o(e)}}))};Xr(l,[]);var c=f.useCallbackRef((function(){window.location.reload()}));R(r,(function(){return{onRefresh:function e(r){var t=r===undefined?true:r;t&&yt.open();l().finally((function(){t&&yt.close()}))}}}));if(u.status==="error"){var d;if(i){return i(u.respData)}return J(oi,{fullIndex:0,style:{backgroundColor:"#fff"},children:J(T,{status:"error",title:"数据获取异常",subTitle:((d=u.respData)==null?void 0:d.message)||"数据请求异常",extra:[J(v,{type:"primary",onClick:c,children:"重新获取"},"console")]})})}if(u.status==="loading"&&!n){return J(oi,$e({loading:true},a,{children:J(B,{})}))}return J(li,$e({loading:u.status==="loading",respData:u.respData},a))}));export{Qt as Bread,ii as HistoryBackButton,Kn as LayoutPage,oi as Page,ci as PageWrapper,ti as bootstrap,Pt as message,Bt as modal,jt as notification,ai as useHistoryBack,qn as useIframe};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|