xmirror-components 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/index.cjs +31 -0
- package/build/dist/index.mjs +1382 -0
- package/build/es/index.d.ts +3 -1
- package/build/es/index.js +3 -1
- package/build/lib/components/AntdApp/index.d.ts +12 -0
- package/build/lib/components/CheckboxValue/index.d.ts +40 -0
- package/build/lib/components/IconButton/index.d.ts +42 -0
- package/build/lib/components/IconFont/index.d.ts +21 -0
- package/build/lib/components/SwitchValue/index.d.ts +30 -0
- package/build/lib/hooks/useRequest/index.d.ts +19 -0
- package/build/lib/index.d.ts +131 -0
- 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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("antd"),p=require("react");exports.message=X.message;exports.notification=X.notification;exports.modal=X.Modal;function Cr({children:r}){const e=X.App.useApp();return exports.message=e.message,exports.modal=e.modal,exports.notification=e.notification,r}var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var se={exports:{}},re={};/**
|
|
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 er;function Ar(){if(er)return re;er=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(a,o,i){var c=null;if(i!==void 0&&(c=""+i),o.key!==void 0&&(c=""+o.key),"key"in o){i={};for(var f in o)f!=="key"&&(i[f]=o[f])}else i=o;return o=i.ref,{$$typeof:r,type:a,key:c,ref:o!==void 0?o:null,props:i}}return re.Fragment=e,re.jsx=n,re.jsxs=n,re}var te={};/**
|
|
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 rr;function Nr(){return rr||(rr=1,process.env.NODE_ENV!=="production"&&function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Or?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case L:return"Fragment";case G:return"Portal";case P:return"Profiler";case W:return"StrictMode";case U:return"Suspense";case w:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case ie:return(t.displayName||"Context")+".Provider";case Z:return(t._context.displayName||"Context")+".Consumer";case Q:var l=t.render;return t=t.displayName,t||(t=l.displayName||l.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case C:return l=t.displayName||null,l!==null?l:r(t.type)||"Memo";case $:l=t._payload,t=t._init;try{return r(t(l))}catch{}}return null}function e(t){return""+t}function n(t){try{e(t);var l=!1}catch{l=!0}if(l){l=console;var d=l.error,y=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return d.call(l,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",y),e(t)}}function a(){}function o(){if(K===0){Ge=console.log,Ue=console.info,Be=console.warn,He=console.error,ze=console.group,De=console.groupCollapsed,Ve=console.groupEnd;var t={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}K++}function i(){if(K--,K===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},t,{value:Ge}),info:H({},t,{value:Ue}),warn:H({},t,{value:Be}),error:H({},t,{value:He}),group:H({},t,{value:ze}),groupCollapsed:H({},t,{value:De}),groupEnd:H({},t,{value:Ve})})}0>K&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function c(t){if(he===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);he=l&&l[1]||"",Je=-1<d.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+he+t+Je}function f(t,l){if(!t||ye)return"";var d=pe.get(t);if(d!==void 0)return d;ye=!0,d=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var y=null;y=B.H,B.H=null,o();try{var j={DetermineComponentFrameRoot:function(){try{if(l){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(I){var ce=I}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(I){ce=I}t.call(Y.prototype)}}else{try{throw Error()}catch(I){ce=I}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&ce&&typeof I.stack=="string")return[I.stack,ce.stack]}return[null,null]}};j.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(j.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(j.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=j.DetermineComponentFrameRoot(),F=h[0],V=h[1];if(F&&V){var O=F.split(`
|
|
20
|
+
`),z=V.split(`
|
|
21
|
+
`);for(h=R=0;R<O.length&&!O[R].includes("DetermineComponentFrameRoot");)R++;for(;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;if(R===O.length||h===z.length)for(R=O.length-1,h=z.length-1;1<=R&&0<=h&&O[R]!==z[h];)h--;for(;1<=R&&0<=h;R--,h--)if(O[R]!==z[h]){if(R!==1||h!==1)do if(R--,h--,0>h||O[R]!==z[h]){var ee=`
|
|
22
|
+
`+O[R].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),typeof t=="function"&&pe.set(t,ee),ee}while(1<=R&&0<=h);break}}}finally{ye=!1,B.H=y,i(),Error.prepareStackTrace=d}return O=(O=t?t.displayName||t.name:"")?c(O):"",typeof t=="function"&&pe.set(t,O),O}function s(t){if(t==null)return"";if(typeof t=="function"){var l=t.prototype;return f(t,!(!l||!l.isReactComponent))}if(typeof t=="string")return c(t);switch(t){case U:return c("Suspense");case w:return c("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case Q:return t=f(t.render,!1),t;case C:return s(t.type);case $:l=t._payload,t=t._init;try{return s(t(l))}catch{}}return""}function u(){var t=B.A;return t===null?null:t.getOwner()}function m(t){if(Ye.call(t,"key")){var l=Object.getOwnPropertyDescriptor(t,"key").get;if(l&&l.isReactWarning)return!1}return t.key!==void 0}function v(t,l){function d(){Xe||(Xe=!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)",l))}d.isReactWarning=!0,Object.defineProperty(t,"key",{get:d,configurable:!0})}function E(){var t=r(this.type);return Ze[t]||(Ze[t]=!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.")),t=this.props.ref,t!==void 0?t:null}function g(t,l,d,y,j,R){return d=R.ref,t={$$typeof:k,type:t,key:l,props:R,_owner:j},(d!==void 0?d:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:E}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function b(t,l,d,y,j,R){if(typeof t=="string"||typeof t=="function"||t===L||t===P||t===W||t===U||t===w||t===ue||typeof t=="object"&&t!==null&&(t.$$typeof===$||t.$$typeof===C||t.$$typeof===ie||t.$$typeof===Z||t.$$typeof===Q||t.$$typeof===xr||t.getModuleId!==void 0)){var h=l.children;if(h!==void 0)if(y)if(ge(h)){for(y=0;y<h.length;y++)T(h[y],t);Object.freeze&&Object.freeze(h)}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(h,t)}else h="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?y="null":ge(t)?y="array":t!==void 0&&t.$$typeof===k?(y="<"+(r(t.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):y=typeof t,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",y,h);if(Ye.call(l,"key")){h=r(t);var F=Object.keys(l).filter(function(O){return O!=="key"});y=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",Qe[h+y]||(F=0<F.length?"{"+F.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} />`,y,h,F,h),Qe[h+y]=!0)}if(h=null,d!==void 0&&(n(d),h=""+d),m(l)&&(n(l.key),h=""+l.key),"key"in l){d={};for(var V in l)V!=="key"&&(d[V]=l[V])}else d=l;return h&&v(d,typeof t=="function"?t.displayName||t.name||"Unknown":t),g(t,h,R,j,u(),d)}function T(t,l){if(typeof t=="object"&&t&&t.$$typeof!==Pr){if(ge(t))for(var d=0;d<t.length;d++){var y=t[d];x(y)&&q(y,l)}else if(x(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?d=null:(d=Le&&t[Le]||t["@@iterator"],d=typeof d=="function"?d:null),typeof d=="function"&&d!==t.entries&&(d=d.call(t),d!==t))for(;!(t=d.next()).done;)x(t.value)&&q(t.value,l)}}function x(t){return typeof t=="object"&&t!==null&&t.$$typeof===k}function q(t,l){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,l=N(l),!Ke[l])){Ke[l]=!0;var d="";t&&t._owner!=null&&t._owner!==u()&&(d=null,typeof t._owner.tag=="number"?d=r(t._owner.type):typeof t._owner.name=="string"&&(d=t._owner.name),d=" It was passed a child from "+d+".");var y=B.getCurrentStack;B.getCurrentStack=function(){var j=s(t.type);return y&&(j+=y()||""),j},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.',l,d),B.getCurrentStack=y}}function N(t){var l="",d=u();return d&&(d=r(d.type))&&(l=`
|
|
28
|
+
|
|
29
|
+
Check the render method of \``+d+"`."),l||(t=r(t))&&(l=`
|
|
30
|
+
|
|
31
|
+
Check the top-level render call using <`+t+">."),l}var M=p,k=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),Le=Symbol.iterator,Or=Symbol.for("react.client.reference"),B=M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ye=Object.prototype.hasOwnProperty,H=Object.assign,xr=Symbol.for("react.client.reference"),ge=Array.isArray,K=0,Ge,Ue,Be,He,ze,De,Ve;a.__reactDisabledLog=!0;var he,Je,ye=!1,pe=new(typeof WeakMap=="function"?WeakMap:Map),Pr=Symbol.for("react.client.reference"),Xe,Ze={},Qe={},Ke={};te.Fragment=L,te.jsx=function(t,l,d,y,j){return b(t,l,d,!1,y,j)},te.jsxs=function(t,l,d,y,j){return b(t,l,d,!0,y,j)}}()),te}var tr;function kr(){return tr||(tr=1,process.env.NODE_ENV==="production"?se.exports=Ar():se.exports=Nr()),se.exports}var ne=kr();const qr=p.forwardRef(({type:r="",className:e="",symbol:n=!1,...a},o)=>n?ne.jsx("svg",{className:`iconfont-symbol ${r} ${e}`,"aria-hidden":"true",ref:o,...a,children:ne.jsx("use",{xlinkHref:`#${r}`})}):ne.jsx("i",{className:`iconfont ${r} ${e}`,ref:o,...a})),Mr=({checked:r,onChange:e,trueValue:n=!0,falseValue:a=!1,trueLabel:o="",falseLabel:i="",children:c,...f})=>{const s=r===n,u=m=>{e==null||e(m.target.checked?n:a,m)};return ne.jsx(X.Checkbox,{checked:s,onChange:u,...f,children:c||(s?o:i)})},Wr=({checked:r,onChange:e,trueValue:n=!0,falseValue:a=!1,...o})=>{const i=r===n,c=(f,s)=>{e==null||e(f?n:a,s)};return ne.jsx(X.Switch,{checked:i,onChange:c,...o})};var $r=function(r){return function(e,n){var a=p.useRef(!1);r(function(){return function(){a.current=!1}},[]),r(function(){if(!a.current)a.current=!0;else return e()},n)}},A=function(){return A=Object.assign||function(e){for(var n,a=1,o=arguments.length;a<o;a++){n=arguments[a];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},A.apply(this,arguments)};function Er(r,e){var n={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(n[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(r);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(n[a[o]]=r[a[o]]);return n}function Fr(r,e,n,a){function o(i){return i instanceof n?i:new n(function(c){c(i)})}return new(n||(n=Promise))(function(i,c){function f(m){try{u(a.next(m))}catch(v){c(v)}}function s(m){try{u(a.throw(m))}catch(v){c(v)}}function u(m){m.done?i(m.value):o(m.value).then(f,s)}u((a=a.apply(r,e||[])).next())})}function Ir(r,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=f(0),c.throw=f(1),c.return=f(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(u){return function(m){return s([u,m])}}function s(u){if(a)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(n=0)),n;)try{if(a=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(r,n)}catch(m){u=[6,m],o=0}finally{a=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _(r,e){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var a=n.call(r),o,i=[],c;try{for(;(e===void 0||e-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(f){c={error:f}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return i}function S(r,e,n){if(n||arguments.length===2)for(var a=0,o=e.length,i;a<o;a++)(i||!(a in e))&&(i||(i=Array.prototype.slice.call(e,0,a)),i[a]=e[a]);return r.concat(i||Array.prototype.slice.call(e))}var ve=function(r){return typeof r=="function"},me=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function J(r){me&&(ve(r)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof r)));var e=p.useRef(r);e.current=p.useMemo(function(){return r},[r]);var n=p.useRef();return n.current||(n.current=function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return e.current.apply(this,a)}),n.current}const We=$r(p.useEffect);var Tr=function(r,e){var n=e.manual,a=e.ready,o=a===void 0?!0:a,i=e.defaultParams,c=i===void 0?[]:i,f=e.refreshDeps,s=f===void 0?[]:f,u=e.refreshDepsAction,m=p.useRef(!1);return m.current=!1,We(function(){!n&&o&&(m.current=!0,r.run.apply(r,S([],_(c),!1)))},[o]),We(function(){m.current||n||(m.current=!0,u?u():r.refresh())},S([],_(s),!1)),{onBefore:function(){if(!o)return{stopNow:!0}}}};Tr.onInit=function(r){var e=r.ready,n=e===void 0?!0:e,a=r.manual;return{loading:!a&&n}};function Lr(r,e){if(r===e)return!0;for(var n=0;n<r.length;n++)if(!Object.is(r[n],e[n]))return!1;return!0}function wr(r,e){var n=p.useRef({deps:e,obj:void 0,initialized:!1}).current;return(n.initialized===!1||!Lr(n.deps,e))&&(n.deps=e,n.obj=r(),n.initialized=!0),n.obj}function Rr(r){var e=p.useRef(r);return e.current=r,e}var $e=function(r){me&&(ve(r)||console.error("useUnmount expected parameter is a function, got ".concat(typeof r)));var e=Rr(r);p.useEffect(function(){return function(){e.current()}},[])},le=new Map,Yr=function(r,e,n){var a=le.get(r);a!=null&&a.timer&&clearTimeout(a.timer);var o=void 0;e>-1&&(o=setTimeout(function(){le.delete(r)},e)),le.set(r,A(A({},n),{timer:o}))},Gr=function(r){return le.get(r)},de=new Map,Ur=function(r){return de.get(r)},Br=function(r,e){de.set(r,e),e.then(function(n){return de.delete(r),n}).catch(function(){de.delete(r)})},D={},Hr=function(r,e){D[r]&&D[r].forEach(function(n){return n(e)})},Ee=function(r,e){return D[r]||(D[r]=[]),D[r].push(e),function(){var a=D[r].indexOf(e);D[r].splice(a,1)}},zr=function(r,e){var n=e.cacheKey,a=e.cacheTime,o=a===void 0?5*60*1e3:a,i=e.staleTime,c=i===void 0?0:i,f=e.setCache,s=e.getCache,u=p.useRef(),m=p.useRef(),v=function(g,b){f?f(b):Yr(g,o,b),Hr(g,b.data)},E=function(g,b){return b===void 0&&(b=[]),s?s(b):Gr(g)};return wr(function(){if(n){var g=E(n);g&&Object.hasOwnProperty.call(g,"data")&&(r.state.data=g.data,r.state.params=g.params,(c===-1||new Date().getTime()-g.time<=c)&&(r.state.loading=!1)),u.current=Ee(n,function(b){r.setState({data:b})})}},[]),$e(function(){var g;(g=u.current)===null||g===void 0||g.call(u)}),n?{onBefore:function(g){var b=E(n,g);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(g,b){var T=Ur(n);return T&&T!==m.current?{servicePromise:T}:(T=g.apply(void 0,S([],_(b),!1)),m.current=T,Br(n,T),{servicePromise:T})},onSuccess:function(g,b){var T;n&&((T=u.current)===null||T===void 0||T.call(u),v(n,{data:g,params:b,time:new Date().getTime()}),u.current=Ee(n,function(x){r.setState({data:x})}))},onMutate:function(g){var b;n&&((b=u.current)===null||b===void 0||b.call(u),v(n,{data:g,params:r.state.params,time:new Date().getTime()}),u.current=Ee(n,function(T){r.setState({data:T})}))}}:{}},Te,nr;function Fe(){if(nr)return Te;nr=1;function r(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Te=r,Te}var we,ar;function Dr(){if(ar)return we;ar=1;var r=typeof fe=="object"&&fe&&fe.Object===Object&&fe;return we=r,we}var Re,or;function jr(){if(or)return Re;or=1;var r=Dr(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=r||e||Function("return this")();return Re=n,Re}var je,ir;function Vr(){if(ir)return je;ir=1;var r=jr(),e=function(){return r.Date.now()};return je=e,je}var _e,ur;function Jr(){if(ur)return _e;ur=1;var r=/\s/;function e(n){for(var a=n.length;a--&&r.test(n.charAt(a)););return a}return _e=e,_e}var Se,cr;function Xr(){if(cr)return Se;cr=1;var r=Jr(),e=/^\s+/;function n(a){return a&&a.slice(0,r(a)+1).replace(e,"")}return Se=n,Se}var Oe,fr;function _r(){if(fr)return Oe;fr=1;var r=jr(),e=r.Symbol;return Oe=e,Oe}var xe,sr;function Zr(){if(sr)return xe;sr=1;var r=_r(),e=Object.prototype,n=e.hasOwnProperty,a=e.toString,o=r?r.toStringTag:void 0;function i(c){var f=n.call(c,o),s=c[o];try{c[o]=void 0;var u=!0}catch{}var m=a.call(c);return u&&(f?c[o]=s:delete c[o]),m}return xe=i,xe}var Pe,lr;function Qr(){if(lr)return Pe;lr=1;var r=Object.prototype,e=r.toString;function n(a){return e.call(a)}return Pe=n,Pe}var Ce,dr;function Kr(){if(dr)return Ce;dr=1;var r=_r(),e=Zr(),n=Qr(),a="[object Null]",o="[object Undefined]",i=r?r.toStringTag:void 0;function c(f){return f==null?f===void 0?o:a:i&&i in Object(f)?e(f):n(f)}return Ce=c,Ce}var Ae,vr;function et(){if(vr)return Ae;vr=1;function r(e){return e!=null&&typeof e=="object"}return Ae=r,Ae}var Ne,mr;function rt(){if(mr)return Ne;mr=1;var r=Kr(),e=et(),n="[object Symbol]";function a(o){return typeof o=="symbol"||e(o)&&r(o)==n}return Ne=a,Ne}var ke,br;function tt(){if(br)return ke;br=1;var r=Xr(),e=Fe(),n=rt(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;function s(u){if(typeof u=="number")return u;if(n(u))return a;if(e(u)){var m=typeof u.valueOf=="function"?u.valueOf():u;u=e(m)?m+"":m}if(typeof u!="string")return u===0?u:+u;u=r(u);var v=i.test(u);return v||c.test(u)?f(u.slice(2),v?2:8):o.test(u)?a:+u}return ke=s,ke}var qe,gr;function Sr(){if(gr)return qe;gr=1;var r=Fe(),e=Vr(),n=tt(),a="Expected a function",o=Math.max,i=Math.min;function c(f,s,u){var m,v,E,g,b,T,x=0,q=!1,N=!1,M=!0;if(typeof f!="function")throw new TypeError(a);s=n(s)||0,r(u)&&(q=!!u.leading,N="maxWait"in u,E=N?o(n(u.maxWait)||0,s):E,M="trailing"in u?!!u.trailing:M);function k(w){var C=m,$=v;return m=v=void 0,x=w,g=f.apply($,C),g}function G(w){return x=w,b=setTimeout(P,s),q?k(w):g}function L(w){var C=w-T,$=w-x,ue=s-C;return N?i(ue,E-$):ue}function W(w){var C=w-T,$=w-x;return T===void 0||C>=s||C<0||N&&$>=E}function P(){var w=e();if(W(w))return Z(w);b=setTimeout(P,L(w))}function Z(w){return b=void 0,M&&m?k(w):(m=v=void 0,g)}function ie(){b!==void 0&&clearTimeout(b),x=0,m=T=v=b=void 0}function Q(){return b===void 0?g:Z(e())}function U(){var w=e(),C=W(w);if(m=arguments,v=this,T=w,C){if(b===void 0)return G(T);if(N)return clearTimeout(b),b=setTimeout(P,s),k(T)}return b===void 0&&(b=setTimeout(P,s)),g}return U.cancel=ie,U.flush=Q,U}return qe=c,qe}var nt=Sr();const at=pr(nt);var ot=function(r,e){var n=e.debounceWait,a=e.debounceLeading,o=e.debounceTrailing,i=e.debounceMaxWait,c=p.useRef(),f=p.useMemo(function(){var s={};return a!==void 0&&(s.leading=a),o!==void 0&&(s.trailing=o),i!==void 0&&(s.maxWait=i),s},[a,o,i]);return p.useEffect(function(){if(n){var s=r.runAsync.bind(r);return c.current=at(function(u){u()},n,f),r.runAsync=function(){for(var u=[],m=0;m<arguments.length;m++)u[m]=arguments[m];return new Promise(function(v,E){var g;(g=c.current)===null||g===void 0||g.call(c,function(){s.apply(void 0,S([],_(u),!1)).then(v).catch(E)})})},function(){var u;(u=c.current)===null||u===void 0||u.cancel(),r.runAsync=s}}},[n,f]),n?{onCancel:function(){var s;(s=c.current)===null||s===void 0||s.cancel()}}:{}},it=function(r,e){var n=e.loadingDelay,a=e.ready,o=p.useRef();if(!n)return{};var i=function(){o.current&&clearTimeout(o.current)};return{onBefore:function(){return i(),a!==!1&&(o.current=setTimeout(function(){r.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){i()},onCancel:function(){i()}}},be=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ie(){return be?document.visibilityState!=="hidden":!0}var ae=[];function ut(r){return ae.push(r),function(){var n=ae.indexOf(r);ae.splice(n,1)}}if(be){var ct=function(){if(Ie())for(var r=0;r<ae.length;r++){var e=ae[r];e()}};window.addEventListener("visibilitychange",ct,!1)}var ft=function(r,e){var n=e.pollingInterval,a=e.pollingWhenHidden,o=a===void 0?!0:a,i=e.pollingErrorRetryCount,c=i===void 0?-1:i,f=p.useRef(),s=p.useRef(),u=p.useRef(0),m=function(){var v;f.current&&clearTimeout(f.current),(v=s.current)===null||v===void 0||v.call(s)};return We(function(){n||m()},[n]),n?{onBefore:function(){m()},onError:function(){u.current+=1},onSuccess:function(){u.current=0},onFinally:function(){c===-1||c!==-1&&u.current<=c?f.current=setTimeout(function(){!o&&!Ie()?s.current=ut(function(){r.refresh()}):r.refresh()},n):u.current=0},onCancel:function(){m()}}:{}};function st(r,e){var n=!1;return function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];n||(n=!0,r.apply(void 0,S([],_(a),!1)),setTimeout(function(){n=!1},e))}}function lt(){return be&&typeof navigator.onLine<"u"?navigator.onLine:!0}var oe=[];function dt(r){return oe.push(r),function(){var n=oe.indexOf(r);n>-1&&oe.splice(n,1)}}if(be){var hr=function(){if(!(!Ie()||!lt()))for(var r=0;r<oe.length;r++){var e=oe[r];e()}};window.addEventListener("visibilitychange",hr,!1),window.addEventListener("focus",hr,!1)}var vt=function(r,e){var n=e.refreshOnWindowFocus,a=e.focusTimespan,o=a===void 0?5e3:a,i=p.useRef(),c=function(){var f;(f=i.current)===null||f===void 0||f.call(i)};return p.useEffect(function(){if(n){var f=st(r.refresh.bind(r),o);i.current=dt(function(){f()})}return function(){c()}},[n,o]),$e(function(){c()}),{}},mt=function(r,e){var n=e.retryInterval,a=e.retryCount,o=p.useRef(),i=p.useRef(0),c=p.useRef(!1);return a?{onBefore:function(){c.current||(i.current=0),c.current=!1,o.current&&clearTimeout(o.current)},onSuccess:function(){i.current=0},onError:function(){if(i.current+=1,a===-1||i.current<=a){var f=n??Math.min(1e3*Math.pow(2,i.current),3e4);o.current=setTimeout(function(){c.current=!0,r.refresh()},f)}else i.current=0},onCancel:function(){i.current=0,o.current&&clearTimeout(o.current)}}:{}},Me,yr;function bt(){if(yr)return Me;yr=1;var r=Sr(),e=Fe(),n="Expected a function";function a(o,i,c){var f=!0,s=!0;if(typeof o!="function")throw new TypeError(n);return e(c)&&(f="leading"in c?!!c.leading:f,s="trailing"in c?!!c.trailing:s),r(o,i,{leading:f,maxWait:i,trailing:s})}return Me=a,Me}var gt=bt();const ht=pr(gt);var yt=function(r,e){var n=e.throttleWait,a=e.throttleLeading,o=e.throttleTrailing,i=p.useRef(),c={};return a!==void 0&&(c.leading=a),o!==void 0&&(c.trailing=o),p.useEffect(function(){if(n){var f=r.runAsync.bind(r);return i.current=ht(function(s){s()},n,c),r.runAsync=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return new Promise(function(m,v){var E;(E=i.current)===null||E===void 0||E.call(i,function(){f.apply(void 0,S([],_(s),!1)).then(m).catch(v)})})},function(){var s;r.runAsync=f,(s=i.current)===null||s===void 0||s.cancel()}}},[n,a,o]),n?{onCancel:function(){var f;(f=i.current)===null||f===void 0||f.cancel()}}:{}},pt=function(r){me&&(ve(r)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof r,'".'))),p.useEffect(function(){r==null||r()},[])},Et=function(){var r=_(p.useState({}),2),e=r[1];return p.useCallback(function(){return e({})},[])},Tt=function(){function r(e,n,a,o){o===void 0&&(o={}),this.serviceRef=e,this.options=n,this.subscribe=a,this.initState=o,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=A(A(A({},this.state),{loading:!n.manual}),o)}return r.prototype.setState=function(e){e===void 0&&(e={}),this.state=A(A({},this.state),e),this.subscribe()},r.prototype.runPluginHandler=function(e){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var o=this.pluginImpls.map(function(i){var c;return(c=i[e])===null||c===void 0?void 0:c.call.apply(c,S([i],_(n),!1))}).filter(Boolean);return Object.assign.apply(Object,S([{}],_(o),!1))},r.prototype.runAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Fr(this,void 0,void 0,function(){var a,o,i,c,f,s,u,m,v,E,g,b,T,x,q,N,M,k,G,L,W;return Ir(this,function(P){switch(P.label){case 0:if(this.count+=1,a=this.count,o=this.runPluginHandler("onBefore",e),i=o.stopNow,c=i===void 0?!1:i,f=o.returnNow,s=f===void 0?!1:f,u=Er(o,["stopNow","returnNow"]),c)return[2,new Promise(function(){})];if(this.setState(A({loading:!0,params:e},u)),s)return[2,Promise.resolve(u.data)];(T=(b=this.options).onBefore)===null||T===void 0||T.call(b,e),P.label=1;case 1:return P.trys.push([1,3,,4]),m=this.runPluginHandler("onRequest",this.serviceRef.current,e).servicePromise,m||(m=(g=this.serviceRef).current.apply(g,S([],_(e),!1))),[4,m];case 2:return v=P.sent(),a!==this.count?[2,new Promise(function(){})]:(this.setState({data:v,error:void 0,loading:!1}),(q=(x=this.options).onSuccess)===null||q===void 0||q.call(x,v,e),this.runPluginHandler("onSuccess",v,e),(M=(N=this.options).onFinally)===null||M===void 0||M.call(N,e,v,void 0),a===this.count&&this.runPluginHandler("onFinally",e,v,void 0),[2,v]);case 3:if(E=P.sent(),a!==this.count)return[2,new Promise(function(){})];throw this.setState({error:E,loading:!1}),(G=(k=this.options).onError)===null||G===void 0||G.call(k,E,e),this.runPluginHandler("onError",E,e),(W=(L=this.options).onFinally)===null||W===void 0||W.call(L,e,void 0,E),a===this.count&&this.runPluginHandler("onFinally",e,void 0,E),E;case 4:return[2]}})})},r.prototype.run=function(){for(var e=this,n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];this.runAsync.apply(this,S([],_(n),!1)).catch(function(o){e.options.onError||console.error(o)})},r.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},r.prototype.refresh=function(){this.run.apply(this,S([],_(this.state.params||[]),!1))},r.prototype.refreshAsync=function(){return this.runAsync.apply(this,S([],_(this.state.params||[]),!1))},r.prototype.mutate=function(e){var n=ve(e)?e(this.state.data):e;this.runPluginHandler("onMutate",n),this.setState({data:n})},r}();function wt(r,e,n){e===void 0&&(e={}),n===void 0&&(n=[]);var a=e.manual,o=a===void 0?!1:a,i=e.ready,c=i===void 0?!0:i,f=Er(e,["manual","ready"]);me&&e.defaultParams&&!Array.isArray(e.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof e.defaultParams));var s=A({manual:o,ready:c},f),u=Rr(r),m=Et(),v=wr(function(){var E=n.map(function(g){var b;return(b=g==null?void 0:g.onInit)===null||b===void 0?void 0:b.call(g,s)}).filter(Boolean);return new Tt(u,s,m,Object.assign.apply(Object,S([{}],_(E),!1)))},[]);return v.options=s,v.pluginImpls=n.map(function(E){return E(v,s)}),pt(function(){if(!o&&c){var E=v.state.params||e.defaultParams||[];v.run.apply(v,S([],_(E),!1))}}),$e(function(){v.cancel()}),{loading:v.state.loading,data:v.state.data,error:v.state.error,params:v.state.params||[],cancel:J(v.cancel.bind(v)),refresh:J(v.refresh.bind(v)),refreshAsync:J(v.refreshAsync.bind(v)),run:J(v.run.bind(v)),runAsync:J(v.runAsync.bind(v)),mutate:J(v.mutate.bind(v))}}function Rt(r,e,n){return wt(r,e,S(S([],_(n||[]),!1),[ot,it,ft,vt,yt,Tr,zr,mt],!1))}function jt(r,e,n){const a=Rt(r,{...e,onError(i,c){var f;((e==null?void 0:e.errorMessage)??!0)&&exports.message.error(i.message),(f=e==null?void 0:e.onError)==null||f.call(e,i,c)}},n),o=a.data&&typeof a.data=="object"&&"data"in a.data?a.data.data:a.data;return{...a,data:o}}exports.App=Cr;exports.CheckboxValue=Mr;exports.IconFont=qr;exports.SwitchValue=Wr;exports.useRequest=jt;
|