@yester/virtual-table 1.2.2 → 1.2.3
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/dist/virtual-table.es.js +1113 -1110
- package/dist/virtual-table.es.js.map +1 -1
- package/dist/virtual-table.umd.js +14 -14
- package/dist/virtual-table.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(we,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],C):(we=typeof globalThis<"u"?globalThis:we||self,C(we.VirtualTable={},we.React,we.ReactDOM))})(this,function(we,C,wt){"use strict";function ar(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const te=ar(C);function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ze={exports:{}},Ne={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var _t;function cr(){if(_t)return Ne;_t=1;var e=C,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(d,l,c){var h,v={},E=null,I=null;c!==void 0&&(E=""+c),l.key!==void 0&&(E=""+l.key),l.ref!==void 0&&(I=l.ref);for(h in l)n.call(l,h)&&!s.hasOwnProperty(h)&&(v[h]=l[h]);if(d&&d.defaultProps)for(h in l=d.defaultProps,l)v[h]===void 0&&(v[h]=l[h]);return{$$typeof:t,type:d,key:E,ref:I,props:v,_owner:i.current}}return Ne.Fragment=r,Ne.jsx=a,Ne.jsxs=a,Ne}var Fe={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+H[
|
|
17
|
+
*/var St;function ur(){return St||(St=1,process.env.NODE_ENV!=="production"&&function(){var e=C,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),d=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),A=Symbol.iterator,O="@@iterator";function u(o){if(o===null||typeof o!="object")return null;var f=A&&o[A]||o[O];return typeof f=="function"?f:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(o){{for(var f=arguments.length,y=new Array(f>1?f-1:0),L=1;L<f;L++)y[L-1]=arguments[L];X("error",o,y)}}function X(o,f,y){{var L=M.ReactDebugCurrentFrame,U=L.getStackAddendum();U!==""&&(f+="%s",y=y.concat([U]));var Q=y.map(function(Y){return String(Y)});Q.unshift("Warning: "+f),Function.prototype.apply.call(console[o],console,Q)}}var k=!1,W=!1,$=!1,D=!1,p=!1,F;F=Symbol.for("react.module.reference");function z(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===s||p||o===i||o===c||o===h||D||o===I||k||W||$||typeof o=="object"&&o!==null&&(o.$$typeof===E||o.$$typeof===v||o.$$typeof===a||o.$$typeof===d||o.$$typeof===l||o.$$typeof===F||o.getModuleId!==void 0))}function V(o,f,y){var L=o.displayName;if(L)return L;var U=f.displayName||f.name||"";return U!==""?y+"("+U+")":y}function K(o){return o.displayName||"Context"}function B(o){if(o==null)return null;if(typeof o.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case h:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case d:var f=o;return K(f)+".Consumer";case a:var y=o;return K(y._context)+".Provider";case l:return V(o,o.render,"ForwardRef");case v:var L=o.displayName||null;return L!==null?L:B(o.type)||"Memo";case E:{var U=o,Q=U._payload,Y=U._init;try{return B(Y(Q))}catch{return null}}}return null}var re=Object.assign,he=0,be,xe,Se,me,Te,Pe,g;function w(){}w.__reactDisabledLog=!0;function _(){{if(he===0){be=console.log,xe=console.info,Se=console.warn,me=console.error,Te=console.group,Pe=console.groupCollapsed,g=console.groupEnd;var o={configurable:!0,enumerable:!0,value:w,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}he++}}function S(){{if(he--,he===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:re({},o,{value:be}),info:re({},o,{value:xe}),warn:re({},o,{value:Se}),error:re({},o,{value:me}),group:re({},o,{value:Te}),groupCollapsed:re({},o,{value:Pe}),groupEnd:re({},o,{value:g})})}he<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var m=M.ReactCurrentDispatcher,T;function R(o,f,y){{if(T===void 0)try{throw Error()}catch(U){var L=U.stack.trim().match(/\n( *(at )?)/);T=L&&L[1]||""}return`
|
|
18
|
+
`+T+o}}var j=!1,x;{var N=typeof WeakMap=="function"?WeakMap:Map;x=new N}function G(o,f){if(!o||j)return"";{var y=x.get(o);if(y!==void 0)return y}var L;j=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q;Q=m.current,m.current=null,_();try{if(f){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(pe){L=pe}Reflect.construct(o,[],Y)}else{try{Y.call()}catch(pe){L=pe}o.call(Y.prototype)}}else{try{throw Error()}catch(pe){L=pe}o()}}catch(pe){if(pe&&L&&typeof pe.stack=="string"){for(var H=pe.stack.split(`
|
|
19
|
+
`),de=L.stack.split(`
|
|
20
|
+
`),ie=H.length-1,ae=de.length-1;ie>=1&&ae>=0&&H[ie]!==de[ae];)ae--;for(;ie>=1&&ae>=0;ie--,ae--)if(H[ie]!==de[ae]){if(ie!==1||ae!==1)do if(ie--,ae--,ae<0||H[ie]!==de[ae]){var ye=`
|
|
21
|
+
`+H[ie].replace(" at new "," at ");return o.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",o.displayName)),typeof o=="function"&&x.set(o,ye),ye}while(ie>=1&&ae>=0);break}}}finally{j=!1,m.current=Q,S(),Error.prepareStackTrace=U}var De=o?o.displayName||o.name:"",Ie=De?R(De):"";return typeof o=="function"&&x.set(o,Ie),Ie}function oe(o,f,y){return G(o,!1)}function b(o){var f=o.prototype;return!!(f&&f.isReactComponent)}function ue(o,f,y){if(o==null)return"";if(typeof o=="function")return G(o,b(o));if(typeof o=="string")return R(o);switch(o){case c:return R("Suspense");case h:return R("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return oe(o.render);case v:return ue(o.type,f,y);case E:{var L=o,U=L._payload,Q=L._init;try{return ue(Q(U),f,y)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,le={},ge=M.ReactDebugCurrentFrame;function je(o){if(o){var f=o._owner,y=ue(o.type,o._source,f?f.type:null);ge.setExtraStackFrame(y)}else ge.setExtraStackFrame(null)}function Ee(o,f,y,L,U){{var Q=Function.call.bind(Z);for(var Y in o)if(Q(o,Y)){var H=void 0;try{if(typeof o[Y]!="function"){var de=Error((L||"React class")+": "+y+" type `"+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[Y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw de.name="Invariant Violation",de}H=o[Y](f,Y,L,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ie){H=ie}H&&!(H instanceof Error)&&(je(U),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",L||"React class",y,Y,typeof H),je(null)),H instanceof Error&&!(H.message in le)&&(le[H.message]=!0,je(U),P("Failed %s type: %s",y,H.message),je(null))}}}var se=Array.isArray;function ne(o){return se(o)}function fe(o){{var f=typeof Symbol=="function"&&Symbol.toStringTag,y=f&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y}}function Ae(o){try{return He(o),!1}catch{return!0}}function He(o){return""+o}function ze(o){if(Ae(o))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fe(o)),He(o)}var Me=M.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0},Zt,Qt,mt;mt={};function Rn(o){if(Z.call(o,"ref")){var f=Object.getOwnPropertyDescriptor(o,"ref").get;if(f&&f.isReactWarning)return!1}return o.ref!==void 0}function Tn(o){if(Z.call(o,"key")){var f=Object.getOwnPropertyDescriptor(o,"key").get;if(f&&f.isReactWarning)return!1}return o.key!==void 0}function Pn(o,f){if(typeof o.ref=="string"&&Me.current&&f&&Me.current.stateNode!==f){var y=B(Me.current.type);mt[y]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(Me.current.type),o.ref),mt[y]=!0)}}function jn(o,f){{var y=function(){Zt||(Zt=!0,P("%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://reactjs.org/link/special-props)",f))};y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}}function Mn(o,f){{var y=function(){Qt||(Qt=!0,P("%s: `ref` 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://reactjs.org/link/special-props)",f))};y.isReactWarning=!0,Object.defineProperty(o,"ref",{get:y,configurable:!0})}}var An=function(o,f,y,L,U,Q,Y){var H={$$typeof:t,type:o,key:f,ref:y,props:Y,_owner:Q};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function zn(o,f,y,L,U){{var Q,Y={},H=null,de=null;y!==void 0&&(ze(y),H=""+y),Tn(f)&&(ze(f.key),H=""+f.key),Rn(f)&&(de=f.ref,Pn(f,U));for(Q in f)Z.call(f,Q)&&!Be.hasOwnProperty(Q)&&(Y[Q]=f[Q]);if(o&&o.defaultProps){var ie=o.defaultProps;for(Q in ie)Y[Q]===void 0&&(Y[Q]=ie[Q])}if(H||de){var ae=typeof o=="function"?o.displayName||o.name||"Unknown":o;H&&jn(Y,ae),de&&Mn(Y,ae)}return An(o,H,de,U,L,Me.current,Y)}}var gt=M.ReactCurrentOwner,er=M.ReactDebugCurrentFrame;function $e(o){if(o){var f=o._owner,y=ue(o.type,o._source,f?f.type:null);er.setExtraStackFrame(y)}else er.setExtraStackFrame(null)}var bt;bt=!1;function yt(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function tr(){{if(gt.current){var o=B(gt.current.type);if(o)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+o+"`."}return""}}function In(o){{if(o!==void 0){var
|
|
23
|
+
Check the render method of \``+o+"`."}return""}}function In(o){{if(o!==void 0){var f=o.fileName.replace(/^.*[\\\/]/,""),y=o.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+
|
|
25
|
+
Check your code at `+f+":"+y+"."}return""}}var rr={};function kn(o){{var f=tr();if(!f){var y=typeof o=="string"?o:o.displayName||o.name;y&&(f=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+
|
|
27
|
+
Check the top-level render call using <`+y+">.")}return f}}function nr(o,f){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var y=kn(f);if(rr[y])return;rr[y]=!0;var L="";o&&o._owner&&o._owner!==gt.current&&(L=" It was passed a child from "+B(o._owner.type)+"."),$e(o),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,L),$e(null)}}function or(o,f){{if(typeof o!="object")return;if(ne(o))for(var y=0;y<o.length;y++){var L=o[y];yt(L)&&nr(L,f)}else if(yt(o))o._store&&(o._store.validated=!0);else if(o){var U=u(o);if(typeof U=="function"&&U!==o.entries)for(var Q=U.call(o),Y;!(Y=Q.next()).done;)yt(Y.value)&&nr(Y.value,f)}}}function Ln(o){{var f=o.type;if(f==null||typeof f=="string")return;var y;if(typeof f=="function")y=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===l||f.$$typeof===v))y=f.propTypes;else return;if(y){var L=B(f);Ee(y,o.props,"prop",L,o)}else if(f.PropTypes!==void 0&&!bt){bt=!0;var U=B(f);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $n(o){{for(var f=Object.keys(o.props),y=0;y<f.length;y++){var L=f[y];if(L!=="children"&&L!=="key"){$e(o),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",L),$e(null);break}}o.ref!==null&&($e(o),P("Invalid attribute `ref` supplied to `React.Fragment`."),$e(null))}}var ir={};function sr(o,f,y,L,U,Q){{var Y=z(o);if(!Y){var H="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).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.");var de=In(U);de?H+=de:H+=tr();var ie;o===null?ie="null":ne(o)?ie="array":o!==void 0&&o.$$typeof===t?(ie="<"+(B(o.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):ie=typeof o,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ie,H)}var ae=zn(o,f,y,U,Q);if(ae==null)return ae;if(Y){var ye=f.children;if(ye!==void 0)if(L)if(ne(ye)){for(var De=0;De<ye.length;De++)or(ye[De],o);Object.freeze&&Object.freeze(ye)}else P("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 or(ye,o)}if(Z.call(f,"key")){var Ie=B(o),pe=Object.keys(f).filter(function(Hn){return Hn!=="key"}),Et=pe.length>0?"{key: someKey, "+pe.join(": ..., ")+": ...}":"{key: someKey}";if(!ir[Ie+Et]){var Vn=pe.length>0?"{"+pe.join(": ..., ")+": ...}":"{}";P(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,
|
|
32
|
+
<%s key={someKey} {...props} />`,Et,Ie,Vn,Ie),ir[Ie+Et]=!0}}return o===n?$n(ae):Ln(ae),ae}}function Dn(o,f,y){return sr(o,f,y,!0)}function Nn(o,f,y){return sr(o,f,y,!1)}var Fn=Nn,Wn=Dn;Fe.Fragment=n,Fe.jsx=Fn,Fe.jsxs=Wn}()),Fe}process.env.NODE_ENV==="production"?Ze.exports=cr():Ze.exports=ur();var ee=Ze.exports;function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qe.apply(null,arguments)}function _e(e){"@babel/helpers - typeof";return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(e)}var fr=Symbol.for("react.element"),dr=Symbol.for("react.transitional.element"),hr=Symbol.for("react.fragment");function Ct(e){return e&&_e(e)==="object"&&(e.$$typeof===fr||e.$$typeof===dr)&&e.type===hr}function et(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[];return C.Children.forEach(e,function(n){n==null&&!t.keepEmpty||(Array.isArray(n)?r=r.concat(et(n)):Ct(n)&&n.props?r=r.concat(et(n.props.children,t)):r.push(n))}),r}var pr=[];function Ot(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0)var r=pr.reduce(function(n,i){return i(n??"","warning")},t)}function vr(e,t){if(_e(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_e(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xt(e){var t=vr(e,"string");return _e(t)=="symbol"?t:t+""}function mr(e,t,r){return(t=xt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rt(Object(r),!0).forEach(function(n){mr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pt(e){return e instanceof HTMLElement||e instanceof SVGElement}function gr(e){return e&&_e(e)==="object"&&Pt(e.nativeElement)?e.nativeElement:Pt(e)?e:null}function tt(e){var t=gr(e);if(t)return t;if(e instanceof C.Component){var r;return(r=wt.findDOMNode)===null||r===void 0?void 0:r.call(wt,e)}return null}var rt={exports:{}},q={};/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-is.production.min.js
|
|
35
35
|
*
|
|
@@ -37,7 +37,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var
|
|
40
|
+
*/var jt;function br(){if(jt)return q;jt=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),d=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),A;A=Symbol.for("react.module.reference");function O(u){if(typeof u=="object"&&u!==null){var M=u.$$typeof;switch(M){case e:switch(u=u.type,u){case r:case i:case n:case c:case h:return u;default:switch(u=u&&u.$$typeof,u){case d:case a:case l:case E:case v:case s:return u;default:return M}}case t:return M}}}return q.ContextConsumer=a,q.ContextProvider=s,q.Element=e,q.ForwardRef=l,q.Fragment=r,q.Lazy=E,q.Memo=v,q.Portal=t,q.Profiler=i,q.StrictMode=n,q.Suspense=c,q.SuspenseList=h,q.isAsyncMode=function(){return!1},q.isConcurrentMode=function(){return!1},q.isContextConsumer=function(u){return O(u)===a},q.isContextProvider=function(u){return O(u)===s},q.isElement=function(u){return typeof u=="object"&&u!==null&&u.$$typeof===e},q.isForwardRef=function(u){return O(u)===l},q.isFragment=function(u){return O(u)===r},q.isLazy=function(u){return O(u)===E},q.isMemo=function(u){return O(u)===v},q.isPortal=function(u){return O(u)===t},q.isProfiler=function(u){return O(u)===i},q.isStrictMode=function(u){return O(u)===n},q.isSuspense=function(u){return O(u)===c},q.isSuspenseList=function(u){return O(u)===h},q.isValidElementType=function(u){return typeof u=="string"||typeof u=="function"||u===r||u===i||u===n||u===c||u===h||u===I||typeof u=="object"&&u!==null&&(u.$$typeof===E||u.$$typeof===v||u.$$typeof===s||u.$$typeof===a||u.$$typeof===l||u.$$typeof===A||u.getModuleId!==void 0)},q.typeOf=O,q}var J={};/**
|
|
41
41
|
* @license React
|
|
42
42
|
* react-is.development.js
|
|
43
43
|
*
|
|
@@ -45,9 +45,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var jt;function br(){return jt||(jt=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),h=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),A=!1,P=!1,u=!1,M=!1,j=!1,X;X=Symbol.for("react.module.reference");function I(T){return!!(typeof T=="string"||typeof T=="function"||T===r||T===i||j||T===n||T===c||T===f||M||T===k||A||P||u||typeof T=="object"&&T!==null&&(T.$$typeof===y||T.$$typeof===E||T.$$typeof===s||T.$$typeof===a||T.$$typeof===l||T.$$typeof===X||T.getModuleId!==void 0))}function W(T){if(typeof T=="object"&&T!==null){var ee=T.$$typeof;switch(ee){case e:var re=T.type;switch(re){case r:case i:case n:case c:case f:return re;default:var de=re&&re.$$typeof;switch(de){case h:case a:case l:case y:case E:case s:return de;default:return ee}}case t:return ee}}}var F=a,D=s,p=e,N=l,z=r,V=y,B=E,G=t,oe=i,pe=n,be=c,Pe=f,we=!1,ye=!1;function xe(T){return we||(we=!0),!1}function v(T){return ye||(ye=!0),!1}function x(T){return W(T)===a}function w(T){return W(T)===s}function m(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function g(T){return W(T)===l}function R(T){return W(T)===r}function S(T){return W(T)===y}function C(T){return W(T)===E}function O(T){return W(T)===t}function L(T){return W(T)===i}function K(T){return W(T)===n}function ie(T){return W(T)===c}function te(T){return W(T)===f}J.ContextConsumer=F,J.ContextProvider=D,J.Element=p,J.ForwardRef=N,J.Fragment=z,J.Lazy=V,J.Memo=B,J.Portal=G,J.Profiler=oe,J.StrictMode=pe,J.Suspense=be,J.SuspenseList=Pe,J.isAsyncMode=xe,J.isConcurrentMode=v,J.isContextConsumer=x,J.isContextProvider=w,J.isElement=m,J.isForwardRef=g,J.isFragment=R,J.isLazy=S,J.isMemo=C,J.isPortal=O,J.isProfiler=L,J.isStrictMode=K,J.isSuspense=ie,J.isSuspenseList=te,J.isValidElementType=I,J.typeOf=W}()),J}process.env.NODE_ENV==="production"?tt.exports=gr():tt.exports=br();var rt=tt.exports;function yr(e,t,r){var n=ne.useRef({});return(!("value"in n.current)||r(n.current.condition,t))&&(n.current.value=e(),n.current.condition=t),n.current.value}var Er=Number(_.version.split(".")[0]),wr=function(t,r){typeof t=="function"?t(r):Se(t)==="object"&&t&&"current"in t&&(t.current=r)},_r=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);return i.length<=1?i[0]:function(s){r.forEach(function(a){wr(a,s)})}},Sr=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return yr(function(){return _r.apply(void 0,r)},r,function(i,s){return i.length!==s.length||i.every(function(a,h){return a!==s[h]})})},Cr=function(t){var r,n;if(!t)return!1;if(Mt(t)&&Er>=19)return!0;var i=rt.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((r=i.prototype)!==null&&r!==void 0&&r.render)&&i.$$typeof!==rt.ForwardRef||typeof t=="function"&&!((n=t.prototype)!==null&&n!==void 0&&n.render)&&t.$$typeof!==rt.ForwardRef)};function Mt(e){return _.isValidElement(e)&&!St(e)}var Or=function(t){if(t&&Mt(t)){var r=t;return r.props.propertyIsEnumerable("ref")?r.props.ref:r.ref}return null},nt=ne.createContext(null);function xr(e){var t=e.children,r=e.onBatchResize,n=ne.useRef(0),i=ne.useRef([]),s=ne.useContext(nt),a=ne.useCallback(function(h,l,c){n.current+=1;var f=n.current;i.current.push({size:h,element:l,data:c}),Promise.resolve().then(function(){f===n.current&&(r==null||r(i.current),i.current=[])}),s==null||s(h,l,c)},[r,s]);return ne.createElement(nt.Provider,{value:a},t)}var At=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(i,s){return i[0]===r?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(r,n){var i=e(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,i=e(n,r);~i&&n.splice(i,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,s=this.__entries__;i<s.length;i++){var a=s[i];r.call(n,a[1],a[0])}},t}()}(),ot=typeof window<"u"&&typeof document<"u"&&window.document===document,He=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Rr=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(He):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Tr=2;function Pr(e,t){var r=!1,n=!1,i=0;function s(){r&&(r=!1,e()),n&&h()}function a(){Rr(s)}function h(){var l=Date.now();if(r){if(l-i<Tr)return;n=!0}else r=!0,n=!1,setTimeout(a,t);i=l}return h}var jr=20,Mr=["top","right","bottom","left","width","height","size","weight"],Ar=typeof MutationObserver<"u",zr=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Pr(this.refresh.bind(this),jr)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ot||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ar?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ot||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,i=Mr.some(function(s){return!!~n.indexOf(s)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),zt=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},ze=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||He},It=Ye(0,0,0,0);function Be(e){return parseFloat(e)||0}function kt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,i){var s=e["border-"+i+"-width"];return n+Be(s)},0)}function Ir(e){for(var t=["top","right","bottom","left"],r={},n=0,i=t;n<i.length;n++){var s=i[n],a=e["padding-"+s];r[s]=Be(a)}return r}function kr(e){var t=e.getBBox();return Ye(0,0,t.width,t.height)}function Lr(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return It;var n=ze(e).getComputedStyle(e),i=Ir(n),s=i.left+i.right,a=i.top+i.bottom,h=Be(n.width),l=Be(n.height);if(n.boxSizing==="border-box"&&(Math.round(h+s)!==t&&(h-=kt(n,"left","right")+s),Math.round(l+a)!==r&&(l-=kt(n,"top","bottom")+a)),!Dr(e)){var c=Math.round(h+s)-t,f=Math.round(l+a)-r;Math.abs(c)!==1&&(h-=c),Math.abs(f)!==1&&(l-=f)}return Ye(i.left,i.top,h,l)}var $r=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ze(e).SVGGraphicsElement}:function(e){return e instanceof ze(e).SVGElement&&typeof e.getBBox=="function"}}();function Dr(e){return e===ze(e).document.documentElement}function Fr(e){return ot?$r(e)?kr(e):Lr(e):It}function Nr(e){var t=e.x,r=e.y,n=e.width,i=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(s.prototype);return zt(a,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),a}function Ye(e,t,r,n){return{x:e,y:t,width:r,height:n}}var Wr=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ye(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Fr(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),Vr=function(){function e(t,r){var n=Nr(r);zt(this,{target:t,contentRect:n})}return e}(),Hr=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new At,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ze(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new Wr(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ze(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Vr(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Lt=typeof WeakMap<"u"?new WeakMap:new At,$t=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=zr.getInstance(),n=new Hr(t,r,this);Lt.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){$t.prototype[e]=function(){var t;return(t=Lt.get(this))[e].apply(t,arguments)}});var Br=function(){return typeof He.ResizeObserver<"u"?He.ResizeObserver:$t}(),Ce=new Map;function Dt(e){e.forEach(function(t){var r,n=t.target;(r=Ce.get(n))===null||r===void 0||r.forEach(function(i){return i(n)})})}var Ft=new Br(Dt);process.env.NODE_ENV,process.env.NODE_ENV;function Yr(e,t){Ce.has(e)||(Ce.set(e,new Set),Ft.observe(e)),Ce.get(e).add(t)}function Kr(e,t){Ce.has(e)&&(Ce.get(e).delete(t),Ce.get(e).size||(Ft.unobserve(e),Ce.delete(e)))}function Gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ot(n.key),n)}}function Ur(e,t,r){return t&&Nt(e.prototype,t),r&&Nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function it(e,t){return it=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},it(e,t)}function qr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&it(e,t)}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ke(e)}function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wt=function(){return!!e})()}function Jr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xr(e,t){if(t&&(Se(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jr(e)}function Zr(e){var t=Wt();return function(){var r,n=Ke(e);if(t){var i=Ke(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Xr(this,r)}}var Qr=function(e){qr(r,e);var t=Zr(r);function r(){return Gr(this,r),t.apply(this,arguments)}return Ur(r,[{key:"render",value:function(){return this.props.children}}]),r}(ne.Component);function en(e,t){var r=e.children,n=e.disabled,i=ne.useRef(null),s=ne.useRef(null),a=ne.useContext(nt),h=typeof r=="function",l=h?r(i):r,c=ne.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),f=!h&&ne.isValidElement(l)&&Cr(l),E=f?Or(l):null,y=Sr(E,i),k=function(){var M;return et(i.current)||(i.current&&Se(i.current)==="object"?et((M=i.current)===null||M===void 0?void 0:M.nativeElement):null)||et(s.current)};ne.useImperativeHandle(t,function(){return k()});var A=ne.useRef(e);A.current=e;var P=ne.useCallback(function(u){var M=A.current,j=M.onResize,X=M.data,I=u.getBoundingClientRect(),W=I.width,F=I.height,D=u.offsetWidth,p=u.offsetHeight,N=Math.floor(W),z=Math.floor(F);if(c.current.width!==N||c.current.height!==z||c.current.offsetWidth!==D||c.current.offsetHeight!==p){var V={width:N,height:z,offsetWidth:D,offsetHeight:p};c.current=V;var B=D===Math.round(W)?W:D,G=p===Math.round(F)?F:p,oe=Rt(Rt({},V),{},{offsetWidth:B,offsetHeight:G});a==null||a(oe,u,X),j&&Promise.resolve().then(function(){j(oe,u)})}},[]);return ne.useEffect(function(){var u=k();return u&&!n&&Yr(u,P),function(){return Kr(u,P)}},[i.current,n]),ne.createElement(Qr,{ref:s},f?ne.cloneElement(l,{ref:y}):l)}var Vt=ne.forwardRef(en);process.env.NODE_ENV!=="production"&&(Vt.displayName="SingleObserver");var tn="rc-observer-key";function rn(e,t){var r=e.children,n=typeof r=="function"?[r]:Qe(r);return process.env.NODE_ENV!=="production"&&(n.length>1?Ct(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):n.length===0&&Ct(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),n.map(function(i,s){var a=(i==null?void 0:i.key)||"".concat(tn,"-").concat(s);return ne.createElement(Vt,Ze({},e,{key:a,ref:s===0?t:void 0}),i)})}var st=ne.forwardRef(rn);process.env.NODE_ENV!=="production"&&(st.displayName="ResizeObserver"),st.Collection=xr;var Ht={exports:{}};/*!
|
|
48
|
+
*/var Mt;function yr(){return Mt||(Mt=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),d=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),A=!1,O=!1,u=!1,M=!1,P=!1,X;X=Symbol.for("react.module.reference");function k(b){return!!(typeof b=="string"||typeof b=="function"||b===r||b===i||P||b===n||b===c||b===h||M||b===I||A||O||u||typeof b=="object"&&b!==null&&(b.$$typeof===E||b.$$typeof===v||b.$$typeof===s||b.$$typeof===a||b.$$typeof===l||b.$$typeof===X||b.getModuleId!==void 0))}function W(b){if(typeof b=="object"&&b!==null){var ue=b.$$typeof;switch(ue){case e:var Z=b.type;switch(Z){case r:case i:case n:case c:case h:return Z;default:var le=Z&&Z.$$typeof;switch(le){case d:case a:case l:case E:case v:case s:return le;default:return ue}}case t:return ue}}}var $=a,D=s,p=e,F=l,z=r,V=E,K=v,B=t,re=i,he=n,be=c,xe=h,Se=!1,me=!1;function Te(b){return Se||(Se=!0),!1}function Pe(b){return me||(me=!0),!1}function g(b){return W(b)===a}function w(b){return W(b)===s}function _(b){return typeof b=="object"&&b!==null&&b.$$typeof===e}function S(b){return W(b)===l}function m(b){return W(b)===r}function T(b){return W(b)===E}function R(b){return W(b)===v}function j(b){return W(b)===t}function x(b){return W(b)===i}function N(b){return W(b)===n}function G(b){return W(b)===c}function oe(b){return W(b)===h}J.ContextConsumer=$,J.ContextProvider=D,J.Element=p,J.ForwardRef=F,J.Fragment=z,J.Lazy=V,J.Memo=K,J.Portal=B,J.Profiler=re,J.StrictMode=he,J.Suspense=be,J.SuspenseList=xe,J.isAsyncMode=Te,J.isConcurrentMode=Pe,J.isContextConsumer=g,J.isContextProvider=w,J.isElement=_,J.isForwardRef=S,J.isFragment=m,J.isLazy=T,J.isMemo=R,J.isPortal=j,J.isProfiler=x,J.isStrictMode=N,J.isSuspense=G,J.isSuspenseList=oe,J.isValidElementType=k,J.typeOf=W}()),J}process.env.NODE_ENV==="production"?rt.exports=br():rt.exports=yr();var nt=rt.exports;function Er(e,t,r){var n=te.useRef({});return(!("value"in n.current)||r(n.current.condition,t))&&(n.current.value=e(),n.current.condition=t),n.current.value}var wr=Number(C.version.split(".")[0]),_r=function(t,r){typeof t=="function"?t(r):_e(t)==="object"&&t&&"current"in t&&(t.current=r)},Sr=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);return i.length<=1?i[0]:function(s){r.forEach(function(a){_r(a,s)})}},Cr=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Er(function(){return Sr.apply(void 0,r)},r,function(i,s){return i.length!==s.length||i.every(function(a,d){return a!==s[d]})})},Or=function(t){var r,n;if(!t)return!1;if(At(t)&&wr>=19)return!0;var i=nt.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((r=i.prototype)!==null&&r!==void 0&&r.render)&&i.$$typeof!==nt.ForwardRef||typeof t=="function"&&!((n=t.prototype)!==null&&n!==void 0&&n.render)&&t.$$typeof!==nt.ForwardRef)};function At(e){return C.isValidElement(e)&&!Ct(e)}var xr=function(t){if(t&&At(t)){var r=t;return r.props.propertyIsEnumerable("ref")?r.props.ref:r.ref}return null},ot=te.createContext(null);function Rr(e){var t=e.children,r=e.onBatchResize,n=te.useRef(0),i=te.useRef([]),s=te.useContext(ot),a=te.useCallback(function(d,l,c){n.current+=1;var h=n.current;i.current.push({size:d,element:l,data:c}),Promise.resolve().then(function(){h===n.current&&(r==null||r(i.current),i.current=[])}),s==null||s(d,l,c)},[r,s]);return te.createElement(ot.Provider,{value:a},t)}var zt=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(i,s){return i[0]===r?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(r,n){var i=e(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,i=e(n,r);~i&&n.splice(i,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,s=this.__entries__;i<s.length;i++){var a=s[i];r.call(n,a[1],a[0])}},t}()}(),it=typeof window<"u"&&typeof document<"u"&&window.document===document,Ye=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Tr=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ye):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Pr=2;function jr(e,t){var r=!1,n=!1,i=0;function s(){r&&(r=!1,e()),n&&d()}function a(){Tr(s)}function d(){var l=Date.now();if(r){if(l-i<Pr)return;n=!0}else r=!0,n=!1,setTimeout(a,t);i=l}return d}var Mr=20,Ar=["top","right","bottom","left","width","height","size","weight"],zr=typeof MutationObserver<"u",Ir=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=jr(this.refresh.bind(this),Mr)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!it||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),zr?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!it||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,i=Ar.some(function(s){return!!~n.indexOf(s)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),It=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},ke=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ye},kt=Ge(0,0,0,0);function Ke(e){return parseFloat(e)||0}function Lt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,i){var s=e["border-"+i+"-width"];return n+Ke(s)},0)}function kr(e){for(var t=["top","right","bottom","left"],r={},n=0,i=t;n<i.length;n++){var s=i[n],a=e["padding-"+s];r[s]=Ke(a)}return r}function Lr(e){var t=e.getBBox();return Ge(0,0,t.width,t.height)}function $r(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return kt;var n=ke(e).getComputedStyle(e),i=kr(n),s=i.left+i.right,a=i.top+i.bottom,d=Ke(n.width),l=Ke(n.height);if(n.boxSizing==="border-box"&&(Math.round(d+s)!==t&&(d-=Lt(n,"left","right")+s),Math.round(l+a)!==r&&(l-=Lt(n,"top","bottom")+a)),!Nr(e)){var c=Math.round(d+s)-t,h=Math.round(l+a)-r;Math.abs(c)!==1&&(d-=c),Math.abs(h)!==1&&(l-=h)}return Ge(i.left,i.top,d,l)}var Dr=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ke(e).SVGGraphicsElement}:function(e){return e instanceof ke(e).SVGElement&&typeof e.getBBox=="function"}}();function Nr(e){return e===ke(e).document.documentElement}function Fr(e){return it?Dr(e)?Lr(e):$r(e):kt}function Wr(e){var t=e.x,r=e.y,n=e.width,i=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(s.prototype);return It(a,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),a}function Ge(e,t,r,n){return{x:e,y:t,width:r,height:n}}var Vr=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ge(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Fr(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),Hr=function(){function e(t,r){var n=Wr(r);It(this,{target:t,contentRect:n})}return e}(),Br=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new zt,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new Vr(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Hr(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$t=typeof WeakMap<"u"?new WeakMap:new zt,Dt=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Ir.getInstance(),n=new Br(t,r,this);$t.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Dt.prototype[e]=function(){var t;return(t=$t.get(this))[e].apply(t,arguments)}});var Yr=function(){return typeof Ye.ResizeObserver<"u"?Ye.ResizeObserver:Dt}(),Ce=new Map;function Nt(e){e.forEach(function(t){var r,n=t.target;(r=Ce.get(n))===null||r===void 0||r.forEach(function(i){return i(n)})})}var Ft=new Yr(Nt);process.env.NODE_ENV,process.env.NODE_ENV;function Kr(e,t){Ce.has(e)||(Ce.set(e,new Set),Ft.observe(e)),Ce.get(e).add(t)}function Gr(e,t){Ce.has(e)&&(Ce.get(e).delete(t),Ce.get(e).size||(Ft.unobserve(e),Ce.delete(e)))}function Ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xt(n.key),n)}}function qr(e,t,r){return t&&Wt(e.prototype,t),r&&Wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function st(e,t){return st=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},st(e,t)}function Jr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&st(e,t)}function Ue(e){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ue(e)}function Vt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vt=function(){return!!e})()}function Xr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zr(e,t){if(t&&(_e(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xr(e)}function Qr(e){var t=Vt();return function(){var r,n=Ue(e);if(t){var i=Ue(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Zr(this,r)}}var en=function(e){Jr(r,e);var t=Qr(r);function r(){return Ur(this,r),t.apply(this,arguments)}return qr(r,[{key:"render",value:function(){return this.props.children}}]),r}(te.Component);function tn(e,t){var r=e.children,n=e.disabled,i=te.useRef(null),s=te.useRef(null),a=te.useContext(ot),d=typeof r=="function",l=d?r(i):r,c=te.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),h=!d&&te.isValidElement(l)&&Or(l),v=h?xr(l):null,E=Cr(v,i),I=function(){var M;return tt(i.current)||(i.current&&_e(i.current)==="object"?tt((M=i.current)===null||M===void 0?void 0:M.nativeElement):null)||tt(s.current)};te.useImperativeHandle(t,function(){return I()});var A=te.useRef(e);A.current=e;var O=te.useCallback(function(u){var M=A.current,P=M.onResize,X=M.data,k=u.getBoundingClientRect(),W=k.width,$=k.height,D=u.offsetWidth,p=u.offsetHeight,F=Math.floor(W),z=Math.floor($);if(c.current.width!==F||c.current.height!==z||c.current.offsetWidth!==D||c.current.offsetHeight!==p){var V={width:F,height:z,offsetWidth:D,offsetHeight:p};c.current=V;var K=D===Math.round(W)?W:D,B=p===Math.round($)?$:p,re=Tt(Tt({},V),{},{offsetWidth:K,offsetHeight:B});a==null||a(re,u,X),P&&Promise.resolve().then(function(){P(re,u)})}},[]);return te.useEffect(function(){var u=I();return u&&!n&&Kr(u,O),function(){return Gr(u,O)}},[i.current,n]),te.createElement(en,{ref:s},h?te.cloneElement(l,{ref:E}):l)}var Ht=te.forwardRef(tn);process.env.NODE_ENV!=="production"&&(Ht.displayName="SingleObserver");var rn="rc-observer-key";function nn(e,t){var r=e.children,n=typeof r=="function"?[r]:et(r);return process.env.NODE_ENV!=="production"&&(n.length>1?Ot(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):n.length===0&&Ot(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),n.map(function(i,s){var a=(i==null?void 0:i.key)||"".concat(rn,"-").concat(s);return te.createElement(Ht,Qe({},e,{key:a,ref:s===0?t:void 0}),i)})}var at=te.forwardRef(nn);process.env.NODE_ENV!=="production"&&(at.displayName="ResizeObserver"),at.Collection=Rr;var Bt={exports:{}};/*!
|
|
49
49
|
Copyright (c) 2018 Jed Watson.
|
|
50
50
|
Licensed under the MIT License (MIT), see
|
|
51
51
|
http://jedwatson.github.io/classnames
|
|
52
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",a=0;a<arguments.length;a++){var h=arguments[a];h&&(s=i(s,n(h)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var h in s)t.call(s,h)&&s[h]&&(a=i(a,h));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ht);var nn=Ht.exports;const at=ar(nn),Bn="",on=_.forwardRef(({columns:e,width:t,onScroll:r,meta:n},i)=>{const s=_.useMemo(()=>{const a=[],h=f=>{let E=0;return f.forEach(y=>{if(y.children&&y.children.length>0){const k=h(y.children);k>E&&(E=k)}}),E+1},l=h(e),c=(f,E)=>{a[E]||(a[E]=[]),f.forEach(y=>{var u,M;let k="left";(u=y.style)!=null&&u.textAlign&&(k=y.style.textAlign);let A=n==null?void 0:n.find(j=>j.field===y.field);if(!A){const j=y.field.split("||");if(j.length>1){const X=j[j.length-1];A=n==null?void 0:n.find(I=>I.field===X)}else y.field.includes("__")&&(A=n==null?void 0:n.find(X=>y.field.startsWith(`${X.field}_`)))}(M=A==null?void 0:A.style)!=null&&M.textAlign&&(k=A.style.textAlign);const P={key:y.field||y.dataIndex||y.title||String(Math.random()),title:y.title,width:y.width,align:k,className:y.field,colSpan:1,rowSpan:1};if(y.children&&y.children.length>0){const j=X=>X.children&&X.children.length>0?X.children.reduce((I,W)=>I+j(W),0):1;P.colSpan=j(y),a[E].push(P),c(y.children,E+1)}else P.rowSpan=l-E,a[E].push(P)})};return c(e,0),a},[e,n]);return Q.jsx("div",{ref:i,className:"virtual-table-header hide-scrollbar",style:{overflow:"auto",width:t},onScroll:r,children:Q.jsxs("table",{style:{tableLayout:"fixed",width:"100%"},children:[Q.jsx("colgroup",{children:e.map((a,h)=>{const l=c=>c.children&&c.children.length>0?c.children.flatMap(l):[c.width];return l(a).map((c,f)=>Q.jsx("col",{style:{width:c,minWidth:c}},`${h}-${f}`))}).flat()}),Q.jsx("thead",{className:"virtual-table-thead",children:s.map((a,h)=>Q.jsx("tr",{className:"virtual-table-row",children:a.map((l,c)=>Q.jsx("th",{className:at("virtual-table-cell",l.className),colSpan:l.colSpan,rowSpan:l.rowSpan,title:l.title,style:{textAlign:l.align},children:l.title},c))},h))})]})})}),lt=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(r=>lt(r));const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=lt(e[r]));return t},ct=43,sn=100,Oe="-",Bt="合计",Ge=20;function an(e){let t=e;for(;t;){if(t.dir)return t.dir==="rtl";t=t.parentElement}return!1}function ln(e,t){const[r,n]=_.useState(t==="rtl");return _.useLayoutEffect(()=>{e&&(t||n(an(e)))},[t,e]),r}const Ue=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Yt(e){if(e!==void 0)switch(typeof e){case"number":return e;case"string":{if(e.endsWith("px"))return parseFloat(e);break}}}function cn({box:e,defaultHeight:t,defaultWidth:r,disabled:n,element:i,mode:s,style:a}){const{styleHeight:h,styleWidth:l}=_.useMemo(()=>({styleHeight:Yt(a==null?void 0:a.height),styleWidth:Yt(a==null?void 0:a.width)}),[a==null?void 0:a.height,a==null?void 0:a.width]),[c,f]=_.useState({height:t,width:r}),E=n||s==="only-height"&&h!==void 0||s==="only-width"&&l!==void 0||h!==void 0&&l!==void 0;return Ue(()=>{if(i===null||E)return;const y=new ResizeObserver(k=>{for(const A of k){const{contentRect:P,target:u}=A;i===u&&f(M=>M.height===P.height&&M.width===P.width?M:{height:P.height,width:P.width})}});return y.observe(i,{box:e}),()=>{y==null||y.unobserve(i)}},[e,E,i,h,l]),_.useMemo(()=>({height:h??c.height,width:l??c.width}),[c,h,l])}function un(e){const t=_.useRef(()=>{throw new Error("Cannot call during render.")});return Ue(()=>{t.current=e},[e]),_.useCallback(r=>{var n;return(n=t.current)==null?void 0:n.call(t,r)},[t])}let Ie=null;function fn(e=!1){if(Ie===null||e){const t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";const n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Ie="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Ie="negative":Ie="positive-ascending"),document.body.removeChild(t),Ie}return Ie}function ut({containerElement:e,direction:t,isRtl:r,scrollOffset:n}){if(t==="horizontal"&&r)switch(fn()){case"negative":return-n;case"positive-descending":{if(e){const{clientWidth:i,scrollLeft:s,scrollWidth:a}=e;return a-i-s}break}}return n}function Te(e,t="Assertion error"){if(!e)throw Error(t)}function Ne(e,t){if(e===t)return!0;if(!!e!=!!t||(Te(e!==void 0),Te(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(const r in e)if(!Object.is(t[r],e[r]))return!1;return!0}function Kt({cachedBounds:e,itemCount:t,itemSize:r}){if(t===0)return 0;if(typeof r=="number")return t*r;{const n=e.get(e.size===0?0:e.size-1);Te(n!==void 0,"Unexpected bounds cache miss");const i=(n.scrollOffset+n.size)/e.size;return t*i}}function dn({align:e,cachedBounds:t,index:r,itemCount:n,itemSize:i,containerScrollOffset:s,containerSize:a}){if(r<0||r>=n)throw RangeError(`Invalid index specified: ${r}`,{cause:`Index ${r} is not within the range of 0 - ${n-1}`});const h=Kt({cachedBounds:t,itemCount:n,itemSize:i}),l=t.get(r),c=Math.max(0,Math.min(h-a,l.scrollOffset)),f=Math.max(0,l.scrollOffset-a+l.size);switch(e==="smart"&&(s>=f&&s<=c?e="auto":e="center"),e){case"start":return c;case"end":return f;case"center":return l.scrollOffset<=a/2?0:l.scrollOffset+l.size/2>=h-a/2?h-a:l.scrollOffset+l.size/2-a/2;case"auto":default:return s>=f&&s<=c?s:s<f?f:c}}function ft({cachedBounds:e,containerScrollOffset:t,containerSize:r,itemCount:n,overscanCount:i}){const s=n-1;let a=0,h=-1,l=0,c=-1,f=0;for(;f<s;){const E=e.get(f);if(E.scrollOffset+E.size>t)break;f++}for(a=f,l=Math.max(0,a-i);f<s;){const E=e.get(f);if(E.scrollOffset+E.size>=t+r)break;f++}return h=Math.min(s,f),c=Math.min(n-1,h+i),a<0&&(a=0,h=-1,l=0,c=-1),{startIndexVisible:a,stopIndexVisible:h,startIndexOverscan:l,stopIndexOverscan:c}}function hn({itemCount:e,itemProps:t,itemSize:r}){const n=new Map;return{get(i){for(Te(i<e,`Invalid index ${i}`);n.size-1<i;){const a=n.size;let h;switch(typeof r){case"function":{h=r(a,t);break}case"number":{h=r;break}}if(a===0)n.set(a,{size:h,scrollOffset:0});else{const l=n.get(a-1);Te(l!==void 0,`Unexpected bounds cache miss for index ${i}`),n.set(a,{scrollOffset:l.scrollOffset+l.size,size:h})}}const s=n.get(i);return Te(s!==void 0,`Unexpected bounds cache miss for index ${i}`),s},set(i,s){n.set(i,s)},get size(){return n.size}}}function pn({itemCount:e,itemProps:t,itemSize:r}){return _.useMemo(()=>hn({itemCount:e,itemProps:t,itemSize:r}),[e,t,r])}function vn({containerSize:e,itemSize:t}){let r;switch(typeof t){case"string":{Te(t.endsWith("%"),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),Te(e!==void 0,"Container size must be defined if a percentage item size is specified"),r=e*parseInt(t)/100;break}default:{r=t;break}}return r}function Gt({containerElement:e,containerStyle:t,defaultContainerSize:r=0,direction:n,isRtl:i=!1,itemCount:s,itemProps:a,itemSize:h,onResize:l,overscanCount:c}){const{height:f=r,width:E=r}=cn({defaultHeight:n==="vertical"?r:void 0,defaultWidth:n==="horizontal"?r:void 0,element:e,mode:n==="vertical"?"only-height":"only-width",style:t}),y=_.useRef({height:0,width:0}),k=n==="vertical"?f:E,A=vn({containerSize:k,itemSize:h});_.useLayoutEffect(()=>{if(typeof l=="function"){const z=y.current;(z.height!==f||z.width!==E)&&(l({height:f,width:E},{...z}),z.height=f,z.width=E)}},[f,l,E]);const P=pn({itemCount:s,itemProps:a,itemSize:A}),u=_.useCallback(z=>P.get(z),[P]),[M,j]=_.useState(()=>ft({cachedBounds:P,containerScrollOffset:0,containerSize:k,itemCount:s,overscanCount:c})),{startIndexVisible:X,startIndexOverscan:I,stopIndexVisible:W,stopIndexOverscan:F}={startIndexVisible:Math.min(s-1,M.startIndexVisible),startIndexOverscan:Math.min(s-1,M.startIndexOverscan),stopIndexVisible:Math.min(s-1,M.stopIndexVisible),stopIndexOverscan:Math.min(s-1,M.stopIndexOverscan)},D=_.useCallback(()=>Kt({cachedBounds:P,itemCount:s,itemSize:A}),[P,s,A]),p=_.useCallback(z=>{const V=ut({containerElement:e,direction:n,isRtl:i,scrollOffset:z});return ft({cachedBounds:P,containerScrollOffset:V,containerSize:k,itemCount:s,overscanCount:c})},[P,e,k,n,i,s,c]);Ue(()=>{const z=(n==="vertical"?e==null?void 0:e.scrollTop:e==null?void 0:e.scrollLeft)??0;j(p(z))},[e,n,p]),Ue(()=>{if(!e)return;const z=()=>{j(V=>{const{scrollLeft:B,scrollTop:G}=e,oe=ut({containerElement:e,direction:n,isRtl:i,scrollOffset:n==="vertical"?G:B}),pe=ft({cachedBounds:P,containerScrollOffset:oe,containerSize:k,itemCount:s,overscanCount:c});return Ne(pe,V)?V:pe})};return e.addEventListener("scroll",z),()=>{e.removeEventListener("scroll",z)}},[P,e,k,n,s,c]);const N=un(({align:z="auto",containerScrollOffset:V,index:B})=>{let G=dn({align:z,cachedBounds:P,containerScrollOffset:V,containerSize:k,index:B,itemCount:s,itemSize:A});if(e){if(G=ut({containerElement:e,direction:n,isRtl:i,scrollOffset:G}),typeof e.scrollTo!="function"){const oe=p(G);Ne(M,oe)||j(oe)}return G}});return{getCellBounds:u,getEstimatedSize:D,scrollToIndex:N,startIndexOverscan:I,startIndexVisible:X,stopIndexOverscan:F,stopIndexVisible:W}}function mn(e){return _.useMemo(()=>e,Object.values(e))}function gn(e,t){const{ariaAttributes:r,style:n,...i}=e,{ariaAttributes:s,style:a,...h}=t;return Ne(r,s)&&Ne(n,a)&&Ne(i,h)}function bn({cellComponent:e,cellProps:t,children:r,className:n,columnCount:i,columnWidth:s,defaultHeight:a=0,defaultWidth:h=0,dir:l,gridRef:c,onCellsRendered:f,onResize:E,overscanCount:y=3,rowCount:k,rowHeight:A,style:P,tagName:u="div",...M}){const j=mn(t),X=_.useMemo(()=>_.memo(e,gn),[e]),[I,W]=_.useState(null),F=ln(I,l),{getCellBounds:D,getEstimatedSize:p,startIndexOverscan:N,startIndexVisible:z,scrollToIndex:V,stopIndexOverscan:B,stopIndexVisible:G}=Gt({containerElement:I,containerStyle:P,defaultContainerSize:h,direction:"horizontal",isRtl:F,itemCount:i,itemProps:j,itemSize:s,onResize:E,overscanCount:y}),{getCellBounds:oe,getEstimatedSize:pe,startIndexOverscan:be,startIndexVisible:Pe,scrollToIndex:we,stopIndexOverscan:ye,stopIndexVisible:xe}=Gt({containerElement:I,containerStyle:P,defaultContainerSize:a,direction:"vertical",itemCount:k,itemProps:j,itemSize:A,onResize:E,overscanCount:y});_.useImperativeHandle(c,()=>({get element(){return I},scrollToCell({behavior:w="auto",columnAlign:m="auto",columnIndex:g,rowAlign:R="auto",rowIndex:S}){const C=V({align:m,containerScrollOffset:(I==null?void 0:I.scrollLeft)??0,index:g}),O=we({align:R,containerScrollOffset:(I==null?void 0:I.scrollTop)??0,index:S});typeof(I==null?void 0:I.scrollTo)=="function"&&I.scrollTo({behavior:w,left:C,top:O})},scrollToColumn({align:w="auto",behavior:m="auto",index:g}){const R=V({align:w,containerScrollOffset:(I==null?void 0:I.scrollLeft)??0,index:g});typeof(I==null?void 0:I.scrollTo)=="function"&&I.scrollTo({behavior:m,left:R})},scrollToRow({align:w="auto",behavior:m="auto",index:g}){const R=we({align:w,containerScrollOffset:(I==null?void 0:I.scrollTop)??0,index:g});typeof(I==null?void 0:I.scrollTo)=="function"&&I.scrollTo({behavior:m,top:R})}}),[I,V,we]),_.useEffect(()=>{N>=0&&B>=0&&be>=0&&ye>=0&&f&&f({columnStartIndex:z,columnStopIndex:G,rowStartIndex:Pe,rowStopIndex:xe},{columnStartIndex:N,columnStopIndex:B,rowStartIndex:be,rowStopIndex:ye})},[f,N,z,B,G,be,Pe,ye,xe]);const v=_.useMemo(()=>{const w=[];if(i>0&&k>0)for(let m=be;m<=ye;m++){const g=oe(m),R=[];for(let S=N;S<=B;S++){const C=D(S);R.push(_.createElement(X,{...j,ariaAttributes:{"aria-colindex":S+1,role:"gridcell"},columnIndex:S,key:S,rowIndex:m,style:{position:"absolute",left:F?void 0:0,right:F?0:void 0,transform:`translate(${F?-C.scrollOffset:C.scrollOffset}px, ${g.scrollOffset}px)`,height:g.size,width:C.size}}))}w.push(Q.jsx("div",{role:"row","aria-rowindex":m+1,children:R},m))}return w},[X,j,i,N,B,D,oe,F,k,be,ye]),x=Q.jsx("div",{"aria-hidden":!0,style:{height:pe(),width:p(),zIndex:-1}});return _.createElement(u,{"aria-colcount":i,"aria-rowcount":k,role:"grid",...M,className:n,dir:l,ref:W,style:{position:"relative",maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...P}},v,r,x)}const yn=e=>Q.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...e,children:[Q.jsx("path",{d:"M518.5 360.3a7.95 7.95 0 00-12.9 0l-178 246c-3.8 5.3 0 12.7 6.5 12.7H381c10.2 0 19.9-4.9 25.9-13.2L512 460.4l105.2 145.4c6 8.3 15.6 13.2 25.9 13.2H690c6.5 0 10.3-7.4 6.5-12.7l-178-246z"}),Q.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})]}),En=e=>Q.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...e,children:[Q.jsx("path",{d:"M690 405h-46.9c-10.2 0-19.9 4.9-25.9 13.2L512 563.6 406.8 418.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246c3.2 4.4 9.7 4.4 12.9 0l178-246c3.9-5.3.1-12.7-6.4-12.7z"}),Q.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})]}),wn=(e,t,r)=>{var i;const n=(i=r[e])==null?void 0:i[t];return n?n.rowspan===0||n.colspan===0:!1},_n=(e,t,r,n,i,s,a)=>{var P,u;const h=(P=n[e])==null?void 0:P[t],l=a||h;if(!l)return;const c={...r};let f=i[t];const E=f.field.split("||"),y=E[E.length-1],k=s==null?void 0:s.find(M=>M.field===y||M.field===f.field),A=(k==null?void 0:k.style)||(f==null?void 0:f.style);if(l.colspan>1){let M=0;for(let j=t;j<t+l.colspan;j++)M+=Number((u=i[j])==null?void 0:u.width)||100;c.width=M}return l.rowspan>1&&(c.height=l.rowspan*ct),c.height||(c.height=ct),A!=null&&A.textAlign&&(c.textAlign=A.textAlign,A.textAlign==="right"&&(c.justifyContent="flex-end"),A.textAlign==="center"&&(c.justifyContent="center")),c.border="1px solid #f0f0f0",c.padding="8px 16px",c.display="flex",c.alignItems="center",c.backgroundColor="#fff",l.rowspan>Ge&&(c.zIndex=1e4-e,c.position="absolute"),c},Sn=({columnIndex:e,rowIndex:t,style:r,mergedData:n,columns:i,handleExpand:s,meta:a,mergedCellsMap:h})=>{let l=n[t][e],c=!1;if(l.rowspan===0&&h){const M=`${t}-${e}`,j=h.get(M);if(j&&j.rowspan>Ge&&j.startIndex<t){const X=j.rowspan-(t-j.startIndex);l={...l,...j,rowspan:X},c=!0}}if(!c&&wn(t,e,n))return null;const f=_n(t,e,r,n,i,a,l),E=i[e],y=E.field.split("||"),k=y[y.length-1],A=a==null?void 0:a.find(M=>M.field===k||M.field===E.field),P=_.isValidElement(l.content);let u;if(u=l.content,"formatter"in E&&E.formatter&&!P&&(u=E.formatter(u,l.data)),A!=null&&A.clickHandler&&!P&&u!==null&&u!==void 0){const M=l.data;u=Q.jsx("a",{href:"javascript:void(0)",onClick:j=>{j.preventDefault(),j.stopPropagation(),A.clickHandler(M)},className:"virtual-table-cell-link",children:u})}return Q.jsxs("div",{style:f,className:at("table-cell","virtual-table-cell",{"virtual-table-cell-last":e===i.length-1}),title:typeof u=="string"?u:void 0,children:[Q.jsx("span",{className:"expand-icon",children:l.expandable?l.expanded?Q.jsx(yn,{onClick:()=>{l.onClick&&l.onClick(l),s(l)}}):Q.jsx(En,{onClick:()=>{l.onClick&&l.onClick(l),s(l)}}):null}),u]})},Cn=e=>{const{data:t,info:r,scroll:n,columns:i,tableWidth:s}=e,{ref:a,onScroll:h}=r,l=_.useRef(),c=_.useMemo(()=>{const F={};return Object.defineProperty(F,"scrollLeft",{get:()=>{var D,p;return((p=(D=l.current)==null?void 0:D.element)==null?void 0:p.scrollLeft)||0},set:D=>{var p;(p=l.current)!=null&&p.element&&(l.current.element.scrollLeft=D)}}),Object.defineProperty(F,"scrollTop",{get:()=>{var D,p;return((p=(D=l.current)==null?void 0:D.element)==null?void 0:p.scrollTop)||0},set:D=>{var p;(p=l.current)!=null&&p.element&&(l.current.element.scrollTop=D)}}),F},[]);_.useEffect(()=>{a&&(a.current=c)},[a,c]);const f=t,E=f.length,y=_.useCallback(F=>{let D=0;return F.forEach(p=>{p!=null&&p.children&&p.children.length>0?D+=y(p.children):D+=1}),D},[]),k=y(i),A=_.useCallback(F=>{let D=[];return F.forEach(p=>{p!=null&&p.children&&p.children.length>0?D=[...D,...A(p.children)]:D.push(p)}),D},[]),P=A(i),u=_.useCallback(F=>{const D=P[F];let p=(D==null?void 0:D.width)||100;return typeof p=="string"&&(p=parseInt(p.replace("px",""))||100),p},[P]),M=_.useCallback(F=>ct,[]),j=_.useMemo(()=>f.map(F=>F.cells),[f]),X=_.useCallback(F=>{if(F&&typeof F.scrollLeft=="number"){h&&h(F);return}if(F&&F.target){const{scrollLeft:D,scrollTop:p}=F.target;h&&h({scrollLeft:D,scrollTop:p})}},[h]),I=_.useMemo(()=>{const F=new Map;return f.forEach((D,p)=>{D.cells.forEach((N,z)=>{if(N.rowspan>Ge){const V={startIndex:p,rowspan:N.rowspan,content:N.content,data:N.data,expandable:N.expandable,expanded:N.expanded,level:N.level,rowKey:N.rowKey,onClick:N.onClick};for(let B=0;B<N.rowspan;B++){const G=`${p+B}-${z}`;F.set(G,V)}}})}),F},[f]),W=(typeof(n==null?void 0:n.y)=="number"?n.y:parseInt((n==null?void 0:n.y)||"400"))||400;return Q.jsx(bn,{gridRef:l,columnCount:k,columnWidth:u,rowCount:E,rowHeight:M,style:{height:W-40,width:s,overflowY:"auto"},onScroll:X,className:"virtual-grid",overscanCount:Ge,cellComponent:Sn,cellProps:{mergedData:j,columns:P,data:f,handleExpand:e.handleExpand,meta:e.meta,mergedCellsMap:I}})},We=e=>{const t=[],r=n=>{n.children&&n.children.length>0?n.children.forEach(i=>r(i)):t.push(n)};return e.forEach(n=>r(n)),t},ge=(e,t)=>{const r=t.split(".");let n=e;for(const i of r){if(n==null)return n;n=n[i]}return n==null&&(n=Oe),n},dt=(e,t)=>"|"+t.map(n=>ge(e,n)).join("|"),Ut=(e,t)=>{if(!e)return null;try{const r=e.replace(/\{(\w+)\}/g,(n,i)=>{const s=t[i];return s!=null&&!isNaN(s)?String(s):"0"});return/^[\d\.\+\-\*\/\(\)\s]+$/.test(r)?new Function(`return ${r}`)():null}catch{return null}},qe={sum:e=>e.reduce((t,r)=>t+(Number(r)||0),0),avg:e=>{const t=e;return t.length>0?t.reduce((r,n)=>r+(isNaN(Number(n))?0:Number(n)),0)/t.length:0},count:e=>e.length,min:e=>Math.min(...e.map(t=>Number(t)||1/0)),max:e=>Math.max(...e.map(t=>Number(t)||-1/0)),d_count:e=>new Set(e).size,variance:e=>{const t=e.map(i=>Number(i)).filter(i=>!isNaN(i));if(t.length===0)return 0;const r=t.reduce((i,s)=>i+s,0)/t.length;return t.map(i=>Math.pow(i-r,2)).reduce((i,s)=>i+s,0)/t.length},stddev:e=>{const t=e.map(s=>Number(s)).filter(s=>!isNaN(s));if(t.length===0)return 0;const r=t.reduce((s,a)=>s+a,0)/t.length,i=t.map(s=>Math.pow(s-r,2)).reduce((s,a)=>s+a,0)/t.length;return Math.sqrt(i)}},fe=new Map,ht=new Map,pt=new Map,qt=e=>{const{data:t,sortParams:r,fields:n}=e,{rows:i,columns:s,values:a}=n;if(!t||t.length===0||!i.length&&!s.length&&!a.length)return{list:[],dataExpandFilter:v=>v};const h=We(i),l=We(s),c=We(a).filter(v=>!v.hidden),f=h.map(v=>v.field),E=l.map(v=>v.field),y=new Map,k=new Map,A=new Map;t.forEach(v=>{const x=dt(v,f);y.has(x)||y.set(x,[]),y.get(x).push(v);const w=dt(v,E);k.has(w)||k.set(w,[]),k.get(w).push(v);const m=`${x}||${w}`;A.has(m)||A.set(m,[]),A.get(m).push(v)});const P=()=>Array.from(y.entries()).sort(([v,x],[w,m])=>{if(r&&r.length>0)for(const g of r){const{field:R,sortType:S}=g,C=S==="asc",O=ge(x[0],R),L=ge(m[0],R);if(O<L)return C?-1:1;if(O>L)return C?1:-1}for(let g=0;g<f.length;g++){const R=f[g],S=h[g],C=ge(x[0],R),O=ge(m[0],R);if(C!==O)if(S.sort&&S.sort.enabled){const L=S.sort.type==="asc";if(C<O)return L?-1:1;if(C>O)return L?1:-1}else{if(C<O)return-1;if(C>O)return 1}}return 0}),u=()=>Array.from(k.entries()).sort(([v,x],[w,m])=>{for(let g=0;g<E.length;g++){const R=E[g],S=l[g],C=ge(x[0],R),O=ge(m[0],R);if(C!==O)if(S.sort&&S.sort.enabled){const L=S.sort.type==="asc";if(C<O)return L?-1:1;if(C>O)return L?1:-1}else{if(C<O)return-1;if(C>O)return 1}}return 0}),M=()=>{const v=[],x=We(i);for(let w=1;w<=x.length;w++)v.push(x.slice(0,w));return v},j=()=>{const v=M(),x=new Set;return v.forEach((w,m)=>{const g=w[w.length-1];g.total&&g.total.enabled&&x.add(m)}),x},X=()=>{const v=M(),x=[],w=j();return w.size===0||w.forEach(m=>{let g=[];m>0&&(g=v[m-1]);const R={};t.forEach(S=>{let C="";if(m>0?C=g.map(O=>ge(S,O.field)).join("|"):C="__GLOBAL__",!R[C]){const L=v[m][m].total;R[C]={records:[],config:L}}R[C].records.push(S)}),x.push({level:m,data:R})}),x},I=u(),W=new Map,F=(v,x)=>{if(fe.has(v)){const w=fe.get(v),g=!w.get(x);w.set(x,g),ht.set("rowKey",x),ht.set("level",v),ht.set("expanded",g);const R=v-1;if(R>=0&&R<h.length&&h[R].clickExpandChildren&&g===!0){const C=v+1;if(fe.has(C)){const O=fe.get(C),L=x+"|";O.forEach((K,ie)=>{ie.startsWith(L)&&(O.set(ie,!0),D(C,ie))})}}}},D=(v,x)=>{const w=v+1;if(fe.has(w)){const m=fe.get(w),g=x+"|";m.forEach((R,S)=>{S.startsWith(g)&&(m.set(S,!0),D(w,S))})}},p=v=>{const x=X(),w=[...v];if(x.length===0)return w;for(let m=0;m<x.length;m++){const{level:g,data:R}=x[m];Object.keys(R).forEach(S=>{const{records:C,config:O}=R[S],{label:L=Bt,position:K="bottom"}=O||{},ie=S.split("|");let te=-1,T=-1;if(g===0)te=0,T=w.length-1;else for(let ee=0;ee<w.length;ee++){const re=w[ee];f.slice(0,g).every((ke,ve)=>{var ae;return((ae=re[ve])==null?void 0:ae.content)===ie[ve]})&&(te===-1&&(te=ee),T=ee)}if(te!==-1){const ee=[];let re="";f.forEach((ke,ve)=>{let ae=Oe;const le=ve+1,ue=le<f.length,je=h[ve];ve<=g&&(ve===g?ae=L:ae=ie[ve],re+=`|${ae}`);const Je=fe.has(le)&&fe.get(le).get(re)||!0;(ae===Oe||ae===null||ae===void 0)&&je.emptyReplace&&(ae=je.emptyReplace),ee.push({content:ae,rowspan:1,colspan:1,data:null,rowKey:re,expandable:K==="top"&&ue&&ae!==Oe&&ae!==Bt,expanded:K==="top"?Je:!1,level:le,onClick:K==="top"&&ue?Me=>F(Me.level,Me.rowKey):void 0})}),I.forEach(([ke,ve])=>{const ae={};c.forEach(le=>{if(le.calculateType==="expr")return;const ue=le.field,je=le.calculateType||"sum",Me=C.filter(Re=>dt(Re,E)===ke).map(Re=>ge(Re,ue));let Ve=0;qe[je]&&(Ve=qe[je](Me)),ae[le.field]=Ve}),c.forEach(le=>{if(le.calculateType==="expr"&&le.expression){const ue=Ut(le.expression,ae);ae[le.field]=ue!==null?ue:0}}),c.forEach(le=>{let ue=ae[le.field];(ue===Oe||ue===null||ue===void 0||typeof ue=="number"&&isNaN(ue))&&le.emptyReplace&&(ue=le.emptyReplace),ee.push({content:ue,rowspan:1,colspan:1,data:null})})});const de=K==="top"?te:T+1;pt.has(re)||(w.splice(de,0,ee),pt.set(re,1),K==="top"&&g>0&&W.set(S,re))}})}return w},N=We(i);fe.clear(),t.forEach(v=>{let x="";f.forEach((w,m)=>{const g=m+1,R=ge(v,w);x+=`|${R}`,fe.has(g)||fe.set(g,new Map);const S=h[m].collapsed;fe.get(g).set(x,!S)})});const z=P();let V=[];const B=new Map;z.forEach(([v,x])=>{const w=x[0];let m="";f.forEach((g,R)=>{const S=ge(w,g),C=R+1;m+=`|${S}`,B.has(C)||B.set(C,new Map);const O=B.get(C);O.set(m,(O.get(m)||0)+1)})}),z.forEach(([v,x])=>{const w=x[0],m=[];let g="";f.forEach((R,S)=>{var re;let C=ge(w,R);const O=S+1,L=O<f.length,K=h[S];g+=`|${C}`;let ie=v;const te=N.find(de=>de.field===R);if((re=te==null?void 0:te.total)!=null&&re.enabled&&te.total.label&&(ie=`${g}|${te.total.label}`),L){const de=g;W.has(de)||W.set(de,ie)}const T=fe.has(O)&&fe.get(O).get(g)||!0,ee=O<f.length?(B.get(O).get(g)||0)>1:!1;(C===Oe||C===null||C===void 0)&&K.emptyReplace&&(C=K.emptyReplace),m.push({content:C,rowspan:1,colspan:1,data:w,expandable:L&&ee,expanded:T,level:O,rowKey:g,onClick:L&&ee?de=>F(de.level,de.rowKey):void 0})}),I.forEach(([R,S])=>{const C={};c.forEach(O=>{if(O.calculateType==="expr")return;const L=O.field,K=O.calculateType||"sum",ie=`${v}||${R}`,T=(A.get(ie)||[]).map(re=>ge(re,L));let ee=0;qe[K]&&(ee=qe[K](T)),C[O.field]=ee}),c.forEach(O=>{if(O.calculateType==="expr"&&O.expression){const L=Ut(O.expression,C);C[O.field]=L!==null?L:0}}),c.forEach(O=>{let L=C[O.field];(L===Oe||L===null||L===void 0||typeof L=="number"&&isNaN(L))&&O.emptyReplace&&(L=O.emptyReplace),m.push({content:L,rowspan:1,colspan:1,data:w})})}),V.push({cells:m,rowKey:g})});const G=v=>{const w=v.split("|").filter(Boolean).length;for(let m=1;m<w;m++)if(fe.has(m)){const g=fe.get(m),R=v.split("|").slice(0,m+1).join("|");if(g.has(R)&&!g.get(R)){const S=R,C=W.get(S);if(v!==C)return!1}}return!0},oe=v=>{var x,w;if(!v||v.length===0)return v;for(let m=0;m<h.length;m++){let g=v[0][m].content,R=0,S=h[m],C=(x=S.total)==null?void 0:x.enabled,O=((w=S.total)==null?void 0:w.label)||"";for(let L=1;L<v.length;L++){const K=v[L][m];let ie=!0;if(m>0)for(let te=0;te<m;te++){const T=v[R][te],ee=v[L][te];if(T.content!==ee.content){ie=!1;break}}K.content!==Oe&&(!C||K.content!==O)&&K.content===g&&ie?(K.rowspan=0,v[R][m].rowspan++):(g=K.content,R=L)}}return v},pe=v=>{const x=v.filter(g=>G(g.rowKey)),w=x.map(g=>g.cells.map(R=>{const S={...R};if(S.expandable&&S.level&&S.rowKey&&fe.has(S.level)){const C=fe.get(S.level);C.has(S.rowKey)&&(S.expanded=C.get(S.rowKey))}return S}));return oe(w),x.map((g,R)=>({rowKey:g.rowKey,cells:w[R]}))};pt.clear();const be=V.map(v=>v.cells),we=p(be).map((v,x)=>{let w="";return v.forEach((m,g)=>{g<f.length&&m.rowKey&&(w=m.rowKey)}),{cells:v,rowKey:w}}),xe=(()=>{const v=[];if(h.forEach(x=>{v.push({...x,width:x.width||100,fixed:"left",key:x.field})}),l.length===0)c.forEach(x=>{v.push({...x,width:x.width||100,key:x.field})});else{const x=[];I.forEach(([w,m])=>{const g=w.split("|").filter(S=>S!=="");let R=x;g.forEach((S,C)=>{var L;let O=R.find(K=>K.title===S);if(!O){const ie=`${((L=l[C])==null?void 0:L.field)||"unknown"}__${S}`,te={field:ie,title:S,children:[],key:ie};R.push(te),O=te}C===g.length-1?c.forEach(K=>{O.children||(O.children=[]),O.children.push({...K,field:`${w}||${K.field}`,title:K.title||K.field,width:K.width||100,key:`${w}||${K.field}`})}):(O.children||(O.children=[]),R=O.children)})}),v.push(...x)}return v})();return{list:we,dataExpandFilter:pe,tableColumns:xe}},Jt=e=>{const{data:t,fields:r}=e,{rows:n,columns:i,values:s}=r;if(!s||s.length===0)return{list:[],dataExpandFilter:a=>a};if(!t||t.length===0)return{list:[],dataExpandFilter:a=>a};if(n.length===0&&i.length===0){const a=s.filter(c=>!c.hidden),h=a.map(c=>({...c,width:c.width||100,key:c.field}));return{list:t.map((c,f)=>({cells:a.map(y=>({content:c[y.field]??Oe,rowspan:1,colspan:1,style:y.style,data:c})),rowKey:f.toString()})),dataExpandFilter:c=>c,tableColumns:h}}return qt(e)},On=_.memo(e=>{const{scroll:t,data:r,meta:n,sortParams:i,fields:s}=e,[a,h]=_.useState(0),[l,c]=_.useState([]),[f,E]=_.useState([]),y=_.useRef(null),k=_.useCallback(()=>{if(y.current){let p=y.current;if(!p||!p.list||!p.dataExpandFilter)return;c(p.dataExpandFilter(p.list))}},[]);_.useEffect(()=>{let N=Jt({data:r,meta:n,sortParams:i,fields:s});y.current=N,N.tableColumns&&E(N.tableColumns),k()},[r,n,i,s,k]);const A=_.useCallback(p=>p?typeof p=="string"?parseInt(p.replace("px",""))||0:typeof p=="number"?p:0:0,[]),{baseWidth:P,colCount:u}=_.useMemo(()=>{let p=0,N=0;const z=V=>{V.forEach(B=>{(!("type"in B)||B.type!=="group")&&(p+=A(B.width),N+=1),B!=null&&B.children&&B.children.length>0&&z(B.children)})};return z(f),{baseWidth:p,colCount:N}},[f,A]),M=_.useMemo(()=>{const p=N=>N.map(z=>{let V=0;P<a&&u>0&&(V=Math.floor((a-P)/u));const G=(z.width?A(z.width):sn)+V;return z.colSpan&&z.colSpan>1?z.width=G*z.colSpan:z.width=G,z.fixed&&(z.fixed=!1),z!=null&&z.children&&z.children.length>0&&(z.children=p(z.children)),z});return p(lt(f))},[f,P,a,u,A]),j=_.useMemo(()=>{let p=0;const N=z=>{z.forEach(V=>{(!("type"in V)||V.type!=="group")&&(p+=A(V.width)),V!=null&&V.children&&V.children.length>0&&N(V.children)})};return N(M),p},[M,A]),X=_.useRef(null),I=_.useRef(null),W=_.useRef(!1),F=_.useCallback(({scrollLeft:p})=>{W.current||(W.current=!0,X.current&&(X.current.scrollLeft=p),requestAnimationFrame(()=>{W.current=!1}))},[]),D=_.useCallback(p=>{if(W.current)return;W.current=!0;const N=p.currentTarget.scrollLeft;I.current&&(I.current.scrollLeft=N),requestAnimationFrame(()=>{W.current=!1})},[]);return Q.jsx(st,{onResize:({width:p})=>{p&&p!==a&&h(p)},children:Q.jsxs("div",{className:at("virtual-table",e.className),style:{width:"100%",...e.style},children:[Q.jsx(on,{ref:X,columns:M,width:a-8,onScroll:D,meta:n}),Q.jsx("div",{className:"virtual-table-body",style:{width:"100%"},children:Q.jsx(Cn,{data:l,info:{ref:I,onScroll:F},scroll:t,columns:M,tableWidth:a,gridWidth:j,handleExpand:k,meta:n})})]})})});_e.VirtualTable=On,_e.dataHandler=Jt,_e.pivotDataHandler=qt,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
|
|
52
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",a=0;a<arguments.length;a++){var d=arguments[a];d&&(s=i(s,n(d)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var d in s)t.call(s,d)&&s[d]&&(a=i(a,d));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Bt);var on=Bt.exports;const lt=lr(on),Bn="",sn=C.forwardRef(({columns:e,width:t,onScroll:r,meta:n},i)=>{const s=C.useMemo(()=>{const a=[],d=h=>{let v=0;return h.forEach(E=>{if(E.children&&E.children.length>0){const I=d(E.children);I>v&&(v=I)}}),v+1},l=d(e),c=(h,v)=>{a[v]||(a[v]=[]),h.forEach(E=>{var u,M;let I="left";(u=E.style)!=null&&u.textAlign&&(I=E.style.textAlign);let A=n==null?void 0:n.find(P=>P.field===E.field);if(!A){const P=E.field.split("||");if(P.length>1){const X=P[P.length-1];A=n==null?void 0:n.find(k=>k.field===X)}else E.field.includes("__")&&(A=n==null?void 0:n.find(X=>E.field.startsWith(`${X.field}_`)))}(M=A==null?void 0:A.style)!=null&&M.textAlign&&(I=A.style.textAlign);const O={key:E.field||E.dataIndex||E.title||String(Math.random()),title:E.title,width:E.width,align:I,className:E.field,colSpan:1,rowSpan:1};if(E.children&&E.children.length>0){const P=X=>X.children&&X.children.length>0?X.children.reduce((k,W)=>k+P(W),0):1;O.colSpan=P(E),a[v].push(O),c(E.children,v+1)}else O.rowSpan=l-v,a[v].push(O)})};return c(e,0),a},[e,n]);return ee.jsx("div",{ref:i,className:"virtual-table-header hide-scrollbar",style:{overflow:"auto",width:t},onScroll:r,children:ee.jsxs("table",{style:{tableLayout:"fixed",width:"100%"},children:[ee.jsx("colgroup",{children:e.map((a,d)=>{const l=c=>c.children&&c.children.length>0?c.children.flatMap(l):[c.width];return l(a).map((c,h)=>ee.jsx("col",{style:{width:c,minWidth:c}},`${d}-${h}`))}).flat()}),ee.jsx("thead",{className:"virtual-table-thead",children:s.map((a,d)=>ee.jsx("tr",{className:"virtual-table-row",children:a.map((l,c)=>ee.jsx("th",{className:lt("virtual-table-cell",l.className),colSpan:l.colSpan,rowSpan:l.rowSpan,title:l.title,style:{textAlign:l.align},children:l.title},c))},d))})]})})}),ct=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(r=>ct(r));const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=ct(e[r]));return t},ut=43,an=100,Oe="-",Yt="合计",qe=20;function ln(e){let t=e;for(;t;){if(t.dir)return t.dir==="rtl";t=t.parentElement}return!1}function cn(e,t){const[r,n]=C.useState(t==="rtl");return C.useLayoutEffect(()=>{e&&(t||n(ln(e)))},[t,e]),r}const Je=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Kt(e){if(e!==void 0)switch(typeof e){case"number":return e;case"string":{if(e.endsWith("px"))return parseFloat(e);break}}}function un({box:e,defaultHeight:t,defaultWidth:r,disabled:n,element:i,mode:s,style:a}){const{styleHeight:d,styleWidth:l}=C.useMemo(()=>({styleHeight:Kt(a==null?void 0:a.height),styleWidth:Kt(a==null?void 0:a.width)}),[a==null?void 0:a.height,a==null?void 0:a.width]),[c,h]=C.useState({height:t,width:r}),v=n||s==="only-height"&&d!==void 0||s==="only-width"&&l!==void 0||d!==void 0&&l!==void 0;return Je(()=>{if(i===null||v)return;const E=new ResizeObserver(I=>{for(const A of I){const{contentRect:O,target:u}=A;i===u&&h(M=>M.height===O.height&&M.width===O.width?M:{height:O.height,width:O.width})}});return E.observe(i,{box:e}),()=>{E==null||E.unobserve(i)}},[e,v,i,d,l]),C.useMemo(()=>({height:d??c.height,width:l??c.width}),[c,d,l])}function fn(e){const t=C.useRef(()=>{throw new Error("Cannot call during render.")});return Je(()=>{t.current=e},[e]),C.useCallback(r=>{var n;return(n=t.current)==null?void 0:n.call(t,r)},[t])}let Le=null;function dn(e=!1){if(Le===null||e){const t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";const n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Le="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Le="negative":Le="positive-ascending"),document.body.removeChild(t),Le}return Le}function ft({containerElement:e,direction:t,isRtl:r,scrollOffset:n}){if(t==="horizontal"&&r)switch(dn()){case"negative":return-n;case"positive-descending":{if(e){const{clientWidth:i,scrollLeft:s,scrollWidth:a}=e;return a-i-s}break}}return n}function Re(e,t="Assertion error"){if(!e)throw Error(t)}function We(e,t){if(e===t)return!0;if(!!e!=!!t||(Re(e!==void 0),Re(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(const r in e)if(!Object.is(t[r],e[r]))return!1;return!0}function Gt({cachedBounds:e,itemCount:t,itemSize:r}){if(t===0)return 0;if(typeof r=="number")return t*r;{const n=e.get(e.size===0?0:e.size-1);Re(n!==void 0,"Unexpected bounds cache miss");const i=(n.scrollOffset+n.size)/e.size;return t*i}}function hn({align:e,cachedBounds:t,index:r,itemCount:n,itemSize:i,containerScrollOffset:s,containerSize:a}){if(r<0||r>=n)throw RangeError(`Invalid index specified: ${r}`,{cause:`Index ${r} is not within the range of 0 - ${n-1}`});const d=Gt({cachedBounds:t,itemCount:n,itemSize:i}),l=t.get(r),c=Math.max(0,Math.min(d-a,l.scrollOffset)),h=Math.max(0,l.scrollOffset-a+l.size);switch(e==="smart"&&(s>=h&&s<=c?e="auto":e="center"),e){case"start":return c;case"end":return h;case"center":return l.scrollOffset<=a/2?0:l.scrollOffset+l.size/2>=d-a/2?d-a:l.scrollOffset+l.size/2-a/2;case"auto":default:return s>=h&&s<=c?s:s<h?h:c}}function dt({cachedBounds:e,containerScrollOffset:t,containerSize:r,itemCount:n,overscanCount:i}){const s=n-1;let a=0,d=-1,l=0,c=-1,h=0;for(;h<s;){const v=e.get(h);if(v.scrollOffset+v.size>t)break;h++}for(a=h,l=Math.max(0,a-i);h<s;){const v=e.get(h);if(v.scrollOffset+v.size>=t+r)break;h++}return d=Math.min(s,h),c=Math.min(n-1,d+i),a<0&&(a=0,d=-1,l=0,c=-1),{startIndexVisible:a,stopIndexVisible:d,startIndexOverscan:l,stopIndexOverscan:c}}function pn({itemCount:e,itemProps:t,itemSize:r}){const n=new Map;return{get(i){for(Re(i<e,`Invalid index ${i}`);n.size-1<i;){const a=n.size;let d;switch(typeof r){case"function":{d=r(a,t);break}case"number":{d=r;break}}if(a===0)n.set(a,{size:d,scrollOffset:0});else{const l=n.get(a-1);Re(l!==void 0,`Unexpected bounds cache miss for index ${i}`),n.set(a,{scrollOffset:l.scrollOffset+l.size,size:d})}}const s=n.get(i);return Re(s!==void 0,`Unexpected bounds cache miss for index ${i}`),s},set(i,s){n.set(i,s)},get size(){return n.size}}}function vn({itemCount:e,itemProps:t,itemSize:r}){return C.useMemo(()=>pn({itemCount:e,itemProps:t,itemSize:r}),[e,t,r])}function mn({containerSize:e,itemSize:t}){let r;switch(typeof t){case"string":{Re(t.endsWith("%"),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),Re(e!==void 0,"Container size must be defined if a percentage item size is specified"),r=e*parseInt(t)/100;break}default:{r=t;break}}return r}function Ut({containerElement:e,containerStyle:t,defaultContainerSize:r=0,direction:n,isRtl:i=!1,itemCount:s,itemProps:a,itemSize:d,onResize:l,overscanCount:c}){const{height:h=r,width:v=r}=un({defaultHeight:n==="vertical"?r:void 0,defaultWidth:n==="horizontal"?r:void 0,element:e,mode:n==="vertical"?"only-height":"only-width",style:t}),E=C.useRef({height:0,width:0}),I=n==="vertical"?h:v,A=mn({containerSize:I,itemSize:d});C.useLayoutEffect(()=>{if(typeof l=="function"){const z=E.current;(z.height!==h||z.width!==v)&&(l({height:h,width:v},{...z}),z.height=h,z.width=v)}},[h,l,v]);const O=vn({itemCount:s,itemProps:a,itemSize:A}),u=C.useCallback(z=>O.get(z),[O]),[M,P]=C.useState(()=>dt({cachedBounds:O,containerScrollOffset:0,containerSize:I,itemCount:s,overscanCount:c})),{startIndexVisible:X,startIndexOverscan:k,stopIndexVisible:W,stopIndexOverscan:$}={startIndexVisible:Math.min(s-1,M.startIndexVisible),startIndexOverscan:Math.min(s-1,M.startIndexOverscan),stopIndexVisible:Math.min(s-1,M.stopIndexVisible),stopIndexOverscan:Math.min(s-1,M.stopIndexOverscan)},D=C.useCallback(()=>Gt({cachedBounds:O,itemCount:s,itemSize:A}),[O,s,A]),p=C.useCallback(z=>{const V=ft({containerElement:e,direction:n,isRtl:i,scrollOffset:z});return dt({cachedBounds:O,containerScrollOffset:V,containerSize:I,itemCount:s,overscanCount:c})},[O,e,I,n,i,s,c]);Je(()=>{const z=(n==="vertical"?e==null?void 0:e.scrollTop:e==null?void 0:e.scrollLeft)??0;P(p(z))},[e,n,p]),Je(()=>{if(!e)return;const z=()=>{P(V=>{const{scrollLeft:K,scrollTop:B}=e,re=ft({containerElement:e,direction:n,isRtl:i,scrollOffset:n==="vertical"?B:K}),he=dt({cachedBounds:O,containerScrollOffset:re,containerSize:I,itemCount:s,overscanCount:c});return We(he,V)?V:he})};return e.addEventListener("scroll",z),()=>{e.removeEventListener("scroll",z)}},[O,e,I,n,s,c]);const F=fn(({align:z="auto",containerScrollOffset:V,index:K})=>{let B=hn({align:z,cachedBounds:O,containerScrollOffset:V,containerSize:I,index:K,itemCount:s,itemSize:A});if(e){if(B=ft({containerElement:e,direction:n,isRtl:i,scrollOffset:B}),typeof e.scrollTo!="function"){const re=p(B);We(M,re)||P(re)}return B}});return{getCellBounds:u,getEstimatedSize:D,scrollToIndex:F,startIndexOverscan:k,startIndexVisible:X,stopIndexOverscan:$,stopIndexVisible:W}}function gn(e){return C.useMemo(()=>e,Object.values(e))}function bn(e,t){const{ariaAttributes:r,style:n,...i}=e,{ariaAttributes:s,style:a,...d}=t;return We(r,s)&&We(n,a)&&We(i,d)}function yn({cellComponent:e,cellProps:t,children:r,className:n,columnCount:i,columnWidth:s,defaultHeight:a=0,defaultWidth:d=0,dir:l,gridRef:c,onCellsRendered:h,onResize:v,overscanCount:E=3,rowCount:I,rowHeight:A,style:O,tagName:u="div",...M}){const P=gn(t),X=C.useMemo(()=>C.memo(e,bn),[e]),[k,W]=C.useState(null),$=cn(k,l),{getCellBounds:D,getEstimatedSize:p,startIndexOverscan:F,startIndexVisible:z,scrollToIndex:V,stopIndexOverscan:K,stopIndexVisible:B}=Ut({containerElement:k,containerStyle:O,defaultContainerSize:d,direction:"horizontal",isRtl:$,itemCount:i,itemProps:P,itemSize:s,onResize:v,overscanCount:E}),{getCellBounds:re,getEstimatedSize:he,startIndexOverscan:be,startIndexVisible:xe,scrollToIndex:Se,stopIndexOverscan:me,stopIndexVisible:Te}=Ut({containerElement:k,containerStyle:O,defaultContainerSize:a,direction:"vertical",itemCount:I,itemProps:P,itemSize:A,onResize:v,overscanCount:E});C.useImperativeHandle(c,()=>({get element(){return k},scrollToCell({behavior:w="auto",columnAlign:_="auto",columnIndex:S,rowAlign:m="auto",rowIndex:T}){const R=V({align:_,containerScrollOffset:(k==null?void 0:k.scrollLeft)??0,index:S}),j=Se({align:m,containerScrollOffset:(k==null?void 0:k.scrollTop)??0,index:T});typeof(k==null?void 0:k.scrollTo)=="function"&&k.scrollTo({behavior:w,left:R,top:j})},scrollToColumn({align:w="auto",behavior:_="auto",index:S}){const m=V({align:w,containerScrollOffset:(k==null?void 0:k.scrollLeft)??0,index:S});typeof(k==null?void 0:k.scrollTo)=="function"&&k.scrollTo({behavior:_,left:m})},scrollToRow({align:w="auto",behavior:_="auto",index:S}){const m=Se({align:w,containerScrollOffset:(k==null?void 0:k.scrollTop)??0,index:S});typeof(k==null?void 0:k.scrollTo)=="function"&&k.scrollTo({behavior:_,top:m})}}),[k,V,Se]),C.useEffect(()=>{F>=0&&K>=0&&be>=0&&me>=0&&h&&h({columnStartIndex:z,columnStopIndex:B,rowStartIndex:xe,rowStopIndex:Te},{columnStartIndex:F,columnStopIndex:K,rowStartIndex:be,rowStopIndex:me})},[h,F,z,K,B,be,xe,me,Te]);const Pe=C.useMemo(()=>{const w=[];if(i>0&&I>0)for(let _=be;_<=me;_++){const S=re(_),m=[];for(let T=F;T<=K;T++){const R=D(T);m.push(C.createElement(X,{...P,ariaAttributes:{"aria-colindex":T+1,role:"gridcell"},columnIndex:T,key:T,rowIndex:_,style:{position:"absolute",left:$?void 0:0,right:$?0:void 0,transform:`translate(${$?-R.scrollOffset:R.scrollOffset}px, ${S.scrollOffset}px)`,height:S.size,width:R.size}}))}w.push(ee.jsx("div",{role:"row","aria-rowindex":_+1,children:m},_))}return w},[X,P,i,F,K,D,re,$,I,be,me]),g=ee.jsx("div",{"aria-hidden":!0,style:{height:he(),width:p(),zIndex:-1}});return C.createElement(u,{"aria-colcount":i,"aria-rowcount":I,role:"grid",...M,className:n,dir:l,ref:W,style:{position:"relative",maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...O}},Pe,r,g)}const En=e=>ee.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...e,children:[ee.jsx("path",{d:"M518.5 360.3a7.95 7.95 0 00-12.9 0l-178 246c-3.8 5.3 0 12.7 6.5 12.7H381c10.2 0 19.9-4.9 25.9-13.2L512 460.4l105.2 145.4c6 8.3 15.6 13.2 25.9 13.2H690c6.5 0 10.3-7.4 6.5-12.7l-178-246z"}),ee.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})]}),wn=e=>ee.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...e,children:[ee.jsx("path",{d:"M690 405h-46.9c-10.2 0-19.9 4.9-25.9 13.2L512 563.6 406.8 418.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246c3.2 4.4 9.7 4.4 12.9 0l178-246c3.9-5.3.1-12.7-6.4-12.7z"}),ee.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})]}),_n=(e,t,r)=>{var i;const n=(i=r[e])==null?void 0:i[t];return n?n.rowspan===0||n.colspan===0:!1},Sn=(e,t,r,n,i,s,a)=>{var O,u;const d=(O=n[e])==null?void 0:O[t],l=a||d;if(!l)return;const c={...r};let h=i[t];const v=h.field.split("||"),E=v[v.length-1],I=s==null?void 0:s.find(M=>M.field===E||M.field===h.field),A=(I==null?void 0:I.style)||(h==null?void 0:h.style);if(l.colspan>1){let M=0;for(let P=t;P<t+l.colspan;P++)M+=Number((u=i[P])==null?void 0:u.width)||100;c.width=M}return l.rowspan>1&&(c.height=l.rowspan*ut),c.height||(c.height=ut),A!=null&&A.textAlign&&(c.textAlign=A.textAlign,A.textAlign==="right"&&(c.justifyContent="flex-end"),A.textAlign==="center"&&(c.justifyContent="center")),c.border="1px solid #f0f0f0",c.padding="8px 16px",c.display="flex",c.alignItems="center",c.backgroundColor="#fff",l.rowspan>qe&&(c.zIndex=1e4-e,c.position="absolute"),c},Cn=({columnIndex:e,rowIndex:t,style:r,mergedData:n,columns:i,handleExpand:s,meta:a,mergedCellsMap:d})=>{let l=n[t][e],c=!1;if(l.rowspan===0&&d){const M=`${t}-${e}`,P=d.get(M);if(P&&P.rowspan>qe&&P.startIndex<t){const X=P.rowspan-(t-P.startIndex);l={...l,...P,rowspan:X},c=!0}}if(!c&&_n(t,e,n))return null;const h=Sn(t,e,r,n,i,a,l),v=i[e],E=v.field.split("||"),I=E[E.length-1],A=a==null?void 0:a.find(M=>M.field===I||M.field===v.field),O=C.isValidElement(l.content);let u;if(u=l.content,"formatter"in v&&v.formatter&&!O&&(l.data.satisfaction_denominator_count,u=v.formatter(u,l.data)),A!=null&&A.clickHandler&&!O&&u!==null&&u!==void 0){const M=l.data;u=ee.jsx("a",{href:"javascript:void(0)",onClick:P=>{P.preventDefault(),P.stopPropagation(),A.clickHandler(M)},className:"virtual-table-cell-link",children:u})}return ee.jsxs("div",{style:h,className:lt("table-cell","virtual-table-cell",{"virtual-table-cell-last":e===i.length-1}),title:typeof u=="string"?u:void 0,children:[ee.jsx("span",{className:"expand-icon",children:l.expandable?l.expanded?ee.jsx(En,{onClick:()=>{l.onClick&&l.onClick(l),s(l)}}):ee.jsx(wn,{onClick:()=>{l.onClick&&l.onClick(l),s(l)}}):null}),u]})},On=e=>{const{data:t,info:r,scroll:n,columns:i,tableWidth:s}=e,{ref:a,onScroll:d}=r,l=C.useRef(),c=C.useMemo(()=>{const $={};return Object.defineProperty($,"scrollLeft",{get:()=>{var D,p;return((p=(D=l.current)==null?void 0:D.element)==null?void 0:p.scrollLeft)||0},set:D=>{var p;(p=l.current)!=null&&p.element&&(l.current.element.scrollLeft=D)}}),Object.defineProperty($,"scrollTop",{get:()=>{var D,p;return((p=(D=l.current)==null?void 0:D.element)==null?void 0:p.scrollTop)||0},set:D=>{var p;(p=l.current)!=null&&p.element&&(l.current.element.scrollTop=D)}}),$},[]);C.useEffect(()=>{a&&(a.current=c)},[a,c]);const h=t,v=h.length,E=C.useCallback($=>{let D=0;return $.forEach(p=>{p!=null&&p.children&&p.children.length>0?D+=E(p.children):D+=1}),D},[]),I=E(i),A=C.useCallback($=>{let D=[];return $.forEach(p=>{p!=null&&p.children&&p.children.length>0?D=[...D,...A(p.children)]:D.push(p)}),D},[]),O=A(i),u=C.useCallback($=>{const D=O[$];let p=(D==null?void 0:D.width)||100;return typeof p=="string"&&(p=parseInt(p.replace("px",""))||100),p},[O]),M=C.useCallback($=>ut,[]),P=C.useMemo(()=>h.map($=>$.cells),[h]),X=C.useCallback($=>{if($&&typeof $.scrollLeft=="number"){d&&d($);return}if($&&$.target){const{scrollLeft:D,scrollTop:p}=$.target;d&&d({scrollLeft:D,scrollTop:p})}},[d]),k=C.useMemo(()=>{const $=new Map;return h.forEach((D,p)=>{D.cells.forEach((F,z)=>{if(F.rowspan>qe){const V={startIndex:p,rowspan:F.rowspan,content:F.content,data:F.data,expandable:F.expandable,expanded:F.expanded,level:F.level,rowKey:F.rowKey,onClick:F.onClick};for(let K=0;K<F.rowspan;K++){const B=`${p+K}-${z}`;$.set(B,V)}}})}),$},[h]),W=(typeof(n==null?void 0:n.y)=="number"?n.y:parseInt((n==null?void 0:n.y)||"400"))||400;return ee.jsx(yn,{gridRef:l,columnCount:I,columnWidth:u,rowCount:v,rowHeight:M,style:{height:W-40,width:s,overflowY:"auto"},onScroll:X,className:"virtual-grid",overscanCount:qe,cellComponent:Cn,cellProps:{mergedData:P,columns:O,data:h,handleExpand:e.handleExpand,meta:e.meta,mergedCellsMap:k}})},Ve=e=>{const t=[],r=n=>{n.children&&n.children.length>0?n.children.forEach(i=>r(i)):t.push(n)};return e.forEach(n=>r(n)),t},ve=(e,t)=>{const r=t.split(".");let n=e;for(const i of r){if(n==null)return n;n=n[i]}return n==null&&(n=Oe),n},ht=(e,t)=>"|"+t.map(n=>ve(e,n)).join("|"),qt=(e,t)=>{if(!e)return null;try{const r=e.replace(/\{(\w+)\}/g,(i,s)=>{const a=t[s];return a!=null&&!isNaN(a)?String(a):"0"});if(!/^[\d\.\+\-\*\/\(\)\s]+$/.test(r))return null;const n=new Function(`return ${r}`)();return typeof n!="number"||!isFinite(n)||isNaN(n)?null:n}catch{return null}},Xe={sum:e=>e.reduce((t,r)=>t+(Number(r)||0),0),avg:e=>{const t=e;return t.length>0?t.reduce((r,n)=>r+(isNaN(Number(n))?0:Number(n)),0)/t.length:0},count:e=>e.length,min:e=>Math.min(...e.map(t=>Number(t)||1/0)),max:e=>Math.max(...e.map(t=>Number(t)||-1/0)),d_count:e=>new Set(e).size,variance:e=>{const t=e.map(i=>Number(i)).filter(i=>!isNaN(i));if(t.length===0)return 0;const r=t.reduce((i,s)=>i+s,0)/t.length;return t.map(i=>Math.pow(i-r,2)).reduce((i,s)=>i+s,0)/t.length},stddev:e=>{const t=e.map(s=>Number(s)).filter(s=>!isNaN(s));if(t.length===0)return 0;const r=t.reduce((s,a)=>s+a,0)/t.length,i=t.map(s=>Math.pow(s-r,2)).reduce((s,a)=>s+a,0)/t.length;return Math.sqrt(i)}},ce=new Map,pt=new Map,vt=new Map,Jt=e=>{const{data:t,sortParams:r,fields:n}=e,{rows:i,columns:s,values:a}=n;if(!t||t.length===0||!i.length&&!s.length&&!a.length)return{list:[],dataExpandFilter:g=>g};const d=Ve(i),l=Ve(s),c=Ve(a),h=c.filter(g=>!g.hidden),v=d.map(g=>g.field),E=l.map(g=>g.field),I=new Map,A=new Map,O=new Map;t.forEach(g=>{const w=ht(g,v);I.has(w)||I.set(w,[]),I.get(w).push(g);const _=ht(g,E);A.has(_)||A.set(_,[]),A.get(_).push(g);const S=`${w}||${_}`;O.has(S)||O.set(S,[]),O.get(S).push(g)});const u=()=>Array.from(I.entries()).sort(([g,w],[_,S])=>{if(r&&r.length>0)for(const m of r){const{field:T,sortType:R}=m,j=R==="asc",x=ve(w[0],T),N=ve(S[0],T);if(x<N)return j?-1:1;if(x>N)return j?1:-1}for(let m=0;m<v.length;m++){const T=v[m],R=d[m],j=ve(w[0],T),x=ve(S[0],T);if(j!==x)if(R.sort&&R.sort.enabled){const N=R.sort.type==="asc";if(j<x)return N?-1:1;if(j>x)return N?1:-1}else{if(j<x)return-1;if(j>x)return 1}}return 0}),M=()=>Array.from(A.entries()).sort(([g,w],[_,S])=>{for(let m=0;m<E.length;m++){const T=E[m],R=l[m],j=ve(w[0],T),x=ve(S[0],T);if(j!==x)if(R.sort&&R.sort.enabled){const N=R.sort.type==="asc";if(j<x)return N?-1:1;if(j>x)return N?1:-1}else{if(j<x)return-1;if(j>x)return 1}}return 0}),P=()=>{const g=[],w=Ve(i);for(let _=1;_<=w.length;_++)g.push(w.slice(0,_));return g},X=()=>{const g=P(),w=new Set;return g.forEach((_,S)=>{const m=_[_.length-1];m.total&&m.total.enabled&&w.add(S)}),w},k=()=>{const g=P(),w=[],_=X();return _.size===0||_.forEach(S=>{let m=[];S>0&&(m=g[S-1]);const T={};t.forEach(R=>{let j="";if(S>0?j=m.map(x=>ve(R,x.field)).join("|"):j="__GLOBAL__",!T[j]){const N=g[S][S].total;T[j]={records:[],config:N}}T[j].records.push(R)}),w.push({level:S,data:T})}),w},W=M(),$=new Map,D=(g,w)=>{if(ce.has(g)){const _=ce.get(g),m=!_.get(w);_.set(w,m),pt.set("rowKey",w),pt.set("level",g),pt.set("expanded",m);const T=g-1;if(T>=0&&T<d.length&&d[T].clickExpandChildren&&m===!0){const j=g+1;if(ce.has(j)){const x=ce.get(j),N=w+"|";x.forEach((G,oe)=>{oe.startsWith(N)&&(x.set(oe,!0),p(j,oe))})}}}},p=(g,w)=>{const _=g+1;if(ce.has(_)){const S=ce.get(_),m=w+"|";S.forEach((T,R)=>{R.startsWith(m)&&(S.set(R,!0),p(_,R))})}},F=g=>{const w=k(),_=[...g];if(w.length===0)return _;for(let S=0;S<w.length;S++){const{level:m,data:T}=w[S];Object.keys(T).forEach(R=>{const{records:j,config:x}=T[R],{label:N=Yt,position:G="bottom"}=x||{},oe=R.split("|");let b=-1,ue=-1;if(m===0)b=0,ue=_.length-1;else for(let Z=0;Z<_.length;Z++){const le=_[Z];v.slice(0,m).every((je,Ee)=>{var se;return((se=le[Ee])==null?void 0:se.content)===oe[Ee]})&&(b===-1&&(b=Z),ue=Z)}if(b!==-1){const Z=[];let le="";v.forEach((je,Ee)=>{let se=Oe;const ne=Ee+1,fe=ne<v.length,Ae=d[Ee];Ee<=m&&(Ee===m?se=N:se=oe[Ee],le+=`|${se}`);const He=ce.has(ne)&&ce.get(ne).get(le)||!0;(se===Oe||se===null||se===void 0)&&Ae.emptyReplace&&(se=Ae.emptyReplace),Z.push({content:se,rowspan:1,colspan:1,data:null,rowKey:le,expandable:G==="top"&&fe&&se!==Oe&&se!==Yt,expanded:G==="top"?He:!1,level:ne,onClick:G==="top"&&fe?ze=>D(ze.level,ze.rowKey):void 0})}),W.forEach(([je,Ee])=>{const se={};c.forEach(ne=>{if(ne.calculateType==="expr")return;const fe=ne.field,Ae=ne.calculateType||"sum",ze=j.filter(Be=>ht(Be,E)===je).map(Be=>ve(Be,fe));let Me=0;Xe[Ae]&&(Me=Xe[Ae](ze)),se[ne.field]=Me}),c.forEach(ne=>{if(ne.calculateType==="expr"&&ne.expression){const fe=qt(ne.expression,se);se[ne.field]=fe!==null?fe:0}}),h.forEach(ne=>{let fe=se[ne.field];(fe===Oe||fe===null||fe===void 0||typeof fe=="number"&&isNaN(fe))&&ne.emptyReplace&&(fe=ne.emptyReplace),Z.push({content:fe,rowspan:1,colspan:1,data:null})})});const ge=G==="top"?b:ue+1;vt.has(le)||(_.splice(ge,0,Z),vt.set(le,1),G==="top"&&m>0&&$.set(R,le))}})}return _},z=Ve(i);ce.clear(),t.forEach(g=>{let w="";v.forEach((_,S)=>{const m=S+1,T=ve(g,_);w+=`|${T}`,ce.has(m)||ce.set(m,new Map);const R=d[S].collapsed;ce.get(m).set(w,!R)})});const V=u();let K=[];const B=new Map;V.forEach(([g,w])=>{const _=w[0];let S="";v.forEach((m,T)=>{const R=ve(_,m),j=T+1;S+=`|${R}`,B.has(j)||B.set(j,new Map);const x=B.get(j);x.set(S,(x.get(S)||0)+1)})}),V.forEach(([g,w])=>{const _=w[0],S=[];let m="";v.forEach((T,R)=>{var le;let j=ve(_,T);const x=R+1,N=x<v.length,G=d[R];m+=`|${j}`;let oe=g;const b=z.find(ge=>ge.field===T);if((le=b==null?void 0:b.total)!=null&&le.enabled&&b.total.label&&(oe=`${m}|${b.total.label}`),N){const ge=m;$.has(ge)||$.set(ge,oe)}const ue=ce.has(x)&&ce.get(x).get(m)||!0,Z=x<v.length?(B.get(x).get(m)||0)>1:!1;(j===Oe||j===null||j===void 0)&&G.emptyReplace&&(j=G.emptyReplace),S.push({content:j,rowspan:1,colspan:1,data:_,expandable:N&&Z,expanded:ue,level:x,rowKey:m,onClick:N&&Z?ge=>D(ge.level,ge.rowKey):void 0})}),W.forEach(([T,R])=>{const j={};c.forEach(x=>{if(x.calculateType==="expr")return;const N=x.field,G=x.calculateType||"sum",oe=`${g}||${T}`,ue=(O.get(oe)||[]).map(le=>ve(le,N));let Z=0;Xe[G]&&(Z=Xe[G](ue)),j[x.field]=Z}),c.forEach(x=>{if(x.calculateType==="expr"&&x.expression){const N=qt(x.expression,j);j[x.field]=N!==null?N:0}}),h.forEach(x=>{let N=j[x.field];(N===Oe||N===null||N===void 0||typeof N=="number"&&isNaN(N))&&x.emptyReplace&&(N=x.emptyReplace),S.push({content:N,rowspan:1,colspan:1,data:_})})}),K.push({cells:S,rowKey:m})});const re=g=>{const _=g.split("|").filter(Boolean).length;for(let S=1;S<_;S++)if(ce.has(S)){const m=ce.get(S),T=g.split("|").slice(0,S+1).join("|");if(m.has(T)&&!m.get(T)){const R=T,j=$.get(R);if(g!==j)return!1}}return!0},he=g=>{var w,_;if(!g||g.length===0)return g;for(let S=0;S<d.length;S++){let m=g[0][S].content,T=0,R=d[S],j=(w=R.total)==null?void 0:w.enabled,x=((_=R.total)==null?void 0:_.label)||"";for(let N=1;N<g.length;N++){const G=g[N][S];let oe=!0;if(S>0)for(let b=0;b<S;b++){const ue=g[T][b],Z=g[N][b];if(ue.content!==Z.content){oe=!1;break}}G.content!==Oe&&(!j||G.content!==x)&&G.content===m&&oe?(G.rowspan=0,g[T][S].rowspan++):(m=G.content,T=N)}}return g},be=g=>{const w=g.filter(m=>re(m.rowKey)),_=w.map(m=>m.cells.map(T=>{const R={...T};if(R.expandable&&R.level&&R.rowKey&&ce.has(R.level)){const j=ce.get(R.level);j.has(R.rowKey)&&(R.expanded=j.get(R.rowKey))}return R}));return he(_),w.map((m,T)=>({rowKey:m.rowKey,cells:_[T]}))};vt.clear();const xe=K.map(g=>g.cells),me=F(xe).map((g,w)=>{let _="";return g.forEach((S,m)=>{m<v.length&&S.rowKey&&(_=S.rowKey)}),{cells:g,rowKey:_}}),Pe=(()=>{const g=[];if(d.forEach(w=>{g.push({...w,width:w.width||100,fixed:"left",key:w.field})}),l.length===0)h.forEach(w=>{g.push({...w,width:w.width||100,key:w.field})});else{const w=[];W.forEach(([_,S])=>{const m=_.split("|").filter(R=>R!=="");let T=w;m.forEach((R,j)=>{var N;let x=T.find(G=>G.title===R);if(!x){const oe=`${((N=l[j])==null?void 0:N.field)||"unknown"}__${R}`,b={field:oe,title:R,children:[],key:oe};T.push(b),x=b}j===m.length-1?h.forEach(G=>{x.children||(x.children=[]),x.children.push({...G,field:`${_}||${G.field}`,title:G.title||G.field,width:G.width||100,key:`${_}||${G.field}`})}):(x.children||(x.children=[]),T=x.children)})}),g.push(...w)}return g})();return{list:me,dataExpandFilter:be,tableColumns:Pe}},Xt=e=>{const{data:t,fields:r}=e,{rows:n,columns:i,values:s}=r;if(!s||s.length===0)return{list:[],dataExpandFilter:a=>a};if(!t||t.length===0)return{list:[],dataExpandFilter:a=>a};if(n.length===0&&i.length===0){const a=s.filter(c=>!c.hidden),d=a.map(c=>({...c,width:c.width||100,key:c.field}));return{list:t.map((c,h)=>({cells:a.map(E=>({content:c[E.field]??Oe,rowspan:1,colspan:1,style:E.style,data:c})),rowKey:h.toString()})),dataExpandFilter:c=>c,tableColumns:d}}return Jt(e)},xn=C.memo(e=>{const{scroll:t,data:r,meta:n,sortParams:i,fields:s}=e,[a,d]=C.useState(0),[l,c]=C.useState([]),[h,v]=C.useState([]),E=C.useRef(null),I=C.useCallback(()=>{if(E.current){let p=E.current;if(!p||!p.list||!p.dataExpandFilter)return;c(p.dataExpandFilter(p.list))}},[]);C.useEffect(()=>{let F=Xt({data:r,meta:n,sortParams:i,fields:s});E.current=F,F.tableColumns&&v(F.tableColumns),I()},[r,n,i,s,I]);const A=C.useCallback(p=>p?typeof p=="string"?parseInt(p.replace("px",""))||0:typeof p=="number"?p:0:0,[]),{baseWidth:O,colCount:u}=C.useMemo(()=>{let p=0,F=0;const z=V=>{V.forEach(K=>{(!("type"in K)||K.type!=="group")&&(p+=A(K.width),F+=1),K!=null&&K.children&&K.children.length>0&&z(K.children)})};return z(h),{baseWidth:p,colCount:F}},[h,A]),M=C.useMemo(()=>{const p=F=>F.map(z=>{let V=0;O<a&&u>0&&(V=Math.floor((a-O)/u));const B=(z.width?A(z.width):an)+V;return z.colSpan&&z.colSpan>1?z.width=B*z.colSpan:z.width=B,z.fixed&&(z.fixed=!1),z!=null&&z.children&&z.children.length>0&&(z.children=p(z.children)),z});return p(ct(h))},[h,O,a,u,A]),P=C.useMemo(()=>{let p=0;const F=z=>{z.forEach(V=>{(!("type"in V)||V.type!=="group")&&(p+=A(V.width)),V!=null&&V.children&&V.children.length>0&&F(V.children)})};return F(M),p},[M,A]),X=C.useRef(null),k=C.useRef(null),W=C.useRef(!1),$=C.useCallback(({scrollLeft:p})=>{W.current||(W.current=!0,X.current&&(X.current.scrollLeft=p),requestAnimationFrame(()=>{W.current=!1}))},[]),D=C.useCallback(p=>{if(W.current)return;W.current=!0;const F=p.currentTarget.scrollLeft;k.current&&(k.current.scrollLeft=F),requestAnimationFrame(()=>{W.current=!1})},[]);return ee.jsx(at,{onResize:({width:p})=>{p&&p!==a&&d(p)},children:ee.jsxs("div",{className:lt("virtual-table",e.className),style:{width:"100%",...e.style},children:[ee.jsx(sn,{ref:X,columns:M,width:a-8,onScroll:D,meta:n}),ee.jsx("div",{className:"virtual-table-body",style:{width:"100%"},children:ee.jsx(On,{data:l,info:{ref:k,onScroll:$},scroll:t,columns:M,tableWidth:a,gridWidth:P,handleExpand:I,meta:n})})]})})});we.VirtualTable=xn,we.dataHandler=Xt,we.pivotDataHandler=Jt,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
|
|
53
53
|
//# sourceMappingURL=virtual-table.umd.js.map
|