xmirror-components 1.0.7 → 1.0.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/build/dist/index.cjs +31 -0
- package/build/dist/index.mjs +1382 -0
- package/build/es/components/IconButton/index.js +1 -1
- package/build/es/hooks/useRequest/index.js +1 -1
- package/build/es/index.d.ts +3 -1
- package/build/es/index.js +3 -1
- package/build/lib/components/IconButton/index.js +1 -1
- package/build/lib/hooks/useRequest/index.js +1 -1
- package/build/lib/index.js +7 -3
- package/build/package.json +2 -1
- package/package.json +2 -1
- package/build/dist/xmirror-components.css +0 -1
- package/build/dist/xmirror-components.js +0 -1563
- package/build/dist/xmirror-components.umd.cjs +0 -35
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
(function(_,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("antd"),require("react")):typeof define=="function"&&define.amd?define(["exports","antd","react"],k):(_=typeof globalThis<"u"?globalThis:_||self,k(_.XMirrorComponents={},_.antd,_.React))})(this,function(_,k,h){"use strict";_.message=k.message,_.notification=k.notification,_.modal=k.Modal;function Fr({children:e}){const t=k.App.useApp();return _.message=t.message,_.modal=t.modal,_.notification=t.notification,e}var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var le={exports:{}},$={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Je;function Ir(){if(Je)return $;Je=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var s in i)s!=="key"&&(o[s]=i[s])}else o=i;return i=o.ref,{$$typeof:e,type:a,key:c,ref:i!==void 0?i:null,props:o}}return $.Fragment=t,$.jsx=r,$.jsxs=r,$}var ee={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Xe;function Br(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){function e(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===nn?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case U:return"Fragment";case V:return"Portal";case C:return"Profiler";case I:return"StrictMode";case J:return"Suspense";case w:return"SuspenseList"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case he:return(n.displayName||"Context")+".Provider";case ie:return(n._context.displayName||"Context")+".Consumer";case ue:var v=n.render;return n=n.displayName,n||(n=v.displayName||v.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case A:return v=n.displayName||null,v!==null?v:e(n.type)||"Memo";case B:v=n._payload,n=n._init;try{return e(n(v))}catch{}}return null}function t(n){return""+n}function r(n){try{t(n);var v=!1}catch{v=!0}if(v){v=console;var g=v.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return g.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(n)}}function a(){}function i(){if(ce===0){_r=console.log,Sr=console.info,Or=console.warn,xr=console.error,Pr=console.group,Cr=console.groupCollapsed,Ar=console.groupEnd;var n={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}ce++}function o(){if(ce--,ce===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},n,{value:_r}),info:q({},n,{value:Sr}),warn:q({},n,{value:Or}),error:q({},n,{value:xr}),group:q({},n,{value:Pr}),groupCollapsed:q({},n,{value:Cr}),groupEnd:q({},n,{value:Ar})})}0>ce&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function c(n){if(ze===void 0)try{throw Error()}catch(g){var v=g.stack.trim().match(/\n( *(at )?)/);ze=v&&v[1]||"",Nr=-1<g.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+ze+n+Nr}function s(n,v){if(!n||De)return"";var g=Ve.get(n);if(g!==void 0)return g;De=!0,g=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var E=null;E=X.H,X.H=null,i();try{var O={DetermineComponentFrameRoot:function(){try{if(v){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(Y){var pe=Y}Reflect.construct(n,[],z)}else{try{z.call()}catch(Y){pe=Y}n.call(z.prototype)}}else{try{throw Error()}catch(Y){pe=Y}(z=n())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(Y){if(Y&&pe&&typeof Y.stack=="string")return[Y.stack,pe.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=O.DetermineComponentFrameRoot(),G=y[0],K=y[1];if(G&&K){var x=G.split(`
|
|
20
|
-
`),Z=K.split(`
|
|
21
|
-
`);for(y=R=0;R<x.length&&!x[R].includes("DetermineComponentFrameRoot");)R++;for(;y<Z.length&&!Z[y].includes("DetermineComponentFrameRoot");)y++;if(R===x.length||y===Z.length)for(R=x.length-1,y=Z.length-1;1<=R&&0<=y&&x[R]!==Z[y];)y--;for(;1<=R&&0<=y;R--,y--)if(x[R]!==Z[y]){if(R!==1||y!==1)do if(R--,y--,0>y||x[R]!==Z[y]){var se=`
|
|
22
|
-
`+x[R].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),typeof n=="function"&&Ve.set(n,se),se}while(1<=R&&0<=y);break}}}finally{De=!1,X.H=E,o(),Error.prepareStackTrace=g}return x=(x=n?n.displayName||n.name:"")?c(x):"",typeof n=="function"&&Ve.set(n,x),x}function f(n){if(n==null)return"";if(typeof n=="function"){var v=n.prototype;return s(n,!(!v||!v.isReactComponent))}if(typeof n=="string")return c(n);switch(n){case J:return c("Suspense");case w:return c("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case ue:return n=s(n.render,!1),n;case A:return f(n.type);case B:v=n._payload,n=n._init;try{return f(n(v))}catch{}}return""}function u(){var n=X.A;return n===null?null:n.getOwner()}function d(n){if(jr.call(n,"key")){var v=Object.getOwnPropertyDescriptor(n,"key").get;if(v&&v.isReactWarning)return!1}return n.key!==void 0}function l(n,v){function g(){kr||(kr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}g.isReactWarning=!0,Object.defineProperty(n,"key",{get:g,configurable:!0})}function p(){var n=e(this.type);return Mr[n]||(Mr[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function m(n,v,g,E,O,R){return g=R.ref,n={$$typeof:W,type:n,key:v,props:R,_owner:O},(g!==void 0?g:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:p}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function b(n,v,g,E,O,R){if(typeof n=="string"||typeof n=="function"||n===U||n===C||n===I||n===J||n===w||n===ye||typeof n=="object"&&n!==null&&(n.$$typeof===B||n.$$typeof===A||n.$$typeof===he||n.$$typeof===ie||n.$$typeof===ue||n.$$typeof===an||n.getModuleId!==void 0)){var y=v.children;if(y!==void 0)if(E)if(Ue(y)){for(E=0;E<y.length;E++)T(y[E],n);Object.freeze&&Object.freeze(y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(y,n)}else y="",(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n===null?E="null":Ue(n)?E="array":n!==void 0&&n.$$typeof===W?(E="<"+(e(n.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):E=typeof n,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,y);if(jr.call(v,"key")){y=e(n);var G=Object.keys(v).filter(function(x){return x!=="key"});E=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",Wr[y+E]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
|
-
let props = %s;
|
|
24
|
-
<%s {...props} />
|
|
25
|
-
React keys must be passed directly to JSX without using spread:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,E,y,G,y),Wr[y+E]=!0)}if(y=null,g!==void 0&&(r(g),y=""+g),d(v)&&(r(v.key),y=""+v.key),"key"in v){g={};for(var K in v)K!=="key"&&(g[K]=v[K])}else g=v;return y&&l(g,typeof n=="function"?n.displayName||n.name||"Unknown":n),m(n,y,R,O,u(),g)}function T(n,v){if(typeof n=="object"&&n&&n.$$typeof!==on){if(Ue(n))for(var g=0;g<n.length;g++){var E=n[g];P(E)&&L(E,v)}else if(P(n))n._store&&(n._store.validated=1);else if(n===null||typeof n!="object"?g=null:(g=Rr&&n[Rr]||n["@@iterator"],g=typeof g=="function"?g:null),typeof g=="function"&&g!==n.entries&&(g=g.call(n),g!==n))for(;!(n=g.next()).done;)P(n.value)&&L(n.value,v)}}function P(n){return typeof n=="object"&&n!==null&&n.$$typeof===W}function L(n,v){if(n._store&&!n._store.validated&&n.key==null&&(n._store.validated=1,v=M(v),!Lr[v])){Lr[v]=!0;var g="";n&&n._owner!=null&&n._owner!==u()&&(g=null,typeof n._owner.tag=="number"?g=e(n._owner.type):typeof n._owner.name=="string"&&(g=n._owner.name),g=" It was passed a child from "+g+".");var E=X.getCurrentStack;X.getCurrentStack=function(){var O=f(n.type);return E&&(O+=E()||""),O},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',v,g),X.getCurrentStack=E}}function M(n){var v="",g=u();return g&&(g=e(g.type))&&(v=`
|
|
28
|
-
|
|
29
|
-
Check the render method of \``+g+"`."),v||(n=e(n))&&(v=`
|
|
30
|
-
|
|
31
|
-
Check the top-level render call using <`+n+">."),v}var F=h,W=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),he=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),Rr=Symbol.iterator,nn=Symbol.for("react.client.reference"),X=F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,jr=Object.prototype.hasOwnProperty,q=Object.assign,an=Symbol.for("react.client.reference"),Ue=Array.isArray,ce=0,_r,Sr,Or,xr,Pr,Cr,Ar;a.__reactDisabledLog=!0;var ze,Nr,De=!1,Ve=new(typeof WeakMap=="function"?WeakMap:Map),on=Symbol.for("react.client.reference"),kr,Mr={},Wr={},Lr={};ee.Fragment=U,ee.jsx=function(n,v,g,E,O){return b(n,v,g,!1,E,O)},ee.jsxs=function(n,v,g,E,O){return b(n,v,g,!0,E,O)}}()),ee}var qe;function Gr(){return qe||(qe=1,process.env.NODE_ENV==="production"?le.exports=Ir():le.exports=Br()),le.exports}var H=Gr(),Yr=typeof global=="object"&&global&&global.Object===Object&&global,Hr=typeof self=="object"&&self&&self.Object===Object&&self,Ur=Yr||Hr||Function("return this")(),de=Ur.Symbol,Ze=Object.prototype,zr=Ze.hasOwnProperty,Dr=Ze.toString,re=de?de.toStringTag:void 0;function Vr(e){var t=zr.call(e,re),r=e[re];try{e[re]=void 0;var a=!0}catch{}var i=Dr.call(e);return a&&(t?e[re]=r:delete e[re]),i}var Jr=Object.prototype,Xr=Jr.toString;function qr(e){return Xr.call(e)}var Zr="[object Null]",Qr="[object Undefined]",Qe=de?de.toStringTag:void 0;function Kr(e){return e==null?e===void 0?Qr:Zr:Qe&&Qe in Object(e)?Vr(e):qr(e)}function $r(e){return e!=null&&typeof e=="object"}var et=Array.isArray;function rt(){}var tt="[object String]";function nt(e){return typeof e=="string"||!et(e)&&$r(e)&&Kr(e)==tt}var Te={exports:{}};/*!
|
|
32
|
-
Copyright (c) 2018 Jed Watson.
|
|
33
|
-
Licensed under the MIT License (MIT), see
|
|
34
|
-
http://jedwatson.github.io/classnames
|
|
35
|
-
*/var Ke;function at(){return Ke||(Ke=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(o=i(o,a(s)))}return o}function a(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var c="";for(var s in o)t.call(o,s)&&o[s]&&(c=i(c,s));return c}function i(o,c){return c?o?o+" "+c:o+c:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Te)),Te.exports}var ot=at();const it=Ee(ot);var ut=function(e){return function(t,r){var a=h.useRef(!1);e(function(){return function(){a.current=!1}},[]),e(function(){if(!a.current)a.current=!0;else return t()},r)}},N=function(){return N=Object.assign||function(t){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},N.apply(this,arguments)};function $e(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]]);return r}function ct(e,t,r,a){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function s(d){try{u(a.next(d))}catch(l){c(l)}}function f(d){try{u(a.throw(d))}catch(l){c(l)}}function u(d){d.done?o(d.value):i(d.value).then(s,f)}u((a=a.apply(e,t||[])).next())})}function st(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,i,o,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=s(0),c.throw=s(1),c.return=s(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function s(u){return function(d){return f([u,d])}}function f(u){if(a)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(r=0)),r;)try{if(a=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],i=0}finally{a=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function j(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),i,o=[],c;try{for(;(t===void 0||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(s){c={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(c)throw c.error}}return o}function S(e,t,r){if(r||arguments.length===2)for(var a=0,i=t.length,o;a<i;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var te=function(e){return typeof e=="function"},ve=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Q(e){ve&&(te(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=h.useRef(e);t.current=h.useMemo(function(){return e},[e]);var r=h.useRef();return r.current||(r.current=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];return t.current.apply(this,a)}),r.current}const we=ut(h.useEffect);var er=function(e,t){var r=t.manual,a=t.ready,i=a===void 0?!0:a,o=t.defaultParams,c=o===void 0?[]:o,s=t.refreshDeps,f=s===void 0?[]:s,u=t.refreshDepsAction,d=h.useRef(!1);return d.current=!1,we(function(){!r&&i&&(d.current=!0,e.run.apply(e,S([],j(c),!1)))},[i]),we(function(){d.current||r||(d.current=!0,u?u():e.refresh())},S([],j(f),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};er.onInit=function(e){var t=e.ready,r=t===void 0?!0:t,a=e.manual;return{loading:!a&&r}};function Re(e,t){if(e===t)return!0;for(var r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function rr(e,t){var r=h.useRef({deps:t,obj:void 0,initialized:!1}).current;return(r.initialized===!1||!Re(r.deps,t))&&(r.deps=t,r.obj=e(),r.initialized=!0),r.obj}function je(e){var t=h.useRef(e);return t.current=e,t}var ge=function(e){ve&&(te(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=je(e);h.useEffect(function(){return function(){t.current()}},[])},be=new Map,ft=function(e,t,r){var a=be.get(e);a!=null&&a.timer&&clearTimeout(a.timer);var i=void 0;t>-1&&(i=setTimeout(function(){be.delete(e)},t)),be.set(e,N(N({},r),{timer:i}))},lt=function(e){return be.get(e)},me=new Map,dt=function(e){return me.get(e)},vt=function(e,t){me.set(e,t),t.then(function(r){return me.delete(e),r}).catch(function(){me.delete(e)})},D={},gt=function(e,t){D[e]&&D[e].forEach(function(r){return r(t)})},_e=function(e,t){return D[e]||(D[e]=[]),D[e].push(t),function(){var a=D[e].indexOf(t);D[e].splice(a,1)}},bt=function(e,t){var r=t.cacheKey,a=t.cacheTime,i=a===void 0?5*60*1e3:a,o=t.staleTime,c=o===void 0?0:o,s=t.setCache,f=t.getCache,u=h.useRef(),d=h.useRef(),l=function(m,b){s?s(b):ft(m,i,b),gt(m,b.data)},p=function(m,b){return b===void 0&&(b=[]),f?f(b):lt(m)};return rr(function(){if(r){var m=p(r);m&&Object.hasOwnProperty.call(m,"data")&&(e.state.data=m.data,e.state.params=m.params,(c===-1||new Date().getTime()-m.time<=c)&&(e.state.loading=!1)),u.current=_e(r,function(b){e.setState({data:b})})}},[]),ge(function(){var m;(m=u.current)===null||m===void 0||m.call(u)}),r?{onBefore:function(m){var b=p(r,m);return!b||!Object.hasOwnProperty.call(b,"data")?{}:c===-1||new Date().getTime()-b.time<=c?{loading:!1,data:b==null?void 0:b.data,error:void 0,returnNow:!0}:{data:b==null?void 0:b.data,error:void 0}},onRequest:function(m,b){var T=dt(r);return T&&T!==d.current?{servicePromise:T}:(T=m.apply(void 0,S([],j(b),!1)),d.current=T,vt(r,T),{servicePromise:T})},onSuccess:function(m,b){var T;r&&((T=u.current)===null||T===void 0||T.call(u),l(r,{data:m,params:b,time:new Date().getTime()}),u.current=_e(r,function(P){e.setState({data:P})}))},onMutate:function(m){var b;r&&((b=u.current)===null||b===void 0||b.call(u),l(r,{data:m,params:e.state.params,time:new Date().getTime()}),u.current=_e(r,function(T){e.setState({data:T})}))}}:{}},Se,tr;function Oe(){if(tr)return Se;tr=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Se=e,Se}var xe,nr;function mt(){if(nr)return xe;nr=1;var e=typeof fe=="object"&&fe&&fe.Object===Object&&fe;return xe=e,xe}var Pe,ar;function or(){if(ar)return Pe;ar=1;var e=mt(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Pe=r,Pe}var Ce,ir;function ht(){if(ir)return Ce;ir=1;var e=or(),t=function(){return e.Date.now()};return Ce=t,Ce}var Ae,ur;function yt(){if(ur)return Ae;ur=1;var e=/\s/;function t(r){for(var a=r.length;a--&&e.test(r.charAt(a)););return a}return Ae=t,Ae}var Ne,cr;function pt(){if(cr)return Ne;cr=1;var e=yt(),t=/^\s+/;function r(a){return a&&a.slice(0,e(a)+1).replace(t,"")}return Ne=r,Ne}var ke,sr;function fr(){if(sr)return ke;sr=1;var e=or(),t=e.Symbol;return ke=t,ke}var Me,lr;function Et(){if(lr)return Me;lr=1;var e=fr(),t=Object.prototype,r=t.hasOwnProperty,a=t.toString,i=e?e.toStringTag:void 0;function o(c){var s=r.call(c,i),f=c[i];try{c[i]=void 0;var u=!0}catch{}var d=a.call(c);return u&&(s?c[i]=f:delete c[i]),d}return Me=o,Me}var We,dr;function Tt(){if(dr)return We;dr=1;var e=Object.prototype,t=e.toString;function r(a){return t.call(a)}return We=r,We}var Le,vr;function wt(){if(vr)return Le;vr=1;var e=fr(),t=Et(),r=Tt(),a="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function c(s){return s==null?s===void 0?i:a:o&&o in Object(s)?t(s):r(s)}return Le=c,Le}var Fe,gr;function Rt(){if(gr)return Fe;gr=1;function e(t){return t!=null&&typeof t=="object"}return Fe=e,Fe}var Ie,br;function jt(){if(br)return Ie;br=1;var e=wt(),t=Rt(),r="[object Symbol]";function a(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Ie=a,Ie}var Be,mr;function _t(){if(mr)return Be;mr=1;var e=pt(),t=Oe(),r=jt(),a=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;function f(u){if(typeof u=="number")return u;if(r(u))return a;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var l=o.test(u);return l||c.test(u)?s(u.slice(2),l?2:8):i.test(u)?a:+u}return Be=f,Be}var Ge,hr;function yr(){if(hr)return Ge;hr=1;var e=Oe(),t=ht(),r=_t(),a="Expected a function",i=Math.max,o=Math.min;function c(s,f,u){var d,l,p,m,b,T,P=0,L=!1,M=!1,F=!0;if(typeof s!="function")throw new TypeError(a);f=r(f)||0,e(u)&&(L=!!u.leading,M="maxWait"in u,p=M?i(r(u.maxWait)||0,f):p,F="trailing"in u?!!u.trailing:F);function W(w){var A=d,B=l;return d=l=void 0,P=w,m=s.apply(B,A),m}function V(w){return P=w,b=setTimeout(C,f),L?W(w):m}function U(w){var A=w-T,B=w-P,ye=f-A;return M?o(ye,p-B):ye}function I(w){var A=w-T,B=w-P;return T===void 0||A>=f||A<0||M&&B>=p}function C(){var w=t();if(I(w))return ie(w);b=setTimeout(C,U(w))}function ie(w){return b=void 0,F&&d?W(w):(d=l=void 0,m)}function he(){b!==void 0&&clearTimeout(b),P=0,d=T=l=b=void 0}function ue(){return b===void 0?m:ie(t())}function J(){var w=t(),A=I(w);if(d=arguments,l=this,T=w,A){if(b===void 0)return V(T);if(M)return clearTimeout(b),b=setTimeout(C,f),W(T)}return b===void 0&&(b=setTimeout(C,f)),m}return J.cancel=he,J.flush=ue,J}return Ge=c,Ge}var St=yr();const Ot=Ee(St);var xt=function(e,t){var r=t.debounceWait,a=t.debounceLeading,i=t.debounceTrailing,o=t.debounceMaxWait,c=h.useRef(),s=h.useMemo(function(){var f={};return a!==void 0&&(f.leading=a),i!==void 0&&(f.trailing=i),o!==void 0&&(f.maxWait=o),f},[a,i,o]);return h.useEffect(function(){if(r){var f=e.runAsync.bind(e);return c.current=Ot(function(u){u()},r,s),e.runAsync=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return new Promise(function(l,p){var m;(m=c.current)===null||m===void 0||m.call(c,function(){f.apply(void 0,S([],j(u),!1)).then(l).catch(p)})})},function(){var u;(u=c.current)===null||u===void 0||u.cancel(),e.runAsync=f}}},[r,s]),r?{onCancel:function(){var f;(f=c.current)===null||f===void 0||f.cancel()}}:{}},Pt=function(e,t){var r=t.loadingDelay,a=t.ready,i=h.useRef();if(!r)return{};var o=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return o(),a!==!1&&(i.current=setTimeout(function(){e.setState({loading:!0})},r)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}},ne=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ye(){return ne?document.visibilityState!=="hidden":!0}var ae=[];function Ct(e){return ae.push(e),function(){var r=ae.indexOf(e);ae.splice(r,1)}}if(ne){var At=function(){if(Ye())for(var e=0;e<ae.length;e++){var t=ae[e];t()}};window.addEventListener("visibilitychange",At,!1)}var Nt=function(e,t){var r=t.pollingInterval,a=t.pollingWhenHidden,i=a===void 0?!0:a,o=t.pollingErrorRetryCount,c=o===void 0?-1:o,s=h.useRef(),f=h.useRef(),u=h.useRef(0),d=function(){var l;s.current&&clearTimeout(s.current),(l=f.current)===null||l===void 0||l.call(f)};return we(function(){r||d()},[r]),r?{onBefore:function(){d()},onError:function(){u.current+=1},onSuccess:function(){u.current=0},onFinally:function(){c===-1||c!==-1&&u.current<=c?s.current=setTimeout(function(){!i&&!Ye()?f.current=Ct(function(){e.refresh()}):e.refresh()},r):u.current=0},onCancel:function(){d()}}:{}};function kt(e,t){var r=!1;return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];r||(r=!0,e.apply(void 0,S([],j(a),!1)),setTimeout(function(){r=!1},t))}}function Mt(){return ne&&typeof navigator.onLine<"u"?navigator.onLine:!0}var oe=[];function Wt(e){return oe.push(e),function(){var r=oe.indexOf(e);r>-1&&oe.splice(r,1)}}if(ne){var pr=function(){if(!(!Ye()||!Mt()))for(var e=0;e<oe.length;e++){var t=oe[e];t()}};window.addEventListener("visibilitychange",pr,!1),window.addEventListener("focus",pr,!1)}var Lt=function(e,t){var r=t.refreshOnWindowFocus,a=t.focusTimespan,i=a===void 0?5e3:a,o=h.useRef(),c=function(){var s;(s=o.current)===null||s===void 0||s.call(o)};return h.useEffect(function(){if(r){var s=kt(e.refresh.bind(e),i);o.current=Wt(function(){s()})}return function(){c()}},[r,i]),ge(function(){c()}),{}},Ft=function(e,t){var r=t.retryInterval,a=t.retryCount,i=h.useRef(),o=h.useRef(0),c=h.useRef(!1);return a?{onBefore:function(){c.current||(o.current=0),c.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){o.current=0},onError:function(){if(o.current+=1,a===-1||o.current<=a){var s=r??Math.min(1e3*Math.pow(2,o.current),3e4);i.current=setTimeout(function(){c.current=!0,e.refresh()},s)}else o.current=0},onCancel:function(){o.current=0,i.current&&clearTimeout(i.current)}}:{}},He,Er;function It(){if(Er)return He;Er=1;var e=yr(),t=Oe(),r="Expected a function";function a(i,o,c){var s=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(c)&&(s="leading"in c?!!c.leading:s,f="trailing"in c?!!c.trailing:f),e(i,o,{leading:s,maxWait:o,trailing:f})}return He=a,He}var Bt=It();const Gt=Ee(Bt);var Yt=function(e,t){var r=t.throttleWait,a=t.throttleLeading,i=t.throttleTrailing,o=h.useRef(),c={};return a!==void 0&&(c.leading=a),i!==void 0&&(c.trailing=i),h.useEffect(function(){if(r){var s=e.runAsync.bind(e);return o.current=Gt(function(f){f()},r,c),e.runAsync=function(){for(var f=[],u=0;u<arguments.length;u++)f[u]=arguments[u];return new Promise(function(d,l){var p;(p=o.current)===null||p===void 0||p.call(o,function(){s.apply(void 0,S([],j(f),!1)).then(d).catch(l)})})},function(){var f;e.runAsync=s,(f=o.current)===null||f===void 0||f.cancel()}}},[r,a,i]),r?{onCancel:function(){var s;(s=o.current)===null||s===void 0||s.cancel()}}:{}},Ht=function(e){ve&&(te(e)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e,'".'))),h.useEffect(function(){e==null||e()},[])},Ut=function(){var e=j(h.useState({}),2),t=e[1];return h.useCallback(function(){return t({})},[])},zt=function(){function e(t,r,a,i){i===void 0&&(i={}),this.serviceRef=t,this.options=r,this.subscribe=a,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=N(N(N({},this.state),{loading:!r.manual}),i)}return e.prototype.setState=function(t){t===void 0&&(t={}),this.state=N(N({},this.state),t),this.subscribe()},e.prototype.runPluginHandler=function(t){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var i=this.pluginImpls.map(function(o){var c;return(c=o[t])===null||c===void 0?void 0:c.call.apply(c,S([o],j(r),!1))}).filter(Boolean);return Object.assign.apply(Object,S([{}],j(i),!1))},e.prototype.runAsync=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return ct(this,void 0,void 0,function(){var a,i,o,c,s,f,u,d,l,p,m,b,T,P,L,M,F,W,V,U,I;return st(this,function(C){switch(C.label){case 0:if(this.count+=1,a=this.count,i=this.runPluginHandler("onBefore",t),o=i.stopNow,c=o===void 0?!1:o,s=i.returnNow,f=s===void 0?!1:s,u=$e(i,["stopNow","returnNow"]),c)return[2,new Promise(function(){})];if(this.setState(N({loading:!0,params:t},u)),f)return[2,Promise.resolve(u.data)];(T=(b=this.options).onBefore)===null||T===void 0||T.call(b,t),C.label=1;case 1:return C.trys.push([1,3,,4]),d=this.runPluginHandler("onRequest",this.serviceRef.current,t).servicePromise,d||(d=(m=this.serviceRef).current.apply(m,S([],j(t),!1))),[4,d];case 2:return l=C.sent(),a!==this.count?[2,new Promise(function(){})]:(this.setState({data:l,error:void 0,loading:!1}),(L=(P=this.options).onSuccess)===null||L===void 0||L.call(P,l,t),this.runPluginHandler("onSuccess",l,t),(F=(M=this.options).onFinally)===null||F===void 0||F.call(M,t,l,void 0),a===this.count&&this.runPluginHandler("onFinally",t,l,void 0),[2,l]);case 3:if(p=C.sent(),a!==this.count)return[2,new Promise(function(){})];throw this.setState({error:p,loading:!1}),(V=(W=this.options).onError)===null||V===void 0||V.call(W,p,t),this.runPluginHandler("onError",p,t),(I=(U=this.options).onFinally)===null||I===void 0||I.call(U,t,void 0,p),a===this.count&&this.runPluginHandler("onFinally",t,void 0,p),p;case 4:return[2]}})})},e.prototype.run=function(){for(var t=this,r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];this.runAsync.apply(this,S([],j(r),!1)).catch(function(i){t.options.onError||console.error(i)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,S([],j(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,S([],j(this.state.params||[]),!1))},e.prototype.mutate=function(t){var r=te(t)?t(this.state.data):t;this.runPluginHandler("onMutate",r),this.setState({data:r})},e}();function Dt(e,t,r){t===void 0&&(t={}),r===void 0&&(r=[]);var a=t.manual,i=a===void 0?!1:a,o=t.ready,c=o===void 0?!0:o,s=$e(t,["manual","ready"]);ve&&t.defaultParams&&!Array.isArray(t.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof t.defaultParams));var f=N({manual:i,ready:c},s),u=je(e),d=Ut(),l=rr(function(){var p=r.map(function(m){var b;return(b=m==null?void 0:m.onInit)===null||b===void 0?void 0:b.call(m,f)}).filter(Boolean);return new zt(u,f,d,Object.assign.apply(Object,S([{}],j(p),!1)))},[]);return l.options=f,l.pluginImpls=r.map(function(p){return p(l,f)}),Ht(function(){if(!i&&c){var p=l.state.params||t.defaultParams||[];l.run.apply(l,S([],j(p),!1))}}),ge(function(){l.cancel()}),{loading:l.state.loading,data:l.state.data,error:l.state.error,params:l.state.params||[],cancel:Q(l.cancel.bind(l)),refresh:Q(l.refresh.bind(l)),refreshAsync:Q(l.refreshAsync.bind(l)),run:Q(l.run.bind(l)),runAsync:Q(l.runAsync.bind(l)),mutate:Q(l.mutate.bind(l))}}function Vt(e,t,r){return Dt(e,t,S(S([],j(r||[]),!1),[xt,Pt,Nt,Lt,Yt,er,bt,Ft],!1))}function Jt(e,t){var r=j(h.useState(e),2),a=r[0],i=r[1],o=h.useMemo(function(){var c=!0,s=function(){return i(function(l){return l===e?c:e})},f=function(l){return i(l)},u=function(){return i(e)},d=function(){return i(c)};return{toggle:s,set:f,setLeft:u,setRight:d}},[]);return[a,o]}function Xt(e){var t=j(Jt(!1),2),r=t[0],a=t[1],i=a.toggle,o=a.set,c=h.useMemo(function(){var s=function(){return o(!0)},f=function(){return o(!1)};return{toggle:i,set:function(u){return o(!!u)},setTrue:s,setFalse:f}},[]);return[r,c]}function Tr(e,t){if(ne){if(!e)return t;var r;return te(e)?r=e():"current"in e?r=e.current:r=e,r}}var qt=function(e){var t=function(r,a,i){var o=h.useRef(!1),c=h.useRef([]),s=h.useRef([]),f=h.useRef();e(function(){var u,d=Array.isArray(i)?i:[i],l=d.map(function(p){return Tr(p)});if(!o.current){o.current=!0,c.current=l,s.current=a,f.current=r();return}(l.length!==c.current.length||!Re(c.current,l)||!Re(s.current,a))&&((u=f.current)===null||u===void 0||u.call(f),c.current=l,s.current=a,f.current=r())}),ge(function(){var u;(u=f.current)===null||u===void 0||u.call(f),o.current=!1})};return t},Zt=qt(h.useEffect);function wr(e,t,r){r===void 0&&(r={});var a=r.enable,i=a===void 0?!0:a,o=je(t);Zt(function(){if(i){var c=Tr(r.target,window);if(c!=null&&c.addEventListener){var s=function(u){return o.current(u)},f=Array.isArray(e)?e:[e];return f.forEach(function(u){c.addEventListener(u,s,{capture:r.capture,once:r.once,passive:r.passive})}),function(){f.forEach(function(u){c.removeEventListener(u,s,{capture:r.capture})})}}}},[e,r.capture,r.once,r.passive,i],r.target)}const Qt=function(e,t){var r={},a=r.onEnter,i=r.onLeave,o=r.onChange,c=j(Xt(),2),s=c[0],f=c[1],u=f.setTrue,d=f.setFalse;return wr("mouseenter",function(){a==null||a(),u(),o==null||o(!0)},{target:e}),wr("mouseleave",function(){i==null||i(),d(),o==null||o(!1)},{target:e}),s},Kt=h.forwardRef(({type:e="",className:t="",symbol:r=!1,...a},i)=>r?H.jsx("svg",{className:`iconfont-symbol ${e} ${t}`,"aria-hidden":"true",ref:i,...a,children:H.jsx("use",{xlinkHref:`#${e}`})}):H.jsx("i",{className:`iconfont ${e} ${t}`,ref:i,...a})),$t={btn_icon__warp:"_btn_icon__warp_ay6he_1"},en=(e,t)=>{const r=h.useRef(null),{icon:a,tooltipDisabled:i=!1,onClick:o=rt,disabled:c,size:s="middle",style:f={},className:u,loading:d=!1,...l}=e,p=Qt(r),m=()=>nt(a)&&a.includes("icon-")?H.jsx(Kt,{type:a}):a,b=H.jsx(k.Button,{onClick:o,size:s,disabled:c,style:f,ref:t,loading:d,className:it([u,$t.btn_icon__warp]),icon:m()});if(!a)throw new Error("IconButton 组件必须传入 icon 属性");return H.jsxs(h.Fragment,{children:[i&&b,!i&&H.jsx(k.Tooltip,{open:p,trigger:"contextMenu",destroyTooltipOnHide:!0,...l,children:H.jsx("span",{ref:r,style:{display:"inline-block"},className:"icon-button-box",children:b})})]})},rn=h.forwardRef(en);function tn(e,t,r){const a=Vt(e,{...t,onError(o,c){var s;((t==null?void 0:t.errorMessage)??!0)&&_.message.error(o.message),(s=t==null?void 0:t.onError)==null||s.call(t,o,c)}},r),i=a.data&&typeof a.data=="object"&&"data"in a.data?a.data.data:a.data;return{...a,data:i}}_.App=Fr,_.IconButton=rn,_.useRequest=tn,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|